/* ============================================================
   THE MARYLAND PRIMARY — application styles
   Editorial / data-journalism aesthetic.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -.01em; }
button { font-family: inherit; cursor: pointer; }

/* film grain overlay for atmosphere */
#grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 68px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark {
  font-family: var(--font-display); font-weight: 900; font-size: 22px;
  background: var(--accent); color: #fff; width: 42px; height: 42px;
  display: grid; place-items: center; border-radius: 8px; letter-spacing: -.04em;
  box-shadow: var(--shadow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.brand-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.brand-credit { font-size: 10px; letter-spacing: .04em; color: var(--ink-faint); opacity: .8; font-style: italic; }
.footer-credit { margin-top: 6px; font-size: 12px; color: var(--ink-faint); font-style: italic; }
.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 8px 13px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 500;
  color: var(--ink-soft); transition: all var(--t-fast) var(--ease); white-space: nowrap;
}
.main-nav a:hover { color: var(--ink); background: var(--bg-sunk); }
.main-nav a.active { color: var(--accent); font-weight: 700; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.refresh-pill {
  display: flex; align-items: center; gap: 7px; font-family: var(--font-mono);
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: var(--bg-sunk); border: 1px solid var(--line); color: var(--ink-soft);
}
.refresh-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 0 0 var(--good); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.theme-btn, .nav-toggle {
  width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--ink); font-size: 18px; transition: all var(--t-fast);
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle { display: none; }

/* news ticker */
.ticker { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-sunk); height: 34px; }
.ticker-track { display: flex; gap: 48px; align-items: center; height: 34px; white-space: nowrap;
  animation: ticker 60s linear infinite; padding-left: 100%; font-size: 13px; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-100%); } }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.ticker-item b { color: var(--accent); font-family: var(--font-mono); font-weight: 700; }
.ticker-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; background: var(--accent);
  color: #fff; padding: 2px 6px; border-radius: 3px; }

/* global filter bar */
.filter-bar { border-bottom: 1px solid var(--line); background: var(--bg-elev); }
.filter-bar-inner { max-width: var(--maxw); margin: 0 auto; padding: 8px 24px; display: flex; align-items: center;
  gap: 14px; flex-wrap: wrap; }
.filter-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); font-weight: 700; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.seg-btn { border: none; background: none; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  transition: all var(--t-fast); border-right: 1px solid var(--line); }
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: var(--bg-sunk); color: var(--ink); }
.seg-btn.active { color: #fff; background: var(--ink); }
.seg-btn.seg-dem.active { background: var(--dem); }
.seg-btn.seg-rep.active { background: var(--rep); }
.county-filter { display: inline-flex; align-items: center; gap: 7px; }
.county-select { padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); font-family: var(--font-body); font-size: 13px; font-weight: 500; cursor: pointer; max-width: 200px; }
.county-select:focus { outline: none; border-color: var(--accent); }
.filter-clear { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  font-size: 12px; color: var(--ink-soft); transition: all var(--t-fast); }
.filter-clear:hover { border-color: var(--accent); color: var(--accent); }
.filter-active-note { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
@media (max-width: 720px) { .filter-bar-inner { gap: 8px; padding: 8px 16px; } .filter-label { display: none; } }

/* ---------- layout ---------- */
.app-main { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 80px; min-height: 60vh; }
.loading { display: grid; place-items: center; gap: 16px; padding: 120px 0; color: var(--ink-faint); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* page intro / section heads */
.page-head { margin-bottom: 28px; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .18em; color: var(--accent);
  font-weight: 700; margin-bottom: 8px; }
.page-title { font-size: clamp(30px, 5vw, 52px); font-weight: 800; letter-spacing: -.025em; }
.page-title em { font-style: italic; color: var(--accent); }
.page-sub { color: var(--ink-soft); font-size: 17px; max-width: 60ch; margin-top: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin: 40px 0 20px; }
.section-head h2 { font-size: 24px; }
.section-head .more { font-size: 13px; color: var(--accent); font-weight: 600; }

/* ---------- hero (dashboard) ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin-bottom: 12px; align-items: start; }
.hero-lead { border-top: 4px solid var(--accent); padding-top: 18px; }
.hero-lead .kicker { color: var(--accent); }
.hero-headline { font-size: clamp(34px, 6vw, 60px); font-weight: 900; letter-spacing: -.03em; margin: 6px 0 14px; }
.hero-dek { font-size: 18px; color: var(--ink-soft); line-height: 1.5; }
.hero-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.stat { background: var(--bg-elev); padding: 22px 18px; display: flex; flex-direction: column; justify-content: center; min-height: 104px; }
.stat-num { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; color: var(--accent); }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin-top: 6px; }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast), border-color var(--t-fast);
  position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
/* equal-height cards across a grid row: stretch to row height, push footer to bottom */
.grid { align-items: stretch; }
.grid > * { min-width: 0; }
.race-card { display: flex; flex-direction: column; }
.race-card .rc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.rc-office { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.15; }
.rc-meta { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.rc-tier { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.tier-Toss-up { background: var(--accent); color: #fff; }
.tier-Competitive { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.tier-Lean { background: var(--bg-sunk); color: var(--ink-soft); }
.tier-Safe { background: var(--bg-sunk); color: var(--ink-faint); }

/* candidate bar rows */
.cand-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 5px 0; font-size: 14px; }
.cand-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cand-name .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-name .lead-check { font-weight: 800; }
.lead-check.clinched { color: var(--good); }
.lead-check.leading-now { color: var(--ink-faint); font-weight: 700; }
.lead-legend { font-size: 11.5px; color: var(--ink-faint); margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--line); display: flex; gap: 16px; flex-wrap: wrap; }
.lead-legend .lead-check { margin-right: 3px; }
.inc-tag { font-size: 9px; font-weight: 800; letter-spacing: .06em; background: var(--accent-2); color: #fff;
  padding: 1px 5px; border-radius: 3px; flex: none; }
.inc-alert { color: var(--rep); font-weight: 800; }
.inc-warn { color: var(--accent); font-weight: 700; }
.inc-ok { color: var(--good); font-weight: 600; }
.inc-loss-banner { background: color-mix(in srgb, var(--rep) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--rep) 40%, transparent); border-left: 4px solid var(--rep);
  border-radius: var(--r-md); padding: 13px 18px; margin-top: 8px; font-size: 15px; color: var(--ink); }
.inc-loss-banner b { color: var(--rep); }
/* major flag: defeated incumbents banner (top of the incumbents page) */
.inc-defeat-banner { background: color-mix(in srgb, var(--rep) 10%, var(--bg-elev));
  border: 2px solid var(--rep); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 28px; box-shadow: var(--shadow); }
.inc-defeat-head { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--rep); margin-bottom: 14px; }
.inc-defeat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.inc-defeat-item { display: block; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--rep);
  border-radius: var(--r-sm); padding: 11px 13px; transition: all var(--t-fast); }
.inc-defeat-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.idi-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.idi-race { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.idi-stat { font-size: 11.5px; color: var(--ink-faint); font-family: var(--font-mono); margin-top: 4px; }

.inc-trouble-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 12px; }
.inc-trouble-card { display: flex; flex-direction: column; border-left: 4px solid var(--accent); }
.itc-list { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.itc-cand { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.itc-pct { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
.inc-trouble-card:has(.inc-alert) { border-left-color: var(--rep); }
@media (max-width: 720px) { .inc-trouble-list { grid-template-columns: 1fr; } }
.party-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pd-dem, .dot-dem { background: var(--dem); }
.pd-rep, .dot-rep { background: var(--rep); }
.pd-oth, .dot-oth { background: var(--oth); }
.cand-val { font-family: var(--font-mono); font-weight: 600; font-size: 13px; text-align: right; }
.cand-val .pct { color: var(--ink); }
.seat-chip { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-right: 6px;
  text-transform: uppercase; letter-spacing: .03em; }
.seat-in { background: var(--good); color: #fff; }
.seat-likely { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.seat-tossup { background: var(--accent); color: #fff; }
.seat-longshot { background: var(--bg-sunk); color: var(--ink-soft); }
.seat-out { background: var(--bg-sunk); color: var(--ink-faint); }
.cand-val .votes { color: var(--ink-faint); font-size: 11.5px; margin-left: 6px; }
.bar-track { grid-column: 1/-1; height: 6px; background: var(--bg-sunk); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width var(--t-med) var(--ease); }
.bf-dem { background: var(--dem); } .bf-rep { background: var(--rep); } .bf-oth { background: var(--oth); }
.leading .bar-fill { box-shadow: inset 0 0 0 99px color-mix(in srgb, currentColor 0%, transparent); }

/* reporting + footer of card */
.rc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-faint); }
.reporting { font-family: var(--font-mono); }
.fav-btn { background: none; border: none; font-size: 17px; color: var(--ink-faint); transition: all var(--t-fast); line-height: 1; }
.fav-btn:hover { transform: scale(1.2); color: var(--gold); }
.fav-btn.on { color: var(--gold); }

/* ---------- needle component ---------- */
.needle-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.needle-gauge { position: relative; width: 200px; height: 110px; overflow: hidden; }
.needle-svg { width: 200px; height: 110px; display: block; }
.needle-pointer { transform-origin: 100px 100px; transition: transform 1s var(--ease); }
.needle-state { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.needle-prob { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.needle-mini { width: 100%; height: 8px; border-radius: 999px; overflow: hidden; display: flex; background: var(--bg-sunk); }

/* "how the night unfolded" interactive chart */
.hist-wrap { position: relative; }
.hist-svg { display: block; overflow: visible; }
.hist-hit { cursor: crosshair; }
.hist-tip { position: absolute; top: 4px; min-width: 180px; background: var(--ink); color: var(--bg);
  border-radius: var(--r-sm); padding: 9px 11px; font-size: 12.5px; box-shadow: var(--shadow); pointer-events: none; z-index: 50; }
.hist-tip .ht-head { font-weight: 700; margin-bottom: 6px; font-family: var(--font-mono); font-size: 11.5px; opacity: .85; }
.hist-tip .ht-row { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 7px; align-items: center; padding: 1px 0; }
.hist-tip .ht-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-tip .ht-row b { font-family: var(--font-mono); }
.hist-tip .ht-v { font-family: var(--font-mono); opacity: .6; font-size: 11px; }

/* win-probability panel (replaces the needle gauge) */
.wp-row { display: grid; grid-template-columns: 1fr 120px 44px; gap: 10px; align-items: center; padding: 7px 0; }
.wp-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-width: 0; }
.wp-name .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-track { height: 10px; background: var(--bg-sunk); border-radius: 999px; overflow: hidden; }
.wp-fill { height: 100%; border-radius: 999px; transition: width var(--t-med) var(--ease); }
.wp-pct { font-family: var(--font-mono); font-weight: 700; font-size: 14px; text-align: right; }
@media (max-width: 520px) { .wp-row { grid-template-columns: 1fr 80px 40px; } }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-family: var(--font-body); font-weight: 700; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint);
  padding: 10px 12px; border-bottom: 2px solid var(--ink); background: var(--bg-elev); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.tbl tr:hover td { background: var(--bg-sunk); }
.tbl .num { font-family: var(--font-mono); text-align: right; }
.tbl .lead-row td { font-weight: 600; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--accent); }

/* expandable precinct/county rows */
.expand-row td { padding: 0; background: var(--bg-sunk); }
.expand-inner { padding: 14px 18px; }
.disclosure { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 13px; }
.disclosure .chev { transition: transform var(--t-fast); }
.disclosure[aria-expanded="true"] .chev { transform: rotate(90deg); }

/* ---------- chips / filters ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-elev);
  font-size: 13.5px; font-weight: 500; color: var(--ink-soft); transition: all var(--t-fast);
}
.chip:hover { border-color: var(--line-strong); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search-box { width: 100%; padding: 13px 16px; font-size: 15px; font-family: var(--font-body);
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink);
  margin-bottom: 16px; }
.search-box:focus { outline: none; border-color: var(--accent); }

/* ---------- map ---------- */
.map-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.map-panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px;
  position: sticky; top: 92px; max-height: calc(100vh - 120px); overflow-y: auto; }
#map { height: calc(100vh - 150px); min-height: 560px; border-radius: var(--r-md); border: 1px solid var(--line); overflow: hidden; }
.leaflet-container { background: var(--bg-sunk); font-family: var(--font-body); }
.map-legend { margin-top: 16px; }
.legend-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13.5px; }
.legend-swatch { width: 22px; height: 14px; border-radius: 3px; flex: none; border: 1px solid rgba(0,0,0,.15); }
.race-pick { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: none; color: var(--ink-soft); font-size: 14px; }
.race-pick:hover { background: var(--bg-sunk); color: var(--ink); }
.race-pick.active { background: var(--bg-sunk); color: var(--accent); font-weight: 600; border-color: var(--line); }

/* ---------- candidate page ---------- */
.cand-hero { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: start; margin-bottom: 32px; }
.cand-photo { width: 180px; height: 220px; border-radius: var(--r-md); object-fit: cover; background: var(--bg-sunk);
  border: 1px solid var(--line); display: grid; place-items: center; font-size: 60px; color: var(--ink-faint); font-family: var(--font-display); }
.cand-links a { display: inline-flex; gap: 6px; align-items: center; padding: 7px 13px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 13.5px; margin: 4px 6px 0 0; transition: all var(--t-fast); }
.cand-links a:hover { border-color: var(--accent); color: var(--accent); }
.news-item { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news-item .nt { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.news-item .ns { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- vote-type stacked bar ---------- */
.vt-bar { display: flex; height: 28px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.vt-seg { display: grid; place-items: center; font-size: 11px; font-weight: 600; font-family: var(--font-mono); color: #fff; min-width: 0; }
.vt-legend { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); }
.vt-leg-item { display: inline-flex; align-items: center; gap: 6px; }
.vt-leg-item b { color: var(--ink); font-weight: 600; }
.vt-swatch { width: 14px; height: 14px; border-radius: 3px; flex: none; border: 1px solid rgba(0,0,0,.12); }

/* ---------- misc ---------- */
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: .05em; }
.badge-dem { background: color-mix(in srgb, var(--dem) 16%, transparent); color: var(--dem); }
.badge-rep { background: color-mix(in srgb, var(--rep) 16%, transparent); color: var(--rep); }
.badge-inc { background: var(--gold); color: #fff; }
.disclaimer { background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--r-md); padding: 14px 18px; font-size: 14px; color: var(--ink-soft); margin-bottom: 24px; display: flex; gap: 12px; align-items: flex-start; }
.disclaimer b { color: var(--accent); }
.crumb { font-size: 13px; color: var(--ink-faint); margin-bottom: 14px; }
.crumb a:hover { color: var(--accent); }
.empty { text-align: center; padding: 80px 20px; color: var(--ink-faint); }
.empty .big { font-size: 48px; margin-bottom: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px;
  border-radius: var(--r-sm); background: var(--accent); color: #fff; border: 1px solid var(--accent);
  font-weight: 600; font-size: 14px; line-height: 1.2; transition: all var(--t-fast); box-sizing: border-box;
  vertical-align: top; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: var(--bg-elev); color: var(--ink); border: 1px solid var(--line); }

/* theme sheet */
.theme-sheet[hidden] { display: none !important; }
.theme-sheet { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.4);
  display: grid; place-items: center; backdrop-filter: blur(3px); }
.theme-sheet-inner { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px; max-width: 520px; width: 90%; box-shadow: var(--shadow); }
.theme-sheet-inner h3 { font-size: 22px; margin-bottom: 18px; }
.theme-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.theme-card { border: 2px solid var(--line); border-radius: var(--r-md); overflow: hidden; cursor: pointer; transition: all var(--t-fast); }
.theme-card:hover { transform: translateY(-2px); }
.theme-card.active { border-color: var(--accent); }
.theme-swatch { height: 64px; display: flex; }
.theme-swatch span { flex: 1; }
.theme-card .tc-name { padding: 8px 10px; font-size: 13px; font-weight: 600; }
.btn-close { margin-top: 18px; width: 100%; padding: 11px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--ink); color: var(--bg); font-weight: 600; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-elev); margin-top: 60px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px; display: flex; justify-content: space-between;
  gap: 20px; font-size: 13px; color: var(--ink-faint); flex-wrap: wrap; }

/* info tooltips (jargon explainers) */
.info-tip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; cursor: help; }
.info-i { width: 16px; height: 16px; border-radius: 50%; background: var(--ink-faint); color: var(--bg);
  font-size: 10px; font-weight: 700; font-family: var(--font-body); display: grid; place-items: center; font-style: normal; }
.info-tip:hover .info-i, .info-tip:focus .info-i { background: var(--accent); }
.info-pop { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 260px; background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.45; font-weight: 400;
  padding: 10px 12px; border-radius: var(--r-sm); box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity var(--t-fast); z-index: 500; text-transform: none; letter-spacing: normal; }
.info-pop::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink); }
.info-tip:hover .info-pop, .info-tip:focus .info-pop { opacity: 1; }
@media (max-width: 600px) { .info-pop { width: 200px; left: auto; right: 0; transform: none; } .info-pop::after { left: auto; right: 6px; } }

/* "leader flipped" pulse (Expansionist) */
@keyframes flip-flash { 0%,100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 3px var(--gold); } }
.just-flipped { animation: flip-flash 1.4s var(--ease) 2; }
.projected-pill { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  background: var(--good); color: #fff; padding: 2px 7px; border-radius: 4px; margin-left: 6px; }

/* staggered entrance */
.stagger > * { opacity: 0; animation: rise .5s var(--ease) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .map-layout { grid-template-columns: 1fr; }
  .map-panel { position: static; max-height: none; }
  #map { height: 60vh; }
}
@media (max-width: 720px) {
  .main-nav { position: fixed; inset: 68px 0 auto 0; flex-direction: column; background: var(--bg-elev);
    border-bottom: 1px solid var(--line); padding: 12px; gap: 2px; transform: translateY(-150%);
    transition: transform var(--t-med) var(--ease); box-shadow: var(--shadow); }
  .main-nav.open { transform: none; }
  .nav-toggle { display: grid; place-items: center; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .cand-hero { grid-template-columns: 1fr; }
  .header-inner { gap: 12px; }
  .brand-sub { display: none; }
}
