/* Chicago Voter — Ballot Match.
   Graphic standards borrowed from the City of Chicago: the municipal flag's
   white field, two light-blue bars (the lake & the branches of the river) and
   four red six-pointed stars; CTA station-sign typography (heavy Helvetica,
   white on black); and the eight 'L' line colors for the ballot's sections. */
:root {
  color-scheme: light;
  --flag-blue: #41b6e6; --flag-blue-soft: #b3ddf2; --flag-red: #e4002b;
  --bg: #ffffff; --bg-2: #eef7fc; --surface: #ffffff; --surface-2: #f6fbfe;
  --border: #d5e7f1; --border-2: #b9d7e8;
  --text: #0f1a22; --text-2: #44576a; --text-3: #7a8b99;
  --sign: #111417; --sign-t: #ffffff;
  --star: var(--flag-red); --star-2: #ff4d64; --sky: #1593cf;
  --ok: #178a4c; --lean: #1a73b5; --warn: #b8670f; --no: #c8102e;
  --red: #c60c30; --blue: #00a1de; --brown: #62361b; --green: #009b3a; --orange: #f9461c; --purple: #522398; --pink: #e27ea6; --yellow: #f9e300;
  --r: 16px; --r-sm: 10px;
  --shadow: 0 14px 40px rgba(10, 60, 100, .13);
  --font: 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --flag-blue: #41b6e6; --flag-blue-soft: #1b4f6b; --flag-red: #ff3355;
  --bg: #08121a; --bg-2: #0d1c27; --surface: #112330; --surface-2: #16303f;
  --border: #20394a; --border-2: #2b4b60;
  --text: #eaf4fa; --text-2: #a2bacb; --text-3: #6b8597;
  --sign: #000000; --sign-t: #ffffff;
  --sky: #5cc8f5; --ok: #4fd08a; --lean: #6bb9f0; --warn: #f0ae4c; --no: #ff6b7d;
  --brown: #a9714b; --purple: #9a73e0;
  --shadow: 0 18px 48px rgba(0, 0, 0, .55);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; }
a { color: var(--sky); }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 3px solid var(--flag-blue); outline-offset: 2px; border-radius: 6px; }
b { font-weight: 700; }
svg use { fill: currentColor; }

/* ---------------------------------------------------------------- the flag band
   Four stars light up, one for each quarter of the ballot you fill in. */
.flagband { display: grid; grid-template-rows: 9px auto 9px; background: var(--bg); }
.fb-stripe { background: var(--flag-blue); }
.fb-stars { display: flex; justify-content: center; gap: clamp(10px, 4vw, 26px); padding: 7px 0; }
.fstar { width: 26px; height: 26px; color: var(--border-2); transition: color .4s, transform .4s; display: block; }
.fstar svg { width: 100%; height: 100%; display: block; }
.fstar.lit { color: var(--flag-red); animation: starpop .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes starpop { 0% { transform: scale(.4) rotate(-60deg); } 60% { transform: scale(1.35) rotate(10deg); } 100% { transform: none; } }

/* a faint skyline along the bottom of the page */
.skyline { height: 90px; margin-top: 30px; pointer-events: none; opacity: .1;
  background: var(--text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120' preserveAspectRatio='none'%3E%3Cpath d='M0 120V96h20V80h14v16h10V70h18v26h8V60h6V40h4v20h6v36h14V74h22v22h10V50h8V20h3V8h2v12h3v30h8v46h12V64h16v32h6V84h20v12h10V58h6V30h10v28h6v38h14V70h12V52h8v18h12v26h8V76h16v20h12V40h4V24h2v16h4v56h10V66h18v30h14V56h10v40h12V80h16v16h10V62h22v34h12V72h10v24h20V84h14v12h16V68h10v28h20V120Z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120' preserveAspectRatio='none'%3E%3Cpath d='M0 120V96h20V80h14v16h10V70h18v26h8V60h6V40h4v20h6v36h14V74h22v22h10V50h8V20h3V8h2v12h3v30h8v46h12V64h16v32h6V84h20v12h10V58h6V30h10v28h6v38h14V70h12V52h8v18h12v26h8V76h16v20h12V40h4V24h2v16h4v56h10V66h18v30h14V56h10v40h12V80h16v16h10V62h22v34h12V72h10v24h20V84h14v12h16V68h10v28h20V120Z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }

/* ---------------------------------------------------------------- nav */
.nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.brand-star { width: 26px; height: 26px; color: var(--flag-red); transition: transform .6s; }
.brand:hover .brand-star { transform: rotate(60deg); }
.brand-t { font-weight: 900; font-size: 17px; letter-spacing: .5px; }
.brand-t b { color: var(--flag-red); font-weight: 900; margin-left: 3px; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.navlink { color: var(--text-2); text-decoration: none; font-size: 14px; padding: 6px 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); font-size: 15px; flex: none; }
.ballot-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 14px; border-radius: 6px; background: var(--sign); color: var(--sign-t); font-weight: 800; font-size: 14px; letter-spacing: .2px; }
.bb-n { background: var(--flag-red); color: #fff; border-radius: 4px; padding: 2px 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ballot-btn.pulse { animation: pulse .7s ease; }
@keyframes pulse { 0% { transform: scale(1); } 35% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------- layout */
.layout { max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.main { min-width: 0; }
@media (min-width: 1040px) {
  body[data-phase="q"] .layout { grid-template-columns: minmax(0, 1fr) 390px; }
  body[data-phase="q"] .ballot-pane { position: sticky; top: 76px; bottom: auto; left: auto; right: auto; width: auto; max-height: calc(100vh - 96px); transform: none; z-index: 5; }
  body[data-phase="q"] .bp-close { display: none; }
}

/* ---------------------------------------------------------------- ballot pane */
.ballot-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); overflow-y: auto; padding: 0 0 14px; outline: none; }
.ballot-pane { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 86vh; border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .34s cubic-bezier(.2, .8, .2, 1); }
body.sheet-open .ballot-pane { transform: none; }
@media (min-width: 1040px) { .ballot-pane { left: auto; right: 16px; bottom: 16px; top: 76px; width: 410px; max-height: none; border-radius: var(--r); transform: translateX(115%); } }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(5, 15, 25, .45); opacity: 0; pointer-events: none; transition: opacity .25s; }
body.sheet-open .scrim { opacity: 1; pointer-events: auto; }
.bp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--sign); color: var(--sign-t); padding: 12px 14px; position: sticky; top: 0; z-index: 2; }
.bp-head .kicker { color: var(--flag-blue); margin: 0; }
.bp-head b { font-size: 17px; }
.bp-head .icon-btn { background: transparent; border-color: #444; color: #fff; }
.bp-body { padding: 0 14px; }
.bp-group { margin-top: 14px; }
.bp-gname { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-2); margin-bottom: 2px; }
.bp-gname i { width: 26px; height: 6px; border-radius: 3px; background: var(--line); }
.bp-row { width: 100%; text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "office chip" "pick pick"; gap: 0 8px; padding: 7px 10px 7px 12px; border-radius: 8px; border-left: 3px solid var(--line); margin: 3px 0; transition: background .15s; }
.bp-row:hover { background: var(--surface-2); }
.bp-row.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--flag-blue) 28%, transparent); } 100% { background: transparent; } }
.bp-office { grid-area: office; font-size: 12.5px; color: var(--text-2); }
.bp-pick { grid-area: pick; font-weight: 800; font-size: 14.5px; line-height: 1.3; }
.bp-pick.empty { color: var(--text-3); font-weight: 500; }
.bp-row .chip { grid-area: chip; align-self: start; }

.chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 4px; white-space: nowrap; border: 1px solid currentColor; }
.chip.ok { color: var(--ok); } .chip.lean { color: var(--lean); } .chip.warn { color: var(--warn); } .chip.mute { color: var(--text-3); } .chip.lock { color: var(--star); }

/* the oval field: one oval per mark on the ballot, filling as you answer
   (AutoSelector's whittle dots, turned into a ballot) */
.ovalfield { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 14px 4px; }
.ovalfield i { width: 15px; height: 9px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--line) 70%, var(--text-3)); transition: background .3s, transform .3s; }
.ovalfield i.on { background: var(--line); border-color: var(--line); }
.ovalfield i.no { background: transparent; border-color: var(--no); box-shadow: inset 0 0 0 2px var(--no); }
.ovalfield i.pop { animation: ovalpop .6s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes ovalpop { 0% { transform: scale(.2); } 60% { transform: scale(1.6); } 100% { transform: none; } }
.ovalfield.mini { padding: 0; margin: 2px 0 12px; max-width: 760px; gap: 3px; }
.ovalfield.mini i { width: 11px; height: 7px; border-width: 1.2px; }
.of-caption { font-size: 12.5px; color: var(--text-3); padding: 0 14px; }

/* ---------------------------------------------------------------- type */
.kicker { font-size: 11.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 1.6px; color: var(--star); margin-bottom: 6px; }
h1 { font-size: clamp(40px, 8.5vw, 74px); line-height: .98; letter-spacing: -2px; font-weight: 900; }
h2 { font-size: clamp(22px, 4.2vw, 30px); line-height: 1.16; letter-spacing: -.6px; font-weight: 800; }
h3 { font-size: 20px; letter-spacing: -.3px; line-height: 1.25; font-weight: 800; }
h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--text-3); margin: 14px 0 4px; font-weight: 900; }
.red { color: var(--flag-red); }
.lead { font-size: clamp(16px, 2.3vw, 19px); color: var(--text-2); margin-top: 16px; max-width: 640px; }
.fine { font-size: 13px; color: var(--text-3); margin-top: 14px; max-width: 680px; }
.mute-t { color: var(--text-3); font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 6px; font-weight: 800; font-size: 15px; border: 2px solid var(--border-2); background: var(--surface); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--flag-red); border-color: var(--flag-red); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--flag-red) 32%, transparent); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost:hover { border-color: var(--flag-blue); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 17px; }
.btn-sm { min-height: 36px; font-size: 14px; margin-top: 12px; }
.btn svg { width: 18px; height: 18px; }
.link { color: var(--text-2); font-size: 14px; font-weight: 600; padding: 8px 4px; border-radius: 6px; }
.link:hover { color: var(--text); background: var(--surface-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.card-pop { animation: pop .42s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
.leaving { animation: leave .3s ease forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(-30px); } }

/* ---------------------------------------------------------------- intro */
.intro { max-width: 860px; margin: 3vh auto 0; position: relative; }
.intro h1 .star-inline svg { width: 100%; height: 100%; display: block; }
.intro h1 .star-inline { display: inline-block; width: .72em; height: .72em; color: var(--flag-red); vertical-align: -.02em; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.intro-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 26px; max-width: 640px; }
.intro-facts div { background: var(--sign); color: var(--sign-t); border-radius: 8px; padding: 12px 12px 10px; position: relative; overflow: hidden; }
.intro-facts div::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--line); }
.intro-facts b { display: block; font-size: 26px; letter-spacing: -.5px; font-weight: 900; }
.intro-facts span { font-size: 12.5px; opacity: .8; }
.lines { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.lines span { font-size: 12px; font-weight: 800; padding: 3px 9px 3px 7px; border-radius: 4px; background: var(--surface-2); border-left: 6px solid var(--line); color: var(--text-2); }
@media (max-width: 520px) { .intro-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- the L track (progress) */
.track { position: relative; height: 40px; max-width: 760px; margin-bottom: 4px; }
.track .rail { position: absolute; left: 6px; right: 6px; top: 24px; height: 6px; border-radius: 3px; background: var(--border); }
.track .rail-done { position: absolute; left: 6px; top: 24px; height: 6px; border-radius: 3px; background: var(--line, var(--red)); transition: width .6s cubic-bezier(.3, .8, .3, 1); }
.track .stop { position: absolute; top: 21px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border-2); transition: border-color .4s; }
.track .stop.done { border-color: var(--line, var(--red)); }
.track .train { position: absolute; top: 1px; width: 44px; height: 22px; margin-left: -22px; color: var(--sign); transition: left .7s cubic-bezier(.3, .8, .3, 1); }
.track .train svg { width: 100%; height: 100%; display: block; }
.track .train .win { fill: var(--flag-blue); }
.qmeta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-3); margin: 0 0 10px; max-width: 760px; font-weight: 700; }

/* ---------------------------------------------------------------- question card: a CTA station sign */
.qcard { max-width: 760px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.qsign { display: flex; align-items: center; gap: 12px; background: var(--sign); color: var(--sign-t); padding: 12px 18px; }
.qsign .bullet { width: 34px; height: 34px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: 17px; flex: none; }
.qsign .stn { font-weight: 900; font-size: 15px; letter-spacing: .3px; }
.qsign .stn small { display: block; font-weight: 600; font-size: 11.5px; opacity: .7; letter-spacing: 1px; text-transform: uppercase; }
.qsign .qn { margin-left: auto; font-weight: 900; font-size: 13px; opacity: .8; font-variant-numeric: tabular-nums; }
.qbar { height: 6px; background: var(--line); }
.qbody { padding: clamp(18px, 4vw, 30px); }
.scenario { color: var(--text-2); margin-top: 10px; font-size: 16px; }
.opts { display: grid; gap: 10px; margin-top: 20px; }
.opt { position: relative; display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px 16px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface-2); transition: border-color .15s, transform .15s, background .15s; font-size: 15.5px; line-height: 1.4; overflow: hidden; }
.opt:hover { border-color: var(--line); transform: translateX(3px); }
.opt.sel { border-color: var(--flag-red); background: color-mix(in srgb, var(--flag-red) 7%, var(--surface)); }
.opt.chosen { border-color: var(--flag-red); animation: chosen .45s ease; }
@keyframes chosen { 30% { transform: scale(1.02); } 100% { transform: none; } }
.opts.locked .opt:not(.chosen) { opacity: .4; transition: opacity .2s; }
.opt-key { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 900; background: var(--sign); color: var(--sign-t); margin-top: -2px; transition: background .15s; }
.opt:hover .opt-key, .opt.sel .opt-key, .opt.chosen .opt-key { background: var(--flag-red); }
.qfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 6px; flex-wrap: wrap; }
.qfoot .grp { display: flex; gap: 4px; flex-wrap: wrap; }
.why-asked { max-width: 760px; color: var(--text-3); font-size: 13px; margin-top: 12px; }

/* burst of little stars on a tap */
.burst { position: fixed; z-index: 70; pointer-events: none; width: 0; height: 0; }
.burst svg { position: absolute; width: 14px; height: 14px; margin: -7px; color: var(--flag-red); animation: fly .7s cubic-bezier(.2, .7, .3, 1) forwards; }
.burst svg:nth-child(even) { color: var(--flag-blue); }
@keyframes fly { from { transform: translate(0, 0) scale(.4) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1) rotate(160deg); opacity: 0; } }

/* the "your ballot moved" report from the last answer */
.report { max-width: 760px; margin-bottom: 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); overflow: hidden; animation: drop .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.rp-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-align: left; }
.rp-head .rp-n { font-weight: 900; font-size: 18px; color: var(--flag-red); font-variant-numeric: tabular-nums; }
.rp-head .rp-t { font-size: 14px; color: var(--text-2); flex: 1; }
.rp-head .rp-why { font-size: 13px; font-weight: 800; color: var(--sky); white-space: nowrap; }
.rp-detail { padding: 0 14px 12px; font-size: 14px; color: var(--text-2); }
.rp-detail ul { list-style: none; display: grid; gap: 4px; margin-top: 6px; }
.rp-detail li { display: flex; gap: 8px; align-items: baseline; }
.rp-detail li i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); transform: translateY(1px); }
.rp-detail .from { color: var(--text-3); text-decoration: line-through; }

/* lightning */
.lightning { display: grid; gap: 12px; margin-top: 18px; }
.lrow .seg { justify-self: start; }
.lrow { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-left: 5px solid var(--pink); border-radius: 10px; background: var(--surface-2); }
.ltext b { display: block; }
.ltext span { color: var(--text-2); font-size: 14px; }
.seg { display: inline-flex; border: 2px solid var(--border-2); border-radius: 8px; padding: 3px; gap: 2px; background: var(--surface); flex-wrap: wrap; }
.seg button { padding: 6px 14px; border-radius: 5px; font-weight: 800; font-size: 14px; color: var(--text-2); transition: background .15s, color .15s; }
.seg button.on { background: var(--sign); color: var(--sign-t); }
.seg.big { margin-top: 16px; }
.seg.big button { padding: 9px 20px; }

/* ---------------------------------------------------------------- dialog */
.dlg { margin: auto; width: min(780px, calc(100vw - 20px)); max-height: calc(100vh - 30px); border: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); padding: 0; overflow-y: auto; }
.dlg[open] { animation: dlgin .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes dlgin { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.dlg::backdrop { background: rgba(5, 15, 25, .55); }
.dlg-sign { background: var(--sign); color: var(--sign-t); padding: 14px 18px; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; position: sticky; top: 0; z-index: 2; border-bottom: 6px solid var(--line); }
.dlg-sign .kicker { color: var(--flag-blue); }
.dlg-sign .icon-btn { background: transparent; border-color: #444; color: #fff; }
.es { opacity: .65; font-size: 13.5px; font-style: italic; }
.dlg-in { padding: clamp(14px, 4vw, 26px); padding-top: 4px; }
.ctx { color: var(--text-2); margin-top: 12px; font-size: 15px; }
.rec { margin-top: 16px; border-radius: 10px; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--border); border-left: 6px solid var(--flag-red); }
.rec-top { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--text-2); }
.rec-pick { font-size: 22px; font-weight: 900; margin-top: 4px; letter-spacing: -.4px; }
.reasons { margin: 8px 0 0 18px; font-size: 14.5px; color: var(--text-2); display: grid; gap: 4px; }
.reasons b { color: var(--text); }
.cands, .judges { display: grid; gap: 8px; margin-top: 16px; }
.cand, .judge { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); transition: border-color .2s; }
.cand.on { border-color: var(--flag-red); box-shadow: 0 0 0 1px var(--flag-red); }
.judge.flagged { border-color: var(--warn); }
.cand summary, .judge summary { list-style: none; display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; }
.cand summary::-webkit-details-marker, .judge summary::-webkit-details-marker { display: none; }
.num { flex: none; min-width: 38px; height: 24px; padding: 0 6px; border-radius: 12px; border: 2px solid var(--text-3); display: grid; place-items: center; font-size: 12px; font-weight: 900; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cand.on .num { background: var(--text); border-color: var(--text); color: var(--bg); }
.cname { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cname i { font-style: normal; font-size: 14px; color: var(--text-2); }
.cname em { font-style: normal; font-size: 12.5px; color: var(--text-3); }
.match { text-align: right; line-height: 1.1; min-width: 56px; }
.match b { font-size: 18px; display: block; font-weight: 900; }
.match span { font-size: 11px; color: var(--text-3); }
.mbar { height: 4px; border-radius: 2px; background: var(--border); margin-top: 4px; overflow: hidden; }
.mbar span { display: block; height: 100%; background: var(--line); border-radius: 2px; transform-origin: left; animation: grow .8s cubic-bezier(.2, .8, .2, 1); }
@keyframes grow { from { transform: scaleX(0); } }
.cbody { padding: 0 14px 14px; font-size: 14.5px; color: var(--text-2); }
.cbody p { margin-top: 6px; }
.cbody dl { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr); gap: 5px 12px; margin-top: 6px; }
.cbody dt { font-weight: 800; color: var(--text); text-transform: capitalize; }
.cbody dd { margin: 0; }
@media (max-width: 520px) { .cbody dl { grid-template-columns: minmax(0, 1fr); } .cbody dd { margin-bottom: 6px; } }
.gaps, .align, .measure ul { margin: 4px 0 0 18px; display: grid; gap: 3px; }
.align li.agree::marker { content: '✓  '; color: var(--ok); }
.align li.disagree::marker { content: '✕  '; color: var(--no); }
.align li.meh::marker { content: '~  '; color: var(--text-3); }
.srcs { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; font-size: 13px; }
.srcs span { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); }
.srcs a { overflow-wrap: anywhere; }
.measure { margin-top: 16px; font-size: 15px; color: var(--text-2); }
.measure blockquote { border-left: 5px solid var(--flag-blue); padding: 10px 14px; background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--text); font-weight: 600; }
.mfacts { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.yn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .yn { grid-template-columns: minmax(0, 1fr); } }
.jv { font-weight: 900; font-size: 14px; padding: 3px 10px; border-radius: 4px; }
.jv.yes { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.jv.no { color: var(--no); background: color-mix(in srgb, var(--no) 12%, transparent); }
.jv.blank, .jv.none { color: var(--text-3); }
.flagline { font-weight: 800; color: var(--text); }
.flag-concern { color: var(--no); } .flag-caution { color: var(--warn); } .flag-clean { color: var(--ok); }
.filt { margin-top: 12px; }

/* ---------------------------------------------------------------- toast */
.toast { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translate(-50%, 160%); background: var(--sign); color: var(--sign-t); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: min(440px, calc(100vw - 32px)); font-size: 14px; transition: transform .35s cubic-bezier(.2, .8, .2, 1); border-left: 6px solid var(--flag-red); }
.toast { visibility: hidden; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ---------------------------------------------------------------- results */
.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; width: 100vw; height: 100vh; }
.done { max-width: 920px; }
.arch { display: flex; gap: 18px; align-items: center; background: var(--sign); color: var(--sign-t); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); position: relative; overflow: hidden; animation: reveal .8s cubic-bezier(.2, .8, .2, 1); }
.arch::before, .arch::after { content: ''; position: absolute; left: 0; right: 0; height: 7px; background: var(--flag-blue); }
.arch::before { top: 0; } .arch::after { bottom: 0; }
@keyframes reveal { from { transform: rotateX(70deg); opacity: 0; } to { transform: none; opacity: 1; } }
.arch .kicker { color: var(--flag-blue); }
.arch-emo { font-size: 56px; line-height: 1; animation: starpop 1s .3s cubic-bezier(.2, 1.6, .4, 1) both; }
.arch p { opacity: .85; margin-top: 4px; }
.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.tally div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.tally b { display: block; font-size: 22px; font-weight: 900; }
.tally span { font-size: 12px; color: var(--text-2); }
@media (max-width: 560px) { .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sheet { max-width: 920px; margin-top: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: clamp(14px, 3vw, 26px); }
.sheet-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; border-bottom: 3px solid var(--text); padding-bottom: 10px; }
.sheet-head b { font-size: 18px; font-weight: 900; }
.sheet-head span { color: var(--text-3); font-size: 13px; }
.sg h3 { display: flex; align-items: center; gap: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--text); margin: 22px 0 6px; font-weight: 900; }
.sg h3 i { width: 30px; height: 8px; border-radius: 4px; background: var(--line); }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; padding: 9px 8px; border-bottom: 1px dashed var(--border-2); cursor: pointer; border-radius: 6px; opacity: 0; animation: rowin .4s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes rowin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.srow:hover { background: var(--surface-2); }
.soff { font-size: 14px; color: var(--text-2); }
.soff em { font-style: normal; color: var(--text-3); font-size: 12.5px; }
.spick { font-weight: 800; font-size: 15px; }
.oval { display: inline-grid; place-items: center; min-width: 40px; height: 22px; padding: 0 7px; margin-right: 8px; border-radius: 11px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 900; vertical-align: 1px; font-variant-numeric: tabular-nums; }
.judgesrow { grid-template-columns: minmax(0, 1fr); }
.jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; }
.jcell { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.jcell i { font-style: normal; min-width: 34px; text-align: center; font-size: 11.5px; font-weight: 900; border-radius: 10px; padding: 1px 4px; background: var(--bg-2); color: var(--text-2); }
.jcell b { margin-left: auto; font-size: 12.5px; }
.jcell.yes b { color: var(--ok); } .jcell.no b { color: var(--no); } .jcell.no i { background: var(--no); color: #fff; } .jcell.yes i { background: var(--text); color: var(--bg); }
.jcell.fl { font-weight: 800; }
@media (max-width: 560px) { .srow { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.foot { max-width: 1240px; margin: 0 auto; padding: 14px 18px 60px; border-top: 6px solid var(--flag-blue); color: var(--text-3); font-size: 12.5px; }

@media (max-width: 560px) {
  .bb-l { display: none; }
  .ballot-btn { padding: 0 6px 0 8px; }
  .ballot-btn::before { content: '🗳️'; font-size: 15px; }
  .navlink { display: none; }
  .nav { padding: 8px 12px; }
  .opt { padding: 12px 13px; font-size: 15px; }
  .qsign { padding: 10px 14px; }
  .fstar { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .nav, .flagband, .skyline, .ballot-pane, .scrim, .toast, .foot, .done .cta-row, .done .fine, .dlg, .confetti, .tally { display: none !important; }
  body { background: #fff; color: #000; }
  .layout { padding: 0; display: block; }
  .arch { box-shadow: none; padding: 8px 12px; animation: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .arch-emo { font-size: 28px; }
  .sheet { border: 0; padding: 0; margin-top: 6px; }
  .srow { break-inside: avoid; padding: 4px 0; opacity: 1; animation: none; }
  .oval, .sg h3 i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .jgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 11px; }
}
:root[data-theme="dark"] .track .train { color: #dfe9f0; }
:root[data-theme="dark"] .track .train .win { fill: #0b1620; }
