:root {
  --night: #07080c;
  --panel: #121521;
  --panel-2: #161a26;
  --line: #2a3040;
  --ink: #eef0f5;
  --ink-2: #c9cdd8;
  --ink-3: #8b91a1;
  --violet: #a78bfa;
  --apc: #d97706;
  --pdp: #0891b2;
  --lp: #db2777;
  --nnpp: #8b5cf6;
  --ticket: #94a3b8;
  --heading: "Space Grotesk", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--night); color: var(--ink-2); font: 400 1.05rem/1.65 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--heading); color: var(--ink); line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0.2rem 0 1rem; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 0 0 0.8rem; }
b { color: var(--ink); font-weight: 600; }
a { color: var(--violet); }
.hero, .block { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.hero { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; position: relative; }
.eyebrow { font: 500 0.78rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--violet); margin: 0; }
.lede { font-size: 1.2rem; color: var(--ink); max-width: 38rem; }
.scroll-cue { position: absolute; bottom: 1.5rem; font: 500 0.72rem var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.scroll-cue::after { content: " \2193"; }
.block { padding-top: 3.5rem; padding-bottom: 3.5rem; border-top: 1px solid var(--line); }
.note, .hint { font-size: 0.88rem; color: var(--ink-3); }

/* the rule: 36 squares */
.rule-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; max-width: 420px; margin-top: 1.4rem; }
.rule-grid span { aspect-ratio: 1; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); transition: background 0.4s, border-color 0.4s; }
.rule-grid.on span.need { background: var(--violet); border-color: var(--violet); }

/* bars */
.bar-year { font: 600 0.95rem var(--heading); color: var(--ink); margin: 1.1rem 0 0.4rem; }
.bar-row { display: grid; grid-template-columns: 12rem 1fr 3rem; align-items: center; gap: 0.6rem; margin: 0.25rem 0; font-size: 0.92rem; }
.bar-track { position: relative; display: block; height: 16px; }
.bar-fill { display: block; height: 100%; border-radius: 3px; width: 0; transition: width 0.9s cubic-bezier(.2,.7,.2,1); }
.bar-line { position: absolute; top: -6px; bottom: -6px; border-left: 1.5px dashed var(--ink); }
.bar-n { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar-axis { display: grid; grid-template-columns: 12rem 1fr 3rem; gap: 0.6rem; font-size: 0.78rem; color: var(--ink-3); margin-top: 0.4rem; }
.bar-axis .ticks { position: relative; height: 1.2em; }
.bar-axis .ticks > span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.bar-axis .ticks > span:first-child { transform: none; }
.bar-axis .ticks > span:last-child { transform: translateX(-100%); }
.met { color: var(--ink-3); font-size: 0.8rem; margin-left: 0.4rem; }

/* maps */
.map-controls { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0.6rem; }
.chip { font: 500 0.85rem var(--body); color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.8rem; cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--ink); border-color: var(--violet); background: rgb(139 92 246 / 0.2); }
.map-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0.6rem; }
.map { width: 100%; height: auto; display: block; }
.map path { stroke: var(--night); stroke-width: 0.8; transition: fill 0.45s, fill-opacity 0.45s; cursor: pointer; }
.map path.fct { stroke: var(--ink); stroke-width: 1.4; }
.map path:hover { stroke: var(--ink); stroke-width: 1.6; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.84rem; color: var(--ink-3); margin-top: 0.6rem; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 0.35rem; vertical-align: -1px; }

/* simulator */
.sim { max-width: 1080px; }
.sim > h2, .sim > p { max-width: 720px; }
.sim-grid { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: 1.4rem; margin-top: 1.2rem; align-items: start; }
.sim-controls { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; position: sticky; top: 1rem; }
.field { border: 0; padding: 0; margin: 0 0 1rem; display: block; }
.field > span, .field legend, .row span, .slider span { display: block; font: 500 0.7rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.35rem; }
.slider span b { font-family: var(--body); letter-spacing: 0; }
select { width: 100%; font: 500 0.95rem var(--body); color: var(--ink); background: var(--panel-2); border: 1px solid rgb(167 139 250 / 0.45); border-radius: 8px; padding: 0.45rem 0.6rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0.7rem; }
input[type="range"] { width: 100%; accent-color: var(--violet); }
.checks label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; color: var(--ink-2); margin: 0.2rem 0; cursor: pointer; }
.checks input { accent-color: var(--violet); }
.button { font: 500 0.9rem var(--body); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 1rem; cursor: pointer; }
.button:hover { border-color: var(--violet); }
.verdict { font: 500 1.1rem/1.45 var(--heading); color: var(--ink); background: var(--panel); border-left: 3px solid var(--violet); border-radius: 8px; padding: 0.8rem 1rem; margin: 0 0 1rem; }
.verdict.no { border-left-color: var(--lp); }
#sim-bars { margin-bottom: 1rem; }
#sim-bars .bar-row { grid-template-columns: 11rem 1fr 6.5rem; }
#sim-bars .bar-axis { grid-template-columns: 11rem 1fr 6.5rem; }

.method p, .cta p { font-size: 0.95rem; }
.cta { border-top-color: var(--violet); }

.tooltip { position: fixed; z-index: 10; pointer-events: none; background: rgb(18 21 33 / 0.96); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.75rem; font-size: 0.84rem; color: var(--ink-2); min-width: 12rem; box-shadow: 0 10px 28px rgb(0 0 0 / 0.5); }
.tooltip b { display: block; font: 600 0.95rem var(--heading); color: var(--ink); margin-bottom: 0.25rem; }
.tooltip div { display: flex; justify-content: space-between; gap: 1rem; }
.tooltip i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 0.35rem; }

@media (max-width: 760px) {
  .sim-grid { grid-template-columns: 1fr; }
  .sim-controls { position: static; }
  .bar-row, .bar-axis, #sim-bars .bar-row, #sim-bars .bar-axis { grid-template-columns: 7.5rem 1fr 4.5rem; font-size: 0.84rem; }
}

/* portraits and party badges */
.who { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.who .nm { overflow: hidden; text-overflow: ellipsis; }
.avs { display: inline-flex; flex: none; }
.av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--line); background: var(--panel-2); }
.avs .av + .av { margin-left: -10px; }
.badge { flex: none; font: 600 0.66rem var(--mono); letter-spacing: 0.04em; color: var(--ink); background: color-mix(in srgb, var(--c) 30%, transparent); border: 1px solid var(--c); border-radius: 4px; padding: 0.05rem 0.3rem; }
.badge + .badge { margin-left: -0.2rem; }
.chip .avs { margin-right: 0.35rem; vertical-align: middle; }
.chip .av { width: 22px; height: 22px; }
.checks .av { width: 24px; height: 24px; }
.bar-row { grid-template-columns: 15rem 1fr 3rem; }
.bar-axis { grid-template-columns: 15rem 1fr 3rem; }
#sim-bars .bar-row, #sim-bars .bar-axis { grid-template-columns: 15rem 1fr 6.5rem; }
@media (max-width: 760px) {
  .bar-row, .bar-axis, #sim-bars .bar-row, #sim-bars .bar-axis { grid-template-columns: 9.5rem 1fr 4.5rem; }
  .who .nm { font-size: 0.82rem; }
}

/* restored: series line, key findings, strip chart */
.series { color: var(--ink-3); font-size: 0.95rem; font-style: italic; margin: 0.3rem 0 0; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.key-findings { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--violet); border-radius: 12px; padding: 0.4rem 1.1rem; margin: 1.4rem 0 3.5rem; max-width: 40rem; }
.kf-title { font: 500 0.72rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--violet); margin: 0.6rem 0 0; }
.key-findings ul { margin: 0.4rem 0 0.8rem; padding-left: 1.1rem; }
.key-findings li { margin: 0.35rem 0; }
.hero { min-height: auto; padding-top: 4rem; padding-bottom: 4rem; }
.strip-svg { width: 100%; height: auto; display: block; }
.strip-svg circle { fill-opacity: 0.88; stroke: var(--night); stroke-width: 1; cursor: pointer; }
.strip-svg circle:hover { stroke: var(--ink); stroke-width: 1.6; }
.strip-line { stroke: var(--ink); stroke-width: 1.3; stroke-dasharray: 4 3; }
.strip-axis { stroke: var(--line); }
.strip-name { fill: var(--ink); font: 600 14px var(--body); }
.strip-sub, .strip-tick { fill: var(--ink-3); font: 12px var(--body); }
.strip-label { fill: var(--ink); font: 12px var(--body); }

/* ---- motion ---- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero > * { animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.hero > :nth-child(2) { animation-delay: 0.08s; }
.hero > :nth-child(3) { animation-delay: 0.16s; }
.hero > :nth-child(4) { animation-delay: 0.26s; }
.hero > :nth-child(5) { animation-delay: 0.4s; }
.hero > :nth-child(6) { animation-delay: 0.6s; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.rule-grid span { transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease; }
.rule-grid.on span.need { transform: scale(1.06); }
.map path { transition: fill 0.5s ease, fill-opacity 0.5s ease, opacity 0.6s ease, transform 0.6s ease; transform-box: fill-box; transform-origin: center; }
.map.pending path { opacity: 0; transform: scale(0.92); }
.strip-svg circle { transition: transform 0.9s cubic-bezier(.2,.7,.2,1), opacity 0.5s ease; }
.strip.pending circle { transform: translateX(var(--from)); opacity: 0; }
.bar-fill { transition: width 0.8s cubic-bezier(.2,.7,.2,1); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgb(167 139 250 / 0.55); } 100% { box-shadow: 0 0 0 14px rgb(167 139 250 / 0); } }
.verdict.flash { animation: flash 0.9s ease-out; }
.n-states, .n-share { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- screens: phone, small and large ---- */
.short { display: none; }
@media (max-width: 760px) {
  .who .full { display: none; }
  .who .short { display: inline; }
  .bar-axis .ticks .t12 { display: none; }
  .bar-axis .full { display: none; }
  .bar-row, .bar-axis { grid-template-columns: 9.6rem 1fr 2rem; }
  #sim-bars .bar-row, #sim-bars .bar-axis { grid-template-columns: 9.6rem 1fr 5.2rem; }
  .who { gap: 0.35rem; }
  .who .av { width: 26px; height: 26px; }
  .bar-n { text-align: right; }
}
/* the simulator's verdict stays in sight while the controls are used */
.sim-sticky { position: sticky; top: 0; z-index: 6; padding: 0.5rem 0; background: linear-gradient(var(--night) 80%, transparent); margin-top: 0.6rem; }
.sim-sticky .verdict { margin: 0; box-shadow: 0 8px 22px rgb(0 0 0 / 0.45); }
@media (max-width: 760px) { .sim-sticky .verdict { font-size: 0.98rem; padding: 0.65rem 0.85rem; } }
.sim-controls { top: 5.5rem; }
/* larger tap targets */
.checks label { min-height: 42px; }
.checks input { width: 20px; height: 20px; flex: none; }
input[type="range"] { height: 34px; }
.chip { min-height: 38px; }
.button { min-height: 42px; }
/* figures use more of a wide screen */
@media (min-width: 1100px) {
  .wide { width: min(1080px, calc(100vw - 48px)); position: relative; left: 50%; transform: translateX(-50%); }
  .map-wrap.wide .map { max-height: 78vh; margin: 0 auto; width: auto; max-width: 100%; }
  .bars-history.wide { padding: 0 2rem; }
}
@media (min-width: 1600px) {
  html { font-size: 17.5px; }
  .sim { max-width: 1240px; }
}

/* chart labels keep a dark halo where a line passes behind them */
.strip-name, .strip-sub, .strip-label { paint-order: stroke; stroke: var(--night); stroke-width: 4px; stroke-linejoin: round; }

/* ---- the story: cards scroll past one pinned map ---- */
.scrolly { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 0 3.5rem; max-width: 1240px; margin: 0 auto; padding: 0 24px; border-top: 1px solid var(--line); }
.stage { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 1.5rem 0; }
.steps { grid-column: 1; grid-row: 1; padding: 30vh 0 40vh; }
.step { min-height: 78vh; display: flex; align-items: center; }
.step .card { background: rgb(18 21 33 / 0.92); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.25rem; opacity: 0.38; transition: opacity 0.45s ease, border-color 0.45s ease; }
.step.active .card { opacity: 1; border-color: rgb(167 139 250 / 0.55); }
.step .card h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); }
.step .card h3 { font: 600 1.05rem var(--heading); color: var(--ink); margin: 0 0 0.6rem; }
.step .card p:last-child { margin-bottom: 0; }
.stage-head { display: flex; align-items: baseline; gap: 0.8rem; min-height: 4.6rem; }
.stage-count { font: 700 clamp(2.8rem, 6vw, 4.4rem)/1 var(--heading); color: var(--ink); margin: 0; font-variant-numeric: tabular-nums; min-width: 2ch; }
.stage-label { margin: 0; color: var(--ink-2); font-size: 0.98rem; max-width: 30rem; }
.stage-map { width: 100%; max-height: 74vh; }
.stage-legend { min-height: 1.6rem; }
.map path.dim { fill: var(--panel-2) !important; fill-opacity: 1 !important; }
.map path.mark { stroke: var(--ink); stroke-width: 2.6; }
.card .bars-history .bar-row, .card .bars-history .bar-axis { grid-template-columns: 9.6rem 1fr 1.6rem; }
.card .who .av { width: 24px; height: 24px; }
.card .badge { font-size: 0.6rem; padding: 0 0.25rem; }
.card .who .full { display: none; }
.card .who .short { display: inline; }
.card .bar-axis .full { display: none; }

/* headline figures in the opening */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0 0 2.5rem; max-width: 46rem; }
.stats > div { border-top: 2px solid var(--violet); padding-top: 0.7rem; }
.stat-n { font: 700 clamp(2rem, 5vw, 2.8rem)/1.05 var(--heading); color: var(--ink); margin: 0 0 0.35rem; }
.stat-n .unit { font-size: 0.5em; color: var(--ink-3); font-weight: 500; }
.stats p:not(.stat-n) { margin: 0; font-size: 0.88rem; color: var(--ink-3); line-height: 1.45; }

@media (max-width: 900px) {
  .scrolly { grid-template-columns: 1fr; padding: 0 16px; }
  .stage { grid-column: 1; grid-row: 1; height: 56svh; top: 0; z-index: 5; background: var(--night); padding: 0.6rem 0 0.4rem; justify-content: flex-start; box-shadow: 0 14px 18px -8px var(--night); }
  .stage-head { min-height: 3.2rem; gap: 0.6rem; }
  .stage-count { font-size: 2.6rem; }
  .stage-label { font-size: 0.85rem; }
  .stage-map { max-height: 40svh; }
  .stage-legend { font-size: 0.76rem; gap: 0.2rem 0.7rem; }
  .steps { grid-column: 1; grid-row: 2; padding: 2vh 0 30vh; position: relative; z-index: 1; }
  .step { min-height: 66svh; align-items: flex-start; }
  .step .card { opacity: 0.55; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; gap: 0.9rem; }
  .stats > div { display: grid; grid-template-columns: 7.5rem 1fr; align-items: center; gap: 0.6rem; }
}

/* ---- pages: each idea fills one window, like turning the page of a book ---- */
html { scroll-snap-type: y proximity; }
.page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; scroll-snap-align: start; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.hero.page { min-height: 100svh; padding-top: 2rem; padding-bottom: 3.5rem; }
.brief { max-width: 760px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.brief .key-findings { margin: 0; font-size: 1.08rem; }
.steps { padding: 0; }
.step { min-height: 100vh; min-height: 100svh; scroll-snap-align: start; }
.block h2 { margin-top: 0; }
.page .strip { max-height: 62svh; }
.page .strip-svg { max-height: 62svh; width: 100%; }

/* ---- the funnel: population to valid votes ---- */
.funnel { margin: 1.2rem 0 0.4rem; }
.f-row { display: grid; grid-template-columns: 11rem 1fr 6.5rem; align-items: center; gap: 0.7rem; margin: 0.35rem 0; font-size: 0.92rem; }
.f-name { color: var(--ink-2); }
.f-track { position: relative; height: 22px; display: block; }
.f-fill { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; background: var(--violet); transition: width 1s cubic-bezier(.2,.7,.2,1); }
.f-row.inec .f-fill { background: color-mix(in srgb, var(--violet) 70%, var(--panel)); }
.f-row.proj .f-fill { background: color-mix(in srgb, var(--violet) 35%, var(--panel)); }
.f-n { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.per100 { font-size: 1.05rem; color: var(--ink); margin-top: 1rem; }
.per100 b { font: 700 1.3rem var(--heading); color: var(--violet); }
@media (max-width: 560px) {
  .f-row { grid-template-columns: 7.2rem 1fr 4.6rem; font-size: 0.82rem; gap: 0.45rem; }
}

/* ---- the simulator: one screen; the controls and the result panel share one height ---- */
.sim.page { max-width: 1240px; margin: 0 auto; padding: 1.2rem 24px; justify-content: flex-start; height: 100svh; min-height: 680px; border-top: 1px solid var(--line); }
.sim-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1.6rem; }
.sim-head h2 { margin: 0; white-space: nowrap; }
.sim-head p { margin: 0; flex: 1 1 28rem; font-size: 0.93rem; color: var(--ink-3); }
.sim .sim-sticky { margin-top: 0.5rem; }
.sim .verdict { font-size: 1rem; padding: 0.6rem 0.9rem; }
.sim-grid { flex: 1; min-height: 0; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; margin-top: 0.4rem; align-items: stretch; }
.sim-controls { position: static; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 0.8rem 1rem; }
.sim-controls .field { margin-bottom: 0.7rem; }
.sim-controls .checks label { min-height: 34px; margin: 0.05rem 0; }
.sim-controls .hint { margin: 0.25rem 0 0; font-size: 0.8rem; }
.sim-controls .button { margin-top: auto; align-self: flex-start; }
.sim-result { min-height: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem; }
.sim-result #sim-bars { margin-bottom: 0.4rem; }
.sim-result .map-wrap { flex: 1; min-height: 0; border: 0; padding: 0; display: flex; }
.sim-result .map { width: 100%; height: 100%; }
.sim-result .note { margin: 0.3rem 0 0; }
#panel-turnout:disabled { opacity: 0.5; }
@media (max-width: 760px) {
  .sim.page { height: auto; min-height: 100svh; padding: 1rem 16px; }
  .sim-head p { display: none; }
  .sim-grid { grid-template-columns: 1fr; }
  .sim-result { order: 1; }
  .sim-controls { order: 2; }
  .sim-result .map-wrap { flex: none; }
  .sim-result .map { max-height: 34svh; }
}

/* phones: the card sits below the pinned map within its page */
@media (max-width: 900px) {
  .step { align-items: flex-end; padding-bottom: 4svh; }
  .steps { padding: 0; }
}

/* fixes after the page-by-page check */
.stage-count { flex: none; }
a.button { display: inline-flex; align-items: center; text-decoration: none; }
.page .strip, .page .strip-svg { max-height: 54svh; }
.funnel .f-row { grid-template-columns: 13rem 1fr 6rem; }
@media (max-width: 560px) {
  .hero.page { padding-top: 1.2rem; padding-bottom: 2.6rem; }
  .hero h1 { font-size: 1.85rem; margin-bottom: 0.6rem; }
  .lede { font-size: 1.05rem; }
  .funnel .f-row { grid-template-columns: 7.2rem 1fr 4.6rem; }
}

/* the funnel is as wide as the text; the reset button sits beside the verdict */
.funnel .f-row { grid-template-columns: 11.5rem 1fr 4.2rem; }
.sim .sim-sticky { display: flex; align-items: stretch; gap: 0.8rem; }
.sim .sim-sticky .verdict { flex: 1; }
.sim .sim-sticky .button { flex: none; align-self: center; }
.sim-controls .checks label { min-height: 31px; }
.sim-controls legend, .sim-controls .field > span { margin-bottom: 0.2rem; }
.sim-controls .row { margin-bottom: 0.3rem; }
.sim-controls input[type="range"] { height: 26px; }
@media (max-height: 820px) {
  .sim-head p { font-size: 0.85rem; }
  .sim-controls .hint { font-size: 0.76rem; line-height: 1.4; }
}
@media (max-width: 760px) {
  .sim .sim-sticky { flex-direction: column; gap: 0.4rem; }
  .sim .sim-sticky .button { align-self: flex-start; min-height: 36px; padding: 0.3rem 0.9rem; }
}

/* the simulator as first designed: verdict on top, bars over the map, and the control panel and
   the map panel side by side at the same height */
.sim .sim-sticky { display: block; }
.sim-grid { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "controls bars" "controls map" "controls below"; column-gap: 1.4rem; row-gap: 0.6rem; }
.sim-controls { grid-area: controls; }
.sim-grid #sim-bars { grid-area: bars; margin: 0; }
.sim-grid .map-wrap { grid-area: map; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0.6rem; }
.sim-grid .map-wrap .map { width: 100%; height: 100%; }
.sim-below { grid-area: below; }
.sim-below .legend { margin-top: 0; }
.sim-below .note { margin: 0.2rem 0 0; }
@media (min-width: 761px) {
  /* the control panel starts level with the map panel and ends with it */
  .sim-grid { grid-template-areas: ". bars" "controls map" ". below"; }
}
@media (max-width: 760px) {
  .sim-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "bars" "controls" "map" "below"; }
  .sim-grid .map-wrap .map { max-height: 34svh; }
}
/* the controls set the height of the row; the map panel matches it */
.sim.page { height: auto; min-height: 100svh; }
.sim-controls { overflow: visible; }
@media (min-width: 761px) {
  .sim-grid .map-wrap { position: relative; min-height: 420px; }
  .sim-grid .map-wrap .map { position: absolute; inset: 0.6rem; width: calc(100% - 1.2rem); height: calc(100% - 1.2rem); }
}
/* as first designed: controls from the top beside the bars, ending level with the map panel */
@media (min-width: 761px) {
  .sim-grid { grid-template-areas: "controls bars" "controls map" ". below"; }
}
/* the intro sits under the heading */
.sim-head { display: block; }
.sim-head h2 { margin: 0 0 0.4rem; white-space: normal; }
.sim-head p { max-width: 46rem; font-size: 0.98rem; color: var(--ink-2); }
@media (max-width: 760px) { .sim-head p { display: block; font-size: 0.9rem; } }
/* the closing page: who made this */
.cta.page { border-top: 1px solid var(--violet); }
.cta-lead { font: 500 clamp(1.3rem, 2.6vw, 1.75rem)/1.45 var(--heading); color: var(--ink-2); max-width: 40rem; }
.cta-lead b { color: var(--ink); }
.cta.page .cta-lead { font: 500 clamp(1.3rem, 2.6vw, 1.75rem)/1.45 var(--heading); }

/* ---- the control panel: three numbered groups, each value in a pill, sliders with their range ---- */
.sim-controls { padding: 0; gap: 0; }
.sim-controls > * { padding: 0.85rem 1rem; }
.ctl-year { display: block; border-bottom: 1px solid var(--line); }
.ctl { border: 0; margin: 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.ctl legend { float: left; width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0; margin: 0 0 0.15rem; font: 600 0.95rem var(--heading); color: var(--ink); letter-spacing: 0; text-transform: none; }
.ctl legend + * { clear: both; }
.ctl-n { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; font: 600 0.72rem var(--mono); color: var(--ink); background: rgb(139 92 246 / 0.35); border: 1px solid var(--violet); flex: none; }
.ctl-label { display: block; font: 500 0.68rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.3rem; }
.sim-controls .checks { display: flex; flex-direction: column; gap: 0.1rem; }
.sim-controls .checks label { min-height: 32px; margin: 0; font-size: 0.9rem; }
.sim-controls .hint { margin: 0; font-size: 0.78rem; line-height: 1.45; }
.from-to { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 0.4rem; }
.from-to .arrow { color: var(--ink-3); padding-bottom: 0.5rem; }
.slider { display: block; }
.slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.slider-head .ctl-label { margin: 0; }
.pill { flex: none; font: 600 0.8rem var(--mono); color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.55rem; font-variant-numeric: tabular-nums; }
.sim-controls input[type="range"] { display: block; width: 100%; height: 26px; margin: 0.25rem 0 0; }
.slider .ticks { position: relative; display: flex; justify-content: space-between; height: 1.1em; font: 500 0.68rem var(--mono); color: var(--ink-3); }
.slider .ticks-3 > span:nth-child(2) { position: absolute; transform: translateX(-50%); }
#panel-turnout:disabled .ctl-label, #panel-turnout:disabled select, #panel-turnout:disabled input { opacity: 0.45; }
.sim-controls .reset { margin: auto 1rem 0.9rem; padding: 0.45rem 1rem; align-self: stretch; justify-content: center; }

/* review fixes */
.f-row.inec .f-fill, .f-inec { background: var(--violet); }
.f-row.proj .f-fill, .f-proj { background: color-mix(in srgb, var(--violet) 38%, var(--panel)); }
.f-legend { margin-top: 0.6rem; }
.f-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 0.35rem; vertical-align: -1px; }
.stage-sub { color: var(--ink-3); font-size: 0.86em; }
/* states set aside keep a visible outline against the page */
.map path.dim { stroke: var(--line); }
/* phones: each card starts below the pinned map, never under it */
@media (max-width: 900px) {
  .step { align-items: flex-start; padding-top: calc(56svh + 0.8rem); padding-bottom: 2rem; }
}
.slider .slider-head { display: flex; font: inherit; letter-spacing: 0; text-transform: none; color: inherit; margin: 0; }
.slider .slider-head .ctl-label { display: block; }
.slider .ticks > span { display: inline; margin: 0; letter-spacing: 0; text-transform: none; font: 500 0.68rem var(--mono); }
/* simulator review: short names in its bars; on phones the map follows the bars and the controls
   come last, and the map keeps its shape */
.sim-grid #sim-bars .who .full { display: none; }
.sim-grid #sim-bars .who .short { display: inline; }
@media (max-width: 760px) {
  .sim-grid { grid-template-areas: "bars" "map" "below" "controls"; }
  .sim-grid .map-wrap { display: block; padding: 0.4rem; }
  .sim-grid .map-wrap .map { width: 100%; height: auto; aspect-ratio: 600 / 500; max-height: none; }
  .sim .sim-sticky { position: sticky; top: 0; z-index: 6; background: var(--night); padding: 0.4rem 0; }
}
.from-to { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.from-to select { padding-left: 0.5rem; padding-right: 0.3rem; }
/* the reset button stands clear of the last group: no divider above it, and space around it */
#panel-turnout { border-bottom: 0; margin-bottom: 0.6rem; }
.sim-controls .reset { margin: auto 1rem 1rem; }
/* a card's call to action sits centred under its text */
.card-action { text-align: center; margin-top: 1rem; }
/* cards: the same space on all four sides; the first and last items bring no margin of their own */
.step .card { padding: 1.2rem 1.3rem; }
.step .card > :first-child, .key-findings > :first-child { margin-top: 0; }
.step .card > :last-child, .key-findings > :last-child { margin-bottom: 0; }
.key-findings { padding: 1.2rem 1.3rem; }
.key-findings .kf-title { margin-top: 0; }
.key-findings li:last-child { margin-bottom: 0; }
.cta .rights { margin-top: 2.2rem; max-width: 40rem; }

/* a slim bar back to the website, over the opening page */
.site-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 0.9rem 24px; }
.site-logo { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font: 600 0.95rem var(--heading); }
.site-logo img { height: 17px; width: auto; }
.site-link { font: 500 0.72rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; }
.site-link:hover, .site-logo:hover span { color: var(--violet); }
@media (max-width: 560px) { .site-bar { padding: 0.7rem 16px; } }

/* the bar back to the website is a header in its own right: its own row and a line under it; the
   opening page fills the rest of the window below it */
.site-bar { position: relative; max-width: none; padding: 0.85rem max(24px, calc((100vw - 1240px) / 2)); border-bottom: 1px solid var(--line); }
.hero.page { min-height: calc(100svh - 3.3rem); padding-top: 2.5rem; padding-bottom: 3rem; }
@media (max-height: 860px) and (min-width: 561px) {
  .hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 0.8rem; }
  .lede { font-size: 1.08rem; }
  .stats { margin-bottom: 1.6rem; }
  .stat-n { font-size: clamp(1.8rem, 4vw, 2.3rem); }
}
@media (max-width: 560px) { .site-bar { padding: 0.7rem 16px; } }
.site-bar { scroll-snap-align: start; } /* the top of the page, bar included, is where the first page rests */

/* ---- the website's header (copied from monstrous.com.ng's design: same logo, menu, button and
   sizes); it scrolls away rather than staying pinned, so the story's pinned maps keep the window ---- */
.site-bar { display: none; }
.site-header { position: relative; z-index: 10; background: rgb(7 8 12 / 0.72); border-bottom: 1px solid rgb(255 255 255 / 0.08); scroll-snap-align: start; }
.site-wrap { display: flex; align-items: center; gap: 32px; height: 70px; width: min(1290px, 100%); margin: 0 auto; padding: 0 24px; }
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.site-logo img { height: 28px; width: auto; }
.site-logo span { font: 600 1.02rem var(--heading); letter-spacing: -0.01em; }
.site-nav { display: flex; gap: 30px; margin-left: auto; font-size: 0.94rem; }
.site-nav a { text-decoration: none; color: #8d94a6; transition: color .15s; }
.site-nav a:hover { color: var(--ink); }
.site-btn { white-space: nowrap; display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 10px; font: 500 0.9rem var(--body); color: #fff; text-decoration: none; background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); box-shadow: 0 0 0 1px rgb(139 92 246 / .5), 0 8px 30px -8px rgb(139 92 246 / .7); transition: transform .15s, box-shadow .2s; }
.site-btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgb(167 139 250 / .8), 0 10px 40px -6px rgb(139 92 246 / .9); }
.site-menu { display: none; margin-left: auto; font-size: 1.4rem; line-height: 1; color: var(--ink); background: none; border: 0; padding: 8px; cursor: pointer; }
.site-drawer { display: flex; flex-direction: column; gap: 4px; padding: 8px 24px 20px; border-top: 1px solid rgb(255 255 255 / 0.08); }
.site-drawer[hidden] { display: none; }
.site-drawer a { color: var(--ink); text-decoration: none; padding: 10px 0; font-size: 1rem; }
.site-drawer .site-btn { align-self: flex-start; margin-top: 8px; padding: 10px 18px; }
@media (max-width: 900px) {
  .site-nav, .site-wrap > .site-btn { display: none; }
  .site-menu { display: block; }
}
@media (min-width: 901px) { .site-drawer { display: none !important; } }
@media (min-width: 1800px) { .site-wrap { width: min(1520px, 100%); } }
.hero.page { min-height: calc(100svh - 71px); }

/* back to top: a button at the end of the article, and a round one in the corner (as on the
   website) once the opening page is out of view; phones keep only the one at the end */
.to-top-end { margin-top: 2.4rem; }
.to-top-link { text-decoration: none; }
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 9; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font: 600 1.1rem var(--body); color: var(--violet); text-decoration: none; background: rgb(13 15 22 / 0.9); border: 1px solid rgb(139 92 246 / 0.6); box-shadow: 0 8px 24px rgb(0 0 0 / 0.4); transition: transform .15s, border-color .2s; }
.to-top:hover { transform: translateY(-2px); border-color: var(--violet); }
.to-top[hidden] { display: none; }
@media (max-width: 900px) { .to-top { display: none !important; } }
.hero.page { scroll-snap-align: none; } /* the top of the page (the header) is the only resting point up there */

/* ---- the website's footer (copied from monstrous.com.ng's design) ---- */
.site-footer { background: #07080c; color: #8d94a6; font-size: 0.92rem; border-top: 1px solid rgb(255 255 255 / 0.08); scroll-snap-align: end; }
.site-footer a { text-decoration: none; color: #8d94a6; }
.site-footer a:hover { color: var(--ink); }
.site-footer .site-wrap { height: auto; }
.site-footer .foot { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 44px; align-items: start; }
.site-footer .foot-logo img { height: 26px; width: auto; display: block; }
.site-footer .foot-brand p { margin: 16px 0 0; max-width: 38ch; line-height: 1.6; }
.site-footer .foot-brand .loc { font: 500 0.74rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.site-footer .foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.site-footer .foot-col h4 { margin: 4px 0 6px; font: 500 0.74rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--violet); }
.site-footer .foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid rgb(255 255 255 / 0.08); font-size: 0.85rem; }
@media (max-width: 900px) {
  .site-footer .foot { grid-template-columns: auto 1fr; gap: 32px 48px; padding-top: 44px; padding-bottom: 32px; }
  .site-footer .foot-brand { grid-column: 1 / -1; }
  .site-footer .foot-col a { padding: 2px 0; }
}
@media (max-width: 600px) {
  .site-footer .foot { grid-template-columns: 1fr 1fr; }
}
/* the closing page no longer needs to fill a whole window: the footer follows it */
.cta.page { min-height: auto; padding-top: 5rem; padding-bottom: 4rem; }
/* the link on to the next issue */
.series-nav { margin-top: 1.6rem; }
/* the axis under the funnel */
.funnel .f-axis { margin-top: 0.3rem; }
.funnel .f-axis .f-track { height: 1.3em; border-top: 1.2px solid var(--ink-3); }
.funnel .f-axis .f-track > span { position: absolute; top: 4px; transform: translateX(-50%); font: 500 0.72rem var(--mono); color: var(--ink-3); white-space: nowrap; }
.funnel .f-axis .f-track > span:first-child { transform: none; }
.funnel .f-axis .f-n { font: 500 0.72rem var(--mono); color: var(--ink-3); text-align: right; }
/* every bar chart starts from a y-axis */


.strip-axis { stroke: var(--ink-3); }
/* the y-axis: a line at the start of the bars, drawn past each row so the rows join into one line */
.bar-track::before { content: ""; position: absolute; left: -1px; top: -8px; bottom: -8px; border-left: 1.2px solid var(--ink-3); }
.bar-fill { position: relative; z-index: 1; }
.funnel .f-row:not(.f-axis) .f-track::before { content: ""; position: absolute; left: -1px; top: -18px; bottom: -18px; border-left: 1.2px solid var(--ink-3); }
.funnel .f-row:first-child .f-track::before { top: 0; }
.funnel .f-fill { position: relative; z-index: 1; }

/* ==== check our working: one download, one number worked through as a picture ==== */
.ck-lede { font: 600 clamp(1.1rem, 2.2vw, 1.35rem)/1.4 var(--heading); color: var(--ink); max-width: 44rem; margin: 0.2rem 0 1.1rem; }
.ck-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem; margin-bottom: 1.4rem; }
.ck-button { display: inline-flex; align-items: center; gap: 0.8rem; background: var(--violet); color: #0b0a14; text-decoration: none; border-radius: 12px; padding: 0.85rem 1.3rem; font: 700 1.05rem var(--heading); }
.ck-button:hover { filter: brightness(1.08); }
.ck-button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ck-button > span { display: grid; }
.ck-size { font: 500 0.75rem var(--mono); opacity: 0.75; }
.ck-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; max-width: 46rem; }
.ck-title { font: 500 0.75rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.8rem; }
.ck-steps { list-style: none; margin: 0 0 1.1rem; padding: 0; display: flex; justify-content: space-between; gap: 0.6rem 1rem; }
.ck-steps li { white-space: nowrap; align-items: center; }
.ck-steps li { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.9rem; line-height: 1.35; color: var(--ink-2); min-width: 0; }
.ck-steps b { color: var(--ink); }
.ck-steps a { font-family: var(--mono); font-size: 0.82rem; text-decoration: none; overflow-wrap: anywhere; }
.ck-n { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: rgb(167 139 250 / 0.18); color: var(--violet); font: 700 0.85rem var(--heading); }
.ck-work { display: grid; gap: 1.1rem; }
.ck-sheet { overflow-x: auto; max-width: 100%; }
.ck-tab { display: inline-block; margin: 0; padding: 0.3rem 0.8rem; background: #e6e8ee; color: #3b2a8a; font: 600 0.78rem var(--mono); border-radius: 6px 6px 0 0; }
.ck-sheet table { width: 100%; border-collapse: collapse; font: 500 0.82rem var(--mono); white-space: nowrap; background: #f4f5f8; color: #1d2130; border-radius: 0 6px 6px 6px; overflow: hidden; }
.ck-sheet th, .ck-sheet td { border: 1px solid #d5d8e0; padding: 0.32rem 0.6rem; text-align: left; }
.ck-sheet th { background: #e6e8ee; color: #5b6070; font-weight: 500; text-align: center; }
.ck-sheet .rn { background: #e6e8ee; color: #5b6070; text-align: center; min-width: 2.2rem; }
.ck-sheet .hd td { color: #5b6070; }
.ck-sheet th.lit { background: #d9cffd; color: #3b2a8a; }
.ck-sheet td.lit { background: #ece6ff; color: #2a1d6e; font-weight: 700; outline: 2px solid #8b6cf0; outline-offset: -2px; }
.ck-sheet .hd td.lit { font-weight: 500; outline: none; }
.ck-sum { display: grid; gap: 0.35rem; padding-left: 1.4rem; border-left: 2px solid rgb(167 139 250 / 0.45); }
.ck-line { margin: 0; font: 500 clamp(0.95rem, 2vw, 1.1rem) var(--mono); color: var(--ink); white-space: nowrap; }
.ck-result { margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.1rem; }
.ck-result b { font: 700 clamp(2rem, 5vw, 2.8rem)/1 var(--heading); color: var(--violet); }
.ck-result span { flex: 1 1 14rem; font-size: 0.95rem; line-height: 1.45; color: var(--ink-2); }
.ck-after { margin: 0.4rem 0 0; font-size: 0.88rem; color: var(--ink-3); }
.ck-files { list-style: none; margin: 0.3rem 0 0; padding: 0; display: grid; gap: 0.6rem; max-width: 46rem; }
.ck-files li { display: grid; gap: 0.1rem; }
.ck-files a { font: 500 0.86rem var(--mono); text-decoration: none; word-break: break-all; }
.ck-files span { font-size: 0.85rem; color: var(--ink-2); line-height: 1.4; }
.ck-small { font-size: 0.85rem; color: var(--ink-3); margin: 0.8rem 0 0; }
.ck-actions .ck-small { margin: 0; }
.ck-more { margin-top: 0.6rem; }
.ck-more summary { cursor: pointer; font: 500 0.8rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet); padding: 0.4rem 0; list-style: none; }
.ck-more summary::-webkit-details-marker { display: none; }
.ck-more summary::before { content: "+ "; }
.ck-more[open] summary::before { content: "− "; }
.ck-sources { margin: 0.3rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; font-size: 0.88rem; color: var(--ink-2); line-height: 1.45; max-width: 46rem; }
@media (max-width: 560px) {
  .ck-steps { flex-direction: column; gap: 0.45rem; }
  .ck-line { white-space: normal; }
  .ck-sheet table { font-size: 0.66rem; }
  .ck-sheet th, .ck-sheet td { padding: 0.26rem 0.3rem; }
  .ck-sheet .rn { min-width: 1.4rem; }
  .ck-line { font-size: 0.88rem; }
  .ck-sum { min-width: 0; padding-left: 0; border-left: 0; padding-top: 0.8rem; border-top: 2px solid rgb(167 139 250 / 0.45); }
  .ck-card { padding: 1rem 0.9rem; }
  .ck-button { width: 100%; justify-content: center; }
}
