/* BAS Review 客户门户 — production stylesheet.
   Token source of truth: DESIGN.md (repo root). Derived from the approved
   prototype designs/client-portal-20260731/portal.css; demo-only pieces
   (state switcher, design notes, sidebar variant) removed — 顶部导航定稿.
   Fonts: Google Fonts for now; production self-hosts woff2 (DESIGN.md
   Typography/Loading — swap the @import for @font-face before go-live). */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&family=Noto+Sans+SC:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&family=Instrument+Serif&display=swap');
:root {
  --font-body: "Source Sans 3", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", "Menlo", monospace;
  --font-display: "Instrument Serif", Georgia, serif;
  --ink: #1f2430; --muted: #6a7188; --line: #e3e6ee; --bg: #ffffff;
  --accent: #1d5a8a; --accent-soft: #eaf1f7; --panel: #f6f8fb;
  --sev-high: #8a4b0f; --sev-med: #b98a17; --sev-low: #7a7f8f;
  --neg: #8a1d1d; --ok: #2e6b3a;
  --period-1: #6d9bc0; --period-2: #3f77a2; --period-3: #1d5a8a;
  --shadow: 0 8px 28px rgba(31,36,48,.14);
}
* { box-sizing: border-box; }
/* 锚点跳转要避开 52px sticky topbar，否则标题被压在导航条下面 */
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-family: var(--font-body); color: var(--ink); background: var(--bg);
       margin: 0; font-size: 16px; line-height: 1.55; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 30px 0 10px; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
h3 { font-size: 15.5px; margin: 18px 0 8px; }
a { color: var(--accent); text-decoration: none; }
.sub, .small { color: var(--muted); font-size: 12.5px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- portal shell ---------- */
.topbar { display: flex; align-items: center; gap: 22px; padding: 0 28px;
  height: 52px; border-bottom: 1px solid var(--line); background: #fff;
  position: sticky; top: 0; z-index: 40; }
.topbar .logo { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.topbar .logo span { color: var(--accent); }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { padding: 15px 12px 13px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; }
.topbar nav a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.topbar .user { font-size: 13px; color: var(--muted); white-space: nowrap; }
.topbar .user b { color: var(--ink); font-weight: 600; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 26px 32px 80px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumb a { color: var(--muted); } .crumb a:hover { color: var(--accent); }
.headrow { display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 10px; }

/* ---------- badges / chips / dots ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 3px; color: #fff;
  font-size: 11.5px; font-weight: 600; letter-spacing: .3px; }
.badge.high { background: var(--sev-high); } .badge.medium { background: var(--sev-med); }
.badge.low { background: var(--sev-low); }
.badge.tier-green { background: var(--ok); } .badge.tier-yellow { background: var(--sev-med); }
.badge.tier-red { background: var(--neg); } .badge.gray { background: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 12px;
  background: #fff; color: var(--muted); }
.chip.agree { border-color: var(--ok); color: var(--ok); background: #f2f8f3; }
.chip.disagree { border-color: var(--neg); color: var(--neg); background: #faf1f1; }
.chip.needinfo { border-color: var(--sev-med); color: #8a6a10; background: #fdf8ea; }
.chip.cite { border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
  font-family: var(--font-mono); font-size: 11.5px; cursor: pointer; }
.chip.new { border-color: var(--accent); color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.ok { background: var(--ok); } .dot.off { background: var(--muted); }
.dot.lock { background: var(--neg); } .dot.run { background: var(--sev-med); }

/* ---------- cards / tables ---------- */
.cards { display: flex; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.card { flex: 1 1 200px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 14px 16px; }
.card .big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .def { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.card.click { cursor: pointer; transition: border-color .15s; }
.card.click:hover, .card.click.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 8px 0 16px; }
th { text-align: left; border-bottom: 2px solid var(--ink); padding: 6px 8px; font-size: 12.5px; }
td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
tr.rowlink:hover td { background: var(--accent-soft); cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums;
  font-family: var(--font-body); font-size: 13.5px; white-space: nowrap; }
.masthead { font-family: var(--font-display); font-weight: 400; font-size: 30px;
  letter-spacing: .2px; }
td.neg { color: var(--neg); }
.hl { background: #fff7e0; }

/* ---------- buttons / forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px;
  border-radius: 5px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: #fff; color: var(--accent); }
.btn.subtle { background: #fff; color: var(--muted); border-color: var(--line); font-weight: 500; }
.btn.danger { background: #fff; color: var(--neg); border-color: var(--neg); }
.btn.sm { padding: 4px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
label.fl { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 5px; }
input[type=text], input[type=password], input[type=email], textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px;
  font-size: 14.5px; font-family: inherit; background: #fff; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--panel); }
.login-box { width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 34px 36px 30px; box-shadow: 0 2px 14px rgba(31,36,48,.06); }
.turnstile-note { margin: 16px 0 4px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--panel); padding: 12px 14px; font-size: 13px; color: var(--muted); }
.alert { border-left: 4px solid var(--neg); background: #faf1f1; color: var(--neg);
  padding: 9px 13px; font-size: 13.5px; border-radius: 0 4px 4px 0; margin: 12px 0; }
.alert.warn { border-color: var(--sev-med); background: #fdf8ea; color: #7a5c0d; }
.alert.info { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- empty / loading / progress ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); background: var(--panel);
  border: 1px dashed var(--line); border-radius: 6px; margin: 12px 0; }
.empty .ico { font-size: 26px; margin-bottom: 6px; }
.empty b { color: var(--ink); display: block; margin-bottom: 4px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%; animation: sp 1s linear infinite;
  vertical-align: -2px; margin-right: 6px; }
@keyframes sp { to { transform: rotate(360deg); } }
.progress { height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- client list (dashboard · 2026-08-01 卡片网格 → 列表) ---------- */
.client-table td { vertical-align: middle; padding-top: 11px; padding-bottom: 11px; }
.client-table .btn { margin-left: 6px; }
.sevbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 10px 0 4px; }
.sevbar i { display: block; } .sevbar .h { background: var(--sev-high); }
.sevbar .m { background: var(--sev-med); } .sevbar .l { background: var(--sev-low); }
.sevbar.mini { width: 110px; margin: 0 0 4px; }
.progress.mini { width: 110px; margin-bottom: 4px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 18px 0 14px; }
.tabs button, .tabs a { padding: 8px 16px; border: 0; background: none; font: inherit; font-size: 14px;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  display: inline-block; }
.tabs button.on, .tabs a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- report layout ---------- */
.report-layout { display: grid; grid-template-columns: 200px 1fr; gap: 34px; align-items: start; }
.toc { position: sticky; top: 70px; font-size: 13px; }
.toc a { display: block; padding: 5px 10px; color: var(--muted); border-left: 2px solid var(--line); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.toc .prog { margin-top: 14px; padding: 10px; background: var(--panel); border-radius: 5px; }
.finding { border: 1px solid var(--line); border-radius: 6px; margin: 10px 0; padding: 11px 14px;
  transition: border-color .12s; }
.finding:hover, .finding:focus-within { border-color: var(--accent); outline: none; }
.finding.judged { background: #fbfcfd; }
.finding .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.finding .ref { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.finding .why { margin: 6px 0 2px; font-size: 14px; }
.finding .foot { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.integrity { background: var(--panel); border-left: 4px solid var(--accent);
  padding: 8px 14px; font-size: 13.5px; margin: 10px 0 4px; }

/* ---------- finding 证据抽屉（2026-08-01 一级抽屉回归 — 用户复核拍板） ----------
   卡片保持摘要态；点击（或任何 finding 引用）→ 详情 .fx 移入 findingDrawer。 */
.finding .fhead { cursor: pointer; }
.finding .chev { margin-left: auto; color: var(--muted); }
.finding.open { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.finding .fx { display: none; }                    /* 详情常驻卡片内，打开时移入抽屉 */
.drawer.finding-drawer { width: 78vw; max-width: 1280px; min-width: 640px; }
.finding-drawer .dhead { align-items: flex-start; }
.finding-drawer .fd-title { flex: 1; min-width: 0; }
.finding-drawer .fd-title .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.finding-drawer .fd-title .why { margin: 6px 0 0; font-size: 14.5px; font-weight: 600; }
.finding-drawer .fd-title .why.teaser { display: none; }  /* 折叠态摘要不进抽屉标题 */
.finding-drawer .dbody { padding-bottom: 0; }
.finding-drawer .dbody .fx { display: block; }
.finding-drawer .dbody .fx h3 { margin: 12px 0 6px; }
.finding-drawer .fxfoot { position: sticky; bottom: 0; margin: 14px -20px 0; padding: 12px 20px;
  background: var(--panel); border-top: 1px solid var(--line); }
.evwrap { overflow-x: auto; }
.chip.conflict { border-color: var(--sev-high); color: var(--sev-high); background: #fff7e0; }
.relrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 10px 0; font-size: 13px; }

/* ---------- 已核对通过组 ---------- */
details.cleared-wrap > summary { list-style: none; cursor: pointer; display: flex;
  align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 14px; color: var(--muted); }
details.cleared-wrap > summary::-webkit-details-marker { display: none; }
details.cleared-wrap > summary:hover { border-color: var(--accent); }
details.cleared-wrap[open] > summary { border-color: var(--accent); color: var(--ink); margin-bottom: 4px; }
details.cleared-wrap .chev { color: var(--muted); transition: transform .15s; }
details.cleared-wrap[open] > summary .chev { transform: rotate(180deg); }

/* ---------- 准确度对照：只读芯片 + 改判 ---------- */
.acc-table .gtcell { white-space: nowrap; }
.gtcell .gtchip { margin-right: 6px; }
.linklike { border: 0; background: none; color: var(--accent); font: inherit;
  font-size: 12.5px; cursor: pointer; padding: 0; text-decoration: underline;
  text-underline-offset: 2px; }
.adj.gt { flex-wrap: nowrap; gap: 6px; margin-top: 6px; }
.adj.gt .abtn { padding: 4px 10px; font-size: 12.5px; white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- §4 GST 分组卡片（服务端预载首页，无点开等待） ---------- */
details.gst-group { border: 1px solid var(--line); border-radius: 6px; margin: 10px 0; }
details.gst-group > summary { list-style: none; cursor: pointer; display: flex;
  align-items: center; gap: 10px; padding: 11px 14px; font-size: 14px; min-height: 44px; }
details.gst-group > summary::-webkit-details-marker { display: none; }
details.gst-group > summary:hover { background: var(--accent-soft); }
details.gst-group .gname { font-weight: 600; }
details.gst-group .gmeta { margin-left: auto; color: var(--muted); font-size: 12.5px;
  font-variant-numeric: tabular-nums; }
details.gst-group .chev { color: var(--muted); transition: transform .15s; }
details.gst-group[open] > summary { border-bottom: 1px solid var(--line); }
details.gst-group[open] > summary .chev { transform: rotate(180deg); }
details.gst-group table { margin: 0; }
details.gst-group td:first-child, details.gst-group th:first-child { padding-left: 14px; }

/* ---------- Checklist 覆盖地图（决议 D-Fix2/D-Fix4：紧凑表格行，禁 tile） ---------- */
.covmap { border: 1px solid var(--line); border-radius: 6px; margin: 14px 0 6px;
  background: #fff; }
.covhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px 6px; }
.covtable { margin: 0; font-size: 13px; }
.covtable td { padding: 4px 8px; border-bottom: 1px solid var(--line); line-height: 1.4; }
.covtable tr:last-child td { border-bottom: 0; }
.covsec { font-weight: 600; white-space: nowrap; width: 168px; color: var(--ink);
  border-right: 1px solid var(--line); background: var(--panel); vertical-align: top; }
.covref { width: 34px; color: var(--muted); }
.covname { color: var(--ink); }
.covst { white-space: nowrap; width: 190px; }
/* 待处理字形 = amber 实心圆点+数字（决议 #11 — ⚑ 独留三期表波动语义） */
.amberdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--sev-med); margin-right: 5px; vertical-align: -1px; }
.covlink { color: var(--ink); } .covlink:hover { color: var(--accent); }
.covlink .covcount { font-weight: 700; font-variant-numeric: tabular-nums; }
.covst .okmark, .covdone { color: var(--ok); }
.covst .nodata { color: var(--muted); }
.covst .oos { color: var(--muted); opacity: .75; cursor: not-allowed; }
.covfoot { padding: 6px 14px 10px; }
.flash { outline: 2px solid var(--accent); outline-offset: 2px;
  transition: outline-color .3s; border-radius: 4px; }

/* ---------- P2 行内展开（决议 D-Fix2 · TD4 例外） ---------- */
.p2toggle { border: 0; background: none; font: inherit; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.p2toggle:hover { color: var(--accent); }
.p2toggle .chev { transition: transform .15s; color: var(--muted); }
tr.p2open .p2toggle .chev { transform: rotate(90deg); }
.p2chip { font-size: 11px; padding: 1px 7px; }
tr.p2x > td { background: var(--panel); padding: 10px 14px; }
.pfind { border: 1px solid var(--line); border-radius: 6px; background: #fff;
  padding: 10px 13px; margin: 6px 0; }
.pfind.judged { background: #fbfcfd; }
.pfind .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pfind .ref { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.pfind .why { margin: 6px 0 2px; font-size: 14px; }

/* ---------- §4.3 组级抽查摘要（决议 #3/#15：reviewed 确认制） ---------- */
.gsum { padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--panel); }
.gsum.judged { background: #f7faf7; }
.gsum-lede { margin-bottom: 4px; }
.gsum-ai { font-size: 13.5px; margin: 4px 0; }
.gsum-bar { margin-top: 8px; }
.gsum-chip { font-size: 11px; }

/* ---------- 审查收束（premise P5 · design F9） ---------- */
.wrapup { border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px;
  background: #fff; }
.wrapup-prog { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.wrapup-list { margin: 8px 0 14px; padding-left: 20px; font-size: 13.5px; }
.wrapup-list li { margin: 3px 0; }
.wrapup-list li.done-li { opacity: .45; text-decoration: line-through; }
.wrapup-none { color: var(--ok); font-weight: 600; }
.wrapup-v2 { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.v2link[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* ---------- 方法与范围（固定展开，不再折叠） ---------- */
.method { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2px 28px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 12px 18px 14px; }
.method h4 { margin: 8px 0 2px; font-size: 13.5px; }
.method p { margin: 0 0 6px; }

/* ---------- drawers ---------- */
.overlay { position: fixed; inset: 0; background: rgba(31,36,48,.32); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .18s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 68vw; max-width: 960px;
  min-width: 520px; background: #fff; z-index: 70; box-shadow: var(--shadow);
  transform: translateX(105%); transition: transform .2s ease-out;
  display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer.lvl2 { width: 50vw; max-width: 700px; min-width: 440px; z-index: 80; }
.drawer.narrow { width: 460px; min-width: 320px; }
.evtable td:first-child { white-space: nowrap; }
.drawer .dhead { padding: 14px 20px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer .dhead h3 { margin: 0; font-size: 15px; }
.drawer .dbody { padding: 16px 20px; overflow-y: auto; flex: 1;
  overscroll-behavior: contain; }               /* 抽屉内滚到底不穿透到下层/页面 */
body.no-scroll { overflow: hidden; }            /* 抽屉打开时锁定背景滚动 */
.drawer .dfoot { border-top: 1px solid var(--line); padding: 12px 20px; background: var(--panel); }
.x { border: 0; background: none; font-size: 19px; color: var(--muted); cursor: pointer; padding: 2px 6px; }

/* ---------- adjudication bar ---------- */
.adj { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adj .abtn { padding: 6px 14px; border-radius: 5px; border: 1px solid var(--line);
  background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.adj .abtn:hover { border-color: var(--accent); }
.adj .abtn.agree.on { background: #f2f8f3; border-color: var(--ok); color: var(--ok); font-weight: 700; }
.adj .abtn.disagree.on { background: #faf1f1; border-color: var(--neg); color: var(--neg); font-weight: 700; }
.adj .abtn.needinfo.on, .adj .abtn.hit.on { background: #fdf8ea; border-color: var(--sev-med); color: #8a6a10; font-weight: 700; }
.adj .abtn.hit.on { background: #f2f8f3; border-color: var(--ok); color: var(--ok); }
.adj .saved { font-size: 12px; color: var(--ok); }
.mobile-adj-note { display: none; }

/* ---------- files ---------- */
.dropzone { border: 2px dashed var(--line); border-radius: 7px; padding: 22px; text-align: center;
  color: var(--muted); font-size: 13.5px; margin: 12px 0; background: var(--panel); cursor: pointer; }
.dropzone b { color: var(--accent); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- chat ---------- */
.chat-fab { position: fixed; right: 26px; bottom: 26px; width: 52px; height: 52px;
  border-radius: 50%; background: var(--accent); color: #fff; border: 0; font-size: 21px;
  cursor: pointer; box-shadow: var(--shadow); z-index: 50; }
.chat-panel { position: fixed; right: 26px; bottom: 26px; width: 420px; max-width: 92vw;
  height: 580px; max-height: 84vh; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); z-index: 75; display: none;
  flex-direction: column; overflow: hidden; }
.chat-panel.open { display: flex; }
.chat-head { background: var(--accent); color: #fff; padding: 12px 16px; display: flex;
  justify-content: space-between; align-items: center; }
.chat-head .x { color: #fff; }
.chat-head .ctx { font-size: 11.5px; opacity: .85; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex;
  flex-direction: column; gap: 10px; background: var(--panel); }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 10px; font-size: 13.5px;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
.msg.ai { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.msg .cites { margin-top: 7px; display: flex; gap: 5px; flex-wrap: wrap; }
.msg .toolnote { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.chat-sugs { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px 0; }
.chat-sugs button { border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 11px; font-size: 12px; color: var(--accent); cursor: pointer; font-family: inherit; }
.chat-input { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; }
.chat-disc { font-size: 10.5px; color: var(--muted); text-align: center; padding: 0 14px 9px; }
.typing i { display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted); margin-right: 3px; animation: bl 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes bl { 0%,60%,100% { opacity: .25 } 30% { opacity: 1 } }

/* ---------- charts ---------- */
.chart-row { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0; }
.chart-box { flex: 1 1 340px; border: 1px solid var(--line); border-radius: 7px; padding: 14px 18px; }
.chart-box h4 { margin: 0 0 2px; font-size: 13.5px; }
.chart-box .sub { margin-bottom: 8px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 6px 0 2px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
svg text { font-family: var(--font-body); }
svg .val { font-family: var(--font-mono); font-size: 10.5px; fill: var(--ink); }
svg .ax { font-size: 11px; fill: var(--muted); }
svg .grid { stroke: var(--line); stroke-width: 1; }
svg rect.bar:hover { opacity: .8; }

/* ---------- toast / modal ---------- */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 6px;
  font-size: 13.5px; z-index: 90; display: none; }
.toast.err { background: var(--neg); }
.modal { position: fixed; inset: 0; z-index: 85; display: none; align-items: center;
  justify-content: center; background: rgba(31,36,48,.32); }
.modal.open { display: flex; }
.modal .mbox { width: 440px; background: #fff; border-radius: 8px; padding: 24px 28px;
  box-shadow: var(--shadow); }

/* ---------- responsive: 桌面/iPad 全功能，手机只读 + chat (DESIGN 7B) ---------- */
@media (max-width: 900px) {
  .report-layout { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .toc a { border-left: 0; border-bottom: 2px solid var(--line); }
  .toc .prog { width: 100%; }
  .wrap { padding: 18px 16px 70px; }
  .drawer, .drawer.lvl2, .drawer.finding-drawer { width: 100vw; max-width: 100vw; min-width: 0; }
  .chat-panel { right: 0; bottom: 0; width: 100vw; height: 90vh; border-radius: 10px 10px 0 0; }
  .adj .abtn { display: none; }               /* 手机不可裁定：误裁风险 > 便利 */
  .gtcell .linklike { display: none; }        /* 「改判」同属裁定入口，手机隐藏 */
  .gsum-undo, .wrapup-v2 { display: none; }   /* 组级复核/生成 v2 同属裁定入口 */
  .mobile-adj-note { display: inline; font-size: 12px; color: var(--muted); }
  .topbar { padding: 0 14px; gap: 10px; overflow-x: auto; }
  table { display: block; overflow-x: auto; }
}
@media (pointer: coarse) and (min-width: 901px) {
  .adj .abtn { padding: 11px 18px; }          /* iPad 触控目标 ≥44px */
  .topbar nav a { padding: 18px 14px 16px; }
}
