:root {
  /* Palette reuses philipmathieu.com's own tokens (gray scale, primary red,
     link blue) so this piece reads as part of the site rather than a
     standalone microsite. Shah/Bellows/Jackson stay separate — they're
     chart-only candidate identifiers, not part of the site's UI palette. */
  --ink: #1a1a1a;
  --muted: #4a4a4a;
  --faint: #666666;
  --surface: #f7f7f7;
  --card: #ffffff;
  --line: #e5e5e5;
  --line-strong: #cccccc;
  --link: #1d9acc;
  --accent: #ce112d;
  --accent-600: #a00e24;
  --shah: #2a78d6;
  --bellows: #008300;
  --jackson: #eda100;
  /* Jackson's amber as *text*: #eda100 on white is ~1.9:1, unreadable at 15px.
     This is the same hue pushed dark enough to clear AA (~4.9:1) while still
     reading as his color beside the chart. */
  --jackson-ink: #a86c00;
  --maxw: 1120px;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
/* The UA's [hidden] rule is a bare attribute selector, so any class that sets
   `display` silently outranks it and the element stays visible (the CI
   whiskers toggle via the hidden property), so this has to win. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; }
em { font-style: italic; }
strong { font-weight: 600; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }

.hero__eyebrow, .panel__scenario, .slider__label, .regime__caption,
.footer__meta {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
}

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 15vh 6vw 9vh;
  text-align: center;
}
.hero__eyebrow { margin-bottom: 1.4rem; }
.hero__title { font-size: clamp(2.6rem, 6.5vw, 5rem); margin: 0 0 1.6rem; }
.hero__title em { color: var(--accent); }
.hero__dek {
  max-width: 40rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
}
/* Byline: present but quiet — sans, small, no link-blue. The underline is the
   only tell that it's a mailto. */
.hero__byline {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--faint);
  margin: 1.5rem 0 0;
}
.hero__byline a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.hero__byline a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.hero__scrollcue {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  margin-top: 3.4rem;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- scrolly ---------- */
.scrolly {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 6vw;
  display: flex;
  gap: 4vw;
  align-items: flex-start;
}
.scrolly__graphic {
  position: sticky;
  top: 6vh;
  flex: 1 1 54%;
  min-width: 0;
}
.scrolly__steps { flex: 1 1 46%; }
.step {
  min-height: 82vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3vh 0;
  opacity: 0.32;
  transition: opacity 0.35s ease;
}
.step.is-active { opacity: 1; }
.step h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); margin: 0 0 1rem; }
.step p { margin: 0 0 1rem; }
.step p:last-child { margin-bottom: 0; }

/* ---------- panel ---------- */
/* Ruled like a tally sheet, not a product card: a heavy top rule (report
   header), hairline bottom, square corners, no ambient shadow. */
.panel {
  background: var(--card);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 1.5rem 1.6rem 1.4rem;
}
.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  /* The title never wraps. When the two can't share a row, the counter drops
     to its own line instead — a two-line title reads as a layout accident. */
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.panel__scenario { color: var(--ink); flex: 1 1 auto; white-space: nowrap; }
.panel__s {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}
.panel__sval {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--jackson-ink);
  margin-left: 0.3rem;
}

/* ---------- rounds ---------- */
.rounds { display: flex; flex-direction: column; gap: 1.15rem; }
.round { position: relative; }

/* When someone takes a majority on the first ballot there is no second round.
   The block stays in place, greys out, and gets stamped — the absence of a
   final ballot IS the finding here, so it should be visible, not removed. */
.round__content { transition: opacity 0.5s ease, filter 0.5s ease; }
.round--spent .round__content {
  filter: grayscale(1);
  opacity: 0.32;
}
.round__stamp {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.round--spent .round__stamp { opacity: 1; }
.round__stamp span {
  transform: rotate(-5deg);
  border: 2px solid rgba(26, 26, 26, 0.34);
  border-radius: 3px;
  padding: 0.3rem 0.85rem;
  background: rgba(247, 247, 247, 0.82);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.62);
}
/* Styled like a roll-call/scoreboard tab rather than a soft caption — the
   rounds are a real sequence (first ballot, final ballot), so the label
   should read as a record marker, not decoration. */
.round__head {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.15rem 0.5rem;
  background: var(--ink);
  color: var(--card);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.barrow {
  display: grid;
  grid-template-columns: 6.7rem 1fr 3.2rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.16rem 0;
}
.barrow--out { opacity: 0.5; }
.barrow--hi .barrow__name { font-weight: 600; }
.barrow--hi .barrow__track { box-shadow: 0 0 0 2px rgba(26,26,26,0.09); border-radius: 5px; }
.barrow__name {
  font-family: var(--sans);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.barrow__track {
  position: relative;
  height: 15px;
  background: #eeeeee;
  border-radius: 4px;
}
.barrow__fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.1, 1), background 0.3s;
}
/* During a scripted sweep or a drag, the input IS the animation — a CSS
   transition on top of it just lags half a second behind every frame. Both
   marks must be suppressed together, or they desynchronise. */
.rounds.is-animating .barrow__fill,
.rounds.is-scrubbing .barrow__fill { transition: background 0.3s; }
.rounds.is-animating .barrow__ci,
.rounds.is-scrubbing .barrow__ci { transition: none; }
/* 5th-95th percentile of this candidate's own total. Deliberately understated:
   the decisive uncertainty is in the GAP (stated in the verdict), and a loud
   whisker invites readers to judge significance by whether two bars overlap —
   which is wrong here, since the totals are strongly anticorrelated. */
.barrow__ci {
  position: absolute;
  top: 50%;
  height: 7px;
  transform: translateY(-50%);
  border-left: 1.5px solid rgba(26, 26, 26, 0.55);
  border-right: 1.5px solid rgba(26, 26, 26, 0.55);
  pointer-events: none;
  /* must match .barrow__fill exactly, or the whisker arrives before its bar */
  transition: left 0.5s cubic-bezier(0.4, 0, 0.1, 1),
              width 0.5s cubic-bezier(0.4, 0, 0.1, 1);
}
.barrow__ci::before {
  content: "";
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1.5px;
  background: rgba(26, 26, 26, 0.45);
  transform: translateY(-50%);
}
.barrow--out .barrow__ci { display: none; }
.barrow__maj {
  position: absolute;
  left: 50%; top: -3px; bottom: -3px;
  width: 2px;
  background: repeating-linear-gradient(var(--ink) 0 3px, transparent 3px 6px);
  opacity: 0.5;
}
.barrow__val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  color: var(--ink);
}
.barrow--out .barrow__val { color: var(--faint); font-style: italic; }

/* unmeasurable seats: named, not silently dropped */
.barrow--nodata .barrow__name { color: var(--faint); font-style: italic; }
.barrow--nodata .barrow__val {
  color: var(--faint);
  font-style: italic;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* "Candidate 4*" vs "C4*": both are in the DOM, the breakpoint picks one. */
.barrow__name--abbr { display: none; }
.barrow__track--nodata {
  background: repeating-linear-gradient(
    135deg, transparent 0 5px, #ececec 5px 10px);
  border: 1px dashed var(--line-strong);
}
/* Footnote marker tying the unmeasurable seats to the note directly below.
   Raised like a superscript without <sup>, so it can't disturb line height. */
.ast {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 600;
  color: var(--faint);
  font-size: 13px;
  line-height: 0;
  position: relative;
  top: -0.28em;
  margin-left: 0.12rem;
}
.round__note .ast { margin: 0 0.22rem 0 0; top: -0.2em; }

.round__note {
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--faint);
  margin: 0.75rem 0 0;
  padding-left: 0.1rem;
  max-width: 34rem;
}
.round__note a { color: var(--muted); }

/* ---------- verdict ---------- */
.verdict {
  margin-top: 1.3rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.verdict { align-items: flex-start; }
.verdict__dot {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  margin-top: 0.42em;
}
.verdict__unc {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--faint);
}
.verdict__unc b { color: var(--muted); font-weight: 600; }

/* ---------- 100 conventions (icon array) ---------- */
.grid100 {
  margin-top: 1.3rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line);
}
.grid100__head { margin-bottom: 0.75rem; }
.grid100__pips {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
  max-width: 22rem;
}
.pip {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--line-strong);
  transition: background 0.25s ease;
}
.grid100__note {
  border-top: none;
  margin-top: 0.85rem;
  padding-top: 0;
  gap: 1rem;
}
.grid100__note b { font-family: var(--mono); color: var(--ink); }
@media (max-width: 820px) {
  .grid100__pips { grid-template-columns: repeat(20, 1fr); max-width: none; }
}

/* ---------- probability curves ---------- */
.curves { margin-top: 0.4rem; }
.curves__svg { width: 100%; height: auto; display: block; overflow: visible; }
.cv-grid { stroke: var(--line); stroke-width: 1; }
.cv-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cv-lab {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--faint);
}
.cv-lab--y { text-anchor: end; }
.cv-lab--x { text-anchor: middle; }
.cv-axis {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--faint);
}
.cv-axis--y { text-anchor: middle; }
/* Halo the labels: they sit on the plot, and three curves cross most of it.
   paint-order draws the surface-coloured stroke first, so the glyphs stay
   legible wherever they land without hand-placing them around the lines. */
.cv-name, .cv-actual__lab {
  paint-order: stroke fill;
  stroke: var(--card);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.cv-name {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
}
.cv-actual { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.45; }
.cv-actual__lab { text-anchor: end; fill: var(--muted); }
.cv-ptr { stroke: var(--ink); stroke-width: 2; }
.cv-dot { stroke: var(--card); stroke-width: 1.5; }
.curves__read {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.curves__read b { font-family: var(--mono); color: var(--ink); }

/* ---------- regime strip ---------- */
.regime { margin-top: 1.2rem; }
.regime__track {
  position: relative;
  height: 30px;
  border-radius: 5px;
  overflow: visible;
  /* headroom for the "actual" flag, which sits above the bar: below it would
     land in the axis row and collide with the 450 tick */
  margin-top: 2.7rem;
  margin-bottom: 2.6rem;
}
.regime__band {
  position: absolute; top: 0; bottom: 0;
  border-right: 2px solid var(--card);
}
.regime__band:last-of-type { border-right: none; }
.regime__ptr {
  position: absolute; top: -5px; bottom: -5px;
  width: 3px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-1.5px);
  transition: left 0.3s ease;
}
.regime__flag { position: absolute; top: 0; bottom: 0; }
.regime__flag i {
  position: absolute; top: -5px; bottom: -5px; left: 0;
  width: 2px; background: #fff;
}
.regime__flag b {
  position: absolute; bottom: calc(100% + 11px); left: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
}
.regime__axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  margin-top: -2.2rem;
}
.regime__caption { margin-top: 0.5rem; text-align: center; }

/* ---------- legend ---------- */
.legend {
  display: flex;
  gap: 1.2rem;
  margin-top: 1.15rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.legend__item, .legend .legend__item {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---------- sandbox ---------- */
.sandbox {
  max-width: 760px;
  margin: 12vh auto 0;
  padding: 0 6vw;
}
.sandbox__intro { text-align: center; margin-bottom: 2.5rem; }
.sandbox__intro h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0.7rem 0 1rem; }
.sandbox__intro p { max-width: 34rem; margin: 0 auto; color: var(--muted); }
.sandbox__panel { }

/* The regime band IS the control. A separate slider duplicated the same axis
   twice on one screen; dragging the band you're reading is one object. */
.regime--control { margin: 0 0 1.5rem; }
.regime--control .regime__track {
  height: 38px;
  cursor: ew-resize;
  touch-action: none;
}
.regime--control .regime__track:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.regime--control .regime__ptr {
  /* dragged, so no easing: a transition here trails the pointer */
  transition: none;
  width: 4px;
  transform: translateX(-2px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65);
}
.regime--control .regime__ptr::after {
  content: "";
  position: absolute;
  left: 50%; top: -9px;
  width: 15px; height: 15px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.regime__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.slider__label { white-space: nowrap; }
.slider__out {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 18px;
  color: var(--jackson-ink);
  text-align: right;
}
.sandbox__marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
}
.mark {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.mark:hover { border-color: var(--ink); color: var(--ink); }
.panel--sandbox { margin-top: 0.5rem; }

/* ---------- contact ---------- */
.contact {
  max-width: 760px;
  margin: 5vh auto 0;
  padding: 1.6rem 6vw 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.contact__by {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--ink);
}
.contact__note {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--faint);
}
.contact a { color: var(--muted); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.contact a:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* ---------- footer ---------- */
.footer {
  /* Same content width as the sandbox above — narrower read as a mistake. */
  max-width: 760px;
  margin: 6vh auto 0;
  padding: 3rem 6vw 8vh;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--muted);
  line-height: 1.65;
}
.footer strong { color: var(--ink); }
.footer p { margin: 0 0 1.15rem; }
.footer p:last-of-type { margin-bottom: 0; }
.footer__h {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  margin: 0 0 1.3rem;
}
.footer__meta { font-size: 13px; margin-top: 1.4rem; text-transform: none; letter-spacing: 0; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  body { font-size: 17px; }
  .scrolly { display: block; padding: 0 5vw; }
  .scrolly__graphic {
    position: sticky; top: 0;
    padding: 0.8rem 0 1rem;
    background: linear-gradient(var(--surface) 82%, transparent);
    z-index: 5;
  }
  .scrolly__steps { margin-top: 1rem; }
  .step { min-height: 68vh; }
  /* Abbreviated labels and no name dots: the name column can hand its spare
     width to the bars. */
  .barrow { grid-template-columns: 4.2rem 1fr 3.1rem; }

  /* On a phone the pinned graphic and the prose share one small viewport, so
     the panel keeps only what changes as you scroll: bars, counts, verdict.
     The Article X footnote and the sampling caveat are static methodology —
     both remain in full in the Method section at the foot of the page. */
  .round__note { display: none; }
  .verdict__unc { display: none; }
  .barrow__name--full { display: none; }
  .barrow__name--abbr { display: inline; }
  /* The pinned panel's scenario line already titles each step, so the prose
     headers repeat it — on a phone they cost more height than they're worth. */
  .scrolly .step h2 { display: none; }

  /* Tighter vertical rhythm for everything that stays. */
  .panel { padding: 0.9rem 1rem 0.8rem; }
  .panel__head { margin-bottom: 0.7rem; padding-bottom: 0.55rem; }
  /* The head is ALWAYS two stacked rows on a phone. Left to flex-wrap it
     flipped between one and two rows depending on the scenario title, and
     every flip resized the pinned graphic mid-scroll. The title truncates
     rather than wraps for the same reason. */
  .panel__head { display: block; }
  .panel__scenario { overflow: hidden; text-overflow: ellipsis; }
  .panel__s { text-align: left; margin: 0.2rem 0 0; }
  .rounds { gap: 0.7rem; }
  .round__head { margin-bottom: 0.4rem; }
  .barrow { gap: 0.55rem; padding: 0.1rem 0; }
  .barrow__name { font-size: 13px; }
  .barrow__track { height: 12px; }
  .barrow__val { font-size: 12.5px; }
  .verdict { margin-top: 0.75rem; padding-top: 0.6rem; font-size: 0.95rem; }
  .curves__read { margin-top: 0.6rem; padding-top: 0.55rem; }
}

/* ================================================================
   Part 2 additions — delegate trading cards
   Everything above is the shared site stylesheet, unchanged. */

/* ---------- part-2 nav crumb ---------- */
.crumb {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--faint);
  text-align: center;
  padding-top: 2rem;
}
.crumb a { color: var(--muted); text-decoration-color: var(--line-strong); }
.crumb a:hover { color: var(--ink); }

/* ---------- delegate card ---------- */
/* A trading card, but in this site's tally-sheet dialect: white face, heavy
   ink top rule, a slate-colored spine on the left edge, mono numerals. */
.dcard {
  position: relative;
  background: var(--card);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  border-left: 5px solid var(--line-strong);
  padding: 1.3rem 1.4rem 1.2rem;
  max-width: 30rem;
  margin: 0 auto;
}
.dcard--J { border-left-color: var(--jackson); }
.dcard--B { border-left-color: var(--bellows); }
.dcard--S { border-left-color: var(--shah); }
/* multi-slate spine: JS paints equal color bands on .dcard__spine */
.dcard--multi { border-left: none; padding-left: calc(1.4rem + 5px); }
.dcard__spine {
  position: absolute; left: 0; top: -2px; bottom: -1px; width: 5px;
}
.dcard--composite { border-left-style: dashed; border-left-color: var(--line-strong); }
.dcard--composite .dcard__name { color: var(--muted); font-style: italic; }

.dcard__eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.dcard__name {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 500;
  line-height: 1.15;
  margin: 0.35rem 0 0.1rem;
}
.dcard__town {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* badges row */
.dcard__badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.badge {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.badge .dot { width: 8px; height: 8px; }
.badge--leg { border-color: var(--ink); color: var(--ink); }

/* the two-bar breakdown: EXPECTED (stacked) vs ACTUAL */
.dcard__bars { display: grid; gap: 0.55rem; margin-bottom: 0.4rem; }
.dbar { display: grid; grid-template-columns: 5.2rem 1fr 3.6rem; gap: 0.6rem; align-items: center; }
.dbar__lab {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: right;
}
.dbar__track { position: relative; height: 16px; background: #eeeeee; border-radius: 4px; }
.dbar__seg {
  position: absolute; top: 0; bottom: 0;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.1, 1), left 0.6s cubic-bezier(0.4, 0, 0.1, 1);
}
/* 2px surface gaps between segments via border */
.dbar__seg + .dbar__seg { border-left: 2px solid var(--card); }
.dbar__seg--base { background: #b8b6ad; border-radius: 4px 0 0 4px; }
.dbar__seg--J { background: var(--jackson); }
.dbar__seg--B { background: var(--bellows); }
.dbar__seg--S { background: var(--shah); }
.dbar__seg--actual { background: var(--ink); border-radius: 4px; }
.dbar__seg--pv { background: var(--accent); }
.dbar__seg:last-child { border-radius: 0 4px 4px 0; }
.dbar__seg--actual:first-child { border-radius: 4px; }
.dbar__seg--base:only-child { border-radius: 4px; }
.dbar__val { font-family: var(--mono); font-size: 13.5px; font-weight: 500; text-align: right; }
/* expected tick on the actual row, so the surplus reads against a mark */
.dbar__tick {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: repeating-linear-gradient(var(--ink) 0 3px, transparent 3px 6px);
  opacity: 0.55;
  transition: left 0.6s cubic-bezier(0.4, 0, 0.1, 1);
}

.dcard__legend {
  display: flex; flex-wrap: wrap; gap: 0.85rem;
  font-family: var(--sans); font-size: 11.5px; color: var(--muted);
  margin: 0.7rem 0 0.9rem;
}
.dcard__legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 0.32rem; }

/* stat footer */
.dcard__stats {
  display: flex; justify-content: space-between; gap: 0.6rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
.dstat { text-align: center; flex: 1; }
.dstat b { display: block; font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--ink); }
.dstat--pv.is-pos b { color: var(--accent); }
.dstat span {
  font-family: var(--sans); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint);
  white-space: nowrap;
}

/* seat stamp, reusing the round-stamp language */
.dcard__stamp {
  position: absolute; top: 0.9rem; right: 1rem;
  transform: rotate(4deg);
  border: 2px solid rgba(26,26,26,0.3);
  border-radius: 3px;
  padding: 0.16rem 0.55rem;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: rgba(26,26,26,0.55);
  background: rgba(247,247,247,0.85);
  pointer-events: none;
}
.dcard__stamp--no { border-color: rgba(160,14,36,0.35); color: rgba(160,14,36,0.6); }

/* prologue: the model, before the scrolly */
.prologue { max-width: 760px; margin: 4vh auto 2vh; padding: 0 6vw; }
.prologue h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0.7rem 0 1rem; text-align: center; }
.prologue .hero__eyebrow { text-align: center; }
.prologue p { color: var(--muted); }
.eq {
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--card);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 0.95rem 1.15rem;
  margin: 1.3rem 0;
  overflow-x: auto;
  white-space: nowrap;
}
.eq math { display: block; margin: 0.3rem 0; }

/* the ballot-position ledger line: piece two lives here, not in the bar */
.dcard__pos {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--faint);
  margin: 0.55rem 0 0;
}
.dcard__pos b { font-family: var(--mono); color: var(--muted); }
/* 95% posterior-predictive band: the reference region the surplus is read
   against. Recessive tint, no transition — it's context, not data. */
.dbar__band {
  position: absolute; top: 0; bottom: 0;
  background: rgba(26, 26, 26, 0.07);
  pointer-events: none;
}
.dcard__bandchip { background: #dedede; }

/* outside-the-band tag on the personal-vote stat; absence means "within" */
.dtag {
  display: inline-block; margin-top: 3px; font-style: normal;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-600); border: 1px solid currentColor;
  border-radius: 2px; padding: 0 0.3rem; margin-left: 0.3rem;
  vertical-align: 2px;
}
.dtag--far { background: var(--accent-600); color: var(--card); border-color: var(--accent-600); }

.dstat--range b { letter-spacing: -0.02em; white-space: nowrap; }

/* the seat tick's own legend, inline with its number */
.dcard__pos--seat i {
  display: inline-block; width: 2px; height: 10px;
  background: var(--ink); opacity: 0.4;
  margin-right: 0.35rem; vertical-align: -1px;
}

/* what a seat cost: solid hairline, distinct from the dashed expectation tick */
.dbar__won {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--ink); opacity: 0.4;
}

.prologue__list { color: var(--muted); padding-left: 1.4rem; }
.prologue__list li { margin-bottom: 0.55rem; }
.prologue--bridge { margin: 6vh auto 2vh; }
.prologue--bridge p { text-align: center; max-width: 34rem; margin: 0 auto; }

/* the reveal: stats fade up one by one, the seat stamp lands last */
@keyframes statIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
@keyframes stampIn {
  from { opacity: 0; transform: rotate(4deg) scale(1.35); }
  to { opacity: 1; transform: rotate(4deg) scale(1); }
}
.dcard--reveal .dcard__stats .dstat { animation: statIn 0.35s ease both; }
.dcard--reveal .dcard__stats .dstat:nth-child(2) { animation-delay: 0.12s; }
.dcard--reveal .dcard__stats .dstat:nth-child(3) { animation-delay: 0.24s; }
.dcard--reveal .dcard__stats .dstat:nth-child(4) { animation-delay: 0.36s; }
.dcard--reveal .dcard__stamp { animation: stampIn 0.3s ease 0.55s both; }
@media (prefers-reduced-motion: reduce) {
  .dcard--reveal .dcard__stats .dstat,
  .dcard--reveal .dcard__stamp { animation: none; }
}

/* gallery title chip above the card */
.gallery__arch {
  font-family: var(--mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.9rem;
}
.gallery__arch b { color: var(--accent); }

/* ---------- lookup ---------- */
.lookup { max-width: 760px; margin: 12vh auto 0; padding: 0 6vw; }
.lookup__intro { text-align: center; margin-bottom: 2rem; }
.lookup__intro h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0.7rem 0 1rem; }
.lookup__intro p { max-width: 34rem; margin: 0 auto; color: var(--muted); }
.lookup__box { position: relative; max-width: 30rem; margin: 0 auto 1.1rem; }
.lookup__input {
  width: 100%;
  font-family: var(--sans); font-size: 16px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
}
.lookup__input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.lookup__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  max-height: 17rem; overflow-y: auto;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.lookup__opt {
  display: flex; justify-content: space-between; gap: 1rem;
  width: 100%; text-align: left;
  padding: 0.5rem 0.9rem;
  font-family: var(--sans); font-size: 14px;
  background: none; border: none; cursor: pointer; color: var(--ink);
}
.lookup__opt:hover, .lookup__opt.is-hi { background: var(--surface); }
.lookup__opt small { color: var(--faint); }
.lookup__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 2rem; }
.lookup__note {
  font-family: var(--sans); font-size: 12.5px; color: var(--faint);
  text-align: center; max-width: 32rem; margin: 1.1rem auto 0;
}

/* Stage/gallery swaps must never change the card's height — blocks that a
   stage hasn't revealed yet stay in the layout, invisible. */
.dcard .veil { visibility: hidden; }

/* Mobile: the card shares a small viewport with the prose below it, so it
   caps at half the screen and condenses — legend dropped (the bars carry
   their own labels), chrome shrunk. */
@media (max-width: 820px) {
  .dcard { max-height: 50vh; overflow-y: auto; padding: 0.7rem 0.85rem 0.65rem; }
  .dcard__eyebrow { font-size: 9.5px; }
  .dcard__name { font-size: 1.12rem; margin: 0.18rem 0 0; }
  .dcard__town { font-size: 11px; margin-bottom: 0.5rem; }
  .dcard__badges { gap: 0.3rem; margin-bottom: 0.5rem; }
  .badge { font-size: 9px; padding: 0.08rem 0.42rem; }
  .dcard__legend { display: none; }
  .dcard__bars { gap: 0.4rem; margin-bottom: 0.15rem; }
  .dbar { grid-template-columns: 3.6rem 1fr 2.8rem; gap: 0.4rem; }
  .dbar__lab { font-size: 8.5px; }
  .dbar__track { height: 12px; }
  .dbar__val { font-size: 11px; }
  .dcard__stats { padding-top: 0.45rem; margin-top: 0.45rem; gap: 0.3rem; }
  .dstat b { font-size: 12.5px; }
  .dstat span { font-size: 8px; letter-spacing: 0.05em; }
  .dcard__stamp {
    top: 0.5rem; right: 0.55rem;
    font-size: 8.5px; padding: 0.08rem 0.35rem; letter-spacing: 0.09em;
  }
  .gallery__arch { font-size: 10.5px; margin-bottom: 0.45rem; }
  .dcard__pos { font-size: 9px; margin-top: 0.3rem; }
  .dtag { font-size: 7.5px; padding: 0 0.2rem; }

  .eq { font-size: 14px; padding: 0.7rem 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dbar__seg, .dbar__tick { transition: none; }
  .hero__scrollcue { animation: none; }
}
