:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-border: #dde2ea;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Segoe UI", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
}

/* ---------- ログイン画面 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px 32px;
  text-align: center;
}

.login-card__logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 20px;
}

.login-card__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
}

.login-card__subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 24px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
}

.btn-google:hover {
  background: #f8f9fa;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.login-form {
  text-align: left;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* テキストエリアは、初期表示時から横幅いっぱい・縦10行程度の入力スペースを確保する
   （備考欄等、複数行の入力を想定したテキストボックス全般に適用）。縦方向のみリサイズ可能にし、
   横方向は他の入力欄と揃えたまま変えられないようにする。 */
.form-group textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.6;
}

.btn-primary {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

/* 送信中（二重送信防止で押せなくしたボタン等）は薄く表示し、押せないことが分かるようにする */
.btn-primary:disabled {
  background: var(--color-primary);
  opacity: 0.55;
  cursor: not-allowed;
}

.login-card__footnote {
  margin-top: 24px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.login-card__footnote .lock-icon {
  margin-right: 4px;
}

.login-alert {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

.login-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.login-alert--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

/* ---------- 共通レイアウト（ダッシュボード以降の画面） ---------- */
.app-body {
  background: var(--color-bg);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  /* スクロールしてもメニューを画面の上部に固定する（モーダル・音声UIのz-index 100/200より下） */
  position: sticky;
  top: 0;
  z-index: 90;
}

.app-nav__brand {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.app-nav__links {
  list-style: none;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  /* 項目が収まらないときは、隠さずに、メニューの中で次の行に折り返す */
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  padding: 0;
}

.app-nav__link {
  display: inline-block;
  padding: 6px 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.app-nav__link:hover {
  color: var(--color-text);
}

.app-nav__link.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.app-nav__user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding-left: 24px;
  white-space: nowrap;
}

.app-nav__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.app-nav__logout {
  margin: 0;
}

.app-nav__logout-btn {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.app-nav__logout-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.app-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-title {
  font-size: 20px;
  margin: 0 0 20px;
}

/* ---------- 期間選択 ---------- */
.period-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.period-selector__select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
}

.period-selector__range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.period-selector__range.is-hidden {
  display: none;
}

.period-selector__range input[type="date"] {
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
}

.period-selector__sep {
  color: var(--color-text-muted);
  font-size: 12px;
}

.period-label {
  margin: -8px 0 20px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ---------- KPIカード ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.kpi-card__label {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.kpi-card__value {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kpi-card__note {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-left: 4px;
}

.kpi-card__progress {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-bg);
  overflow: hidden;
}

.kpi-card__progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--color-primary);
}

/* ---------- パネル・テーブル共通 ---------- */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.panel.is-hidden {
  display: none;
}

.panel__title {
  font-size: 14px;
  margin: 0 0 16px;
}

/* 顧客カルテ詳細：1パネル内に複数の見出し（図面一覧／アップロードフォーム等）を持たせる際の小見出し。 */
.panel__subtitle {
  font-size: 12.5px;
  font-weight: 600;
  margin: 18px 0 8px;
}

/* 顧客カルテ詳細：1つの案件（Deal）内に複数の見積（DealQuote）が並ぶ際、見積単位で視覚的に区切る。 */
.quote-block {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0 0 16px;
}

.quote-block:last-of-type {
  margin-bottom: 0;
}

.panel__footnote {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--color-text-muted);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.app-main--wide {
  max-width: 1280px;
}

/* ターゲット一覧：対象外にする操作列を追加した分、一覧エリアを少し広げる（他画面には影響させない）。 */
.app-main--targets {
  max-width: 1440px;
}

.app-main--narrow {
  max-width: 640px;
}

/* 横幅の広い画面の中で、入力フォームだけは幅を抑えて読みやすくする */
.panel--narrow {
  max-width: 720px;
}

.flash-message {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
}

.flash-message--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.form-error {
  margin: 4px 0 0;
  font-size: 12px;
  color: #b91c1c;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.form-actions .btn-primary {
  width: auto;
  padding: 10px 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.page-header .page-title {
  /* 右のボタンに押されて1文字ずつ折り返さないよう、最低限の幅を確保する（足りなければボタン側が次の行へ移る） */
  min-width: min(100%, 12em);
  margin: 0;
}

.page-header__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header__actions {
  flex: 0 1 auto;
}

.page-header__actions .btn-primary:not(.btn-uniform),
.page-header__actions .btn-secondary:not(.btn-uniform) {
  white-space: nowrap;
}

.page-header__actions-form {
  margin: 0;
}

.btn-secondary {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--color-bg);
}

/* ターゲット一覧：対象外にする／復元するボタン（行クリック時のナビゲーションと独立させる） */
.row-action-form {
  display: inline-block;
}

.btn-danger-text {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #d9534f;
  border-radius: 8px;
  background: transparent;
  color: #d9534f;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-danger-text:hover {
  background: #d9534f;
  color: #fff;
}

/* ---------- マップエリア指定・抽出 ---------- */
.scan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 860px) {
  .scan-layout {
    grid-template-columns: 1fr;
  }
}

.map-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
}

.map-panel__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.map-panel__mode {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px;
}

#scanFinishPolygonBtn.is-hidden {
  display: none;
}

.mode-toggle__btn {
  border: none;
  background: transparent;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: inherit;
}

.mode-toggle__btn.is-active {
  background: var(--color-primary);
  color: #fff;
}

.map-canvas {
  height: 420px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #e7ecf5 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(225deg, #e7ecf5 25%, transparent 25%) -10px 0/20px 20px,
    linear-gradient(315deg, #e7ecf5 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(45deg, #e7ecf5 25%, #eef1f7 25%) 0 0/20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.map-canvas__hint {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin: 0;
}

.map-canvas__hint code {
  background: var(--color-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

.map-canvas__note {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.map-panel__legend {
  display: flex;
  gap: 20px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot--s {
  background: #ef4444;
}

.legend-dot--a {
  background: #f59e0b;
}

.legend-dot--other {
  background: #9ca3af;
}

.scan-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.scan-sidebar__cta {
  width: 100%;
}

.scan-sidebar__note {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--color-text-muted);
}

.scan-sidebar__result {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--color-text);
}

.scan-sidebar__result:empty {
  margin: 0;
}

.scan-sidebar__result--error {
  color: #dc2626;
}

.scan-sidebar__result a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.scan-sidebar__result a:hover {
  text-decoration: underline;
}

.scan-result__count {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.scan-result__sub {
  margin: 4px 0 14px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.link-arrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.link-arrow:hover {
  text-decoration: underline;
}

.link-arrow--button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.link-arrow--danger {
  color: #dc2626;
}

/* ---------- 問い合わせ管理：手動紐付けモーダル ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  z-index: 100;
}

/* JavaScriptで hidden 属性をtrueにしてもこのルール（display: flex）の方が
   ブラウザ標準の [hidden] { display: none; } より後に評価され上書きしてしまうため、
   voice-overlayと同様に明示的な上書きルールが必要（無いと「×」を押しても閉じない）。 */
.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 20px;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.modal-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-box__header h2 {
  font-size: 15px;
  margin: 0;
}

.modal-box__close {
  border: none;
  background: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
}

.match-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

.match-search-results__item {
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.match-search-results__item:hover {
  background: var(--color-bg);
}

.match-search-results__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
}

.match-search-results__address {
  font-size: 11.5px;
  color: var(--color-text-muted);
}

/* ---------- 検索履歴 ---------- */
.btn-primary--inline {
  display: inline-block;
  width: auto;
  text-decoration: none;
  white-space: nowrap;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.filter-bar__submit {
  align-self: flex-end;
}

.dm-export-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.dm-export-bar__count {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-right: auto;
}

.dm-export-bar .btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.filter-item__label {
  font-weight: 600;
}

.select-input {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  min-width: 140px;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge--completed {
  background: #dcfce7;
  color: #16a34a;
}

.status-badge--failed {
  background: #fee2e2;
  color: #dc2626;
}

.status-badge--running {
  background: #dbeafe;
  color: #2563eb;
}

/* ---------- ターゲット一覧 ---------- */
.text-input {
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  min-width: 180px;
}

.company-cell__name {
  margin: 0 0 2px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
}

.company-cell__industry {
  margin: 0;
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.data-table--clickable tbody tr {
  cursor: pointer;
}

.data-table--clickable tbody tr:hover {
  background: var(--color-bg);
}

.rank-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.rank-badge--s {
  background: #fee2e2;
  color: #dc2626;
}

.rank-badge--a {
  background: #fef3c7;
  color: #b45309;
}

.rank-badge--b {
  background: #dbeafe;
  color: #2563eb;
}

.rank-badge--c {
  background: #dcfce7;
  color: #16a34a;
}

.rank-badge--unknown {
  background: #f1f2f5;
  color: #6b7280;
}

/* ターゲット一覧の明細テーブル：住所列が長い場合でも「対象外にする」ボタン列が
   見切れないよう、住所列だけ幅を絞って省略表示にし、操作列は縮まないようにする。 */
.targets-table {
  table-layout: fixed;
  width: 100%;
}

.targets-table td,
.targets-table th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.targets-table .company-cell__name,
.targets-table .company-cell__industry {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.targets-table td.js-row-action {
  overflow: visible;
  white-space: nowrap;
  width: 1%;
}

.targets-table .row-action-form {
  white-space: nowrap;
}

/* ---------- 商談・成約管理 ---------- */
.deal-badge--negotiating {
  background: #dbeafe;
  color: #2563eb;
}

.deal-badge--won {
  background: #dcfce7;
  color: #16a34a;
}

.deal-badge--lost {
  background: #f1f2f5;
  color: #6b7280;
}

.deal-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
}

.deal-inline-form input[type="number"] {
  width: 130px;
}

/* 金額入力欄（成約金額・見積金額など）：type="number"はマイナス値の防止など最低限の数値
   バリデーションのために使っているだけで、上下ボタン（スピナー）で1円ずつ増減させる用途を
   想定していない。数十万〜数百万円規模の金額をスピナーで操作するのは非現実的なため、
   見た目だけ通常のテキスト欄に近づけ、手入力しやすくする。 */
.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.amount-input {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ---------- 商談・成約管理：案件カード（画面全体タブの1つとして表示、横長テーブルではなく縦積みカードにする） ----------
   全体タブ化に伴い表示幅が広がったため、カードを1列に並べるのではなくグリッドで並べて空間を活かす。 */
.deal-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.deal-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 14px;
}

.deal-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.deal-card__type {
  font-size: 13px;
  font-weight: 700;
}

.deal-card__meta {
  margin: 0 0 8px;
  font-size: 12.5px;
}

.deal-card__meta div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.deal-card__meta dt {
  color: var(--color-text-muted);
}

.deal-card__meta dd {
  margin: 0;
  text-align: right;
}

.deal-card__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--color-border);
}

/* ---------- SFAプロセスチェックリスト（案件カード内、縦積み表示） ---------- */
.process-checklist--stacked {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.process-checklist__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin: 0 0 2px;
}

.process-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  background: #f1f2f5;
  color: #6b7280;
}

.process-step-row--done {
  background: #dcfce7;
  color: #16a34a;
  font-weight: 600;
}

.process-step-row__label {
  white-space: nowrap;
}

.process-step-row__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  white-space: nowrap;
}

.process-step__form {
  display: inline-flex;
  margin: 0;
}

/* ---------- ユーザー管理 ---------- */
.status-badge--active {
  background: #dcfce7;
  color: #16a34a;
}

.status-badge--inactive {
  background: #f1f2f5;
  color: #6b7280;
}

.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.role-badge--system_admin {
  background: #ede9fe;
  color: #6d28d9;
}

.role-badge--admin {
  background: #dbeafe;
  color: #2563eb;
}

.role-badge--viewer {
  background: #f1f2f5;
  color: #6b7280;
}

.link-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.link-badge--linked {
  background: #dcfce7;
  color: #16a34a;
}

.link-badge--pending {
  background: #fef3c7;
  color: #b45309;
}

.invite-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.data-table__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.inline-form {
  display: inline;
  margin: 0;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-link--danger {
  color: #dc2626;
}

/* ---------- 詳細インスペクション ---------- */
.back-link {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--color-text);
}

.ap-tabs {
  margin-bottom: 20px;
}

.ap-tabs__label {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.ap-tabs__group {
  display: inline-flex;
  gap: 8px;
}

.ap-tab {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.ap-tab.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #eef4ff;
}

/* ---------- 詳細インスペクション画面：全体タブ（企業情報／写真・ストリートビュー／商談・成約管理／
   ヒアリング入力／ヒアリング履歴）。以前は左右2カラム（メインコンテンツ＋300px幅サイドバー）だったが、
   写真関連を常時表示する必要は無い・サイドバーが狭くて見づらいという指摘を受けて、画面全体を
   1カラム＋タブ切り替え式に変更した。見た目は搬入口タブ（.ap-tabs/.ap-tab）と統一している。 ---------- */
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.page-tab {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.page-tab.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #eef4ff;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-panel.is-hidden {
  display: none;
}

.ap-panel.is-hidden {
  display: none;
}

.street-view {
  height: 260px;
  border-radius: 8px;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  position: relative;
}

.street-view__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.street-view-pano {
  width: 100%;
  height: 420px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: var(--color-surface-muted, #f1f5f9);
}

.street-view-map-picker {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--color-surface-muted, #f1f5f9);
}

.pano-save-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.pano-save-form .form-group {
  margin-bottom: 0;
}

.pano-save-status {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  font-size: 13px;
}

.pano-save-status--error {
  background: #fef2f2;
  color: #b91c1c;
}

.pano-capture-history {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pano-capture-history__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.pano-capture-history__delete-form {
  margin: 0 0 0 auto;
}

.pano-capture-history__item img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.street-view__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* ---------- DMはがき裏面設定 ---------- */
.dm-back-design__preview {
  margin-bottom: 20px;
}

.dm-back-design__preview-image {
  width: 200px;
  height: auto;
  aspect-ratio: 100 / 148;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  display: block;
}

.dm-editor {
  margin-bottom: 20px;
}

.dm-editor__canvas {
  position: relative;
  width: 260px;
  aspect-ratio: 100 / 148;
  background: repeating-linear-gradient(45deg, #eef1f6, #eef1f6 10px, #f7f8fa 10px, #f7f8fa 20px);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  margin-bottom: 8px;
}

.dm-editor__bg {
  position: absolute;
  cursor: move;
  user-select: none;
  touch-action: none;
}

.dm-editor__qr {
  position: absolute;
  border: 2px dashed var(--color-primary);
  background: rgba(37, 99, 235, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: move;
  touch-action: none;
}

.dm-editor__qr-label {
  font-size: 11px;
  color: var(--color-primary);
  font-weight: 700;
  pointer-events: none;
}

.dm-editor__resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--color-primary);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: nwse-resize;
  touch-action: none;
}

/* dmQrResizeHandleはdmQrBoxの子要素のため、親（QRボックス）基準の相対位置で右下角に固定する。
   dmBgResizeHandleはdmCanvas直下の兄弟要素のため、こちらはJS側でleft/topを都度計算している。 */
.dm-editor__qr .dm-editor__resize-handle {
  right: -8px;
  bottom: -8px;
}

.dm-editor__hidden-file-input {
  display: none;
}

/* ---------- 判定キュー ---------- */
.queue-thumbnail {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.queue-detail-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-top: 12px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.score-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.score-card__label {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.score-card__value {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  margin: 0;
  padding: 40px 0;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.panel__note {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin: 0 0 16px;
}


.field-intel-form .form-group:last-of-type {
  margin-bottom: 16px;
}

.postal-code-row {
  display: flex;
  gap: 8px;
}

.postal-code-row input {
  flex: 1;
}

.postal-code-row .btn-secondary {
  padding: 0 14px;
  white-space: nowrap;
}

.form-hint {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

#postalCodeCandidates.select-input {
  width: 100%;
  margin-top: 8px;
}

#postalCodeCandidates.is-hidden {
  display: none;
}

/* ---------- 問い合わせ管理 ---------- */
.kpi-card--attention {
  border-color: #fca5a5;
}

.kpi-card--attention .kpi-card__value {
  color: #dc2626;
}

.match-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.match-badge--matched {
  background: #dcfce7;
  color: #16a34a;
}

.match-badge--unprocessed {
  background: #fee2e2;
  color: #dc2626;
}

.match-badge--new {
  background: #dbeafe;
  color: #2563eb;
}

/* ---------- マスター管理 ---------- */
.subnav {
  /* 画面の本体の幅（狭い画面でも）に押しつぶされないよう、収まらないタブは次の行へ送る */
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 18px;
}

.subnav__tab {
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.subnav__tab:hover {
  color: var(--color-text);
}

.subnav__tab.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.platform-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.platform-badge--youtube {
  background: #fee2e2;
  color: #dc2626;
}

.platform-badge--instagram {
  background: #fce7f3;
  color: #db2777;
}

.platform-badge--x {
  background: #f1f2f5;
  color: #111827;
}

.platform-badge--lp {
  background: #dbeafe;
  color: #2563eb;
}

/* ---------- 音声UIオーバーレイ ---------- */
.voice-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  z-index: 100;
}

.voice-fab:hover {
  background: var(--color-primary-hover);
}

.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
}

.voice-overlay[hidden] {
  display: none;
}

.voice-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.voice-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.voice-panel__label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.voice-panel__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.voice-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: voice-pulse 1.4s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .voice-pulse {
    animation: none;
  }
}

@keyframes voice-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.voice-panel__transcript {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--color-bg);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--color-text);
  line-height: 1.6;
}

.voice-panel__examples {
  margin: 0;
  font-size: 11.5px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.voice-result-list {
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-result-row {
  display: flex;
  gap: 12px;
  font-size: 13.5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.voice-result-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.voice-result-row dt {
  flex: 0 0 88px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.voice-result-row dd {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
}

.voice-panel__actions {
  display: flex;
  gap: 10px;
}

.voice-panel__actions .btn-secondary,
.voice-panel__actions .btn-primary {
  flex: 1;
  text-align: center;
}

/* 詳細インスペクション画面：現場写真の手動アップロード（ドラッグ&ドロップ対応） */
.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
  background-color: var(--color-surface-muted, #f8fafc);
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone:hover {
  border-color: var(--color-primary);
}

.upload-dropzone--dragover {
  border-color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.06);
}

.upload-dropzone__hint {
  margin: 0 0 4px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.upload-dropzone__count {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-text);
  font-weight: 600;
}

.upload-dropzone input[type="file"] {
  display: block;
  margin: 8px auto 0;
}

/* 点検関係の画面のボタン：文言の長さによらず同じ幅にそろえる（btn-primaryは元々横幅いっぱいのため上書きする）。
   文言が幅に収まらない場合は、行の長さがそろうよう均等に折り返して中央にそろえる。 */
.btn-uniform {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 220px;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  text-wrap: balance;
  /* 日本語は単語（文節）の途中で折り返さない（対応していないブラウザでは通常の折り返し） */
  word-break: auto-phrase;
  overflow-wrap: break-word;
}

/* .form-actions .btn-primary（幅auto・余白24px）より優先させる */
.form-actions .btn-uniform,
.page-header__actions .btn-uniform {
  width: 220px;
  padding: 8px 16px;
}

/* 画面内の区切り：直前のフォームや表と間をあけ、細い線で区切る */
.form-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

/* 表の行の中の「持ち越しにする」折りたたみ */
.carry-over summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-muted);
}

.carry-over[open] .row-action-form {
  margin-top: 6px;
}

/* 設備の写真の一覧（サムネイルの並び） */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.photo-card {
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  overflow: hidden;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--color-bg);
}

.photo-card figcaption {
  padding: 8px 10px;
  font-size: 12px;
}

.photo-card figcaption form {
  display: flex;
  gap: 6px;
  margin: 4px 0 0;
}

.photo-card figcaption input[type="text"] {
  flex: 1;
  min-width: 0;
}

/* 表の中で使う入力欄：クリック・タップしやすい大きさにそろえる（通常のフォームの入力欄と同じ大きさ） */
.cell-input {
  box-sizing: border-box;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
}

.cell-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.cell-input--short {
  width: 6em;
}

.cell-input--date {
  width: 12em;
}

.cell-input--fill {
  width: 100%;
  min-width: 12em;
}

/* 入力欄の多い表は、行の余白を広げて操作しやすくする */
.data-table--roomy td {
  padding-top: 10px;
  padding-bottom: 10px;
  vertical-align: middle;
}

/* 判定の選択肢（ラジオボタン）：大きめにして、文字もクリックできるようにそろえる */
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.choice-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.choice-group input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-primary);
}

/* 配置図：図の上に設備のピンを重ねる */
.plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .plan-layout {
    grid-template-columns: 1fr;
  }
}

.plan-stage-wrap {
  overflow: auto;
}

.plan-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 100%;
  border: 1px solid var(--color-border);
}

.plan-stage img {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

.plan-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 4px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e8710a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.plan-pin.is-dragging {
  cursor: grabbing;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.plan-pin--view {
  cursor: default;
}

.plan-pin--dim {
  opacity: 0.55;
}

.plan-side h3 {
  margin: 16px 0 6px;
  font-size: 14px;
}

.plan-pin-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 360px;
  overflow: auto;
}

.plan-pin-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.plan-pin-list form {
  margin: 0;
}

.plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0;
  font-size: 13px;
}

.plan-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.plan-legend__dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

/* 評価尺度の編集：3つの軸の表示名を横に並べる */
.scale-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* 担当者の追加：選択欄とボタンを横に並べる（狭い画面では折り返す） */
.assign-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

/* 点検カレンダー（月表示） */
.cal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.cal-title {
  min-width: 7em;
  text-align: center;
  font-size: 18px;
}

.cal-filter {
  margin: 0 0 0 auto;
}

.cal-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.cal-table th {
  padding: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-size: 13px;
}

.cal-sun {
  color: #c0392b;
}

.cal-sat {
  color: #2e6f95;
}

.cal-cell {
  height: 112px;
  padding: 4px;
  border: 1px solid var(--color-border);
  vertical-align: top;
  background: var(--color-surface);
}

.cal-cell--out {
  background: #f6f8fa;
  color: var(--color-text-muted);
}

.cal-cell--today {
  background: #fff7ec;
  box-shadow: inset 0 0 0 2px #e8710a;
}

.cal-day {
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 700;
}

.cal-entry {
  display: block;
  margin-bottom: 3px;
  padding: 3px 5px;
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
  background: #eaf2f8;
  color: var(--color-text);
  font-size: 11px;
  line-height: 1.35;
  text-decoration: none;
  overflow: hidden;
}

.cal-entry--warn {
  border-left-color: #c0392b;
  background: #fdecea;
}

.cal-entry__company {
  display: block;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-entry__meta,
.cal-entry__people,
.cal-entry__warn {
  display: block;
  color: var(--color-text-muted);
}

.cal-entry__warn {
  color: #c0392b;
  font-weight: 700;
}

/* ---------- 点検結果の入力（目視／動作確認の表、項目の追加、過去の処置） ---------- */
.form-section__title {
  margin: 0 0 8px;
  font-size: 15px;
}

.form-section + .form-section__title,
.table-scroll + .form-section__title {
  margin-top: 24px;
}

.history-list {
  margin: 0 0 12px;
  padding-left: 20px;
}

.history-input {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.history-input input[type="date"] {
  width: 160px;
}

.history-input select {
  width: 110px;
}

.history-input .cell-input--fill {
  flex: 1 1 280px;
}

/* 点検項目マスター：追加フォームを横に並べる */
.inline-form-grid {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form-grid .form-group {
  margin-bottom: 0;
}

.is-muted {
  opacity: 0.55;
}

/* 点検結果の表：目視点検と動作確認で列の幅をそろえる */
.result-table {
  table-layout: fixed;
  width: 100%;
}

.result-table .cell-input {
  width: 100%;
}

/* ---------- ダッシュボード（要対応・成果・商談の流れ・推移・点検・ご無沙汰の顧客） ---------- */
.dash-block {
  margin-bottom: 20px;
}

.dash-block__title {
  font-size: 15px;
  margin: 0 0 10px;
}

.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.dash-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.dash-card:hover {
  border-color: var(--color-primary);
}

.dash-card--urgent {
  border-color: #dc2626;
  background: #fef2f2;
}

.dash-card--attention {
  border-color: #d97706;
  background: #fffbeb;
}

.dash-card__label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.dash-card__value {
  font-size: 24px;
  font-weight: 600;
}

.dash-card__unit {
  font-size: 13px;
  font-weight: 400;
  margin-left: 2px;
}

.dash-card__note {
  font-size: 12px;
  color: var(--color-text-muted);
}

.kpi-card__sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.dash-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 4px;
}

.dash-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-bar {
  display: grid;
  grid-template-columns: 96px 1fr 150px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.dash-bar__label {
  color: var(--color-text-muted);
}

.dash-bar__track {
  height: 16px;
  background: #eef2f7;
  border-radius: 3px;
  overflow: hidden;
}

.dash-bar__fill {
  display: block;
  height: 16px;
  background: #93b4f0;
}

.dash-bar__fill--success {
  background: #6bbf8a;
}

.dash-bar__text {
  text-align: right;
}

.dash-trend__switch {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
}

.dash-trend {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding-top: 18px;
}

.dash-trend__col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
}

.dash-trend__value {
  font-size: 11px;
  color: var(--color-text-muted);
}

.dash-trend__bar {
  display: block;
  width: 100%;
  min-height: 2px;
  background: #93b4f0;
  border-radius: 3px 3px 0 0;
  transition: height 0.2s;
}

.dash-trend__col:last-child .dash-trend__bar {
  background: var(--color-primary);
}

.dash-trend__month {
  font-size: 11px;
  color: var(--color-text-muted);
}

.dash-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dash-mini__item {
  background: #f4f6f9;
  border-radius: var(--radius);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--color-text-muted);
}

.dash-mini__item b {
  font-size: 18px;
  color: var(--color-text);
}

.dash-mini__item b.dash-mini__alert {
  color: #dc2626;
}
.dormant-list.is-hidden { display: none; }

/* 商談カードの担当者の変更 */
.assignee-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  flex-wrap: wrap;
  font-size: 13px;
}

.assignee-form .btn-uniform {
  width: auto;
  padding: 4px 14px;
}

/* SFAプロセス：実施内容のメモ */
.process-step__note-input { min-width: 12rem; flex: 1; font-size: 0.85rem; padding: 0.2rem 0.4rem; }
.process-step__note-form { display: flex; gap: 0.5rem; align-items: center; flex-basis: 100%; margin-top: 0.2rem; }
.process-step-row { flex-wrap: wrap; }

/* SFAプロセス：対象外の手順は薄く表示 */
.process-step-row--na { opacity: 0.55; }
.process-step-row--na .process-step-row__label { text-decoration: line-through; }

/* 商談の「次にやること」フォームと、見積の提出記録 */
.follow-up-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; font-size: 0.85rem; }
.follow-up-form__text { flex: 1 1 18rem; min-width: 14rem; }

/* 商談カード（狭い列）内のフォームは折り返して、はみ出さないようにする */
.deal-card .deal-inline-form { flex-wrap: wrap; max-width: 100%; }
.deal-card .deal-inline-form .cell-input { width: auto; max-width: 100%; min-width: 0; }
.follow-up-form .cell-input { width: auto; max-width: 100%; }
.follow-up-form .btn-uniform { width: auto; }

.deal-badge--on_hold {
  background: #fef3c7;
  color: #b45309;
}

/* 判定キュー：連続判定（学習用サンプル写真を、修理確度だけで素早く判定する画面） */
.quick-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 1.05rem; }
.quick-bar__spacer { flex: 1; }
.quick-inline { display: inline-block; margin: 0; }
.quick-panel { text-align: center; }
.quick-note { color: #6b7280; margin: 0 0 8px; }
.quick-image { display: block; margin: 0 auto; max-width: 100%; max-height: calc(100vh - 470px); min-height: 220px; object-fit: contain; border-radius: 8px; border: 1px solid var(--color-border); }
.quick-draft { margin: 10px auto 0; padding: 8px 12px; background: #eef2ff; border-radius: 8px; display: block; max-width: 900px; }
.quick-draft__badge { background: #4f46e5; color: #fff; border-radius: 4px; padding: 1px 8px; margin-right: 6px; font-size: 0.85rem; }
.quick-draft__hint { color: #6b7280; font-size: 0.85rem; }
.quick-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 12px; position: sticky; bottom: 0; background: var(--color-surface, #fff); padding: 8px 0; }
.quick-btn { min-width: 140px; padding: 14px 12px; border: 2px solid transparent; border-radius: 10px; font-size: 1.15rem; font-weight: 700; cursor: pointer; background: #f3f4f6; color: #111827; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.quick-btn small { font-size: 0.8rem; font-weight: 400; color: #4b5563; }
.quick-btn kbd, .quick-sub kbd { background: #111827; color: #fff; border-radius: 4px; padding: 0 6px; font-size: 0.85rem; margin-right: 4px; }
.quick-btn--s { background: #fee2e2; } .quick-btn--a { background: #ffedd5; } .quick-btn--b { background: #fef9c3; }
.quick-btn--c { background: #dcfce7; } .quick-btn--u { background: #e5e7eb; }
.quick-btn:hover { border-color: #6b7280; }
.quick-btn.is-suggested { border-color: #4f46e5; box-shadow: 0 0 0 3px #c7d2fe; }
.quick-sub { margin-top: 14px; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.quick-help { color: #6b7280; font-size: 0.85rem; }
.pager { display: flex; gap: 16px; justify-content: center; margin: 12px 0 0; }

/* エラーページ */
.error-page { text-align: center; padding-top: 48px; }
.error-page__code { font-size: 3rem; font-weight: 700; color: #9ca3af; margin: 0; }

/* 取り消せない操作（一括削除など）のボタン */
.btn-danger { background: #dc2626; color: #fff; border: 1px solid #b91c1c; border-radius: 6px; padding: 10px 18px; font-weight: 600; cursor: pointer; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }
