/* The Mortal Ledger — institutional research-index UI.
   Warm white, ink, desaturated navy, one signal red. Prestige serif for names,
   grotesk for UI, mono for data labels. Large margins, strong grid, hairlines.
   The satire is in the rigor: catastrophe rendered with the calm of a financial portal. */

:root {
  --paper: #fbfaf7;
  --panel: #ffffff;
  --panel-2: #f4f2ec;
  --ink: #1b1a16;
  --slate: #55534b;   /* 7.4:1 on paper */
  --muted: #837f74;   /* 4.7:1 */
  --line: #e7e3d9;
  --line-2: #d5cfc1;
  --navy: #2a3a55;    /* 8.9:1 */
  --navy-weak: #eef0f4;
  --red: #b0392c;     /* 5.3:1 */
  --red-weak: #f6eae7;
  --green: #4f6f5c;   /* 5.4:1 */

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;
  --radius: 3px; --radius-lg: 6px;
  --shadow: 0 8px 40px rgba(30, 28, 22, 0.10);
  --ease: cubic-bezier(0.2, 0, 0, 1); --fast: 140ms; --med: 260ms; --slow: 700ms;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, figure, dl, dd, ol, ul, fieldset { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:where(a, button, input, select, [tabindex]):focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 2px; }

.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--s4); }
.mono { font-family: var(--mono); }
.tnum { font-variant-numeric: tabular-nums; }
.label { font: 500 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.skip-link { position: absolute; left: var(--s2); top: -48px; z-index: 100; background: var(--panel); padding: var(--s1) var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius); transition: top var(--fast) var(--ease); }
.skip-link:focus { top: var(--s2); }

/* ── Masthead ─────────────────────────────────────── */
.masthead { border-bottom: 1px solid var(--line-2); background: var(--paper); position: sticky; top: 0; z-index: 30; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); height: 68px; }
.brand { display: flex; align-items: center; gap: var(--s2); color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border: 1.5px solid var(--navy); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: var(--navy); }
.brand-text { display: grid; }
.brand-name { font: 600 17px/1.1 var(--serif); letter-spacing: -0.01em; }
.brand-dek { font: 400 10.5px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.masthead-nav { display: flex; align-items: center; gap: var(--s3); }
.nav-link { font-size: 13.5px; font-weight: 500; color: var(--slate); background: none; border: 0; cursor: pointer; padding: 0; }
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-compare { display: inline-flex; align-items: center; gap: 6px; }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; background: var(--navy); color: #fff; border-radius: 9px; font: 500 11px/1 var(--mono); }

/* ── Shared: buttons, chips, tags ─────────────────── */
.btn { display: inline-flex; align-items: center; gap: var(--s1); height: 38px; padding: 0 var(--s2); background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line-2); }
.btn-ghost { background: transparent; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: #22314a; border-color: #22314a; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.chip { height: 30px; padding: 0 12px; background: var(--panel); color: var(--slate); border: 1px solid var(--line-2); border-radius: 999px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease), background var(--fast) var(--ease); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--navy); background: var(--navy-weak); color: var(--navy); }
.tag { font: 500 11px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate); }
.tag--contested { color: var(--red); }

/* ── Index view ───────────────────────────────────── */
.dek { padding: var(--s6) 0 var(--s4); border-bottom: 1px solid var(--line); }
.dek h1 { font: 500 clamp(30px, 4.4vw, 50px)/1.06 var(--serif); letter-spacing: -0.02em; max-width: 20ch; }
.dek p { margin-top: var(--s2); max-width: 64ch; font-size: 17px; color: var(--slate); }

.dataset-kpis { display: grid; grid-template-columns: repeat(12, 1fr); border-block: 1px solid var(--line); }
.dataset-kpis > div { grid-column: span 3; display: grid; align-content: start; gap: 14px; padding: var(--s4) var(--s4) var(--s4) 0; border-right: 1px solid var(--line); }
.dataset-kpis > div:last-child { border-right: 0; }
.dataset-kpis dt { margin: 0; }
.dk-val { font: 500 30px/1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.dk-of { font: 400 18px/1 var(--serif); color: var(--muted); margin-left: 8px; }
.dk-sub { font: 400 12px/1.4 var(--mono); color: var(--muted); }

/* Featured collections */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); padding: var(--s4) 0 var(--s2); }
.section-head h2 { font: 500 13px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.collections { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.collection { display: grid; align-content: start; gap: 6px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3); cursor: pointer; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.collection:hover { border-color: var(--navy); }
.collection[aria-pressed="true"] { border-color: var(--navy); background: var(--navy-weak); }
.collection-n { font: 500 20px/1 var(--serif); font-variant-numeric: tabular-nums; }
.collection-label { font-size: 13px; color: var(--slate); line-height: 1.3; }

/* Controls */
.controls { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: var(--s4) 0 var(--s2); }
.search { position: relative; flex: 1 1 280px; min-width: 220px; }
.search input { width: 100%; height: 38px; padding: 0 var(--s2) 0 36px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 14px; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-weak); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.select-wrap { position: relative; }
.select-wrap select { height: 38px; padding: 0 34px 0 12px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 13.5px; color: var(--ink); appearance: none; cursor: pointer; }
.select-wrap::after { content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 11px; }
.select-wrap select:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-weak); }

.filter-bar { display: grid; gap: var(--s2); padding: var(--s2) 0 var(--s3); border-bottom: 1px solid var(--line); }
.filter-row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.filter-row .label { flex: none; width: 92px; }
.filter-foot { display: flex; justify-content: flex-end; padding-top: var(--s1); }

.result-meta { padding: var(--s3) 0 var(--s1); }

/* Subject index table */
.subject-table { width: 100%; border-collapse: collapse; }
.subject-table thead th { text-align: left; padding: var(--s1) var(--s2); font: 500 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.subject-table th.num, .subject-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.subject-table tbody tr { border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--fast) var(--ease); }
.subject-table tbody tr:hover { background: var(--panel-2); }
.subject-table td { padding: var(--s2); vertical-align: middle; }
.st-rank { font: 500 13px/1 var(--mono); color: var(--muted); width: 40px; }
.st-subject { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.st-portrait { display: block; width: 38px; height: 46px; flex: none; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; position: relative; }
.st-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--med) var(--ease); filter: grayscale(1) contrast(1.02); }
.st-portrait.has-img img { opacity: 1; }
.st-mono { display: grid; place-items: center; height: 100%; font: 500 12px/1 var(--mono); color: var(--muted); }
.st-silhouette { width: 20px; height: 20px; fill: var(--muted); }
.st-name { font: 500 18px/1.15 var(--serif); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-title { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-deaths { font: 500 16px/1 var(--sans); font-variant-numeric: tabular-nums; }
.st-range { font: 400 11px/1 var(--mono); color: var(--muted); margin-top: 4px; }
.st-bar { height: 3px; background: var(--line); margin-top: 6px; width: 120px; margin-left: auto; }
.st-bar > i { display: block; height: 100%; background: var(--red); }
.st-acct { font-size: 13px; color: var(--slate); }
.st-acct.zero { color: var(--red); font-weight: 500; }
.st-add { color: var(--muted); border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; }
.st-add svg { width: 12px; height: 12px; display: block; }
.st-add:hover { border-color: var(--navy); color: var(--navy); }
.st-add[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ── Profile view ─────────────────────────────────── */
.crumb { padding: var(--s4) 0 0; font: 500 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--ink); }

.profile-head { display: grid; grid-template-columns: 200px 1fr; gap: var(--s5); padding: var(--s4) 0 var(--s5); border-bottom: 1px solid var(--line); align-items: start; }
.profile-portrait { display: block; width: 200px; height: 250px; background: var(--panel-2); border: 1px solid var(--line-2); overflow: hidden; position: relative; }
.profile-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--med) var(--ease); filter: grayscale(1) contrast(1.03); }
.profile-portrait.has-img img { opacity: 1; }
.profile-portrait .st-mono { font-size: 20px; }
.profile-portrait .st-silhouette { width: 46px; height: 46px; }
.profile-cap { margin-top: 8px; font: 400 11px/1.4 var(--mono); color: var(--muted); }
.profile-id .eyebrow { font: 500 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.profile-name { margin-top: var(--s2); font: 500 clamp(34px, 5vw, 56px)/1.02 var(--serif); letter-spacing: -0.02em; }
.profile-title { margin-top: var(--s1); font-size: 17px; color: var(--slate); }
.profile-facts { margin-top: var(--s3); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.profile-facts > div { display: grid; gap: 4px; }
.profile-facts dd { font-size: 14px; }
.profile-summary { margin-top: var(--s3); max-width: 70ch; font: 400 16px/1.65 var(--serif); color: var(--ink); }

/* KPI modules */
.kpis { display: grid; grid-template-columns: repeat(12, 1fr); border-block: 1px solid var(--line); }
.kpi { grid-column: span 3; display: grid; align-content: start; gap: 14px; padding: var(--s4) var(--s4) var(--s4) 0; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; padding-right: 0; }
.kpi dt { margin: 0; }
.kpi-value { font: 500 30px/1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi-value.red { color: var(--red); }
.kpi-sub { font: 400 12px/1.4 var(--mono); color: var(--muted); }

.panel { border-bottom: 1px solid var(--line); padding: var(--s5) 0; }
.panel-title { font: 500 13px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s3); }
.panel-note { margin-top: var(--s2); font: 400 12px/1.5 var(--mono); color: var(--muted); }

/* Legacy chart */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .band { fill: var(--red-weak); }
.chart .hilo { fill: none; stroke: var(--red); stroke-width: 1; opacity: 0.28; }
.chart .line { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: var(--len, 1800); }
.chart .peak-band { fill: rgba(176, 57, 44, 0.05); }
.chart text { font: 400 10px/1 var(--mono); fill: var(--muted); }
.chart .ev-stem { stroke: var(--red); stroke-width: 1; opacity: 0.3; }
.chart .ev-dot { fill: var(--paper); stroke: var(--red); stroke-width: 1.5; }
.chart .ev-num { font: 600 9px/1 var(--sans); fill: var(--red); }
.chart .peak-label { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--muted); }
.chart .rl-edge { fill: var(--muted); }
.chart .rl-mid { fill: var(--red); font-weight: 500; }
.chart .rl-dot { fill: var(--red); }
.chart .rl-dot.edge { fill: var(--red); opacity: 0.4; }
/* Draws on scroll into view (armed by JS; reduced-motion shows it fully drawn) */
.chart--armed .line { stroke-dashoffset: var(--len, 1800); }
.chart--armed .band, .chart--armed .hilo, .chart--armed .events, .chart--armed .endlabels { opacity: 0; }
.chart--armed.in-view .line { animation: draw var(--slow) var(--ease) forwards; }
.chart--armed.in-view .band { animation: fade var(--slow) var(--ease) 0.1s forwards; }
.chart--armed.in-view .hilo { animation: fadeHilo var(--slow) var(--ease) 0.2s forwards; }
.chart--armed.in-view .events { animation: fade var(--med) var(--ease) 0.6s forwards; }
.chart--armed.in-view .endlabels { animation: fade var(--med) var(--ease) 0.75s forwards; }
@keyframes draw { from { stroke-dashoffset: var(--len, 1800); } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeHilo { from { opacity: 0; } to { opacity: 0.28; } }

/* Key moments key */
.moments { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s3); }
.moments li { display: flex; align-items: baseline; gap: var(--s1); font-size: 13px; color: var(--slate); }
.moment-n { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--red); color: var(--red); border-radius: 50%; font: 600 10px/1 var(--sans); flex: none; align-self: center; }
.moment-yr { font: 500 12px/1 var(--mono); color: var(--ink); }

/* Decision → consequence timeline */
.timeline { list-style: none; position: relative; display: grid; gap: var(--s4); max-width: 760px; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 16px; bottom: 16px; width: 1px; background: var(--line-2); }
.tl-item { display: grid; grid-template-columns: 26px 1fr; gap: var(--s3); align-items: start; }
.tl-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--red); color: var(--red); border-radius: 50%; font: 600 12px/1 var(--sans); background: var(--paper); position: relative; z-index: 1; }
.tl-content { display: grid; gap: 5px; padding-top: 2px; }
.tl-year { font: 500 14px/1 var(--mono); color: var(--muted); }
.tl-line { display: grid; grid-template-columns: 92px 1fr; gap: var(--s2); align-items: baseline; font-size: 15px; line-height: 1.5; color: var(--ink); }
.tl-tag { font: 500 10px/1.5 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.tag-decision { color: var(--slate); }
.tag-cat { color: var(--red); }
.tl-toll { display: grid; grid-template-columns: 92px 1fr; column-gap: var(--s2); align-items: baseline; margin-top: 1px; }
.tl-toll-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s2); }
.tag-toll { color: var(--red); }
.tag-proj { color: var(--muted); }
.tl-toll-val { font: 500 15px/1 var(--mono); color: var(--red); }
.tl-toll-val.proj { color: var(--muted); }
.tl-note { font-size: 13px; color: var(--muted); }
.tl-toll-empty { display: block; padding-left: calc(92px + var(--s2)); font-size: 13px; color: var(--muted); }

/* Competing scholarly estimates */
.estimates .label { display: block; margin-bottom: 12px; }
.est-list { list-style: none; display: grid; gap: var(--s3); }
.est-list li { display: grid; gap: 3px; align-content: start; }
.est-who { font-size: 13px; line-height: 1.35; color: var(--slate); }
.est-val { font: 500 16px/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }

/* Featured collection spotlight */
.spotlight { display: grid; grid-template-columns: 3fr 2fr; gap: var(--s6); align-items: start; padding: var(--s5) 0; border-bottom: 1px solid var(--line); }
.spot-eyebrow { color: var(--red); margin-bottom: var(--s2); }
.spot-side-label { margin-bottom: var(--s1); }
.spot-title { font: 500 clamp(26px, 3.4vw, 38px)/1.05 var(--serif); letter-spacing: -0.02em; }
.spot-desc { margin: var(--s2) 0 var(--s3); max-width: 48ch; font: 400 17px/1.6 var(--serif); color: var(--slate); }
.spot-list { list-style: none; display: grid; }
.spot-list li { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s2); align-items: baseline; padding: var(--s2) 0; border-top: 1px solid var(--line); cursor: pointer; }
.spot-list li:hover .spot-name { text-decoration: underline; text-underline-offset: 2px; }
.spot-rank { font: 500 12px/1 var(--mono); color: var(--muted); }
.spot-name { font: 500 18px/1.1 var(--serif); }
.spot-num { font: 500 15px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--red); }

/* Regional exposure map */
.map-wrap { max-width: none; }
.worldmap { width: 100%; height: auto; display: block; }
.worldmap .m-bg { fill: var(--line-2); }
.worldmap .m-hl { fill: var(--red); }
.worldmap.armed circle { opacity: 0; }
.worldmap.armed.in circle { animation: mapdot 0.5s var(--ease) forwards; animation-delay: calc(var(--i) * 5ms); }
@keyframes mapdot { from { opacity: 0; } to { opacity: 1; } }
.map-legend { margin-top: var(--s3); display: grid; gap: var(--s1); }
.map-primary { font-size: 14px; color: var(--slate); display: flex; align-items: center; gap: var(--s1); }
.map-primary strong { color: var(--ink); font-weight: 600; }
.map-key { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; }
.map-secondary { font-size: 13px; color: var(--muted); padding-left: 18px; }
.map-scale { display: flex; align-items: center; gap: var(--s1); padding-left: 18px; margin-top: 2px; }
.map-scale .label { margin-right: 4px; }
.scale-grad { width: 84px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(176, 57, 44, 0.32), rgba(176, 57, 44, 1)); }
.scale-ends { font: 400 11px/1 var(--mono); color: var(--muted); }

/* Accountability + peer comparison */
.ratio { display: grid; grid-template-columns: auto minmax(300px, 1fr) minmax(320px, 1.25fr); gap: var(--s5); align-items: start; }
.ratio-figure { display: grid; gap: 2px; justify-items: start; }
.ratio-num { font: 500 52px/0.9 var(--serif); letter-spacing: -0.02em; }
.ratio-num.inf { color: var(--red); }
.ratio-cap { font: 400 11px/1.3 var(--mono); color: var(--muted); }
.ratio-body { display: grid; gap: 8px; align-content: start; }
.ratio-eq { font-size: 15px; color: var(--ink); }
.ratio-eq .tnum { font-weight: 600; }
.ratio-op { color: var(--muted); margin: 0 3px; }
.ratio-desc { font-size: 14px; color: var(--slate); }
.impunity { align-self: start; }
.imp-track { position: relative; padding-bottom: 22px; }
.imp-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.imp-seg { height: 100%; }
.imp-faced { background: #c4bfb4; }
.imp-none { background: rgba(176, 57, 44, 0.52); }
.imp-here { position: absolute; top: 15px; transform: translateX(-50%); font: 500 11px/1 var(--mono); color: var(--red); white-space: nowrap; }
.imp-here::before { content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 5px solid var(--red); }
.imp-legend { display: flex; justify-content: space-between; gap: var(--s2); font: 400 12px/1.4 var(--mono); color: var(--muted); }
.imp-legend b { color: var(--ink); font-weight: 600; }
/* Position-by-toll rug plot */
.tollstrip-wrap { margin-bottom: var(--s4); }
.tollstrip-wrap .label { display: block; margin-bottom: 10px; }
.ts-note { text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.tollstrip { width: 100%; height: auto; display: block; }
.tollstrip .ts-axis { stroke: var(--line); stroke-width: 1; }
.tollstrip .ts-tick { stroke: #c4bfb4; stroke-width: 1.4; }
.tollstrip .ts-ref { stroke: var(--line-2); stroke-width: 1; }
.tollstrip .ts-me { stroke: var(--red); stroke-width: 2.4; }
.tollstrip .ts-me-dot { fill: var(--red); }
.tollstrip .ts-lbl { font: 400 10px/1 var(--mono); fill: var(--muted); }
.ts-cap { display: flex; align-items: center; gap: var(--s1); margin-top: 8px; font-size: 13px; color: var(--slate); }
.ts-here-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }

.peers { list-style: none; display: grid; gap: 2px; }
.peers li { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); align-items: baseline; padding: var(--s2) 0; border-top: 1px solid var(--line); font-size: 14px; }
.peers li:first-child { border-top: 0; }
.peers .peer-val { font: 500 14px/1 var(--mono); color: var(--ink); text-align: right; }
.peers .peer-val.red { color: var(--red); }
.peer-link, .stat-link { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-2); transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.peer-link:hover, .stat-link:hover { color: var(--red); border-bottom-color: var(--red); }

.assess { display: grid; grid-template-columns: 3fr 2fr; gap: var(--s5) var(--s6); align-items: start; }
.assess-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s5); align-content: start; }
.assess-side { display: grid; gap: var(--s4); align-content: start; }
.stat dt { margin-bottom: 6px; }
.stat dd { font-size: 15px; }
.reasoning { max-width: 74ch; font: 400 16px/1.7 var(--serif); color: var(--ink); }
.sources { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: baseline; }
.sources a { font: 400 13px/1.4 var(--mono); }

.export-bar { display: flex; flex-wrap: wrap; gap: var(--s1); padding: var(--s4) 0 0; }

/* ── Compare view ─────────────────────────────────── */
.compare-head { padding: var(--s4) 0 var(--s3); }
.compare-head h1 { font: 500 32px/1.05 var(--serif); letter-spacing: -0.02em; }
.compare-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.compare-table th, .compare-table td { border: 1px solid var(--line); padding: var(--s2); vertical-align: top; text-align: left; }
.compare-table thead th { background: var(--panel); vertical-align: bottom; }
.compare-metric { width: 180px; background: var(--panel-2); font: 500 11px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); vertical-align: middle; }
.cmp-portrait { display: block; width: 60px; height: 74px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; position: relative; margin-bottom: var(--s1); }
.cmp-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.cmp-name { font: 500 19px/1.1 var(--serif); letter-spacing: -0.01em; }
.cmp-title { font-size: 12px; color: var(--muted); margin-top: 4px; }
.cmp-remove { margin-top: var(--s1); font: 500 11px/1 var(--mono); color: var(--muted); background: none; border: 0; cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em; }
.cmp-remove:hover { color: var(--red); }
.cmp-big { font: 500 22px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--red); }
.cmp-empty-col { color: var(--muted); font-size: 13px; }

/* ── Modal ────────────────────────────────────────── */
.modal { padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-lg); max-width: 620px; width: 92vw; box-shadow: var(--shadow); color: var(--ink); background: var(--panel); }
.modal::backdrop { background: rgba(27, 26, 22, 0.4); }
.modal-inner { display: grid; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s3); border-bottom: 1px solid var(--line); }
.modal-title { font: 500 20px/1 var(--serif); }
.icon-close { background: none; border: 0; font-size: 15px; color: var(--muted); cursor: pointer; }
.icon-close:hover { color: var(--ink); }
.modal-body { padding: var(--s3); max-height: 60vh; overflow-y: auto; }
.prose h3 { font: 500 13px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy); margin: var(--s3) 0 var(--s1); }
.prose h3:first-child { margin-top: 0; }
.prose p { font-size: 14px; color: var(--slate); margin-bottom: var(--s1); }
.prose strong { color: var(--ink); font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s1); padding: var(--s3); border-top: 1px solid var(--line); }

/* ── States ───────────────────────────────────────── */
.state-panel { text-align: center; padding: var(--s6) var(--s3); display: grid; justify-items: center; gap: var(--s1); }
.state-panel h2 { font: 500 20px/1 var(--serif); }
.state-panel p { font-size: 14px; color: var(--slate); }
.skeleton { opacity: 0.6; }
.sk { background: var(--panel-2); border-radius: 2px; }
@media (prefers-reduced-motion: no-preference) { .sk { animation: pulse 1.4s var(--ease) infinite; } }
@keyframes pulse { 50% { opacity: 0.5; } }

/* ── Toasts ───────────────────────────────────────── */
.toasts { position: fixed; bottom: var(--s3); left: 50%; transform: translateX(-50%); display: grid; gap: var(--s1); z-index: 60; }
.toast { display: flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s2); background: var(--ink); color: var(--paper); border-radius: var(--radius); font-size: 13.5px; box-shadow: var(--shadow); animation: toast-in var(--med) var(--ease); }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; }
.toast[data-kind="success"] .toast-dot { background: #7fce9e; }
.toast[data-kind="error"] .toast-dot { background: #e88; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ── Colophon ─────────────────────────────────────── */
.colophon { border-top: 1px solid var(--line-2); margin-top: var(--s6); }
.colophon-inner { padding: var(--s5) 0 var(--s6); display: grid; gap: var(--s2); }
.colophon-note { max-width: 74ch; font: 400 14px/1.7 var(--serif); color: var(--slate); }
.colophon-meta { font: 400 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* View transition */
@media (prefers-reduced-motion: no-preference) { .view { animation: viewin var(--med) var(--ease); } }
@keyframes viewin { from { opacity: 0; transform: translateY(4px); } }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .collections { grid-template-columns: repeat(2, 1fr); }
  .dataset-kpis > div { grid-column: span 6; }
  .kpi { grid-column: span 6; }
  .profile-head { grid-template-columns: 140px 1fr; gap: var(--s3); }
  .profile-portrait { width: 140px; height: 176px; }
  .ratio { grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); }
  .impunity { grid-column: 1 / -1; margin-top: var(--s2); max-width: 520px; }
}
@media (max-width: 680px) {
  .container { padding-inline: var(--s3); }
  .masthead-inner { height: 60px; }
  .brand-dek { display: none; }
  .spotlight { grid-template-columns: 1fr; gap: var(--s3); }
  .dataset-kpis > div, .kpi { grid-column: span 12; border-right: 0; border-bottom: 1px solid var(--line); }
  .assess { grid-template-columns: 1fr; gap: var(--s4); }
  .assess-facts { grid-template-columns: 1fr 1fr; }
  .tl-line { grid-template-columns: 1fr; gap: 2px; }
  .subject-table thead { display: none; }
  .subject-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "rank subject deaths" "rank mech acct"; column-gap: var(--s2); row-gap: 8px; align-items: start; padding: var(--s3) 0; }
  .subject-table td { padding: 0; border: 0; }
  .st-rank { grid-area: rank; padding-top: 3px; }
  .subject-table td:nth-child(2) { grid-area: subject; min-width: 0; }
  .subject-table td:nth-child(3) { grid-area: deaths; text-align: right; }
  .subject-table td:nth-child(4) { grid-area: mech; align-self: center; }
  .subject-table td:nth-child(5) { grid-area: acct; text-align: right; align-self: center; }
  .subject-table td:nth-child(6) { display: none; }
  .st-bar { display: none; }
  .st-name, .st-title { white-space: normal; }
  .compare-metric { width: 110px; }
  .collections { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
