/* =========================================================================
   IMJ Flow 標準UI — 改修案（モダンSaaS / 削ぎ落とし）
   方針: 思想（静かな業務UI・青グレー赤・左線禁止）は維持。
        面/罫線/色/影を減らし、余白で構造を作る。カードは軽量に作り直す。
   クラス名・HTML構造は現行(mvp-v2)互換 = 既存opt-in画面はそのまま新トーンに乗る。
   ========================================================================= */
:root {
  /* ===== Layer 1: Primitives（パレット・直接は使わない） ===== */
  --blue-300: #93c5fd; --blue-400: #60a5fa; --blue-500: #3b82f6;
  --blue-600: #2563eb; --blue-700: #1d4ed8; --blue-800: #1e40af;
  --red-400: #f87171; --red-500: #ef4444; --red-600: #dc2626; --red-700: #b91c1c;
  --green-500: #22c55e; --green-600: #16a34a; --green-700: #15803d;
  --amber-400: #fbbf24; --amber-500: #f59e0b; --amber-700: #b45309;
  --gray-0: #ffffff; --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb;
  --gray-300: #d1d5db; --gray-400: #9ca3af; --gray-500: #6b7280; --gray-600: #4b5563;
  --gray-700: #374151; --gray-800: #1f2937; --gray-900: #111827; --gray-950: #030712;

  /* ===== Layer 2: Semantic（役割・コンポーネントはこちらを参照） =====
     （目標設計。legacy alias経由の参照が残るため段階移行中） */
  --color-bg-canvas: #fafbfc;
  --color-bg-default: var(--gray-0);
  --color-bg-surface: var(--gray-50);
  --color-bg-subtle: var(--gray-100);
  --color-text-default: var(--gray-900);
  --color-text-subtle: var(--gray-600);
  --color-text-muted: var(--gray-400);
  --color-text-link: var(--blue-700);     /* 本文リンクは700で4.5:1確保（600は白地3.9:1でAA不可） */
  --color-border: #e4e7eb;
  --color-border-subtle: #eef0f3;
  --color-border-strong: var(--gray-400);
  --color-border-focus: var(--blue-600);
  --color-interactive: var(--blue-600);
  --color-interactive-hover: var(--blue-700);
  --color-danger: var(--red-600);
  --color-danger-text: var(--red-700);
  --color-on-primary: #ffffff;  /* A4: 塗り面の上に乗せる文字色（.btn-primary等）。将来の配色変更・ダーク化でのコントラスト事故を防ぐ */

  /* ===== Legacy aliases（既存クラス互換・見た目は不変） ===== */
  --primary: var(--blue-600);
  --primary-dark: var(--blue-700);
  --primary-light: #eef4ff;
  --primary-soft: #dbeafe;
  --success: var(--green-600);
  --success-light: #ecfdf3;
  --warning: var(--amber-700);
  --warning-light: #fffbeb;
  --danger: var(--red-600);
  --danger-light: #fef2f2;
  --canvas: var(--color-bg-canvas);
  --surface: var(--gray-0);
  --line: var(--color-border-subtle);
  --line-2: var(--color-border);
  --placeholder-color: #c4c8cc;
  --phase-lead: var(--blue-600);
  --phase-default: var(--gray-500);

  /* ===== Radius ===== */
  --radius: 10px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* ===== Elevation（Tailwind系の段階・繊細UI向け） ===== */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-pop: 0 12px 28px rgba(16, 24, 40, 0.12), 0 4px 10px rgba(16, 24, 40, 0.06);
  --shadow-card: var(--shadow-xs);
  --shadow-raised: var(--shadow-sm);
  --shadow-overlay: var(--shadow-pop);

  /* ===== Motion（MUI/M3準拠の定数・全コンポーネントで共有） ===== */
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-inout: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-fast: 150ms;
  --motion-standard: 250ms;
  --motion-enter: 225ms var(--ease-out);  /* パネル/モーダルの登場 */
  --motion-exit: 195ms var(--ease-in);     /* 退場は速く */

  /* ===== Density（標準/コンパクトを変数で切替） ===== */
  --row-py: 13px;
}

[data-density="compact"] { --row-py: 7px; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--canvas);
  color: var(--color-text-default);
  line-height: 1.6;            /* 和文の可読性: 1.5だと詰まる */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--placeholder-color); }

/* 数値は等幅で揃える（一覧の視認性） */
table, .metric-value, .score, .peek-score strong { font-variant-numeric: tabular-nums; }

/* ============================ App shell ============================ */
.imj-app-layout { display: flex; min-height: 100vh; }

.imj-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width .18s ease, transform .18s ease;
}

.imj-sidebar-brand {
  padding: 18px 20px 16px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.imj-sidebar-brand a { color: inherit; text-decoration: none; }
.imj-sidebar-brand span { font-size: 11px; font-weight: 500; color: var(--gray-400); }

.sidebar-collapse, .nav-open {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--gray-400);
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 5px 8px;
  transition: background .15s, color .15s;
}
.sidebar-collapse:hover, .nav-open:hover { background: var(--gray-50); color: var(--gray-600); }
.nav-open { display: none; flex-shrink: 0; }
body.nav-collapsed .imj-sidebar { display: none; }
body.nav-collapsed .nav-open { display: inline-flex; }

.imj-sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }

/* グループ: 仕切り罫線・塗りを廃し、余白＋小ラベルだけで分ける（削ぎ落とし） */
.imj-sidebar-group { margin-top: 16px; }
.imj-sidebar-group-title {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
}
.imj-sidebar-group-title:hover { color: var(--gray-500); }
.accordion-icon { color: var(--gray-300); font-size: 10px; transition: transform .15s ease; }
.imj-sidebar-group.is-collapsed .accordion-icon { transform: rotate(-90deg); }
.imj-sidebar-group.is-collapsed .imj-sidebar-group-items { display: none; }

.imj-sidebar-top-link, .imj-sidebar-group-items a {
  text-decoration: none;
  color: var(--gray-700);
  font-size: 13.5px;
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.imj-sidebar-top-link { display: block; padding: 9px 10px; margin: 2px 0 2px; font-weight: 600; }
.imj-sidebar-group-items { display: flex; flex-direction: column; gap: 1px; padding: 2px 0; }
/* B8: バッジ(.nav-badge)を右端に置くため flex 化。padding/文字位置は変えない＝見た目は不変 */
.imj-sidebar-group-items a { display: flex; align-items: center; padding: 8px 10px; }
.imj-sidebar-top-link:hover, .imj-sidebar-group-items a:hover { background: var(--gray-50); color: var(--gray-900); }
.imj-sidebar-top-link.active, .imj-sidebar-group-items a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.imj-sidebar-footer { padding: 12px; border-top: 1px solid var(--line); }
.imj-sidebar-manual {
  display: block;
  padding: 9px 12px;
  text-decoration: none;
  color: var(--gray-500);
  font-size: 12.5px;
  border-radius: 7px;
  text-align: center;
  transition: background .15s, color .15s;
}
.imj-sidebar-manual:hover { background: var(--gray-50); color: var(--gray-700); }
.sidebar-version { margin-top: 8px; text-align: center; font-size: 10px; color: var(--gray-400); }

.imj-app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ============================ Header ============================ */
.imj-page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 12.5px;
  color: var(--gray-500);
}
.breadcrumb-sep { color: var(--gray-300); }
.breadcrumb-current { color: var(--gray-900); font-weight: 600; }
.breadcrumb-home { color: var(--gray-400); }

.imj-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.user-name { font-size: 12.5px; color: var(--gray-700); }

/* フィードバック/ログアウトは静かなゴーストに（削ぎ落とし。amberの面塗りは廃止） */
.btn-report, .btn-logout {
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--gray-600);
  transition: background .15s, color .15s, border-color .15s;
}
.btn-report:hover, .btn-logout:hover { background: var(--gray-50); color: var(--gray-800); }

/* ============================ Content ============================ */
.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 28px 56px; }

.page-kickoff {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.page-kickoff--actions { justify-content: flex-end; }

.page-eyebrow { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: 4px; }
.page-heading { font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; margin-bottom: 4px; }
.page-lead { font-size: 13px; color: var(--gray-500); max-width: 720px; }

.page-actions, .toolbar, .pagination-actions, .peek-actions { display: flex; align-items: center; gap: 8px; }

/* ===== 改修: 指標カードの作り直し =====
   箱を量産せず、1枚のサーフェスに統合し、極薄罫線で間仕切るだけ。 */
.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.metric { padding: 16px 20px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.metric:first-child { border-left: none; }
.metric-label { font-size: 12px; color: var(--gray-500); font-weight: 500; }
.metric-value { font-size: 26px; line-height: 1; font-weight: 700; letter-spacing: -.02em; color: var(--gray-900); }
.metric.is-primary .metric-value { color: var(--primary); }
.metric.is-danger .metric-value { color: var(--danger); }

/* 後方互換: 旧 summary-strip も同トーンに寄せる（既存画面救済） */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.summary-item { padding: 16px 20px; border-left: 1px solid var(--line); min-width: 0; }
.summary-item:first-child { border-left: none; }
.summary-label { font-size: 12px; color: var(--gray-500); font-weight: 500; }
.summary-value { font-size: 26px; line-height: 1; margin-top: 4px; font-weight: 700; letter-spacing: -.02em; }
.summary-item.is-primary .summary-value { color: var(--primary); }
.summary-item.is-danger .summary-value { color: var(--danger); }
.summary-sub { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

/* ===== Tabs ===== */
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.sub-tabs a {
  padding: 9px 14px;
  text-decoration: none;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .15s;
}
.sub-tabs a:hover { color: var(--gray-800); }
.sub-tabs a.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== Workbench (default: full-width) ===== */
.workbench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.workbench.has-side { grid-template-columns: minmax(0, 1fr) 300px; }
.workbench-main { min-width: 0; }

.toolbar { flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select,
.field input, .field select, .field textarea {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.toolbar input, .toolbar select { padding: 8px 12px; font-size: 13px; }
.search-input { min-width: 320px; flex: 1 1 320px; }
.toolbar input:focus, .toolbar select:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line-2);
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  background: var(--surface);
  color: var(--gray-700);
  box-shadow: var(--shadow-xs);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s;
}
.btn:hover { background: var(--gray-50); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--primary); color: var(--color-on-primary); border-color: var(--primary); box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { padding: 4px 9px; font-size: 11.5px; border-radius: 6px; font-weight: 500; box-shadow: none; }
.btn-ai-subtle { background: var(--surface); color: var(--primary); border-color: var(--line-2); }
.btn-ai-subtle:hover { background: var(--primary-light); border-color: var(--primary-soft); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f3c7c7; }
.btn-danger:hover { background: var(--danger-light); }

/* ===== Table ===== */
.table-wrap { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line-2); overflow: hidden; box-shadow: var(--shadow-xs); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; }
thead th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;   /* スクロールしても列見出しを見失わない */
  top: 0;
  z-index: 5;
}
td { padding: var(--row-py) 16px; font-size: 13.5px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody tr.is-hot { background: #f6f9ff; }
tbody tr.is-hot:hover { background: #eef4ff; }
td strong { display: block; font-size: 13.5px; color: var(--gray-900); font-weight: 600; }
td span { display: block; font-size: 11.5px; color: var(--gray-500); margin-top: 2px; }

.inquiry-table table { table-layout: fixed; }
.inquiry-table th:nth-child(1), .inquiry-table td:nth-child(1) { width: 78px; }
.inquiry-table th:nth-child(2), .inquiry-table td:nth-child(2) { width: 210px; }
.inquiry-table th:nth-child(3), .inquiry-table td:nth-child(3) { width: 96px; white-space: nowrap; }
.inquiry-table th:nth-child(4), .inquiry-table td:nth-child(4) { width: 70px; }
.inquiry-table th:nth-child(5), .inquiry-table td:nth-child(5) { width: 108px; }
.inquiry-table th:nth-child(6), .inquiry-table td:nth-child(6) { width: 90px; }
/* B1: 行ホバー操作(.row-quick)の「対応済み」ボタン分、104px→186pxに拡張（実演のための唯一の実画面幅変更） */
.inquiry-table th:nth-child(8), .inquiry-table td:nth-child(8) { width: 186px; white-space: nowrap; }
.inquiry-table td:nth-child(8) .row-more { margin-left: 4px; padding-left: 7px; padding-right: 7px; color: var(--gray-400); }
.inquiry-table td:nth-child(8) .row-more:hover { color: var(--gray-700); }
.inquiry-table tbody tr.is-cursor { background: var(--primary-light); }
.inquiry-table tbody tr.is-cursor:hover { background: var(--primary-light); }

.score { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 22px; padding: 0 6px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; }
.score-high { background: var(--primary-light); color: var(--primary-dark); }
.score-mid { background: var(--gray-100); color: var(--gray-600); }
.score-low { background: var(--gray-100); color: var(--gray-500); }

.status-pill, .badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .65; }
.state-new { background: var(--primary-light); color: var(--primary-dark); }
.state-contacted { background: var(--gray-100); color: var(--gray-600); }
.state-qualified { background: var(--gray-100); color: var(--gray-600); }
.state-pending { background: var(--gray-100); color: var(--gray-600); }
/* deprecated: 状態表現にamber禁止。互換のためのみ存置 */
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge::before { display: none; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: var(--gray-500); font-size: 12px; border-top: 1px solid var(--line); }
.pagination button { padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--gray-700); font-size: 12px; cursor: pointer; transition: background .15s; }
.pagination button:hover:not(:disabled) { background: var(--gray-50); }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

/* 後方互換: 旧右パネル task list */
.workbench-side { display: grid; gap: 12px; }
.side-panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-xs); }
.side-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.side-panel h2 { font-size: 14px; font-weight: 700; }
.task-list { display: grid; gap: 0; }
.task-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.task-card:last-child { border-bottom: none; }
.task-card.priority-high { background: var(--gray-50); }
.task-card strong { display: block; font-size: 13px; }
.task-card span { display: block; font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ===== Section ===== */
.section { margin-top: 32px; }
.section-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 14px; color: var(--gray-800); }

/* ===== 改修: パイプラインカードの作り直し（色帯・濃い面を廃止し軽量化） ===== */
.pipeline-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; }
.pipeline-column { flex: 0 0 232px; min-width: 232px; background: transparent; }
.pipeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.pipeline-name { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.pipeline-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--gray-100); color: var(--gray-600);
  font-size: 11.5px; font-weight: 700;
}
.pipeline-count.is-active { background: var(--primary-light); color: var(--primary-dark); }
.pipeline-body { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.pipeline-card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.pipeline-card:hover { border-color: var(--primary-soft); box-shadow: var(--shadow-sm); }
.pipeline-card .name { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.pipeline-card .store, .pipeline-card .meta { font-size: 11.5px; color: var(--gray-500); margin-top: 3px; }

/* ===== Design notes ===== */
.design-notes { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.design-notes summary { cursor: pointer; padding: 13px 16px; color: var(--gray-600); font-size: 13px; font-weight: 600; list-style: none; }
.design-notes summary::-webkit-details-marker { display: none; }
.design-notes summary::before { content: '▸ '; color: var(--gray-400); }
.design-notes[open] summary::before { content: '▾ '; }
.notes-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; }
.notes-grid article { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px; background: var(--gray-50); }
.notes-grid h2 { font-size: 13px; margin-bottom: 5px; color: var(--gray-800); }
.notes-grid p { font-size: 12px; color: var(--gray-600); }

/* ===== Side peek ===== */
.peek-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .28); opacity: 0; visibility: hidden; transition: opacity .18s, visibility .18s; z-index: 900; }
.peek-overlay.show { opacity: 1; visibility: visible; }
.side-peek {
  position: fixed; top: 0; right: 0;
  width: 440px; max-width: 92vw; height: 100vh;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  transform: translateX(100%);
  transition: transform var(--motion-enter);
  z-index: 901;
  display: flex; flex-direction: column;
}
.side-peek.open { transform: translateX(0); }
.peek-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.peek-eyebrow { color: var(--gray-400); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.peek-header h2 { font-size: 18px; line-height: 1.3; margin-top: 3px; letter-spacing: -.01em; }
.peek-close { background: none; border: none; font-size: 22px; color: var(--gray-400); cursor: pointer; padding: 2px 6px; border-radius: 7px; transition: background .15s, color .15s; }
.peek-close:hover { background: var(--gray-100); color: var(--gray-700); }
.peek-body { padding: 20px 22px; overflow-y: auto; }
.peek-score { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; background: var(--gray-50); }
.peek-score span { display: block; font-size: 11px; color: var(--gray-500); font-weight: 600; }
.peek-score strong { display: block; font-size: 30px; line-height: 1; color: var(--primary); margin-top: 3px; letter-spacing: -.02em; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--gray-700); margin-bottom: 5px; }
.field .hint { display: block; font-weight: 400; font-size: 12px; color: var(--gray-500); margin-top: 3px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 12px; font-size: 14px; }
.field textarea { resize: vertical; }

/* 手順ステップ（後方互換・トーン調整） */
.steps { display: flex; flex-direction: column; }
.step { position: relative; padding: 0 0 26px 54px; }
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: var(--line-2); }
.step-num { position: absolute; left: 0; top: 2px; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--color-on-primary); font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.step-main { padding-top: 4px; }
.step-title { font-weight: 700; font-size: 16px; color: var(--gray-800); margin-bottom: 10px; }
.step-help { color: var(--gray-600); font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.step .field:last-child { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 880px) { .form-grid { grid-template-columns: 1fr; } }

.timeline { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.timeline h3 { font-size: 14px; margin-bottom: 12px; }
.timeline div { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: start; margin-bottom: 12px; }
.timeline div span { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-soft); margin-top: 6px; }
.timeline div:first-child span { background: var(--primary); }
.timeline p { font-size: 13px; }
.timeline small { color: var(--gray-500); margin-left: 6px; }

/* ===== Modal ===== */
.report-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 950; display: none; justify-content: center; align-items: center; padding: 20px; }
.report-overlay.show { display: flex; }
.report-modal { background: var(--surface); border-radius: 14px; width: 460px; max-width: 95vw; border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.rm-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.rm-header h2 { font-size: 16px; letter-spacing: -.01em; }
.rm-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-400); border-radius: 7px; padding: 2px 6px; transition: background .15s, color .15s; }
.rm-close:hover { background: var(--gray-100); color: var(--gray-700); }
.rm-body { padding: 20px 22px; }
.rm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--line); }

.imj-sidebar-toggle { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 1000; width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--primary); color: var(--color-on-primary); font-size: 20px; box-shadow: var(--shadow-pop); cursor: pointer; }

:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; border-radius: 6px; }

/* ============================ Auth (login) ============================
   実装踏襲: 中央カード / 淡グレー背景 / mvp-v2準拠(#2563eb) / 影は柔和。
   カード=380px・角丸14px、入力=角丸8px で階層化。 */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--canvas);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 36px 32px 28px;
}
.auth-brand { font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--primary); text-align: center; }
.auth-brand span { font-size: 12px; font-weight: 500; color: var(--gray-400); margin-left: 4px; }
.auth-title { font-size: 16px; font-weight: 700; text-align: center; margin-top: 18px; color: var(--gray-900); }
.auth-sub { font-size: 12.5px; color: var(--gray-500); text-align: center; margin-top: 5px; }
.auth-form { margin-top: 24px; }
.auth-error { display: none; background: var(--danger-light); color: var(--danger); font-size: 12.5px; border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; }
.auth-error.show { display: block; }
.auth-card .field input { padding: 10px 12px; }
.auth-submit { width: 100%; margin-top: 6px; padding: 11px; font-size: 14px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12.5px; }
.auth-row label { display: flex; align-items: center; gap: 6px; color: var(--gray-600); cursor: pointer; }
.auth-row a { color: var(--primary); text-decoration: none; }
.auth-row a:hover { text-decoration: underline; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 11px; color: var(--gray-400); }

/* --- Auth v3 追加（2026-08-01）: パスワード表示切替・注記・狭幅 --- */
.field-pw { position: relative; display: flex; align-items: center; }
/* `.auth-card .field input` より詳細度を上げる（負けると入力文字が表示ボタンに潜る） */
.auth-card .field-pw input { padding-right: 60px; }
.pw-toggle {
  position: absolute; right: 6px;
  background: none; border: none;
  font-size: 12px; font-weight: 600; color: var(--gray-500);
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
  transition: background .15s, color .15s;
}
.pw-toggle:hover { background: var(--gray-100); color: var(--gray-700); }
.auth-note { margin-top: 16px; font-size: 12px; line-height: 1.65; color: var(--gray-500); text-align: center; }
.auth-note a { color: var(--primary); text-decoration: none; }
.auth-note a:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .auth-screen { padding: 16px; align-items: flex-start; padding-top: 48px; }
  .auth-card { padding: 28px 20px 22px; border-radius: 12px; }
}

/* ============================ Account menu (dropdown popup) ============================ */
.has-menu { position: relative; }
.menu-trigger { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px 4px 4px; cursor: pointer; transition: background .15s, border-color .15s; }
.menu-trigger:hover { background: var(--gray-50); border-color: var(--line); }
.menu-trigger .caret { color: var(--gray-400); font-size: 10px; }
.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 208px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
  z-index: 920;
}
.menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: 13px; color: var(--gray-900); }
.menu-head span { display: block; font-size: 11.5px; color: var(--gray-500); margin-top: 2px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: none; border-radius: 8px; padding: 9px 10px; font-size: 13px; color: var(--gray-700); cursor: pointer; text-decoration: none; transition: background .12s, color .12s; }
.menu-item:hover { background: var(--gray-50); color: var(--gray-900); }
.menu-item.is-danger { color: var(--danger); }
.menu-item.is-danger:hover { background: var(--danger-light); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ============================ Confirm dialog (small modal) ============================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 950; display: none; justify-content: center; align-items: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-confirm { background: var(--surface); border-radius: 14px; width: 400px; max-width: 95vw; border: 1px solid var(--line); box-shadow: var(--shadow-pop); padding: 24px; }
.modal-confirm h2 { font-size: 16px; letter-spacing: -.01em; margin-bottom: 8px; }
.modal-confirm p { font-size: 13px; color: var(--gray-600); line-height: 1.6; }
.modal-confirm .rm-actions { padding: 18px 0 0; border: none; margin: 0; }

/* ============================ Toast ============================ */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 980; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 240px; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--gray-800);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); flex-shrink: 0; }
/* A1: 左線廃止・状態は toast-dot の色のみで表す / A2: successは緑でなく青(--primary) */
.toast.success .toast-dot { background: var(--primary); }
.toast.error .toast-dot { background: var(--danger); }
.toast .toast-close { margin-left: auto; background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.toast .toast-close:hover { color: var(--gray-700); }
.toast .toast-action { background: none; border: none; color: var(--primary); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; padding: 0 2px; }
.toast .toast-action:hover { text-decoration: underline; }

/* ============================ Command palette (⌘K) ============================ */
.cmdk-trigger { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--color-text-subtle); cursor: pointer; transition: background .15s, border-color .15s; }
.cmdk-trigger:hover { background: var(--gray-50); border-color: var(--color-border-strong); }
.cmdk-trigger .kbd { font-size: 11px; color: var(--color-text-muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; }
.cmdk-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .40); z-index: 970; display: none; align-items: flex-start; justify-content: center; padding: 12vh 20px 20px; }
.cmdk-overlay.show { display: flex; }
.cmdk { width: 100%; max-width: 600px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-overlay); overflow: hidden; }
.cmdk-input { width: 100%; border: none; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 15px; outline: none; background: var(--surface); }
.cmdk-list { max-height: 56vh; overflow-y: auto; padding: 8px; }
.cmdk-group-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: var(--color-text-default); cursor: pointer; }
.cmdk-item .ci-ico { color: var(--color-text-muted); width: 16px; text-align: center; flex-shrink: 0; }
.cmdk-item .ci-label { flex: 1; }
.cmdk-item .ci-cat { font-size: 11px; color: var(--color-text-muted); }
.cmdk-item .ci-k { font-size: 11px; color: var(--color-text-muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
.cmdk-item.is-active { background: var(--primary-light); color: var(--primary-dark); }
.cmdk-item.is-active .ci-ico, .cmdk-item.is-active .ci-cat { color: var(--primary-dark); }
.cmdk-empty { padding: 22px; text-align: center; color: var(--color-text-muted); font-size: 13px; }

/* ============================ Filter chips ============================ */
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-bar-label { font-size: 12px; color: var(--color-text-muted); }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--gray-50); border: 1px solid var(--line-2); border-radius: var(--radius-pill); padding: 3px 5px 3px 11px; font-size: 12px; color: var(--color-text-default); }
.filter-chip b { font-weight: 600; }
.filter-chip .chip-x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: none; background: transparent; color: var(--color-text-muted); cursor: pointer; font-size: 13px; line-height: 1; }
.filter-chip .chip-x:hover { background: var(--gray-200); color: var(--gray-700); }
.filter-clear { background: none; border: none; color: var(--color-text-link); font-size: 12px; cursor: pointer; padding: 3px 4px; }
.filter-clear:hover { text-decoration: underline; }

/* ============================ Table tools (density) ============================ */
.table-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: none; background: transparent; padding: 7px 11px; font-size: 12px; color: var(--color-text-subtle); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.is-active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

/* ============================ Floating row menu ============================ */
.floating-menu { position: fixed; min-width: 156px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-overlay); padding: 6px; z-index: 940; }

/* ============================ Shortcut help ============================ */
.report-modal.modal-md { width: 560px; }
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.sc-col h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); margin-bottom: 8px; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; color: var(--color-text-default); border-bottom: 1px solid var(--line); }
.sc-row:last-child { border-bottom: none; }
kbd { font-family: inherit; font-size: 11px; color: var(--gray-700); background: var(--gray-50); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; }
@media (max-width: 560px) { .sc-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 1100px) {
  .workbench { grid-template-columns: 1fr; }
  .workbench-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-row, .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3), .summary-item:nth-child(3) { border-left: none; }
  .metric:nth-child(-n+2), .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 820px) {
  .imj-sidebar { position: fixed; left: 0; top: 0; z-index: 999; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-pop); }
  .imj-sidebar.open { transform: translateX(0); }
  body.nav-collapsed .imj-sidebar { display: flex; }
  body.nav-collapsed .nav-open { display: none; }
  .imj-sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .imj-page-header { padding: 0 16px; }
  .container { padding: 18px 16px 82px; }
  .page-kickoff { flex-direction: column; }
  .table-wrap { overflow-x: auto; }
  .inquiry-table table { min-width: 900px; }
  .workbench-side, .notes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .metric-row, .summary-strip { grid-template-columns: 1fr; }
  .metric, .summary-item { border-left: none; border-bottom: 1px solid var(--line); }
  .metric:last-child, .summary-item:last-child { border-bottom: none; }
  .page-actions, .toolbar { width: 100%; }
  .page-actions .btn, .toolbar .btn, .toolbar input, .toolbar select { width: 100%; }
  .user-name { display: none; }
}
/* =========================================================================
   IMJ Flow 改修 — 画面アーキタイプ用の追加コンポーネント
   design-system.css の二層トークンを参照。青/グレー/赤・薄影・左線禁止を踏襲。
   ========================================================================= */

/* ===== セクション見出し（タイトル＋右アクション） ===== */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head .section-title { margin-bottom: 0; }
.section-head .section-actions { display: flex; align-items: center; gap: 8px; }
.section-sub { font-size: 12.5px; color: var(--color-text-muted); margin: -8px 0 14px; }

/* ===== 2カラム詳細レイアウト ===== */
.detail-2col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1024px) { .detail-2col { grid-template-columns: 1fr; } }

/* ===== カード（汎用パネル） ===== */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 14px; font-weight: 700; }
.card-head .card-meta { font-size: 12px; color: var(--color-text-muted); }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

/* ===== 定義リスト（key-value） ===== */
.def-list { display: grid; gap: 0; }
.def-row { display: grid; grid-template-columns: 116px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.def-row:last-child { border-bottom: none; }
.def-row dt { color: var(--color-text-muted); }
.def-row dd { color: var(--color-text-default); font-weight: 500; }

/* ===== 状態ピル（業務別・色は青/グレー/赤に限定） ===== */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .65; }
.pill-blue { background: var(--primary-light); color: var(--primary-dark); }
.pill-gray { background: var(--gray-100); color: var(--gray-600); }
.pill-red { background: var(--danger-light); color: var(--danger); }
.pill-plain { background: var(--gray-100); color: var(--gray-600); }
.pill-plain::before { display: none; }

/* ===== トグルスイッチ ===== */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--gray-300); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch .track::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: var(--shadow-xs); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }

/* 設定行（ラベル＋説明＋右コントロール） */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row .setting-label { font-size: 13.5px; font-weight: 600; color: var(--color-text-default); }
.setting-row .setting-help { font-size: 12px; color: var(--color-text-muted); margin-top: 3px; }

/* ===== 棒グラフ（CSS） ===== */
.chart-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 16px; }
.chart-title { font-size: 13px; font-weight: 700; color: var(--color-text-default); }
.chart-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.bars { display: flex; align-items: stretch; gap: 10px; height: 160px; margin-top: 16px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.bar { width: 100%; max-width: 34px; min-height: 4px; background: var(--primary); border-radius: 6px 6px 0 0; opacity: .85; }
.bar.is-muted { background: var(--gray-300); }
.bar-label { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }
.bar-val { font-size: 11px; color: var(--color-text-subtle); font-weight: 600; }

/* ライン/エリアの簡易SVGチャート（pageでpolylineを置く） */
.svg-chart { width: 100%; height: 150px; display: block; }
.svg-chart .area { fill: var(--primary-light); }
.svg-chart .line { fill: none; stroke: var(--primary); stroke-width: 2; }
.svg-chart .grid { stroke: var(--line); stroke-width: 1; }
.svg-chart .dot { fill: var(--primary); }

/* 横棒ランキング */
.hbar-list { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 46px; align-items: center; gap: 10px; font-size: 12.5px; }
.hbar .hbar-track { height: 8px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.hbar .hbar-fill { height: 100%; background: var(--primary); border-radius: 999px; opacity: .85; }
.hbar .hbar-num { text-align: right; color: var(--color-text-subtle); font-weight: 600; }

/* ドーナツ（conic-gradient） */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0; position: relative; }
.donut::after { content: ''; position: absolute; inset: 22px; background: var(--surface); border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.donut-center strong { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.donut-center span { font-size: 10px; color: var(--color-text-muted); }
.legend { display: grid; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--color-text-default); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-row .legend-num { margin-left: auto; color: var(--color-text-subtle); font-weight: 600; }

/* ===== ファイル/ドキュメントのグリッド ===== */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.file-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.file-card:hover { border-color: var(--primary-soft); box-shadow: var(--shadow-sm); }
.file-ico { width: 36px; height: 44px; border-radius: 5px; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.file-name { font-size: 13.5px; font-weight: 600; margin-top: 12px; color: var(--color-text-default); word-break: break-all; }
.file-meta { font-size: 11.5px; color: var(--color-text-muted); margin-top: 4px; }
.folder-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; cursor: pointer; }
.folder-row:hover { background: var(--gray-50); }
.folder-row .f-ico { color: var(--gray-400); }
.folder-row .f-name { font-size: 13.5px; font-weight: 500; }
.folder-row .f-count { margin-left: auto; font-size: 12px; color: var(--color-text-muted); }

/* ===== 操作履歴（ログ） ===== */
.log-list { display: grid; gap: 0; }
.log-row { display: grid; grid-template-columns: 150px 150px 1fr; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-row:last-child { border-bottom: none; }
.log-row .log-time { color: var(--color-text-muted); font-size: 12px; }
.log-row .log-user { display: flex; align-items: center; gap: 7px; }
.log-row .log-action b { font-weight: 600; }
@media (max-width: 720px) { .log-row { grid-template-columns: 1fr; gap: 2px; } }

/* ===== サービス・料金カード ===== */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.svc-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 18px; }
.svc-card.is-featured { border-color: var(--primary); }
.svc-name { font-size: 14px; font-weight: 700; }
.svc-price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 2px; }
.svc-price small { font-size: 12px; font-weight: 500; color: var(--color-text-muted); }
.svc-feat { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.svc-feat li { font-size: 12.5px; color: var(--color-text-subtle); padding-left: 18px; position: relative; }
.svc-feat li::before { content: '✓'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

/* ===== 進捗バー ===== */
.progress { height: 6px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 999px; }

/* ===== 空状態 ===== */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--gray-100); color: var(--gray-400); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.empty-title { font-size: 15px; font-weight: 700; margin-top: 14px; color: var(--color-text-default); }
.empty-text { font-size: 13px; color: var(--color-text-muted); margin-top: 6px; max-width: 360px; margin-left: auto; margin-right: auto; }
.empty-state .btn { margin-top: 16px; }

/* ===== テーブル内のユーザーセル/アバター ===== */
.cell-user { display: flex; align-items: center; gap: 8px; }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.mini-avatar.is-gray { background: var(--gray-100); color: var(--gray-500); }

/* ===== タグ ===== */
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 500; background: var(--gray-100); color: var(--gray-600); }
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }

/* ===== 金額（右寄せ・等幅） ===== */
.num { font-variant-numeric: tabular-nums; text-align: right; }
td.num, th.num { text-align: right; }

/* ===== インラインの注記/バナー ===== */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--gray-50); font-size: 12.5px; color: var(--color-text-subtle); }
.notice.is-info { background: #eff6ff; border-color: #bfdbfe; color: var(--blue-700); }
.notice.is-danger { background: var(--danger-light); border-color: #f3c7c7; color: var(--danger); }

/* ===== ミニKPI（カード内の小さい指標） ===== */
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.mini-kpi { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mini-kpi .k-label { font-size: 11.5px; color: var(--color-text-muted); }
.mini-kpi .k-value { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; }
.mini-kpi .k-delta { font-size: 11px; margin-top: 3px; color: var(--color-text-muted); }
.mini-kpi .k-delta.up { color: var(--primary-dark); }
.mini-kpi .k-delta.down { color: var(--danger); }

/* =========================================================================
   改修v3: 実戦還流部品 (2026-08-01)
   出典: imj-flow-work / unified-inbox(MADO) / imj-article / CREW(OR FLOW) /
        keiei-dashboard / sales-dashboard / airwork-reply-listing / aptitude-assessment / ai-interview
   色は青/グレー/赤のみ・左線の新規追加なし。
   ========================================================================= */

/* ----- B1: 行ホバー操作 ----- */
.row-quick { display: inline-flex; gap: 4px; opacity: 0; transition: opacity .12s; }
tbody tr:hover .row-quick, tbody tr:focus-within .row-quick { opacity: 1; }
.row-actions { display: inline-flex; align-items: center; gap: 4px; }

/* ----- B2: 保存インジケータ ----- */
.save-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-muted); }
.save-indicator::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gray-300); }
.save-indicator.is-saving::before { background: var(--primary); animation: si-pulse 1s ease-in-out infinite; }
.save-indicator.is-saved::before { background: var(--primary); }
.save-indicator.is-error { color: var(--danger); }
.save-indicator.is-error::before { background: var(--danger); }
@keyframes si-pulse { 50% { opacity: .35; } }

/* ----- B3: コピー行 ----- */
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; padding: 8px 12px; font-size: 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--gray-50); color: var(--gray-700); }

/* ----- B4: 一括選択バー ----- */
.bulk-bar { display: none; align-items: center; gap: 10px; padding: 8px 12px; background: var(--primary-light); border: 1px solid var(--primary-soft); border-radius: var(--radius-sm); margin-bottom: 10px; font-size: 13px; color: var(--primary-dark); }
.bulk-bar.show { display: flex; }
.bulk-bar .bulk-count { font-weight: 700; }
.bulk-bar .bulk-clear { margin-left: auto; background: none; border: none; color: var(--primary-dark); cursor: pointer; font-size: 12px; text-decoration: underline; }

/* ----- B5: セル内ミニバー ----- */
.cell-bar { display: flex; align-items: center; gap: 8px; min-width: 90px; }
.cell-bar .cb-num { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--color-text-subtle); min-width: 38px; }
.cell-bar .cb-track { flex: 1; height: 6px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.cell-bar .cb-fill { height: 100%; background: var(--primary); border-radius: 999px; opacity: .85; }
.cell-bar.is-danger .cb-fill { background: var(--danger); }

/* ----- B6: 差分監査テーブル（before=赤+取り消し線、after=青。緑は使わない） ----- */
.diff-table .diff-before { color: var(--danger-text); background: var(--danger-light); text-decoration: line-through; padding: 1px 6px; border-radius: 4px; }
.diff-table .diff-after { color: var(--primary-dark); background: var(--primary-light); padding: 1px 6px; border-radius: 4px; }

/* ----- B7: ファネル ----- */
.funnel { display: grid; gap: 10px; }
.funnel-step { display: grid; grid-template-columns: 110px 1fr 120px; align-items: center; gap: 10px; font-size: 12.5px; }
.funnel-step .fs-label { color: var(--color-text-subtle); }
.funnel-step .fs-track { height: 22px; background: var(--gray-100); border-radius: 6px; overflow: hidden; }
.funnel-step .fs-fill { height: 100%; background: var(--primary); opacity: .85; border-radius: 6px; display: flex; align-items: center; padding: 0 8px; color: var(--color-on-primary); font-size: 11.5px; font-weight: 600; min-width: 34px; }
.funnel-step .fs-metric { text-align: right; color: var(--color-text-muted); font-size: 11.5px; }
.funnel-step .fs-metric .drop { color: var(--danger); font-weight: 600; }

/* ----- B8: ナビバッジ（件数は未処理数のみ・0は出さない・総数は出さない） ----- */
.nav-badge { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--primary-light); color: var(--primary-dark); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ----- B9: 担当+日時セル / 平均線付き横バー ----- */
.cell-sub { font-size: 11.5px; color: var(--color-text-muted); margin-top: 2px; }
.hbar .hbar-track { position: relative; }
.hbar .hbar-avg { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--gray-400); border-radius: 1px; }

/* ----- 部品見本(details)のレイアウト用スキャフォールド ----- */
.v3-demo-stack { display: grid; gap: 22px; padding: 0 16px 16px; }
.v3-demo-block h2 { font-size: 13px; font-weight: 700; color: var(--gray-800); margin-bottom: 8px; }
.v3-demo-block h2 code { font-size: 11.5px; font-weight: 600; color: var(--color-text-link); background: var(--gray-50); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; margin-left: 4px; }
.v3-demo-desc { font-size: 12px; color: var(--color-text-subtle); margin-top: 6px; line-height: 1.6; }
.v3-demo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }

/* ----- C系ルール文言（既存 design-notes への追加記事） ----- */
.v3-rules-article { grid-column: 1 / -1; }
.v3-rules-list { list-style: none; display: grid; gap: 6px; margin-top: 6px; }
.v3-rules-list li { font-size: 12px; color: var(--gray-600); line-height: 1.6; padding-left: 14px; position: relative; }
.v3-rules-list li::before { content: '–'; position: absolute; left: 0; color: var(--gray-400); }

/* ----- proposal.html 用（読み物・サイドナビ無し1カラム） ----- */
.proposal-doc { max-width: 880px; }
.proposal-head { margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.proposal-section { margin-bottom: 36px; }
.proposal-section h2 { font-size: 16px; font-weight: 700; color: var(--gray-800); margin-bottom: 12px; letter-spacing: -.01em; }
.proposal-section p { font-size: 13.5px; color: var(--gray-600); line-height: 1.75; margin-bottom: 10px; }
.proposal-section table th, .proposal-section table td { font-size: 12.5px; }
.proposal-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--color-text-muted); }

/* =========================================================================
   優福 予約統合ビュー（yufuku-reserve）追加分 — 2026-08-02
   既存トークン(色/角丸/影/罫線)のみを使用。新規の色・二段影・左線・枠の入れ子は追加しない。
   既存コンポーネント(.card/.field/.form-grid/.pill/.tag/.mini-avatar/.seg/.mini-kpis/
   .notice/.donut-wrap/.chart-card/.table-wrap 等)で表現できない「予約カード」と
   「一覧のテーブル⇄カード出し分け」のみ最小限で追加。
   ========================================================================= */

/* ----- 予約カード（今日の予約・一覧のスマホ表示で共用） ----- */
.resv-list { display: grid; gap: 10px; }
@media (min-width: 860px) { .resv-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.resv-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 14px 16px; }
.resv-card.is-conflict { border-color: var(--danger); }
.resv-card.is-done { opacity: .62; }
.resv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.resv-row + .resv-row { margin-top: 8px; }
.resv-time { font-size: 15px; font-weight: 700; color: var(--gray-900); font-variant-numeric: tabular-nums; white-space: nowrap; }
.resv-time small { display: block; font-size: 11px; font-weight: 500; color: var(--gray-400); margin-top: 1px; }
.resv-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.resv-meta { font-size: 12.5px; color: var(--gray-600); margin-top: 6px; }
.resv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.resv-staff { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--gray-600); }
.resv-alert { font-size: 12.5px; color: var(--danger); font-weight: 600; margin-top: 6px; }

/* ----- 一覧: テーブル(PC)／カード(スマホ)の出し分け ----- */
.view-table { display: none; }
.view-cards { display: block; }
@media (min-width: 860px) {
  .view-table { display: block; }
  .view-cards { display: none; }
}

/* ----- ヘッダー内の表示言語トグル（日本語/中文・将来の多言語化を想定した見せ方のみ。翻訳は未実装） ----- */
.lang-seg { margin-right: 4px; }

/* ----- 衝突アラート: 枠にしない（地の文として置く） ----- */
.alert-line { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 12px; font-size: 13px; line-height: 1.65; color: var(--danger); font-weight: 600; }
.alert-line .al-ico { flex: none; }
.alert-line em { font-style: normal; color: var(--gray-700); font-weight: 500; }

/* ----- カード⇄リストの手動切替（メディアクエリではなく明示指定） ----- */
.view-switch .v-cards { display: block; }
.view-switch .v-table { display: none; }
.view-switch[data-view="list"] .v-cards { display: none; }
.view-switch[data-view="list"] .v-table { display: block; }

/* ----- 行クリックで詳細を開く一覧 ----- */
.row-clickable tbody tr { cursor: pointer; }
.row-clickable tbody tr:hover { background: var(--gray-50); }

/* ----- 予約詳細（モーダル内の項目並び。枠は作らず罫線のみ） ----- */
.detail-list { display: grid; gap: 0; }
.detail-row { display: flex; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.detail-row:first-child { border-top: 0; }
.detail-row dt { flex: none; width: 92px; color: var(--gray-500); font-weight: 500; }
.detail-row dd { margin: 0; color: var(--gray-900); font-weight: 500; }

/* =========================================================================
   スマホ最適化 — 2026-08-02
   前提: 現場スタッフが自分のスマホで開く（CEO決定・スマホファースト）。
   狙いは一つだけ、「開いた瞬間に今日の予約が見えること」。
   実測では予約リストが y=719 から始まり、844pxの画面に1件も入っていなかった
   （内訳: 指標4枚が縦1列で330px / 機能説明62px / 切替ボタンが潰れて横に切れる）。
   前置きを畳んで1画面目を予約そのものに明け渡す。
   既存トークンのみ使用。新しい色・枠・左線・ゼブラは足さない。
   ========================================================================= */

/* 2カラム枠は minmax(0,1fr) で組む。1fr のままだと中身（表・ドーナツ）が
   min-content 幅で突っ張り、スマホでページ全体が横に伸びる
   （実測: .grid-2col が 615px → main が 631px になり横スクロールが出ていた）。 */
.grid-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }

/* 表がはみ出した時、.table-wrap の `overflow: hidden`（角丸のため）が
   黙って列を切り落としていた（1100pxで実測 386/411＝25px分の列が見えない）。
   金額や時刻が「無い」ように見えるのが一番まずいので、自分の枠の中で横に流す。
   角丸を保つため overflow-y は hidden のまま。全幅で有効にする */
.table-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }

/* 月間売上「¥3,910,960」が枠を8〜15px超えて隣の指標に重なっていた（実測 枠101 / 中身109）。
   桁を削る・省略記号にするのは論外（金額の見間違いが起きる）ので、
   枠の下限を広げ、狭い幅では数値の級数を1段落とす */
.mini-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 900px) { .mini-kpi .k-value { font-size: 18px; } }

@media (max-width: 860px) {
  /* ここも 1fr ではなく minmax(0,1fr)。1列にしても中身（表・ドーナツ）の min-content で
     突っ張るのは同じで、モック側は 415px まで広がって横あふれしていた */
  .grid-2col { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------------------------------
   指で操作する端末＝スマホだけではない。
   スタッフがタブレット（iPad mini 744 / iPad 810 / Air 820 / Pro 834・横1024）で
   開く可能性がある以上、幅560pxで線を引くと561px以上は入力欄が13pxに戻り、
   指では押しづらいまま残る（実測: 600/700/768/820/1024 で一覧5個・追加10個が16px未満）。
   条件を2つ OR でつなぐ:
     max-width: 1024px … タブレットを「幅」で拾う
     pointer: coarse   … 幅に関係なく「タッチ端末」を拾う（大画面タブレット・タッチPC）
   マウスで使う1280px以上のPCはどちらにも当たらないので、業務画面の密度は従来どおり。
   ------------------------------------------------------------------------- */
@media (max-width: 1024px), (pointer: coarse) {
  /* ----- 指で押せる大きさを確保する。ヘッダーの小物まで広げると崩れるので対象を絞る ----- */
  .sub-tabs a { min-height: 44px; display: inline-flex; align-items: center; }
  .btn { min-height: 44px; }
  .menu-item { min-height: 44px; }
  .imj-sidebar-top-link { min-height: 44px; display: flex; align-items: center; }
  .seg button { min-height: 44px; }
  /* ヘッダーの2つ（アカウントメニュー38px・サイドバーを閉じる26px）だけ小さいまま残っていた。
     どちらも毎日押す。ヘッダーの高さは変えずに当たり判定だけ広げる */
  .menu-trigger { min-height: 44px; }
  .sidebar-collapse { min-width: 44px; min-height: 44px; }
  /* ページ送りは素の <button> なので .btn のルールが当たらない */
  .pagination button { min-height: 44px; }

  /* ----- 登録ボタンを画面下に固定する。
           スマホ(390)で総高1694のy=1559、iPad縦(768)でも総高1697のy=1554にあり、
           どちらも画面外。手入力運用（A-2）で毎回スクロールさせない。
           負のマージン -16px は .card-body の padding:16px に合わせている（実測・全幅で同値） ----- */
  form .page-actions {
    position: sticky; bottom: 0; z-index: 5;
    background: var(--surface);
    border-top: 1px solid var(--line);
    margin: 12px -16px -16px;
    padding: 10px 16px;
    /* 560px以下には既存の `.page-actions { width: 100% }` があり、幅が固定されると
       負のマージンが「広げる」でなく「ずらす」に化ける（実測: カード364に対しバー332が左に16pxずれる）。
       auto に戻して初めてカードの端まで届く */
    width: auto;
  }

  /* ----- iOSは16px未満の入力欄にフォーカスするとページを勝手に拡大する。
           手入力（WeChat経由の予約を入れる運用）で毎回ピンチし直す羽目になっていた ----- */
  .field input, .field select, .field textarea,
  input[type="text"], input[type="tel"], input[type="date"], input[type="time"],
  input[type="number"], input[type="email"], input[type="search"],
  select, textarea { font-size: 16px; min-height: 44px; }
  textarea { min-height: 88px; }
  /* .toolbar を付けて上書きする。素の select では既存の
     `.toolbar input, .toolbar select { font-size: 13px }` に詳細度で負けてiOSズームが残る */
  .toolbar input, .toolbar select { font-size: 16px; min-height: 44px; }

}

/* 日付切替（.seg）は縮ませない。見出しと1行を奪い合って834〜1200pxで3〜5px潰れていた
   （実測: 枠128 / 中身133）。代わりに .page-actions の中で折り返させる。
   足りない時だけ2行になり、ボタンは原寸のまま。幅が足りる1280px以上は1行のまま変わらない。
   ※ flex-shrink:0 を単独で足すと、折り返せないぶん見出しに押し出されて
     ページ全体が88px横あふれする（実測済み）。wrap と必ずセットで入れること。
   ※560px以下は下のブロックで「1切替＝1行」に畳んでいる（basis 100%なのでここと矛盾しない） */
@media (min-width: 561px) {
  .page-kickoff > .page-actions { flex-wrap: wrap; justify-content: flex-end; }
  .page-kickoff > .page-actions > .seg { flex-shrink: 0; }
}

@media (max-width: 560px) {
  /* ----- 1画面目を予約に明け渡す ----- */
  /* 機能の説明文。初回にしか読まれないものを毎日の画面に置かない */
  .page-lead { display: none; }
  /* サイドバーの現在地と同じ文字なので重複 */
  .breadcrumb { display: none; }
  .page-kickoff { gap: 10px; margin-bottom: 12px; }
  .page-heading { font-size: 18px; }
  .container { padding: 14px 12px 88px; }
  .imj-page-header { padding: 0 12px; }

  /* ----- 指標は2×2で詰める（1列だと4枚で330px使い、予約が画面外へ出る）----- */
  .metric-row, .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric, .summary-item { padding: 9px 12px; border-left: none; }
  .metric:nth-child(-n+2), .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric:nth-last-child(-n+2), .summary-item:nth-last-child(-n+2) { border-bottom: none; }
  .metric-label { font-size: 11.5px; }
  .metric-value { font-size: 20px; }

  /* ----- 切替ボタンが nowrap のまま潰れ、中のボタンが切れていた（実測 133>96）----- */
  .page-actions, .toolbar { flex-wrap: wrap; }
  /* 1行に2つ並べると「本日 8/2(日)」が 59px しか貰えず文字が切れる（要 80px）。
     切替は1つずつ1行を使う。1行増えるが、押せないボタンを作るよりよい */
  .page-actions > .seg, .toolbar > .seg { flex: 1 1 100%; min-width: 0; }
  .seg button { flex: 1 1 0; min-width: 0; white-space: nowrap; }

  /* ----- 予約一覧の絞り込み帯。既存ルールが全部100%幅にするので7個が縦一列に積まれ、
           帯だけで359px使い、予約カードが y=584 から始まっていた。2列に畳む ----- */
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar input, .toolbar select, .toolbar .btn { width: 100%; min-width: 0; }

  /* 固定バーの中身。スマホは2つのボタンで幅を半分ずつ分ける（片手で押せる大きさにする）。
     タブレット以上は右寄せのままでよいので、この1行だけ560px以下に置く */
  form .page-actions .btn { flex: 1 1 0; }

  /* ----- 予約カードは画面幅いっぱいに使う ----- */
  .resv-card { padding: 12px 14px; }
}
