/* Informed Voter — design system and components.
   Dark by default (matching the brief's reference look), with a light theme.
   Party/data colors are validated: blue/red/green pass the colorblind checks in
   both themes; text never relies on color alone. */

@font-face { font-family: 'Inter'; src: url('../assets/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('../assets/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0912;
  --bg-2: #110e1b;
  --surface-1: #15121f;
  --surface-2: #1c1829;
  --surface-3: #262035;
  --border: rgba(255, 255, 255, .08);
  --border-2: rgba(255, 255, 255, .16);
  --text-1: #f2f0fa;
  --text-2: #bdb8d0;
  --text-3: #8f8ba1;
  --grid: #2a2636;
  --axis: #3b3748;
  --dem: #3987e5;
  --rep: #e66767;
  --third: #008300;
  --other: #77748a;
  --neutral-mid: #383835;
  --not-up: #1e1a29;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --demo: #fab219;
  --brand-1: #5b6bff;
  --brand-2: #a463ff;
  --brand-3: #f0476a;
  --amber: #f5b942;
  --glow-d: rgba(57, 135, 229, .40);
  --glow-r: rgba(230, 103, 103, .40);
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --veil: rgba(6, 5, 12, .72);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f4fa;
  --bg-2: #eceaf5;
  --surface-1: #ffffff;
  --surface-2: #f6f5fb;
  --surface-3: #ebe9f3;
  --border: rgba(20, 16, 40, .10);
  --border-2: rgba(20, 16, 40, .18);
  --text-1: #14111f;
  --text-2: #4a4759;
  --text-3: #6b6880;
  --grid: #e6e4ee;
  --axis: #c9c6d6;
  --dem: #2a78d6;
  --rep: #e34948;
  --third: #008300;
  --other: #8a8799;
  --neutral-mid: #f0efec;
  --not-up: #eceaf2;
  --demo: #a86a00;
  --amber: #9a5f00;
  --glow-d: rgba(42, 120, 214, .22);
  --glow-r: rgba(227, 73, 72, .22);
  --shadow: 0 14px 34px rgba(20, 16, 40, .10);
  --veil: rgba(20, 16, 40, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text-1);
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(91, 107, 255, .16), transparent 60%),
    radial-gradient(900px 480px at 92% 4%, rgba(240, 71, 106, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
:root[data-theme="dark"] body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,.25), transparent),
    radial-gradient(1px 1px at 45% 80%, rgba(255,255,255,.2), transparent),
    radial-gradient(1px 1px at 85% 65%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 10% 90%, rgba(255,255,255,.2), transparent);
  background-size: 420px 420px;
}
body > * { position: relative; z-index: 1; }
#overlay-root { z-index: 100; } /* above the sticky header */
a { color: inherit; }
a:hover { color: var(--text-1); }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.icon-sm { width: 14px; height: 14px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface-2); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1, .display { font-family: 'Bricolage', 'Inter', system-ui, sans-serif; font-weight: 800; letter-spacing: -.025em; }
h1 { font-size: clamp(30px, 4.6vw, 52px); }
h2 { font-size: clamp(21px, 2.4vw, 28px); font-family: 'Bricolage', 'Inter', sans-serif; font-weight: 750; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0 0 .8em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono, .eyebrow { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.grad-text { background: linear-gradient(90deg, var(--brand-1), var(--brand-2) 48%, var(--brand-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.d-text { color: var(--dem); }
.r-text { color: var(--rep); }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.page { padding: 28px 0 64px; min-height: 60vh; }
.stack-sm > * + * { margin-top: 8px; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* Top utility bar ---------------------------------------------------------- */
.topbar { background: rgba(0,0,0,.25); border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
:root[data-theme="light"] .topbar { background: rgba(255,255,255,.6); }
.topbar .wrap { display: flex; gap: 18px; align-items: center; min-height: 34px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.topbar .live { width: 7px; height: 7px; border-radius: 50%; background: var(--rep); display: inline-block; margin-right: 6px; box-shadow: 0 0 0 3px rgba(230,103,103,.18); }
.topbar strong { color: var(--text-1); font-weight: 650; }
.topbar .sep { flex: 1; }
.chamber-odd b { font-weight: 700; }

/* Header -------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: 'Bricolage', sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand .logo-mark { width: 36px; height: 36px; }
.brand small { display: block; font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 9.5px; letter-spacing: .3em; color: var(--text-3); margin-top: -2px; }
.header-spacer { flex: 1; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-1); cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, border-color .15s; }
.pill-btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.icon-only { width: 40px; padding: 0; justify-content: center; }
.avatar-btn { width: 42px; height: 42px; border-radius: 50%; padding: 0; border: 2px solid var(--border-2); overflow: hidden; cursor: pointer; background: var(--surface-2); }
.avatar-btn:hover { border-color: var(--brand-2); }
.avatar { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

.menu-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 10px); min-width: 260px; background: var(--surface-1); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; z-index: 60; }
.menu[hidden] { display: none; }
.menu.left { left: 0; }
.menu.right { right: 0; }
.menu a, .menu button.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text-1); background: none; border: 0; text-align: left; cursor: pointer; font-size: 14.5px; }
.menu a:hover, .menu a:focus-visible, .menu button.menu-item:hover { background: var(--surface-2); }
.menu a[aria-current="page"] { background: var(--surface-3); }
.menu .icon { color: var(--text-3); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.menu-head { padding: 10px 12px 6px; }

/* Ticker -------------------------------------------------------------------- */
.ticker { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-1) 65%, transparent); overflow: hidden; }
.ticker .inner { display: flex; align-items: stretch; }
.ticker .tag { flex: none; padding: 9px 16px; font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .14em; color: var(--amber); font-weight: 700; border-right: 1px solid var(--border); background: var(--bg-2); z-index: 1; }
.ticker .track { display: flex; gap: 28px; padding: 9px 0; white-space: nowrap; animation: ticker 80s linear infinite; font-size: 13px; }
.ticker:hover .track { animation-play-state: paused; }
.ticker a { text-decoration: none; color: var(--text-2); }
.ticker a b { color: var(--text-1); margin-right: 6px; font-weight: 650; }
.ticker .m { font-family: 'JetBrains Mono', monospace; font-weight: 700; margin-left: 6px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker .track { animation: none; } }

/* Demo banner ---------------------------------------------------------------- */
.demo-banner { border-bottom: 1px solid color-mix(in srgb, var(--demo) 35%, transparent); background: color-mix(in srgb, var(--demo) 10%, transparent); font-size: 13.5px; }
.demo-banner .wrap { display: flex; gap: 10px; align-items: center; padding: 9px 0; }
.demo-banner .icon { color: var(--demo); }
.demo-chip { display: inline-flex; align-items: center; gap: 5px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .12em; font-weight: 700; color: var(--demo); border: 1px solid color-mix(in srgb, var(--demo) 55%, transparent); border-radius: 6px; padding: 2px 6px; text-transform: uppercase; white-space: nowrap; vertical-align: middle; }
.demo-chip::before { content: '\25B2'; font-size: 8px; }

/* Buttons, chips, segmented controls ---------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2); font-weight: 650; cursor: pointer; text-decoration: none; transition: transform .1s, background .15s, border-color .15s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { border: 0; color: #fff; background: linear-gradient(90deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3)); box-shadow: 0 8px 24px rgba(164, 99, 255, .28); }
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(90deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3)); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-ghost { background: transparent; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--text-1); }

.chip { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-1); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.chip b { color: var(--text-1); font-weight: 650; }
.chip.rating-D { color: var(--text-1); border-color: color-mix(in srgb, var(--dem) 60%, transparent); background: color-mix(in srgb, var(--dem) 16%, transparent); }
.chip.rating-R { color: var(--text-1); border-color: color-mix(in srgb, var(--rep) 60%, transparent); background: color-mix(in srgb, var(--rep) 16%, transparent); }
.chip.rating-T { color: var(--text-1); border-color: var(--text-3); }
button.chip { cursor: pointer; }
button.chip[aria-pressed="true"] { background: var(--text-1); color: var(--bg); border-color: var(--text-1); }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--border-2); gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 18px; border-radius: 999px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--text-1); }
.seg [aria-current="page"], .seg [aria-pressed="true"], .seg [aria-selected="true"],
.seg [aria-current="page"]:hover, .seg [aria-pressed="true"]:hover, .seg [aria-selected="true"]:hover { background: var(--text-1); color: var(--bg); }
.seg.big a, .seg.big button { min-height: 46px; padding: 0 24px; font-size: 15px; }

.toggle-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-1); cursor: pointer; color: var(--text-2); transition: color .15s, background .15s, border-color .15s, transform .1s; }
.toggle-icon:hover { color: var(--text-1); border-color: var(--text-3); }
.toggle-icon:active { transform: scale(.94); }
.toggle-icon.star[aria-pressed="true"] { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 60%, transparent); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.toggle-icon.heart[aria-pressed="true"] { color: #ff5c8a; border-color: rgba(255, 92, 138, .55); background: rgba(255, 92, 138, .12); }
.toggle-icon .icon { width: 20px; height: 20px; }
.toggle-icon.sm { width: 32px; height: 32px; border-radius: 10px; }
.toggle-icon.sm .icon { width: 17px; height: 17px; }

/* Cards ----------------------------------------------------------------------- */
.card { background: color-mix(in srgb, var(--surface-1) 92%, transparent); border: 1px solid var(--border); border-radius: 20px; padding: 20px; }
.card.tight { padding: 14px 16px; }
.card h3 { margin-bottom: 6px; }
.card-link { text-decoration: none; display: block; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--border-2); transform: translateY(-1px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head p { margin: 0; }
.empty { text-align: center; padding: 40px 20px; border: 1px dashed var(--border-2); border-radius: 20px; color: var(--text-2); }
.empty .icon { width: 30px; height: 30px; color: var(--text-3); margin-bottom: 8px; }

.stat { background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px; min-width: 0; }
.stat .eyebrow { margin-bottom: 6px; }
.stat .value { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.stat .sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-2); background: var(--surface-2); font-size: 14px; color: var(--text-2); }
.notice .icon { margin-top: 2px; color: var(--text-3); }
.notice.warn { border-color: color-mix(in srgb, var(--demo) 45%, transparent); background: color-mix(in srgb, var(--demo) 8%, transparent); }
.notice.warn .icon { color: var(--demo); }

/* Breadcrumbs & hero ----------------------------------------------------------- */
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text-1); }
.hero { text-align: center; padding: 18px 0 8px; }
.hero h1 { max-width: 860px; margin: 14px auto 12px; }
.hero .lede { max-width: 680px; margin: 0 auto 16px; color: var(--text-2); font-size: 17px; }
.label-pill { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-1); font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--text-2); }
.label-pill .dots { color: var(--amber); letter-spacing: 2px; }
.quiz-cta { text-align: center; padding-top: 6px; }
.quiz-cta .btn-cta { min-height: 56px; padding: 0 28px; font-size: 17px; max-width: 100%; white-space: normal; line-height: 1.25; }
.quiz-cta p { max-width: 620px; margin: 10px auto 0; }
.verdict-d { color: var(--dem); }
.verdict-r { color: var(--rep); }
.verdict-x { color: var(--third); }
.likely { font-style: italic; }

/* Candidate cards ---------------------------------------------------------------- */
.cands { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cand { position: relative; background: var(--surface-1); border: 1px solid var(--border); border-radius: 20px; padding: 22px; overflow: hidden; }
.cand::before { content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 2px; border-radius: 2px; background: var(--party, var(--other)); box-shadow: 0 0 18px 2px var(--glow, transparent); }
.cand.party-D { --party: var(--dem); --glow: var(--glow-d); }
.cand.party-R { --party: var(--rep); --glow: var(--glow-r); }
.cand.party-x { --party: var(--third); }
.cand-top { display: flex; align-items: flex-start; gap: 12px; }
.badge { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 750; color: #fff; background: var(--party, var(--other)); flex: none; font-size: 15px; }
.cand-name { font-weight: 750; font-size: 18px; line-height: 1.2; }
.cand-party { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-top: 3px; }
.cand .big { font-size: clamp(38px, 5vw, 54px); font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: 16px 0 6px; color: var(--party, var(--text-1)); }
.cand .votes { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--text-2); }
.cand .cand-actions { margin-left: auto; display: flex; gap: 6px; }
.segments { display: flex; gap: 3px; margin-top: 12px; }
.segments i { flex: 1; height: 7px; border-radius: 3px; background: var(--surface-3); }
.cand .meta { font-size: 13px; color: var(--text-2); margin-top: 12px; }

.waffle-wrap { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin: 20px 0 6px; }
.waffle { display: grid; grid-template-columns: repeat(25, 1fr); gap: 3px; max-width: 560px; width: 100%; margin: 0 auto; }
.waffle i { aspect-ratio: 1; border-radius: 3px; }
.waffle-side { text-align: center; min-width: 74px; }
.waffle-side .p { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.waffle-side .n { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-top: 4px; }
.waffle-caption { text-align: center; }
.waffle-caption strong { display: block; font-size: 17px; }
@media (max-width: 620px) { .waffle-wrap { grid-template-columns: 1fr 1fr; } .waffle { grid-column: 1 / -1; order: 3; } }

/* Tabs --------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; padding: 9px 14px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--text-3); }
.tabs button:hover { color: var(--text-1); }
.tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text-1); }
.tab-panel { padding-top: 16px; }

/* Tables -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.r, table.data th.r { text-align: right; }

/* Charts ---------------------------------------------------------------------------- */
.chart { position: relative; width: 100%; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid line { stroke: var(--grid); stroke-width: 1; }
.chart-svg .baseline { stroke: var(--axis); stroke-width: 1; }
.chart-svg .axis-label text, .chart-svg .axis-label { fill: var(--text-3); font-size: 11.5px; font-family: 'JetBrains Mono', monospace; }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area { opacity: .1; }
.chart-svg .end-dot { stroke: var(--surface-1); stroke-width: 2; }
.chart-svg .end-label { fill: var(--text-2); font-size: 12px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.chart-svg .crosshair { stroke: var(--text-3); stroke-width: 1; }
.chart-svg .hit { fill: transparent; cursor: crosshair; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-line { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.key-box { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow); min-width: 140px; }
.chart-tip .tip-date { color: var(--text-3); font-size: 11.5px; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 7px; }
.tip-row strong { font-weight: 700; }
.tip-row span { color: var(--text-2); }
.spark { display: block; }
.stackbar { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; }
.stackbar span { display: block; min-width: 3px; }
.stackbar span:first-child { border-radius: 4px 0 0 4px; }
.stackbar span:last-child { border-radius: 0 4px 4px 0; }
.legend-list { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.legend-list span { display: inline-flex; align-items: center; gap: 6px; }
.fund-table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.fund-table td { padding: 3px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.fund-table tr:last-child td { border-bottom: 0; }
.fund-table td:first-child { padding-right: 8px; }
/* Flex on an inner span: a flex <td> leaves the table layout, and its divider then
   sits at a different height from the number cells' when a label wraps. */
.fund-table .fund-label { display: flex; align-items: center; gap: 6px; }
.fund-table .key-box { flex: none; }
.fund-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 10px; }
.share-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.share-bar span { display: block; }

/* Maps -------------------------------------------------------------------------------- */
.map { position: relative; width: 100%; }
.map-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.map .region { stroke: var(--bg); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; transition: filter .12s; }
.map .region:hover, .map .region:focus { filter: brightness(1.25) saturate(1.1); outline: none; }
:root[data-theme="light"] .map .region:hover { filter: brightness(.92) saturate(1.15); }
.map .outline-hover { fill: none; stroke: var(--text-1); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; opacity: 0; }
.map .outline-selected { fill: none; stroke: var(--text-1); stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; opacity: 0; filter: drop-shadow(0 0 6px rgba(255,255,255,.35)); }
.map-labels text { font-size: 12px; font-weight: 700; fill: var(--text-1); pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; font-family: 'JetBrains Mono', monospace; }
.map-tip { position: absolute; z-index: 6; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); min-width: 190px; max-width: 280px; font-size: 13px; }
.map-tip .t-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.map-tip .t-row { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.map-tip .t-row b { color: var(--text-1); }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.map-zoom button:hover { color: var(--text-1); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--border); }
.map-card { padding: 16px; }
.map-spot { position: relative; }
.map-spot::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: -10px; height: 40px; background: radial-gradient(ellipse at center, rgba(164,99,255,.18), transparent 70%); pointer-events: none; }

/* Home ---------------------------------------------------------------------------------- */
.control-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .control-tiles { grid-template-columns: 1fr; } }
.control { padding: 18px 20px; }
.control .bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 12px 0 8px; }
.control .bar span:first-child { background: var(--dem); }
.control .bar span:last-child { background: var(--rep); }
.control .bar span.n { background: var(--other); }
.control .odds { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); }
.control .odds b { font-size: 22px; color: var(--text-1); display: block; letter-spacing: -.02em; }
.race-list { display: grid; gap: 8px; }
.race-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-1); text-decoration: none; }
.race-row:hover { border-color: var(--border-2); }
.race-row .title { font-weight: 650; }
.race-row .sub { font-size: 12.5px; color: var(--text-3); }
.mini-h2h { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; font-size: 13px; }
.mini-h2h .l { text-align: right; }
.mini-h2h .bar { display: flex; height: 8px; width: 120px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface-3); }
@media (max-width: 700px) { .race-row { grid-template-columns: 1fr auto; } .race-row .mini-h2h { grid-column: 1 / -1; } }

/* State page ------------------------------------------------------------------------------ */
.state-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.ballot-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.toggles { padding: 12px 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
@media (min-width: 900px) { .toggles { position: sticky; top: 64px; z-index: 20; background: linear-gradient(var(--bg) 70%, transparent); } }
.compact-race { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.compact-race .h2h { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.compact-cand { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.compact-cand .badge { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
.compact-cand .nm { font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-cand .sh { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-left: auto; color: var(--party); }
.compact-cand.party-D { --party: var(--dem); }
.compact-cand.party-R { --party: var(--rep); }
.compact-cand.party-x { --party: var(--third); }
@media (max-width: 700px) { .compact-race { grid-template-columns: 1fr; } .compact-race .h2h { grid-template-columns: 1fr; } }
.district-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.district-btn { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-1); cursor: pointer; text-align: left; text-decoration: none; }
.district-btn:hover { border-color: var(--border-2); }
.district-btn[aria-pressed="true"] { border-color: var(--text-1); box-shadow: 0 0 0 1px var(--text-1) inset; }
.district-btn .dn { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.district-btn .dm { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; }
.district-btn.not-up { opacity: .5; cursor: default; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }

/* Intro ---------------------------------------------------------------------------------------- */
body.is-intro .topbar, body.is-intro .site-header, body.is-intro .ticker, body.is-intro .demo-banner, body.is-intro .site-footer { display: none; }
.intro { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.intro-card { width: min(880px, 100%); background: color-mix(in srgb, var(--surface-1) 88%, transparent); border: 1px solid var(--border-2); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.intro-top { padding: 28px 32px; background: linear-gradient(120deg, rgba(91,107,255,.28), rgba(164,99,255,.18) 50%, rgba(240,71,106,.22)); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.intro-top .logo-mark { width: 52px; height: 52px; }
.intro-body { padding: 28px 32px 32px; }
.countries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 20px 0 8px; }
@media (max-width: 560px) { .countries { grid-template-columns: 1fr; } .intro-top, .intro-body { padding-inline: 20px; } }
.country { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; border: 1px solid var(--border-2); background: var(--surface-2); text-align: left; cursor: pointer; text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
.country:hover { border-color: var(--brand-2); transform: translateY(-1px); }
.country .flag { width: 64px; height: 40px; border-radius: 6px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px var(--border-2); }
.country .flag svg { width: 100%; height: 100%; display: block; }
.country .cn { font-weight: 700; font-size: 16.5px; }
.country .cs { font-size: 13px; color: var(--text-2); }
.country.disabled { cursor: not-allowed; opacity: .42; filter: grayscale(1); }
.country.disabled:hover { transform: none; border-color: var(--border-2); }
.country .go { margin-left: auto; color: var(--text-3); }
.features { display: grid; gap: 0; margin-top: 18px; border-top: 1px solid var(--border); }
.features div { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.features dt { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .14em; color: var(--text-3); padding-top: 2px; }
.features dd { margin: 0; color: var(--text-2); }
.features dd b { color: var(--text-1); display: block; }

/* Profile -------------------------------------------------------------------------------------- */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-avatar { width: 108px; height: 108px; border-radius: 50%; overflow: hidden; border: 3px solid var(--border-2); box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand-2) 14%, transparent); flex: none; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-3)); transition: width .3s; }
.cat-progress { display: grid; grid-template-columns: minmax(0, 1fr) 80px 48px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cat-progress:last-child { border-bottom: 0; }

/* Questionnaire ------------------------------------------------------------------------------- */
.quiz { max-width: 760px; margin: 0 auto; }
.quiz-card:focus { outline: none; }
.quiz-card { background: var(--surface-1); border: 1px solid var(--border-2); border-radius: 26px; padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow); }
.quiz-q { font-family: 'Bricolage', 'Inter', sans-serif; font-weight: 700; font-size: clamp(22px, 3vw, 30px); line-height: 1.25; letter-spacing: -.015em; margin: 14px 0 24px; min-height: 2.5em; }
.quiz-q.has-terms { margin-bottom: 8px; }
.term-hint { margin: 0 0 20px; }
/* Glossary terms: a dotted underline marks a word with a definition. */
.term { display: inline; font: inherit; letter-spacing: inherit; color: inherit; text-align: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help; text-decoration: underline dotted var(--brand-2); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.term:hover, .term[aria-expanded="true"] { text-decoration-style: solid; }
.term:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }
.term-tip { position: absolute; z-index: 60; width: max-content; max-width: min(340px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--border-2); box-shadow: var(--shadow); font: 14px/1.5 'Inter', system-ui, sans-serif; color: var(--text-2); }
.term-tip b { display: block; margin-bottom: 4px; color: var(--text-1); font-size: 14.5px; }
.scale { display: grid; gap: 10px; }
.scale button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 15.5px; text-align: left; transition: border-color .12s, background .12s, transform .08s; }
.scale button:hover { border-color: var(--text-3); background: var(--surface-3); }
.scale button:active { transform: scale(.99); }
.scale button .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-3); flex: none; display: grid; place-items: center; }
.scale button[aria-pressed="true"] { border-color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 16%, var(--surface-2)); }
.scale button[aria-pressed="true"] .dot { border-color: var(--brand-2); background: var(--brand-2); box-shadow: inset 0 0 0 3px var(--surface-2); }
.scale .k { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-3); }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.quiz-cats { display: flex; gap: 4px; margin-top: 10px; }
.quiz-cats i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.quiz-cats i.done { background: var(--brand-2); }
.quiz-cats i.cur { background: var(--brand-3); }
.answer-list { display: grid; gap: 6px; }
.answer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); text-decoration: none; font-size: 14px; }
.answer-row:hover { background: var(--surface-3); }
.answer-tag { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }

/* Matching -------------------------------------------------------------------------------------- */
.match-list { display: grid; gap: 10px; }
.match-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(120px, 220px) 76px; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-1); cursor: pointer; text-align: left; width: 100%; transition: border-color .15s, transform .12s; }
.match-row:hover { border-color: var(--brand-2); transform: translateY(-1px); }
.match-row .rank { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--text-3); font-size: 18px; text-align: center; }
.match-row .pct { font-size: 26px; font-weight: 800; text-align: right; letter-spacing: -.02em; }
.match-row .meter { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.match-row .meter span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); }
@media (max-width: 620px) { .match-row { grid-template-columns: 34px minmax(0, 1fr) 64px; } .match-row .meter { grid-column: 2 / -1; } }

.overlay { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(170px, 34vh); gap: 14px; padding: 14px; background: var(--veil); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.overlay .panel { background: var(--surface-1); border: 1px solid var(--border-2); border-radius: 22px; box-shadow: var(--shadow); overflow: auto; padding: 18px 20px; overscroll-behavior: contain; }
.overlay .panel h3 { display: flex; align-items: center; gap: 8px; position: sticky; top: -18px; background: var(--surface-1); padding: 4px 0 10px; margin: -4px 0 4px; z-index: 1; }
.overlay .p-left { grid-column: 1; grid-row: 1; animation: slide-l .25s ease-out; }
.overlay .p-right { grid-column: 3; grid-row: 1; animation: slide-r .25s ease-out; }
.overlay .p-center { grid-column: 2; grid-row: 1; align-self: center; text-align: center; animation: fade .2s; }
.overlay .p-bottom { grid-column: 1 / -1; grid-row: 2; animation: slide-b .25s ease-out; }
.overlay .close-x { position: absolute; top: 18px; right: 18px; z-index: 2; }
@keyframes slide-l { from { transform: translateX(-30px); opacity: 0; } }
@keyframes slide-r { from { transform: translateX(30px); opacity: 0; } }
@keyframes slide-b { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .overlay .panel { animation: none !important; } }
@media (max-width: 900px) {
  .overlay { grid-template-columns: 1fr; grid-template-rows: auto; overflow: auto; align-content: start; }
  .overlay .p-left, .overlay .p-right, .overlay .p-center, .overlay .p-bottom { grid-column: 1; grid-row: auto; overflow: visible; }
  .overlay .p-center { order: -1; }
}
.evidence { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.evidence:last-child { border-bottom: 0; }
.evidence .q { font-weight: 600; margin-bottom: 4px; }
.evidence .src { white-space: nowrap; }
.evidence a.src-link, .evidence button.src-link { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-3); vertical-align: baseline; margin-left: 4px; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.sim-dot, .dif-dot, .unc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sim-dot { background: var(--good); }
.dif-dot { background: var(--critical); }
.unc-dot { background: var(--text-3); }

/* News --------------------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.news-list { display: grid; gap: 10px; }
.news-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-1); }
.news-item a.headline { font-weight: 700; font-size: 16.5px; line-height: 1.3; text-decoration: none; }
.news-item a.headline:hover { text-decoration: underline; text-underline-offset: 3px; }
.news-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-3); }
.news-meta .src { font-weight: 650; color: var(--text-2); }
.topic-tag { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-2); color: var(--text-2); }

/* Inflation ------------------------------------------------------------------------------------ */
.series-card .head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.series-card .val { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.delta-up { color: var(--rep); }
.delta-down { color: var(--good); }
:root[data-theme="light"] .delta-down { color: #006300; }
.series-card .chart { margin-top: 8px; }

/* Parties -------------------------------------------------------------------------------------- */
.party-card { border-top: 3px solid var(--tone, var(--other)); }
.party-card.tone-dem { --tone: var(--dem); }
.party-card.tone-rep { --tone: var(--rep); }
.party-card.tone-third { --tone: var(--third); }
.party-card ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14.5px; }
.party-card li { margin: 4px 0; }
.ladder { list-style: none; padding: 0; margin: 10px 0 0; counter-reset: rung; }
.ladder li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.ladder li::before { counter-increment: rung; content: counter(rung); font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-3); text-align: right; }
.ladder .role { color: var(--text-3); font-size: 12.5px; display: block; }
.ladder .who { font-weight: 650; }
.group-card { background: var(--surface-2); border-radius: 16px; padding: 16px; border: 1px solid var(--border); }

/* Location & donate --------------------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.input { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-1); font: inherit; }
.input:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-2); flex: none; }
.suggestion { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; }
.suggestion:hover { border-color: var(--brand-2); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 600; }
.cashtag { font-family: 'Bricolage', sans-serif; font-weight: 800; font-size: 40px; letter-spacing: -.02em; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--brand-2); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer -------------------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--text-3); font-size: 13px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.site-footer a { color: var(--text-2); }

@media (max-width: 620px) {
  .page { padding-top: 20px; }
  .card { padding: 16px; border-radius: 18px; }
  .site-header .wrap { min-height: 58px; }
  .brand-text { display: none; }
  .toggles { top: 58px; }
  .seg a, .seg button { padding: 0 14px; }
  .hide-sm { display: none !important; }
}

/* Researched (real) data ------------------------------------------------------------ */
.real-chip { display: inline-flex; align-items: center; gap: 5px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .12em; font-weight: 700; color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 55%, transparent); border-radius: 6px; padding: 2px 6px; text-transform: uppercase; white-space: nowrap; vertical-align: middle; }
.real-chip::before { content: '\2713'; font-size: 10px; }
:root[data-theme="light"] .real-chip { color: #006300; border-color: rgba(0, 99, 0, .5); }
.ratings-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; }
.ratings-row .chip { font-size: 12.5px; }
.race-notes { list-style: none; padding: 0; margin: 14px auto 0; max-width: 760px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); text-align: left; }
.race-notes li { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.race-notes a { color: var(--text-1); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.field-cand { padding: 18px; }
.field-cand .badge { width: 40px; height: 40px; font-size: 14px; }
.field-cand .cand-name { font-size: 16px; }
.field-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.field-stats b { font-size: 18px; letter-spacing: -.01em; }
.cand .meta a { color: var(--text-1); }

.evidence .quote { color: var(--text-1); font-style: italic; }

/* Automatically refreshed data ------------------------------------------------------- */
.live-chip { display: inline-flex; align-items: center; gap: 5px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .12em; font-weight: 700; color: #8f9bff; border: 1px solid rgba(143, 155, 255, .5); border-radius: 6px; padding: 2px 6px; text-transform: uppercase; white-space: nowrap; vertical-align: middle; }
.live-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
:root[data-theme="light"] .live-chip { color: #3c46c4; border-color: rgba(60, 70, 196, .45); }
.poll-dots circle { opacity: .45; stroke: var(--surface-1); stroke-width: 1; }
.good-text { color: var(--good); }
.warn-text { color: var(--demo); }
:root[data-theme="light"] .good-text { color: #006300; }
.nowrap { white-space: nowrap; }
.control .gain { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.control .gain b { color: var(--text-1); }
.control .market { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.control-history { margin-top: 10px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.check-list li { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.check-list .st { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding-top: 2px; }
.check-list .st.pass { color: var(--good); }
.check-list .st.warn { color: var(--demo); }
.check-list .st.fail { color: var(--critical); }
.check-list .st.info { color: var(--text-3); }
:root[data-theme="light"] .check-list .st.pass { color: #006300; }
.check-list .detail { color: var(--text-3); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
