:root {
  color-scheme: light;
  --paper: #f7f3eb;
  --surface: #fffcf6;
  --ink: #1a2744;
  --text: #394359;
  --muted: #626b7a;
  --line: #dcd6cb;
  --tint: #ede7d9;
  --vermillion: #c44536;
  --gold: #b8963e;
  --amber: #735919;
  --amber-bg: #f1e8d4;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 7rem; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--paper); color: var(--text); font: 15px/1.8 var(--sans); }
button, input, select { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--ink); text-underline-offset: .2em; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
.print-only { display: none; }
:focus-visible { outline: 3px solid var(--vermillion); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .55; }
::selection { background: var(--vermillion); color: white; }

.site-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 4px 24px;
  padding: 12px max(18px, calc((100vw - 1280px) / 2));
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; font: 600 20px/1.3 var(--serif); letter-spacing: .05em; }
.brand::before { content: ""; width: 7px; height: 7px; background: var(--vermillion); border-radius: 50%; flex-shrink: 0; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0 20px; align-items: center; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--vermillion); }
.site-header nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--vermillion); }
.header-actions, .page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.layout { max-width: 1280px; margin: 0 auto; padding: 36px 24px 72px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 46px; }
.sidebar { align-self: start; position: sticky; top: 100px; font-size: 13px; min-width: 0; }
.sidebar > p, .sidebar h2, .sidebar h3 { margin: 0 0 12px; color: var(--muted); font: 600 12px/1.5 var(--sans); letter-spacing: .08em; }
.sidebar nav, .sidebar ul { display: grid; list-style: none; padding: 0; margin: 0; }
.sidebar a { display: flex; align-items: center; min-height: 44px; padding: 9px 10px; text-decoration: none; border-left: 2px solid transparent; }
.sidebar a:hover, .sidebar a[aria-current="page"] { background: var(--tint); border-left-color: var(--vermillion); }
main, .main { min-width: 0; }
.hero { padding: 0 0 30px; border-bottom: 1px solid var(--line); }
.hero h1 { margin: 0 0 16px; color: var(--ink); font: 600 clamp(30px, 4vw, 46px)/1.3 var(--serif); letter-spacing: -.02em; overflow-wrap: anywhere; }
.hero .eyebrow, .eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--vermillion); font-size: 12px; letter-spacing: .12em; }
.hero .eyebrow::before { content: ""; width: 22px; height: 1px; flex-shrink: 0; background: var(--gold); }
.lead { max-width: 60em; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.9; }
.hero .meta, .meta { color: var(--muted); font-size: 12px; }
.section { margin-top: 38px; scroll-margin-top: 110px; }
.section > h2 { margin: 0 0 16px; color: var(--ink); font: 600 25px/1.45 var(--serif); }
.section > h3, h3 { color: var(--ink); font-size: 17px; }
p { margin: 0 0 16px; }
small { font-size: 12px; }
strong { font-weight: 600; }

.tier-control { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--line); background: var(--tint); width: fit-content; max-width: 100%; margin: 22px 0; }
.tier-control button { min-width: 96px; min-height: 44px; padding: 9px 18px; border: 0; background: transparent; color: var(--muted); font-size: 14px; }
.tier-control button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: inset 0 -2px var(--gold); }
.tier-control button:hover:not([aria-pressed="true"]) { background: #e3dbc9; color: var(--ink); }
button[data-print], button[data-expand-all] { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); color: var(--ink); background: transparent; }
button[data-print]:hover, button[data-expand-all]:hover { border-color: var(--ink); background: var(--tint); }
button[data-expand-all][aria-expanded="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.tier-value, [data-net-values], .amount { font-variant-numeric: tabular-nums; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.metric { padding: 20px 18px 18px; border: 1px solid var(--line); border-top: 2px solid var(--gold); background: var(--surface); min-width: 0; }
.metric .label { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.metric .value { color: var(--ink); font-size: clamp(26px, 3vw, 35px); line-height: 1.3; font-weight: 550; letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric .value small, .metric .unit { font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.metric .sub { margin-top: 10px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.decision-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--muted); font-size: 12px; }
.decision-status a { margin-left: auto; display: inline-flex; align-items: center; min-height: 44px; }
.decision-summary .metric:nth-child(2) { border-top-color: var(--vermillion); background: var(--tint); }
.scenario-comparison { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 14px 0; border-block: 1px solid var(--line); font-size: 13px; }
.scenario-comparison > strong { font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }
.scenario-comparison > span:last-child { color: var(--muted); font-size: 12px; }
.tier-decisions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin: 20px 0; }
.tier-decisions article { border-top: 2px solid var(--gold); padding-top: 12px; }
.tier-decisions h3 { font: 600 19px/1.5 var(--serif); margin: 0 0 10px; }
.tier-decisions p { font-size: 13px; color: var(--muted); }
.baseline-fold { margin: 18px 0; border: 1px solid var(--line); padding: 0 16px; }
.baseline-fold > summary { color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; min-height: 52px; padding: 14px 0; }
.current-caption { color: var(--ink); font-size: 13px; border-left: 3px solid var(--gold); padding-left: 12px; }
.notice, .warning { margin: 18px 0; padding: 16px 18px; border-left: 3px solid var(--ink); background: var(--tint); font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.warning { color: var(--amber); border-left-color: var(--gold); background: var(--amber-bg); }
.notice p:last-child, .warning p:last-child { margin-bottom: 0; }

.ledger { border-top: 1px solid var(--line); margin: 18px 0; }
.ledger details { border-bottom: 1px solid var(--line); }
.ledger summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 17px 0; cursor: pointer; list-style: none; }
.ledger summary::-webkit-details-marker { display: none; }
.ledger summary::before { content: "+"; flex: 0 0 20px; text-align: center; color: var(--vermillion); font-size: 20px; font-weight: 400; }
.ledger summary:hover { background: rgba(26, 39, 68, .035); }
.ledger details[open] > summary::before { content: "−"; }
.ledger .section-title { color: var(--ink); font-size: 16px; font-weight: 600; min-width: 0; }
.ledger summary .amount { margin-left: auto; flex-shrink: 0; font-weight: 600; color: var(--ink); }
.cost-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .7fr); gap: 4px 18px; padding: 16px 18px; background: var(--surface); border-top: 1px solid var(--line); }
.cost-name { color: var(--ink); font-size: 14px; font-weight: 550; }
.qpr { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.note { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
.cost-row .note { margin: 2px 0 0; }
.table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; margin: 18px 0; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; line-height: 1.65; }
th { background: var(--tint); color: var(--ink); text-align: left; font-weight: 600; vertical-align: bottom; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
td { font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f0ebe1; }
td:first-child, th:first-child { min-width: 130px; }
.table-hint { color: var(--muted); font-size: 12px; }

#case-search { width: 100%; min-height: 46px; padding: 10px 14px; margin: 12px 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 0; -webkit-appearance: none; }
#case-search::placeholder { color: var(--muted); }
.case-list { display: grid; gap: 12px; margin-top: 16px; }
.case-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; align-items: center; padding: 20px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; min-width: 0; }
.case-link:hover { border-color: var(--gold); background: #f2ecdf; }
.case-link .title { color: var(--ink); font: 600 20px/1.5 var(--serif); overflow-wrap: anywhere; }
.case-link .meta { grid-column: 1; color: var(--muted); font-size: 12px; }
.case-link .value { grid-column: 2; grid-row: 1 / 3; text-align: right; font-size: 16px; font-variant-numeric: tabular-nums; line-height: 1.6; }
.source-list, .audit-list { padding-left: 1.4em; }
.source-list li, .audit-list li { margin-bottom: 15px; padding-left: 3px; overflow-wrap: anywhere; }
.source-list { color: var(--muted); font-size: 13px; }
.source-list a { overflow-wrap: anywhere; }
.audit-list strong { display: inline; color: var(--ink); }
.status { display: inline-flex; align-items: center; padding: 3px 8px; margin: 2px 4px 2px 0; font: 500 11px/1.5 var(--sans); border: 1px solid var(--line); background: var(--tint); color: var(--text); white-space: nowrap; }
.status.actual { background: #e8ebf0; border-color: #bdc6d5; color: var(--ink); }
.status.estimate { background: var(--amber-bg); border-color: #cbbb91; color: var(--amber); }
.status.missing { background: #f4e6df; border-color: #d9afa4; color: #94392e; }
.page-footer { padding-top: 26px; margin-top: 42px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.scenario-panel { min-width: 0; padding: 22px; margin: 22px 0; border: 1px solid var(--line); border-top: 3px solid var(--gold); background: var(--surface); }
.scenario-panel h2, .scenario-panel h3 { margin-top: 0; font-family: var(--serif); }
.scenario-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; min-width: 0; }
.scenario-controls > *, .scenario-results > *, .scenario-line > * { min-width: 0; }
.scenario-panel label { display: grid; gap: 6px; color: var(--text); font-size: 13px; line-height: 1.6; }
.scenario-panel input, .scenario-panel select { width: 100%; max-width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; border: 1px solid #bdb7ab; border-radius: 0; background: var(--paper); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.scenario-panel input[type="checkbox"], .scenario-panel input[type="radio"] { width: 20px; min-height: 20px; margin: 12px 8px 12px 0; accent-color: var(--ink); }
.scenario-panel input[aria-invalid="true"] { border-color: var(--vermillion); box-shadow: inset 0 0 0 1px var(--vermillion); }
.scenario-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.scenario-results .metric { background: var(--paper); }
.scenario-lines { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.scenario-group { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.scenario-group > h3 { margin-bottom: 12px; font-size: 18px; }
.scenario-line { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(96px, .45fr)); gap: 10px 16px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.scenario-line .note { grid-column: 1 / -1; }
.scenario-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; }
.scenario-actions button, .scenario-panel button { min-height: 44px; max-width: 100%; padding: 9px 14px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); }
.scenario-actions button:hover, .scenario-panel button:hover { background: #2d3c5b; }
.scenario-actions button[type="reset"], .scenario-actions button[data-scenario-reset] { background: transparent; color: var(--ink); border-color: var(--line); }
.scenario-error { padding: 12px 14px; margin: 12px 0; border-left: 3px solid var(--vermillion); background: #f4e6df; color: #94392e; font-size: 13px; overflow-wrap: anywhere; }
.scenario-state { color: var(--muted); font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }

/* 图形概览保留金额直读；表格作为精确核对层。 */
.reading-path { display:flex; flex-wrap:wrap; gap:8px 24px; margin:20px 0; }
.reading-path a { display:inline-flex; align-items:center; min-height:44px; gap:8px; font-size:13px; text-decoration:none; }
.reading-path a span { color:var(--vermillion); font-variant-numeric:tabular-nums; }
.reading-upgrades > article > strong { display:block; margin:12px 0; color:var(--ink); font-size:22px; font-variant-numeric:tabular-nums; }
.reading-upgrades > article > p { display:flex; flex-wrap:wrap; gap:4px 12px; margin-bottom:8px; }
.reading-upgrades > article > small { color:var(--muted); }
.reading-chart, .reading-resources { margin:24px 0; }
.reading-chart figcaption, .reading-resources figcaption { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 20px; color:var(--ink); font-size:16px; margin-bottom:16px; }
.reading-chart figcaption span, .reading-resources figcaption small { font-size:12px; color:var(--muted); }
.reading-legend { display:flex; gap:20px; font-size:12px; color:var(--muted); margin-bottom:16px; }
.reading-legend > span { display:inline-flex; align-items:center; gap:6px; }
.reading-key { width:14px; height:10px; background:var(--ink); }
.reading-key.reserve, .reading-track i.reserve { background:var(--gold); border:1px solid var(--amber); }
.reading-track { display:flex; width:100%; height:12px; background:var(--tint); min-width:0; }
.reading-track i { display:block; height:100%; background:var(--ink); flex-shrink:0; }
.reading-track i.memo { background:transparent; border:1px solid var(--muted); }
.reading-tier-row { display:grid; grid-template-columns:52px minmax(0,1fr) 90px; gap:4px 16px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.reading-tier-row > strong { text-align:right; font-size:22px; font-variant-numeric:tabular-nums; color:var(--ink); }
.reading-tier-row > small { grid-column:2 / -1; color:var(--muted); font-size:12px; }
.reading-scope-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:22px; margin:22px 0; }
.reading-scope { margin:0; min-width:0; border-top:1px solid var(--line); padding-top:14px; }
.reading-scope figcaption { color:var(--ink); font-weight:600; margin-bottom:16px; }
.reading-scope figcaption small { display:block; font-weight:400; color:var(--muted); }
.reading-scope > div { display:grid; grid-template-columns:28px minmax(0,1fr) 26px; gap:6px; align-items:center; margin:10px 0; font-size:12px; }
.reading-scope strong { text-align:right; color:var(--ink); font-variant-numeric:tabular-nums; }
.reading-scope .reading-track { height:8px; }
.reading-deliverables { border-top:1px solid var(--line); margin:22px 0; }
.reading-deliverables details { border-bottom:1px solid var(--line); }
.reading-deliverables summary { display:flex; gap:18px; align-items:center; list-style:none; min-height:74px; cursor:pointer; }
.reading-deliverables summary::-webkit-details-marker { display:none; }
.reading-step { color:var(--vermillion); font:500 18px/1.5 var(--sans); font-variant-numeric:tabular-nums; flex-shrink:0; }
.reading-deliverables summary strong { display:block; color:var(--ink); }
.reading-deliverables summary small { display:block; color:var(--muted); }
.reading-plus { margin-left:auto; color:var(--muted); }
.reading-deliverables details[open] .reading-plus { transform:rotate(45deg); }
.reading-deliverables p { margin:0 0 18px 40px; font-size:13px; color:var(--muted); }
.reading-resource-head, .reading-resource-row { display:grid; grid-template-columns:1fr 1fr 1fr; gap:20px; align-items:center; padding:10px 0; }
.reading-resource-head { color:var(--muted); font-size:12px; border-bottom:1px solid var(--line); }
.reading-resource-row { border-bottom:1px solid var(--line); font-size:13px; }
.reading-resource-row strong { font-weight:400; }
.reading-resource-row b { font-weight:500; font-variant-numeric:tabular-nums; }
.reading-resource-row .reading-track { margin-top:5px; height:8px; }
.reading-funding, .reading-triage { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin:24px 0; }
.reading-funding article { border-top:2px solid var(--ink); padding:16px 0 0; min-width:0; }
.reading-funding article:nth-child(2) { border-top-color:var(--gold); }
.reading-funding article:nth-child(3) { border-top:2px dashed var(--muted); }
.reading-account { font-size:12px; color:var(--muted); }
.reading-funding h3 { font-size:15px; margin:5px 0 16px; }
.reading-funding-value { font-size:16px; color:var(--ink); font-variant-numeric:tabular-nums; }
.reading-triage a { display:grid; gap:6px; padding:16px; background:var(--tint); border-top:2px solid var(--ink); text-decoration:none; }
.reading-triage a:nth-child(2) { border-top-color:var(--gold); }
.reading-triage a:nth-child(3) { border-top-style:dashed; }
.reading-triage a > span { font-size:12px; color:var(--muted); }
.reading-triage a > strong { font:600 19px/1.5 var(--serif); }
.reading-triage a > small { color:var(--muted); }
.reading-rules { border-top:1px solid var(--line); }
.reading-rules details { border-bottom:1px solid var(--line); }
.reading-rules summary { display:flex; justify-content:space-between; gap:14px; padding:16px 0; min-height:54px; cursor:pointer; list-style:none; font-size:15px; font-weight:600; color:var(--ink); }
.reading-rules summary::-webkit-details-marker { display:none; }
.reading-rules summary span { color:var(--muted); font-weight:400; }
.reading-rules details[open] summary span { transform:rotate(45deg); }
.reading-rules p { font-size:13px; color:var(--muted); }
.reading-gates { list-style:none; padding:0; margin:24px 0; }
.reading-gates li { display:grid; grid-template-columns:30px minmax(0,1fr); gap:16px; position:relative; padding:0 0 20px; }
.reading-gates li:not(:last-child)::before { content:""; position:absolute; left:12px; top:32px; bottom:7px; width:1px; background:var(--line); }
.reading-gates summary { display:flex; align-items:center; gap:10px; justify-content:space-between; min-height:40px; list-style:none; cursor:pointer; color:var(--ink); }
.reading-gates summary small { border:1px solid var(--line); padding:2px 8px; color:var(--muted); font-size:11px; }
.reading-gates p { font-size:13px; margin:12px 0; }
.sidebar a[data-reading-active="true"] { border-left-color:var(--gold); background:var(--tint); color:var(--ink); }
.reading-progress { position:absolute; bottom:-1px; height:2px; background:var(--vermillion); left:0; width:0; pointer-events:none; }
@media (max-width:800px) { .reading-scope-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) {
  .reading-path { gap:4px 14px; }
  .reading-path a { font-size:12px; }
  .reading-upgrades > article { display:grid; grid-template-columns:1fr auto; gap:4px 10px; padding:14px 0; }
  .reading-upgrades > article > h3 { font-size:16px; margin:0; align-self:center; }
  .reading-upgrades > article > strong { font-size:18px; margin:0; }
  .reading-upgrades > article > p, .reading-upgrades > article > small { grid-column:1 / -1; margin:0; }
  .reading-tier-row { grid-template-columns:36px minmax(0,1fr) 72px; gap:4px 10px; }
  .reading-tier-row > strong { font-size:19px; }
  .reading-funding, .reading-triage { grid-template-columns:1fr; gap:8px; }
  .reading-funding article { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:2px 14px; }
  .reading-funding-value { grid-column:2; grid-row:1 / 3; font-size:14px; margin:0; }
  .reading-funding article .note { grid-column:1 / -1; }
  .reading-triage a { grid-template-columns:64px minmax(0,1fr); gap:2px 8px; }
  .reading-triage a > small { grid-column:2; }
  .reading-resource-head, .reading-resource-row { grid-template-columns:1.1fr 1fr 1fr; gap:10px; }
  .reading-resource-head { font-size:11px; }
  .reading-resources figcaption small { display:block; }
}
@media (prefers-reduced-motion:no-preference) {
  .reading-plus, .reading-rules summary span { transition:transform 180ms ease; }
  .reading-deliverables details[open] > p, .reading-rules details[open] > p, .reading-gates details[open] > p { animation:reading-detail-in 180ms ease; }
  @keyframes reading-detail-in { from { opacity:.4; transform:translateY(-3px); } to { opacity:1; transform:translateY(0); } }
}
@media print {
  .reading-progress, .reading-path, .reading-plus { display:none; }
  .reading-chart, .reading-scope, .reading-resource-row, .reading-deliverables details, .reading-gates li { break-inside:avoid; }
  .reading-track, .reading-key { print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  .reading-scope-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .reading-funding, .reading-triage { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 25px; }
  .sidebar { position: static; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
  .sidebar nav, .sidebar ul { display: flex; gap: 4px 10px; flex-wrap: wrap; }
  .sidebar a { border: 0; padding: 8px 10px; }
  .sidebar a[aria-current="page"] { box-shadow: inset 0 -2px var(--vermillion); }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .site-header { padding: 7px 18px; gap: 0 12px; }
  .brand { font-size: 18px; }
  .site-header nav { gap: 0 10px; }
  .site-header nav a { font-size: 12px; }
  .site-header nav button { padding: 8px 9px; font-size: 12px; }
  .header-actions, .page-actions { gap: 6px; }
  .header-actions button, .page-actions button { padding-left: 10px; padding-right: 10px; font-size: 12px; }
  .layout { padding: 24px 18px 48px; gap: 22px; }
  .sidebar { padding-bottom: 10px; max-width: 100%; }
  .sidebar > p, .sidebar h2, .sidebar h3 { display: none; }
  .sidebar nav, .sidebar ul { display: flex; flex-wrap: nowrap; min-width: 0; max-width: 100%; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; padding: 6px; }
  .sidebar a, .sidebar li { flex-shrink: 0; }
  .sidebar a { min-height: 44px; white-space: nowrap; }
  .hero { padding-bottom: 25px; }
  .lead { font-size: 14px; }
  .section { margin-top: 31px; }
  .section > h2 { font-size: 23px; }
  .tier-control { width: 100%; gap: 4px; }
  .tier-control button { min-width: 0; flex: 1; padding: 9px 6px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 15px 12px; }
  .metric .label { font-size: 12px; min-height: 38px; margin-bottom: 7px; }
  .metric .value { font-size: 28px; }
  .metric .sub { font-size: 11px; }
  .decision-summary { grid-template-columns: 1fr; }
  .decision-summary .metric { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 12px; padding: 15px; }
  .decision-summary .metric .label { min-height: 0; margin: 0; align-self: center; }
  .decision-summary .metric .value { font-size: 27px; }
  .decision-summary .metric .sub { grid-column: 1 / -1; margin-top: 8px; }
  .decision-status a { margin-left: 0; }
  .tier-decisions { grid-template-columns: 1fr; gap: 5px; }
  .tier-decisions article { padding-top: 12px; }
  .baseline-fold { padding: 0 12px; }
  .notice, .warning { padding: 14px; }
  .ledger summary { gap: 7px; padding: 15px 0; }
  .ledger .section-title { font-size: 14px; }
  .ledger summary .amount { font-size: 14px; }
  .ledger summary::before { flex-basis: 16px; }
  .cost-row { grid-template-columns: minmax(0, 1fr); padding: 14px 12px; }
  .qpr { text-align: left; }
  .case-link { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 6px; }
  .case-link .title { font-size: 19px; }
  .case-link .meta, .case-link .value { grid-column: 1; grid-row: auto; text-align: left; }
  .case-link .value { margin-top: 3px; font-size: 15px; }
  .scenario-panel { padding: 16px 13px; }
  .scenario-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .scenario-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .scenario-line { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .scenario-line > :first-child { grid-column: 1 / -1; }
  .scenario-panel input, .scenario-panel select { font-size: 16px; }
  th, td { padding: 10px 12px; }
}
@media (max-width: 350px) {
  .summary-grid { grid-template-columns: 1fr; }
  .metric .label { min-height: 0; }
  .site-header nav { gap: 0 10px; }
  .scenario-controls, .scenario-results { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .print-only { display: block; }
  .realization-control { display: none; }
  @page { size: A4; margin: 16mm; }
  html { scroll-padding: 0; }
  body { background: white; color: #111; font-size: 10pt; }
  .site-header { position: static; display: block; padding: 0 0 8mm; background: white; }
  .site-header nav, .sidebar, .tier-control, button[data-print], button[data-expand-all], #case-search, .table-hint, .scenario-actions, .scenario button { display: none !important; }
  .layout { display: block; max-width: none; padding: 0; }
  .hero h1 { font-size: 27pt; }
  .lead { font-size: 11pt; }
  .section { margin-top: 8mm; }
  .section > h2 { font-size: 17pt; break-after: avoid; }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3mm; }
  .metric, .notice, .warning, .cost-row, .case-link { break-inside: avoid; background: white; }
  .metric { padding: 4mm; }
  .metric .value { font-size: 20pt; }
  .table-wrap { overflow: visible; border: 0; }
  table { min-width: 0; width: 100%; table-layout: auto; font-size: 9pt; }
  th, td { padding: 2.5mm; overflow-wrap: anywhere; }
  th { background: #eee9dd; }
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
  td:first-child, th:first-child { min-width: 0; }
  .ledger summary { min-height: 0; padding: 4mm 0; break-after: avoid; }
  .ledger summary::before { display: none; }
  .cost-row { grid-template-columns: minmax(0, 1fr) minmax(150px, .7fr); }
  .qpr { text-align: right; }
  .source-list, .page-footer { font-size: 8.5pt; }
  a { color: inherit; }
  .status { color: #333 !important; background: white !important; }
  .scenario-panel { background: white; padding: 4mm; }
  .scenario-lines { overflow: visible; }
  .scenario-controls, .scenario-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scenario-panel input, .scenario-panel select { background: white; color: #111; }
}

.cbc-option { display:flex; align-items:center; gap:14px; padding:18px 20px; margin:20px 0; border:1px solid var(--green, #25473e); background:#edf2ec; cursor:pointer; font-weight:600; min-height:56px; }
.duration-choice { display:flex; align-items:center; gap:14px 22px; flex-wrap:wrap; padding:20px 0; border-bottom:1px solid var(--line); }
.duration-choice label { font-weight:600; }
.duration-choice label small { display:block; font-size:12px; font-weight:400; color:var(--muted); }
.duration-choice > div { display:flex; align-items:center; gap:10px; }
.duration-choice input { width:92px; min-height:48px; padding:8px 12px; border:1px solid var(--ink); border-radius:0; background:var(--surface); color:var(--ink); font-family:inherit; font-size:22px; font-weight:600; line-height:1.3; font-variant-numeric:tabular-nums; }
.duration-choice input:focus-visible { outline:2px solid #ad8141; outline-offset:3px; }
.duration-choice p { flex:1 1 220px; margin:0; font-size:13px; color:var(--muted); line-height:1.7; }
.duration-summary { font-size:15px; line-height:1.9; }
.cbc-option input { flex:0 0 auto; width:24px; height:24px; accent-color:#25473e; }
.cbc-option small { display:block; margin-top:5px; font-size:13px; font-weight:400; line-height:1.7; color:#55665c; }
.cbc-option:focus-within { outline:2px solid #ad8141; outline-offset:3px; }
[data-cbc-only][hidden] { display:none !important; }
@media print { .cbc-option { background:white; border-color:#aaa; } }
