/* batonone-staff-desk — スマホ優先。配色は既存 _theme.py のトーンを踏襲（依存はしない）。 */
:root {
  --brand-green: #69b882;
  --brand-green-strong: #306e47;
  --brand-green-soft: #e8f3ec;
  --brand-navy: #001754;

  --bg: #f7f7f7;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-subtle: #f0f1ed;
  --fg: #313131;
  --fg-strong: #1a1a1a;
  --fg-muted: #575757;
  --line: #e1ddd2;
  --border-strong: #c7c1b3;
  --accent: #306e47;
  --accent-on: #ffffff;
  --accent-soft: #e8f3ec;
  --accent-strong: #1f4f30;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --shadow-sm: 0 1px 2px rgba(0, 23, 84, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 23, 84, 0.07), 0 1px 3px rgba(0, 23, 84, 0.04);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15201a;
    --bg-card: #1d2a23;
    --bg-input: #14201a;
    --bg-subtle: #243029;
    --fg: #ecf2ee;
    --fg-strong: #ffffff;
    --fg-muted: #b3bdb6;
    --line: #2f3d35;
    --border-strong: #3f4f44;
    --accent: #69b882;
    --accent-on: #0e1a13;
    --accent-soft: rgba(105, 184, 130, 0.16);
    --accent-strong: #8dd2a4;
    --danger: #ff8a80;
    --danger-soft: rgba(255, 138, 128, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
               "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding-bottom: 40px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

/* ---- ヘッダ ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.topbar .inner {
  max-width: 880px; margin: 0 auto; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
}
.topbar .brand {
  font-weight: 700; color: var(--fg-strong); font-size: 16px;
  font-family: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
}
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 12px; color: var(--fg-muted); }
.topbar form { display: inline; }
.topbar .linkbtn {
  background: none; border: none; color: var(--accent); font-size: 13px;
  cursor: pointer; padding: 4px 2px; font-family: inherit;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 16px 14px 0; }
h1 { font-size: 20px; margin: 8px 0 4px; color: var(--fg-strong);
     font-family: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif; }
h2 { font-size: 16px; margin: 0 0 10px; color: var(--fg-strong); }
.lead { color: var(--fg-muted); font-size: 13px; margin: 0 0 16px; }

/* ---- カード ---- */
.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

/* ---- ホームの大ボタン ---- */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid { grid-template-columns: 1fr 1fr; } }
.entry-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 34px 18px; background: var(--bg-card);
  border: 2px solid var(--line); border-radius: 16px;
  color: var(--fg); text-align: center; box-shadow: var(--shadow-sm);
}
.entry-btn:hover { border-color: var(--brand-green); background: var(--accent-soft);
                   text-decoration: none; box-shadow: var(--shadow-md); }
.entry-btn .icon { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.entry-btn .label { font-size: 17px; font-weight: 600; color: var(--fg-strong); }
.entry-btn .desc { font-size: 12px; color: var(--fg-muted); margin-top: 4px; }

/* ---- フォーム ---- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600;
                 color: var(--fg-muted); margin-bottom: 5px; }
.req { color: var(--danger); }
input[type=text], input[type=password], input[type=date], input[type=time],
select, textarea {
  width: 100%; padding: 11px 12px; font-size: 16px; /* iOS のズーム防止に 16px */
  font-family: inherit; color: var(--fg); background: var(--bg-input);
  border: 1px solid var(--border-strong); border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 72px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 620px) {
  .row { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: 1fr 1fr 1fr; }
}
.row3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.hint { font-size: 12px; color: var(--fg-muted); margin-top: 4px; }

button, .btn {
  font-family: inherit; font-size: 16px; font-weight: 600;
  padding: 12px 18px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg-subtle); color: var(--fg); cursor: pointer;
}
button.primary, .btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-on);
}
button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.small { font-size: 13px; padding: 7px 12px; font-weight: 500; }
button.danger { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.actions button { flex: 1 1 auto; min-width: 140px; }
@media (min-width: 620px) { .actions button { flex: 0 0 auto; } }

/* ---- 予測入力 ---- */
.picker { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: 8px; margin-top: 4px; max-height: 320px; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.suggest .item { padding: 11px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest .item:last-child { border-bottom: none; }
.suggest .item:hover, .suggest .item.on { background: var(--accent-soft); }
.suggest .no { color: var(--fg-muted); font-size: 13px; }
.suggest .sub { font-size: 11px; color: var(--fg-muted); }
/* 案件カード（候補1件の中身）。番号とフォルダ名だけだと取り違えるので、
   最終更新・ファイル数・揃っているサブフォルダ・最近のファイルを添える。 */
.suggest { max-height: 460px; }
.fcard { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.fmeta { font-size: 11px; color: var(--fg-muted); }
.fdots { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0; }
.fdot {
  font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 4px;
  border: 1px solid var(--line); color: var(--fg-muted); opacity: .45;
}
.fdot.has { opacity: 1; border-color: var(--accent); color: var(--accent); font-weight: 600; }
.ffiles { list-style: none; margin: 4px 0 0; padding: 0; }
.ffiles li {
  display: flex; gap: 6px; align-items: baseline;
  font-size: 11px; color: var(--fg-muted); padding: 1px 0;
}
.ffiles .fn { flex: 1 1 auto; min-width: 0; overflow: hidden;
              text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.ffiles .fw { flex: 0 0 auto; padding: 0 4px; border-radius: 3px;
              background: var(--accent-soft); max-width: 40%;
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ffiles .fd { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .ffiles .fw { display: none; } }

.picked {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--accent); background: var(--accent-soft);
  border-radius: 8px; margin-bottom: 6px;
}
.picked .name { font-weight: 600; color: var(--fg-strong); flex: 1; }
.picked .x { cursor: pointer; color: var(--fg-muted); font-size: 20px; line-height: 1;
             padding: 0 4px; }

/* ---- サービス別案内 ---- */
.svc-row { display: grid; grid-template-columns: 100px 1fr; gap: 10px;
           align-items: start; margin-bottom: 8px; }
.svc-row label { display: flex; align-items: center; gap: 7px; padding-top: 9px;
                 font-size: 14px; cursor: pointer; }
.svc-row input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
.svc-row textarea { min-height: 48px; }
@media (max-width: 480px) { .svc-row { grid-template-columns: 1fr; } }

/* ---- 表 ---- */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line);
         vertical-align: top; }
th { color: var(--fg-muted); font-size: 12px; white-space: nowrap; }
td .path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
           color: var(--fg-muted); word-break: break-all; }

.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
          font-size: 13px; background: var(--bg-card); }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }

/* ---- 通知 ---- */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.flash.ok { background: var(--accent-soft); border: 1px solid var(--accent); }
.flash.error { background: var(--danger-soft); border: 1px solid var(--danger); color: var(--danger); }
.flash.warn { background: #fff6e0; border: 1px solid #e0c060; color: #6b4c00; white-space: pre-wrap; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: 90vw; padding: 13px 18px; border-radius: 10px; font-size: 14px;
  background: var(--accent); color: var(--accent-on); box-shadow: var(--shadow-md);
  display: none; z-index: 90; text-align: center;
}
.toast.error { background: var(--danger); color: #fff; }

/* ---- ログイン ---- */
.login-wrap { max-width: 380px; margin: 8vh auto 0; padding: 0 16px; }
.login-wrap h1 { text-align: center; margin-bottom: 20px; }
.login-wrap .actions button { width: 100%; }

/* ==========================================================================
   役員向けダッシュボード区画（/dash）
   ========================================================================== */
.wrap-wide { max-width: 1400px; }

.dashnav {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.dashnav a {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13px; background: var(--bg-card); white-space: nowrap;
}
.dashnav a:hover { border-color: var(--accent); text-decoration: none; }
.dashnav a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }

.freshness { font-size: 12px; color: var(--fg-muted); margin: 0 0 14px; }
.freshness .stale { color: var(--danger); font-weight: 600; }

.statrow { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat {
  flex: 1 1 110px; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 22px; font-weight: 700; color: var(--fg-strong); line-height: 1.2; }
.stat .k { font-size: 11px; color: var(--fg-muted); }
.stat.alert { border-color: var(--danger); }
.stat.alert .n { color: var(--danger); }
.stat.warn { border-color: #d08700; }

/* ── 認知負荷の鉄則（母艦 reports/UI設計原則_認知負荷_20260825.md）で足した部品 ──
   二: 正常はゼロで表示しない  五: 完了と履歴は既定で畳む  */
.calm {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin: 0 0 14px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-left: 3px solid var(--ok, #0ca30c); border-radius: var(--radius);
  color: var(--fg-muted); font-size: 13px; box-shadow: var(--shadow-sm);
}
.calm b { color: var(--fg-strong); }
details.fold { margin: 0 0 14px; }
details.fold > summary {
  cursor: pointer; color: var(--fg-muted); font-size: 12.5px; list-style: none;
  padding: 6px 0; user-select: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸ "; }
details.fold[open] > summary::before { content: "▾ "; }
details.fold > summary:hover { color: var(--fg-strong); }

.filterbar { padding: 12px 14px; margin-bottom: 14px; }
.fb { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.fb label { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
            color: var(--fg-muted); font-weight: 600; flex: 1 1 150px; }
.fb input, .fb select { font-size: 15px; padding: 8px 10px; }
.fb button, .fb .btn { flex: 0 0 auto; }

table.board th, table.board td { vertical-align: top; }
table.board td.stick, table.board th.stick {
  position: sticky; left: 0; background: var(--bg-card); z-index: 2;
  border-right: 1px solid var(--line); min-width: 170px;
}
table.board tbody tr:hover td { background: var(--accent-soft); }
table.board tbody tr:hover td.stick { background: var(--accent-soft); }
table.board tr.sev-alert td.stick { box-shadow: inset 3px 0 0 var(--danger); }
table.board tr.sev-warn td.stick { box-shadow: inset 3px 0 0 #d08700; }
th a { color: var(--fg-muted); }
th a.sorted { color: var(--accent); text-decoration: underline; }

.sub { font-size: 11px; color: var(--fg-muted); }
.muted { color: var(--fg-muted); }
.path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
        color: var(--fg-muted); word-break: break-all; }
pre.pre { white-space: pre-wrap; word-break: break-word; font-size: 13px;
          background: var(--bg-subtle); padding: 12px; border-radius: 8px; }

.chip, .pill {
  display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); background: var(--bg-subtle); color: var(--fg-muted);
  margin-right: 3px; white-space: nowrap;
}
.pill.bad { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.pill.warn { background: rgba(208, 135, 0, .14); border-color: #d08700; color: #a06800; }
.chip.st-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }

.flagchip {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px;
  margin: 0 3px 3px 0; cursor: help; border: 1px solid var(--line);
  background: var(--bg-subtle); color: var(--fg-muted); white-space: nowrap;
}
.flagchip.alert { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.flagchip.warn { background: rgba(208, 135, 0, .14); border-color: #d08700; color: #a06800; }
.flagchip.info { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.flagrow { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.flagrow:last-child { border-bottom: none; }

.dots { display: flex; gap: 3px; flex-wrap: wrap; }
.dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 20px; border-radius: 5px; font-size: 10px;
  border: 1px solid var(--line); background: var(--bg-subtle); color: var(--fg-muted);
}
.dot.has { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }
.dot.no { opacity: .5; }

.svcgrid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
           margin-bottom: 14px; }
.svc-tab { display: block; padding: 10px 12px; background: var(--bg-card);
           border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm); }
.svc-tab:hover { border-color: var(--accent); text-decoration: none; }
.svc-tab.on { background: var(--accent-soft); border-color: var(--accent); }
.svc-tab .n { font-size: 13px; font-weight: 600; color: var(--fg-strong); }

/* スマホ: ナビは横スクロール、表は自前のスクロール枠に閉じ込める（本文は横に伸びない） */
@media (max-width: 640px) {
  .wrap-wide { padding-left: 10px; padding-right: 10px; }
  .dashnav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fb label { flex: 1 1 100%; }
  .statrow .stat { flex: 1 1 calc(50% - 10px); }
  table.board td.stick, table.board th.stick { min-width: 130px; }
  .table-scroll { -webkit-overflow-scrolling: touch; }
}

/* ---- 4本柱パイプライン（顧客詳細・ブリーフィング共通） ----
   One Group は税務・保険・不動産・証券を並行して提供するので、
   既定は **4本が縦に並ぶ**（上から順に読める）。画面が広いときだけ2列に畳む。 */
.lanes { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 1100px) { .lanes { grid-template-columns: 1fr 1fr; } }

.lane {
  border: 1px solid var(--line); border-left: 4px solid var(--lane, var(--accent));
  border-radius: 8px; padding: 12px 14px; background: var(--bg-card);
}
.lane-head { display: flex; align-items: center; gap: 8px; }
.lane-icon { font-size: 18px; line-height: 1; }
.lane-title { font-weight: 700; color: var(--fg-strong); font-size: 15px; }
.lane-state {
  margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--fg-muted);
}
.lane-state.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.lane-state.maybe { background: #fff6e0; border-color: #e0c060; color: #6b4c00; }
.lane-state.no { border-color: var(--danger); color: var(--danger); }
.lane-provider { font-size: 11px; color: var(--fg-muted); margin: 2px 0 8px; }

/* 工程の進み（初回相談→提案→受任→完了）。狭い画面では横スクロールさせて折らない。 */
.lane-stages {
  list-style: none; display: flex; gap: 0; margin: 0 0 10px; padding: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.lane-stages li {
  flex: 1 1 0; min-width: 62px; position: relative; text-align: center;
  font-size: 11px; color: var(--fg-muted); padding-top: 14px;
}
.lane-stages li::before {
  content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px;
  background: var(--line);
}
.lane-stages li:first-child::before { left: 50%; }
.lane-stages li:last-child::before { right: 50%; }
.lane-stages li.done::before { background: var(--lane, var(--accent)); }
.lane-stages .dot {
  position: absolute; top: 1px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--line);
}
.lane-stages li.done .dot { border-color: var(--lane, var(--accent)); background: var(--lane, var(--accent)); }
.lane-stages li.done { color: var(--fg); }
.lane-stages li.now { font-weight: 700; color: var(--fg-strong); }
.lane-stages li.now .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lane, #888) 25%, transparent); }

.lane-items { list-style: none; margin: 0; padding: 0; }
.lane-items li { padding: 5px 0; border-top: 1px solid var(--line); font-size: 12px; }
.lane-items li:first-child { border-top: none; }
.lane-items .li-name { font-weight: 600; color: var(--fg-strong); margin-right: 6px; }
.lane-items .li-date, .lane-items .li-staff { font-size: 11px; color: var(--fg-muted); margin-left: 6px; }
.lane-items .li-note { font-size: 11px; color: var(--fg-muted); margin-top: 2px; white-space: pre-wrap; }
.lane-empty { font-size: 12px; color: var(--fg-muted); margin: 0; }

.chip.on, .pill.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.maybe, .pill.maybe { background: #fff6e0; border-color: #e0c060; color: #6b4c00; }
.chip.no, .pill.no { border-color: var(--danger); color: var(--danger); }

/* ---- 財産状況 ---- */
.asset-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.asset-block:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.asset-block h3 { font-size: 14px; margin: 0 0 6px; display: flex; align-items: center;
                  gap: 8px; flex-wrap: wrap; }

/* ---- 面談前ブリーフィング ---- */
.brief-sec { margin-top: 10px; }
.brief-sec h4 { font-size: 12px; margin: 0 0 3px; color: var(--fg-muted); font-weight: 600; }
.brief-sec p { margin: 0; font-size: 13px; }
.brief-sec.next {
  border-left: 3px solid var(--lane, var(--accent)); padding-left: 8px;
  background: color-mix(in srgb, var(--lane, #888) 7%, transparent);
  border-radius: 0 6px 6px 0; padding-top: 6px; padding-bottom: 6px;
}
details.card > summary { cursor: pointer; font-weight: 600; color: var(--fg-strong); }

/* AI要約の状態バー（面談前ブリーフィング） */
.aibar {
  margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg-subtle);
}
.aibar-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.aibar .hint { margin: 6px 0 0; }
.aibar form { margin-top: 8px; }

/* ===================================================================
   ヒアリング（財産診断・段階開示）— 2026-09-01 先生指示
   「ヒアリング事項を入力すると次の質問がオープンする」UI。
   JS が <body> ではなくフォームに .hearing-on を付けたときだけ効く。
   ＝ JS が無い/落ちた場合は全問が素のフォームとして見える（fail-open）。
   =================================================================== */
.q { border-top: 1px solid var(--line); padding: 16px 0; }
.q:first-of-type { border-top: 0; }
.q-title { font-size: 15px; font-weight: 700; color: var(--fg-strong);
           display: flex; align-items: baseline; gap: 8px; }
.q-no { font-size: 12px; font-weight: 700; color: var(--accent);
        background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; flex: none; }
.q-note { font-size: 12px; color: var(--fg-muted); margin: 4px 0 10px; }
.q-body { margin-top: 10px; }

/* --- JS が効いているときだけの挙動 --- */
.hearing-on .q { display: none; }
.hearing-on .q.is-open,
.hearing-on .q.is-done { display: block; }

/* 回答済みは1行に畳む。クリックで開き直せる。 */
.hearing-on .q.is-done { padding: 9px 0; border-top: 1px dashed var(--line); }
.hearing-on .q.is-done .q-body,
.hearing-on .q.is-done .q-note { display: none; }
.hearing-on .q.is-done .q-title { font-size: 13px; font-weight: 600; color: var(--fg-muted);
                                  cursor: pointer; }
.hearing-on .q.is-done .q-no { background: var(--bg-subtle); color: var(--fg-muted); }
.q-summary { font-size: 12px; color: var(--fg); margin-left: auto; text-align: right;
             max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hearing-on .q:not(.is-done) .q-summary { display: none; }

/* 現在の質問を目立たせる */
.hearing-on .q.is-open { background: var(--bg-card); }

/* 進捗バー */
.q-progress { position: sticky; top: 0; z-index: 5; background: var(--bg-card);
              border-bottom: 1px solid var(--line); padding: 10px 0 12px; margin-bottom: 4px; }
.q-progress .bar { height: 6px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.q-progress .bar > i { display: block; height: 100%; background: var(--accent);
                       transition: width .18s ease; }
.q-progress .lbl { font-size: 12px; color: var(--fg-muted); margin-bottom: 6px;
                   display: flex; justify-content: space-between; }
.hearing-off .q-progress { display: none; }

/* 次へ／スキップ */
.q-next { display: flex; gap: 8px; margin-top: 12px; }
.hearing-off .q-next { display: none; }
.q-next .skip { background: transparent; border: 1px solid var(--border-strong);
                color: var(--fg-muted); }

/* 繰り返し（不動産・預金…）は1件ずつ出し、必要なだけ足させる */
.hearing-on .rep-item.is-hidden { display: none; }
.rep-add { background: transparent; border: 1px dashed var(--border-strong);
           color: var(--accent); width: 100%; margin-top: 6px; }
.hearing-off .rep-add { display: none; }

/* ===================================================================
   下書き復元・通信失敗の表示（商談/面談記録・2026-09-11 WO）
   「押せない／打っても何も出ない」を画面の言葉に変えるための枠。
   =================================================================== */
.draft-note {
  padding: 11px 14px; margin-bottom: 12px; border-radius: 8px; font-size: 14px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.draft-note button { flex: 0 0 auto; }
/* display:flex は UA の hidden（display:none）に勝ってしまうので明示する */
.draft-note[hidden] { display: none; }

/* 候補欄に出す失敗の理由（無言で閉じない） */
.suggest .item.err { color: var(--danger); white-space: normal; line-height: 1.6; }
.suggest .item.err a { color: var(--danger); font-weight: 600; }

/* トーストに添える導線（再ログインなど） */
.toast .tlink { color: inherit; font-weight: 700; text-decoration: underline; }
