/* NZ Election 2026 report site. All colours are tokens; dark values live in two scopes
   (OS setting, and the explicit toggle) so the toggle wins both ways. */
:root {
  color-scheme: light;
  --page: #f6f5f1;
  --surface: #fcfcfb;
  --surface-2: #f0efea;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #76746e;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #4b3cc0;
  --accent-soft: rgba(98, 80, 214, 0.12);
  --range: #6250d6;
  --range-soft: rgba(98, 80, 214, 0.28);
  /* Blocs: diverging red (left) / grey (hung) / blue (right). Checked for CVD separation. */
  --left: #e34948;
  --hung: #a8a79e;
  --right: #2a78d6;
  --hero: #121b2a;
  --hero-ink: #f0efec;
  --hero-ink-2: #c3c2b7;
  --hero-accent: #c8e523;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f0f0e;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #94928a;
    --grid: #2c2c2a;
    --axis: #45453f;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #a59cf0;
    --accent-soft: rgba(144, 133, 233, 0.16);
    --range: #9085e9;
    --range-soft: rgba(144, 133, 233, 0.32);
    --left: #e66767;
    --hung: #c3c2b7;
    --right: #3987e5;
    --hero: #121b2a;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0e;
  --surface: #1a1a19;
  --surface-2: #232321;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #94928a;
  --grid: #2c2c2a;
  --axis: #45453f;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #a59cf0;
  --accent-soft: rgba(144, 133, 233, 0.16);
  --range: #9085e9;
  --range-soft: rgba(144, 133, 233, 0.32);
  --left: #e66767;
  --hung: #c3c2b7;
  --right: #3987e5;
  --hero: #121b2a;
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- masthead ---------- */
.masthead { background: var(--hero); color: var(--hero-ink); }
.masthead a { color: var(--hero-ink); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 0; }
.brand { font: 700 15px/1 var(--mono); letter-spacing: -0.01em; }
.brand::after { content: ".nz"; color: var(--hero-accent); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px;
  border-radius: 8px; border: 1px solid transparent; font: 500 14px/1 var(--font); cursor: pointer;
  text-decoration: none; background: none; color: inherit;
}
.btn-quiet { border-color: rgba(255,255,255,.18); }
.btn-quiet:hover { background: rgba(255,255,255,.08); }
.btn-quiet .muted { color: var(--hero-ink-2); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ico-moon { fill: currentColor; stroke: none; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ico-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .ico-moon { display: none; }
}
.kicker { font: 600 12px/1.4 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.masthead .kicker { color: var(--hero-accent); margin-top: 40px; }
.masthead h1 { font-size: clamp(30px, 5.4vw, 54px); line-height: 1.06; letter-spacing: -0.025em; margin: 0 0 16px; max-width: 21ch; font-weight: 750; }
.dek { font-size: clamp(17px, 2vw, 20px); line-height: 1.45; color: var(--hero-ink-2); max-width: 62ch; margin: 0 0 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--hero-ink-2); margin: 0 0 24px; }
.meta span + span::before { content: ""; }
.notice {
  display: block; border-left: 3px solid var(--hero-accent); background: rgba(255,255,255,.06);
  padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 15px; color: var(--hero-ink-2); margin: 0 0 32px; max-width: 80ch;
}
.notice strong { color: var(--hero-ink); }
.notice-official { border-left-color: #0ca30c; background: rgba(12,163,12,.12); }
.notice-sub { display: block; margin-top: 4px; font-size: 13px; }

.jumpnav { position: sticky; top: 0; z-index: 20; background: var(--hero); border-top: 1px solid rgba(255,255,255,.08); }
.jumpnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.jumpnav .wrap::-webkit-scrollbar { display: none; }
.jumpnav a {
  flex: none; padding: 12px 10px; font-size: 14px; font-weight: 500; text-decoration: none;
  color: var(--hero-ink-2); border-bottom: 2px solid transparent;
}
.jumpnav a:hover, .jumpnav a.active { color: var(--hero-ink); border-bottom-color: var(--hero-accent); }

/* ---------- bands & cards ---------- */
.band { padding: 48px 0; }
.band-alt { background: var(--surface-2); }
.section-h { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 8px; }
.section-dek { color: var(--ink-2); max-width: 70ch; margin: 0 0 24px; }
.section-h + .tiles, .section-h + .grid-2, .section-h + .card { margin-top: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
@media (min-width: 720px) { .card { padding: 24px; } }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; } }
.fineprint { font-size: 14px; color: var(--ink-2); max-width: 80ch; margin: 16px 0 0; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.tile-hero { grid-column: 1 / -1; }
@media (min-width: 1040px) { .tile-hero { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; padding: 24px; } .tile-hero .tile-sub { font-size: 15px; } }
.tile-label { font-size: 13px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 8px; line-height: 1.3; }
.tile-value { font-size: clamp(22px, 3vw, 30px); font-weight: 650; letter-spacing: -0.02em; margin: 6px 0 2px; line-height: 1.15; }
.tile-hero .tile-value { font-size: clamp(40px, 6vw, 56px); }
.tile-sub { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.key { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.key-left { background: var(--left); }
.key-right { background: var(--right); }
.key-hung { background: var(--hung); }

/* ---------- chart chrome ---------- */
.chart-title { font-size: 17px; font-weight: 650; line-height: 1.3; margin: 0 0 4px; letter-spacing: -0.01em; }
.chart-sub { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; line-height: 1.45; }
.chart-note { font-size: 13px; color: var(--ink-2); margin: 12px 0 0; line-height: 1.45; }
.chart-note strong { color: var(--ink); }
.controls { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 14px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--surface-2); }
.seg button {
  border: 0; background: none; color: var(--ink-2); font: 500 13px/1 var(--font); padding: 8px 10px; border-radius: 6px; cursor: pointer; min-height: 32px;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.control-label { font-size: 13px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin: 0 0 12px; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.sw-dot { border-radius: 50%; width: 11px; height: 11px; }
.sw-ring { border-radius: 50%; width: 11px; height: 11px; border: 2px solid var(--muted); background: var(--surface); }
.sw-fill { background: var(--muted); }
.svg-chart { display: block; width: 100%; height: auto; overflow: visible; }
.svg-chart text { font-family: var(--font); }
.t-label { fill: var(--ink); font-size: 14px; }
.t-label-strong { fill: var(--ink); font-size: 14px; font-weight: 600; }
.t-val { fill: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.t-val-strong { fill: var(--ink); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.t-axis { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: var(--axis); stroke-width: 1; }
.c-left { fill: var(--left); stroke: var(--left); }
.c-hung { fill: var(--hung); stroke: var(--hung); }
.c-right { fill: var(--right); stroke: var(--right); }
.bg-left { background: var(--left); }
.bg-hung { background: var(--hung); }
.bg-right { background: var(--right); }
.dumb-line { stroke-width: 3; stroke-opacity: .45; fill: none; }
.dot-old { fill: var(--surface); stroke-width: 2.5; }
.dot-now { stroke: var(--surface); stroke-width: 2; }
.hit { fill: transparent; stroke: none; cursor: default; }
.row-hl { fill: var(--accent-soft); opacity: 0; transition: opacity .15s; }
.row:hover .row-hl, .row:focus .row-hl { opacity: 1; }
.row:focus { outline: none; }
.fade-in { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: .2; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

details.table-view { margin-top: 14px; font-size: 14px; }
details.table-view summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 13px; width: max-content; }
details.table-view .table-wrap { margin-top: 10px; }

/* ---------- HTML bar rows (stacked & simple) ---------- */
.hbars { display: grid; gap: 14px; }
.hrow { display: grid; gap: 6px 16px; grid-template-columns: minmax(0, 1fr); align-items: center; border-radius: 8px; }
@media (min-width: 720px) { .hrow { grid-template-columns: minmax(160px, 30%) minmax(0, 1fr); } }
.hrow-label { font-size: 14px; line-height: 1.3; min-width: 0; }
.hrow-label strong { font-weight: 600; }
.hrow-label .sub { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.hrow-label a { color: var(--ink); }
.hrow-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stack { display: flex; gap: 2px; height: 28px; flex: 1 1 auto; min-width: 0; }
.seg-bar {
  height: 100%; display: flex; align-items: center; justify-content: center; min-width: 3px;
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: #0b0b0b; overflow: visible; white-space: nowrap;
  outline-offset: 1px;
}
.seg-bar:first-child { border-radius: 4px 0 0 4px; }
.seg-bar:last-child { border-radius: 0 4px 4px 0; }
.seg-bar .lbl-hidden { display: none; }
.stack-end { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 44px; color: var(--ink); }
.hrow:hover .stack, .hrow:focus-within .stack { filter: saturate(1.1); }
.this-report .hrow-label strong { font-weight: 700; }

.sbar-track { flex: 1 1 auto; min-width: 0; height: 22px; display: flex; align-items: center; }
.sbar { height: 22px; border-radius: 0 4px 4px 0; min-width: 3px; }
.sbar-val { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; margin-left: 8px; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); white-space: nowrap; }
.chip .sw { width: 8px; height: 8px; border-radius: 2px; }

.seg-ov, .sw-ov { background: var(--range); }
.seg-dom, .sw-dom { background: var(--range-soft); }
.seg-ov { color: #fff; }
:root[data-theme="dark"] .seg-ov { color: #0b0b0b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-ov { color: #0b0b0b; } }
.sbar-lean { background: var(--muted); }
.sbar-lean.sbar-dom { background: var(--range); }
.hbars-tight { gap: 8px; }
.hrow-tight { gap: 4px 16px; }
@media (min-width: 720px) { .hrow-tight { grid-template-columns: minmax(140px, 34%) minmax(0, 1fr); } }
.chart-title-2 { margin-top: 28px; }
.tip-note { margin-top: 4px; opacity: .8; font-size: 12px; }

.band-view { background: var(--surface); border-bottom: 1px solid var(--border); }
.view { max-width: 720px; font-size: 18px; line-height: 1.65; }
.view-h { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 18px; }
.view p { margin: 0 0 16px; }
.view .kicker { color: var(--accent); margin-bottom: 8px; }
.view-ask { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 8px 8px 0; }
.view-foot { font-size: 15px; color: var(--ink-2); }
.card-wide { grid-column: 1 / -1; }
.report-intro { font-size: 15px; color: var(--ink-2); font-style: italic; }
.sw-y23, .bar-y23 { background: var(--muted); }
.sw-y26, .bar-y26 { background: var(--range); }
.sbar-zero { min-width: 0; width: 0; }
.cmp-group { margin-top: 18px; }
.cmp-group:first-of-type { margin-top: 4px; }
.cmp-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.cmp-measure { margin-bottom: 14px; border-radius: 8px; }
.cmp-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cmp-rows { display: grid; gap: 4px; }
.cmp-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; }
.cmp-yr { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cmp-row .sbar { height: 16px; }
.cmp-row .sbar-track { height: 18px; }
.cmp-row .sbar-val { font-weight: 600; font-size: 12.5px; white-space: normal; }

/* ---------- electorate cards ---------- */
.seat-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 680px) { .seat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .seat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.seat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.seat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.seat-name { font-size: 18px; font-weight: 650; margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tag { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--border); color: var(--ink-2); background: var(--surface-2); }
.tag-tossup { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.margin { display: flex; align-items: baseline; gap: 8px; }
.margin-num { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.margin-lbl { font-size: 13px; color: var(--ink-2); }
.cands { display: grid; gap: 4px; font-size: 14px; }
.cand { display: flex; justify-content: space-between; gap: 8px; }
.cand span:last-child { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cand-pos { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-right: 6px; }
.event { font-size: 14px; font-weight: 600; margin: 0; }
.meter-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 62px; gap: 8px; align-items: center; font-size: 13px; }
.meter-row .m-lbl { color: var(--ink-2); }
.meter-row .m-val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.meter { height: 10px; border-radius: 5px; background: var(--range-soft); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--range); border-radius: 5px; }
.meter-old > i { background: var(--muted); }
.meter-old { background: var(--grid); }
.seat-effect { font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--border); padding-top: 10px; margin: auto 0 0; line-height: 1.45; }
.seat-empty { color: var(--ink-2); }

/* ---------- range estimates ---------- */
.ranges { display: grid; gap: 22px; }
.range-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.range-name { font-size: 14px; font-weight: 600; }
.range-fig { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.range-fig strong { color: var(--ink); }
.range-track { position: relative; height: 26px; margin-top: 8px; border-bottom: 1px solid var(--axis);
  background: linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 33.333% 100% repeat-x; }
.range-bar { position: absolute; top: 6px; height: 14px; background: var(--range-soft); border-radius: 4px; }
.range-core { position: absolute; top: 6px; height: 14px; background: var(--range); border-radius: 4px; }
.range-tick { position: absolute; top: 2px; width: 3px; height: 22px; background: var(--ink); border-radius: 2px; transform: translateX(-1.5px); }
.range-axis { position: relative; height: 18px; margin-top: 4px; }
.range-axis span { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.range-axis span:first-child { transform: none; }
.range-axis span:last-child { transform: translateX(-100%); }
.range-note { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }
.check-box { margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: var(--accent-soft); font-size: 13.5px; line-height: 1.5; }
.check-box strong { display: block; margin-bottom: 2px; }

/* ---------- tooltip ---------- */
.tip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 300px;
  background: var(--ink); color: var(--page); font-size: 13px; line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.tip strong { display: block; margin-bottom: 2px; }
.tip .tip-row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }

/* ---------- report ---------- */
.band-report { background: var(--surface); border-top: 1px solid var(--border); }
.report-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1040px) { .report-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 48px; } }
.toc { font-size: 14px; min-width: 0; }
@media (min-width: 1040px) { .toc { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 80px); overflow-y: auto; padding-bottom: 16px; } }
.toc-box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--page); }
.toc-box summary { font-weight: 650; cursor: pointer; }
.toc ol { list-style: none; margin: 8px 0 0; padding: 0; }
.toc ol ol { margin: 2px 0 6px 12px; padding-left: 10px; border-left: 1px solid var(--grid); }
.toc li { margin: 0; }
.toc a { display: block; padding: 3px 0; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); font-weight: 600; }
.toc ol ol a { font-size: 13px; }
.toc-downloads { display: grid; gap: 6px; margin-top: 12px; font-size: 13.5px; }

.prose { max-width: 760px; min-width: 0; font-size: 17px; line-height: 1.65; }
.prose .report-title { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; }
.prose h2.report-title { border-top: 0; padding-top: 0; margin-top: 0; }
.prose h2 { font-size: 25px; line-height: 1.25; letter-spacing: -0.015em; margin: 48px 0 12px; padding-top: 8px; border-top: 1px solid var(--grid); }
.prose h3 { font-size: 19px; line-height: 1.3; margin: 32px 0 8px; }
.prose h2, .prose h3 { position: relative; }
.anchor { margin-left: 8px; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose li > p { margin: 0 0 6px; }
.prose strong { font-weight: 650; }
.prose .formula { font-family: var(--mono); font-size: 14.5px; background: var(--surface-2); padding: 10px 14px; border-radius: 8px; overflow-x: auto; }
.prose .formula strong { font-family: var(--font); }
.cite { font-size: .78em; font-variant-numeric: tabular-nums; text-decoration: none; vertical-align: .25em; line-height: 0; padding: 0 1px; }
.cite:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 10px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.4; }
th, td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--grid); }
th { font-weight: 600; background: var(--surface-2); white-space: nowrap; font-size: 13px; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td { font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--accent-soft); }
.report-fig { margin: 20px 0 24px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--page); }
.prose .chart-title { font-size: 17px; margin: 0 0 4px; }
.prose .legend, .prose .hbars { padding: 0; margin-left: 0; }
.prose .chart-note { margin: 12px 0 0; font-size: 13px; }
.prose .chart-sub { font-size: 14px; margin: 0 0 14px; }
.report-fig figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.report-fig img, .card img { max-width: 100%; height: auto; }
ol.sources { font-size: 14.5px; line-height: 1.5; padding-left: 30px; }
ol.sources li { margin: 0 0 8px; padding: 4px 6px; border-radius: 6px; scroll-margin-top: 80px; }
ol.sources li:target { background: var(--accent-soft); }
ol.sources li > p { margin: 0; }

/* ---------- footer ---------- */
.footer { background: var(--hero); color: var(--hero-ink-2); padding: 36px 0 48px; font-size: 14px; }
.footer p { max-width: 80ch; margin: 0 0 12px; }
.footer strong { color: var(--hero-ink); }
.footer a { color: var(--hero-ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer .muted { color: var(--hero-ink-2); opacity: .8; font-family: var(--mono); font-size: 13px; }

@media print {
  .jumpnav, .topbar-actions, .toc, .controls, details.table-view, .anchor, .skip { display: none !important; }
  .masthead, .footer { background: none; color: #000; }
  .band { padding: 16px 0; }
  .card, .seat, .tile { box-shadow: none; break-inside: avoid; }
}
@media (forced-colors: active) {
  .seg-bar, .sbar, .meter > i, .range-core, .key, .sw { forced-color-adjust: none; border: 1px solid CanvasText; }
}
