:root {
  --bg: #f4f3ef; --panel: #ffffff; --panel-2: #f6f5f1; --text: #111214; --muted: #5f646b; --faint: #9a9fa6;
  --line: oklch(0 0 0 / 0.08); --ink: #111214; --ink-text: #ffffff; --brand: #d6f36b; --brand-ink: #141a05;
  --hi: #c4302b; --lo: #2f6db3; --warn: #b4580f; --warn-soft: #fcefdf;
  --ring: 0 0 0 1px oklch(0 0 0 / 0.06), 0 1px 2px oklch(0 0 0 / 0.04), 0 10px 30px -14px oklch(0 0 0 / 0.18);
  --ring-sm: 0 0 0 1px oklch(0 0 0 / 0.08), 0 1px 2px oklch(0 0 0 / 0.05);
  --map-stroke: #ffffff; --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0b0d; --panel: #111316; --panel-2: #181b1f; --text: #eceef0; --muted: #9097a0; --faint: #5f666f;
  --line: oklch(1 0 0 / 0.08); --ink: #eceef0; --ink-text: #0a0b0d;
  --hi: #ff7a5c; --lo: #7cb8ff; --warn: #f2a65a; --warn-soft: #2d2014;
  --ring: 0 0 0 1px oklch(1 0 0 / 0.07), 0 12px 32px -12px oklch(0 0 0 / 0.8); --ring-sm: 0 0 0 1px oklch(1 0 0 / 0.08);
  --map-stroke: #111316; color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.5 'Geist', system-ui, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; transition: background-color 240ms var(--ease), color 240ms var(--ease); }
.num { font-family: 'Geist Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 0.92em; letter-spacing: -0.01em; }
.serif { font-family: 'Geist', system-ui, sans-serif; font-weight: 600; letter-spacing: -0.03em; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
button, select { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.6; flex: none; }
:focus-visible { outline: 2px solid var(--lo); outline-offset: 2px; border-radius: 8px; }

/* shell */
.app { display: grid; grid-template-columns: 76px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0; border-right: 1px solid var(--line); z-index: 30; background: var(--bg); }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; margin-bottom: 18px; }
.nav { position: relative; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--faint); transition: color 150ms var(--ease), background-color 150ms var(--ease), scale 120ms var(--ease); }
.nav:hover { color: var(--text); background: var(--panel-2); }
.nav[aria-current="page"] { color: var(--text); background: var(--panel); box-shadow: var(--ring-sm); }
.nav[aria-current="page"]::before { content: ''; position: absolute; left: -14px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--text); }
.nav:active, .btn:active, .tab:active, .seg button:active, .iconbtn:active, .link:active { scale: 0.96; }
.nav .lbl { display: none; }
.rail .grow { flex: 1; }

main { padding: 26px 32px 40px; max-width: 1520px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.crumb { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb .tag { color: var(--warn); background: var(--warn-soft); padding: 1px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 500; white-space: nowrap; cursor: help; }
h1.serif { font-size: 40px; line-height: 1.05; margin-top: 8px; }
h1 .dim { color: var(--faint); font-weight: 500; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
.sel { position: relative; }
.sel select { appearance: none; height: 44px; padding: 0 40px 0 40px; border-radius: 12px; background: var(--panel); box-shadow: var(--ring); font-weight: 500; min-width: 180px; }
.sel select option { background: var(--panel); color: var(--text); }
.sel svg { position: absolute; right: 12px; top: 13px; pointer-events: none; color: var(--muted); }
.sel svg.lead { left: 13px; right: auto; width: 16px; height: 16px; top: 14px; }
.btn { height: 44px; padding: 0 16px; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; background: var(--panel); box-shadow: var(--ring); transition: scale 120ms var(--ease), background-color 150ms var(--ease); white-space: nowrap; }
.btn.acc { background: var(--ink); color: var(--ink-text); box-shadow: none; }
.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; color: var(--text); padding: 8px 4px; transition: scale 120ms var(--ease); }
.link svg { width: 16px; height: 16px; }
.spacer { flex: 1; }

.view { display: none; }
.view.on { display: block; animation: fin 420ms var(--ease) both; }
@keyframes fin { from { opacity: 0; translate: 0 8px; } }

/* cards */
.card { background: var(--panel); border-radius: 20px; box-shadow: var(--ring); padding: 18px; min-width: 0; }
.card h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card .ch { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 12.5px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi .k { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .k svg { width: 16px; height: 16px; }
.kpi .v { font-size: 30px; font-weight: 500; letter-spacing: -0.03em; margin-top: 6px; }
.kpi .s { color: var(--faint); font-size: 12px; }
.kpis .kpi { animation: fin 480ms var(--ease) both; }
.kpis .kpi:nth-child(2) { animation-delay: 60ms; } .kpis .kpi:nth-child(3) { animation-delay: 120ms; } .kpis .kpi:nth-child(4) { animation-delay: 180ms; }
.grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.low { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin-top: 12px; }

.tabs { display: flex; background: var(--panel-2); border-radius: 10px; padding: 3px; }
.tab { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 12.5px; font-weight: 500; transition: color 150ms var(--ease), background-color 150ms var(--ease), box-shadow 150ms var(--ease); white-space: nowrap; }
.tab[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--ring-sm); }
.seg { display: flex; padding: 3px; gap: 2px; background: var(--panel-2); border-radius: 10px; position: relative; }
.seg button { position: relative; z-index: 1; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 12.5px; display: flex; align-items: center; gap: 6px; transition: color 160ms var(--ease); }
.seg button svg { width: 15px; height: 15px; }
.seg button[aria-pressed="true"] { color: var(--text); }
.seg .thumb { position: absolute; top: 3px; bottom: 3px; border-radius: 8px; background: var(--panel); box-shadow: var(--ring-sm); transition: left 260ms var(--ease), width 260ms var(--ease); }

/* outcome switch */
.seg.outcome { height: 44px; padding: 4px; background: var(--panel); box-shadow: var(--ring); border-radius: 12px; }
.seg.outcome button { padding: 0 14px; font-size: 13px; border-radius: 9px; }
.seg.outcome .thumb { top: 4px; bottom: 4px; border-radius: 9px; background: var(--ink); box-shadow: none; }
.seg.outcome button[aria-pressed="true"] { color: var(--ink-text); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px; }
.tri { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border-radius: 10px; text-align: left; transition: background-color 150ms var(--ease), scale 120ms var(--ease); }
.tri:hover { background: var(--panel); }
.tri.on { background: var(--panel); box-shadow: var(--ring-sm); }
.tri:active { scale: 0.96; }
.tri .k { font-size: 11px; color: var(--muted); line-height: 1.2; }
.tri .v { font-size: 17px; font-weight: 500; }
.tri .c { font-size: 10.5px; color: var(--faint); }
/* map */
.mapbox { position: relative; height: clamp(340px, 56vh, 600px); overflow: hidden; border-radius: 12px; background: var(--panel-2); touch-action: none; }
.mapcard.big .mapbox { height: calc(100vh - 250px); min-height: 420px; }
.mapbox > svg, .mapbox > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mapbox > canvas { pointer-events: none; }
.mapbox.surface > svg { cursor: crosshair; }
.district { stroke: var(--map-stroke); stroke-width: 0.6; vector-effect: non-scaling-stroke; transition: fill 300ms var(--ease), fill-opacity 300ms var(--ease), opacity 300ms var(--ease); cursor: pointer; }
.district.out { opacity: 0.18; }
.mapbox.surface .district { fill-opacity: 0 !important; stroke: var(--text); stroke-opacity: 0.22; }
.mapbox.surface .district.out { opacity: 0.6; }
.district.hl { stroke: var(--text); stroke-width: 1.8; stroke-opacity: 1 !important; }
.state-edge { fill: none; stroke: var(--text); stroke-opacity: 0.45; stroke-width: 1.1; vector-effect: non-scaling-stroke; pointer-events: none; }
.pin { pointer-events: none; }
.pin .halo { fill: var(--text); fill-opacity: 0.14; animation: halo 1.6s var(--ease) infinite; transform-box: fill-box; transform-origin: center; }
.pin .dot { fill: var(--text); stroke: var(--panel); stroke-width: 2.5; }
@keyframes halo { from { scale: 0.4; opacity: 1; } to { scale: 1.6; opacity: 0; } }
.mapfoot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.legend { font-size: 11.5px; color: var(--muted); min-width: 200px; }
.legend .bar { width: 220px; height: 8px; border-radius: 4px; margin: 6px 0 4px; }
.legend .tk { display: flex; justify-content: space-between; width: 220px; }
.zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--panel); box-shadow: var(--ring); color: var(--muted); transition: scale 120ms var(--ease), color 150ms var(--ease); }
.iconbtn:hover { color: var(--text); }

/* forest */
.forest { max-height: 560px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.fr { display: grid; grid-template-columns: 140px minmax(0, 1fr) 118px; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; cursor: pointer; transition: background-color 140ms var(--ease); width: 100%; text-align: left; }
.fr:hover, .fr.hl { background: var(--panel-2); }
.fr .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr .n small { display: block; color: var(--faint); font-weight: 400; font-size: 11.5px; }
.fr .v { text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fr .v b { color: var(--text); font-weight: 500; }
.fx { position: relative; height: 18px; }
.fx .ref { position: absolute; top: -8px; bottom: -8px; border-left: 1px dashed color-mix(in oklch, var(--text) 30%, transparent); }
.fx .anchor { position: absolute; top: -8px; bottom: -8px; border-left: 2px solid color-mix(in oklch, var(--hi) 45%, transparent); }
.fx .l { position: absolute; top: 8.5px; height: 1.5px; background: var(--muted); border-radius: 1px; transition: left 360ms var(--ease), width 360ms var(--ease); }
.fx .p { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 2px; rotate: 45deg; transition: left 360ms var(--ease), background-color 200ms var(--ease); }
.axis { display: grid; grid-template-columns: 140px minmax(0, 1fr) 118px; gap: 12px; padding: 6px 8px 0; font-size: 11px; color: var(--faint); border-top: 1px solid var(--line); margin-top: 6px; }
.axis .t { display: flex; justify-content: space-between; }
.key { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; margin-bottom: 8px; }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 9px; height: 9px; rotate: 45deg; border-radius: 2px; display: inline-block; }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--faint); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
tr.cur td { background: var(--panel-2); }
tr.cur td:first-child { border-radius: 10px 0 0 10px; } tr.cur td:last-child { border-radius: 0 10px 10px 0; }
td .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--hi); margin-right: 8px; vertical-align: 1px; }
.notes { padding: 0; }
.notes li { list-style: none; display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.notes li:last-child { border: 0; }
.notes svg { color: var(--text); margin-top: 2px; width: 16px; height: 16px; }

/* explorer + inspector */
.explorer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; align-items: start; }
.inspector { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.inspector .empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.inspector .empty .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--panel-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--text); }
.inspector .empty h3 { color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.stagger > * { animation: rise 420ms var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: 50ms; } .stagger > *:nth-child(3) { animation-delay: 100ms; } .stagger > *:nth-child(4) { animation-delay: 150ms; } .stagger > *:nth-child(5) { animation-delay: 200ms; } .stagger > *:nth-child(6) { animation-delay: 250ms; }
@keyframes rise { from { opacity: 0; translate: 0 6px; filter: blur(2px); } }
.ins-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.eyebrow svg { width: 15px; height: 15px; }
.ins-top h3 { font-size: 22px; line-height: 1.1; margin-top: 2px; }
.xbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); flex: none; transition: background-color 140ms var(--ease); }
.xbtn:hover { background: var(--panel-2); }
.hero { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 4px; }
.hero .big { font-size: 46px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.hero .ci-t { color: var(--muted); }
.support { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 99px; margin-top: 8px; }
.support.high { background: color-mix(in oklch, var(--lo) 14%, transparent); color: var(--lo); }
.support.mod { background: var(--panel-2); color: var(--muted); }
.support.low { background: var(--warn-soft); color: var(--warn); }
.support svg { width: 14px; height: 14px; }
.box { background: var(--panel-2); border-radius: 14px; padding: 14px; margin-top: 12px; }
.box h4 { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.box h4 svg { width: 15px; height: 15px; }
.mrow { display: grid; grid-template-columns: 30px minmax(0, 1fr) 54px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.mrow .m { color: var(--muted); font-weight: 500; }
.mrow.cur .m { color: var(--text); }
.ci { position: relative; height: 16px; }
.ci .tr { position: absolute; left: 0; right: 0; top: 7.5px; height: 1px; background: var(--line); }
.ci .b { position: absolute; top: 5px; height: 6px; border-radius: 3px; background: color-mix(in oklch, var(--hi) 35%, transparent); }
.ci .p { position: absolute; top: 3px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--hi); box-shadow: 0 0 0 2px var(--panel-2); }
.cov { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cov:last-child { border: 0; padding-bottom: 0; }
.cov .cl { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.cov .cl svg { width: 15px; height: 15px; color: var(--muted); }
.cov .cv { text-align: right; font-weight: 500; font-size: 13px; }
.cov .cs { grid-column: 1 / 3; display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 11px; color: var(--faint); }
.pct { position: relative; height: 4px; border-radius: 2px; background: color-mix(in oklch, var(--text) 8%, transparent); }
.pct i { position: absolute; top: -3px; width: 2px; height: 10px; border-radius: 1px; background: var(--text); margin-left: -1px; transition: left 300ms var(--ease); }
.note { font-size: 12px; color: var(--muted); margin-top: 12px; }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.statgrid .k { font-size: 12px; color: var(--muted); }
.statgrid .v { font-size: 16px; font-weight: 500; }
.ins-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ins-actions .btn { justify-content: center; height: 42px; }

/* brief */
.brief-bar { display: flex; align-items: center; gap: 8px; max-width: 860px; margin: 0 auto 14px; flex-wrap: wrap; }
.paper { max-width: 860px; margin: 0 auto; background: #fffdf9; color: #1d1a17; box-shadow: var(--ring); border-radius: 6px; padding: 56px 64px; font: 400 14.5px/1.6 'IBM Plex Sans', system-ui, sans-serif; }
.paper .num { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.paper .kick { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: #a8482f; font-weight: 600; }
.paper h2 { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; font-weight: 500; letter-spacing: -0.02em; font-size: 36px; line-height: 1.1; margin: 10px 0 8px; }
.paper .meta { color: #6f625a; font-size: 13px; padding-bottom: 18px; border-bottom: 1px solid #e6ddd2; }
.paper h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: #6f625a; margin: 26px 0 10px; font-weight: 600; }
.paper p { margin: 8px 0; }
.paper .kfacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.paper .kf { border-top: 2px solid #1d1a17; padding-top: 8px; }
.paper .kf .v { font-size: 26px; font-family: 'Fraunces', Georgia, serif; font-weight: 500; }
.paper .kf .k { font-size: 12px; color: #6f625a; }
.paper table { font-size: 13px; }
.paper th { color: #6f625a; border-bottom: 1px solid #1d1a17; padding: 7px 6px; }
.paper td { padding: 8px 6px; border-bottom: 1px solid #ece4da; }
.paper td.num { white-space: nowrap; }
.paper .fig { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.paper .fig svg { width: 100%; height: 320px; }
.paper .fig .district { stroke: #fffdf9; }
.paper .cav { font-size: 12.5px; color: #6f625a; padding-left: 16px; }
.paper .cav li { margin: 4px 0; }
.paper .foot { margin-top: 24px; padding-top: 12px; border-top: 1px solid #e6ddd2; font-size: 11.5px; color: #8b7d72; }
.paper .legend { color: #6f625a; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.prose h2 { font-size: 26px; margin-bottom: 10px; }
.prose h3 { font-size: 15px; margin: 18px 0 6px; }
.prose p, .prose li { color: var(--muted); margin: 6px 0; }
.prose ul { padding-left: 18px; }
.ch-h { margin-bottom: 12px; }
.src td { color: var(--muted); } .src td:first-child { color: var(--text); font-weight: 500; }

/* overlays */
.tip { position: fixed; pointer-events: none; z-index: 60; background: var(--ink); color: var(--ink-text); padding: 8px 10px; border-radius: 10px; font-size: 12.5px; opacity: 0; transition: opacity 120ms var(--ease); white-space: nowrap; }
.tip span { opacity: 0.7; }
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 12px; opacity: 0; background: var(--ink); color: var(--ink-text); padding: 10px 14px; border-radius: 12px; z-index: 70; display: flex; gap: 8px; align-items: center; transition: opacity 200ms var(--ease), translate 200ms var(--ease); font-weight: 500; pointer-events: none; }
.toast.show { opacity: 1; translate: -50% 0; }

@media (max-width: 1180px) {
  .grid, .low, .about { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explorer { grid-template-columns: minmax(0, 1fr); }
  .inspector { position: relative; top: 0; max-height: none; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); background: color-mix(in oklch, var(--bg) 86%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .rail .logo, .rail .grow { display: none; }
  .nav { width: 60px; height: 52px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
  .nav[aria-current="page"] { box-shadow: none; background: transparent; }
  .nav .lbl { display: block; font-size: 10.5px; font-weight: 500; }
  .nav.theme .lbl { display: none; }
  .nav[aria-current="page"]::before { left: 16px; right: 16px; top: -7px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  main { padding: 18px 16px 104px; }
  h1.serif { font-size: 30px; }
  .controls { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .sel select { width: 100%; min-width: 0; padding-right: 34px; }
  .kpi .v { font-size: 23px; }
  .card { padding: 14px; border-radius: 18px; }
  .card .ch { gap: 8px; }
  .tabs { width: 100%; } .tab { flex: 1; text-align: center; padding: 7px 4px; font-size: 12px; }
  .mapbox { height: 62vh; }
  .mapcard.big .mapbox { height: 58vh; min-height: 340px; }
  .fr, .axis { grid-template-columns: 98px minmax(0, 1fr) 46px; gap: 8px; }
  .fr .v .ci-s { display: none; }
  .paper { padding: 26px 20px; }
  .paper h2 { font-size: 28px; }
  .paper .fig, .paper .kfacts { grid-template-columns: 1fr; }
  .brief-bar .btn span { display: none; }
  .legend .bar, .legend .tk { width: 180px; }
}
@media (max-width: 520px) { .controls { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .seg.outcome { grid-column: 1 / -1; } .seg.outcome button { flex: 1; justify-content: center; padding: 0 6px; } }
@media print {
  .rail, .head, .brief-bar, .tip, .toast { display: none !important; }
  .view:not(#v-brief) { display: none !important; }
  body, main { background: #fff; padding: 0; }
  .app { display: block; }
  .paper { box-shadow: none; padding: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; } }
