:root {
  --bg: #120e06;
  --bg-elev: #1a1408;
  --bg-card: rgba(26, 20, 8, 0.92);
  --line: rgba(201, 162, 39, 0.18);
  --line-strong: rgba(245, 197, 66, 0.4);
  --gold: #C9A227;
  --gold-bright: #f5c542;
  --gold-soft: #ffe08a;
  --gold-dim: rgba(201, 162, 39, 0.16);
  --text: #fff6e0;
  --muted: #c4ad86;
  --faint: #8a7454;
  --dem: #2563EB;
  --dem-soft: rgba(37, 99, 235, 0.28);
  --rep: #DC2626;
  --rep-soft: rgba(220, 38, 38, 0.28);
  --lib: #fbbf24;
  --ind: #c4b5fd;
  --neu: #6B7280;
  --neu-soft: rgba(107, 114, 128, 0.35);
  --danger: #fb7185;
  --radius: 20px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, system-ui, sans-serif;
}
body {
  min-height: 100dvh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(201, 162, 39, 0.2), transparent 55%),
    radial-gradient(700px 380px at 100% 10%, rgba(245, 197, 66, 0.1), transparent 50%),
    linear-gradient(180deg, #1a1408 0%, #120e06 45%, #0c0904 100%);
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--gold-bright);
  color: #1a1408;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 10;
}
.skip:focus { top: 12px; }

.site-header, main, .site-footer, .toolbar {
  width: min(860px, calc(100% - 24px));
  margin: 0 auto;
}
.site-header { padding: 22px 0 8px; }

.pp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 66, 0.28);
  background: rgba(26, 20, 8, 0.85);
  color: #fff6e0;
  text-decoration: none;
  font: 700 13px/1.2 Manrope, system-ui, sans-serif;
  width: fit-content;
}
.pp-back:hover, .pp-back:focus-visible {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  outline: none;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 12px var(--gold);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 18px;
}
.wordmark { display: flex; align-items: center; gap: 12px; }
.brand-name {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 0.9;
  text-transform: uppercase;
}
.brand-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.page-title {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 7vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.lede {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(26, 20, 8, 0.85);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.meta-chip.source { color: var(--gold-bright); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 4px;
  position: sticky;
  top: 0;
  z-index: 15;
  background: linear-gradient(180deg, rgba(18, 14, 6, 0.96) 60%, rgba(18, 14, 6, 0.75));
  backdrop-filter: blur(10px);
}
.toolbar .seg {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(26, 20, 8, 0.9);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
}
.toolbar .seg[aria-pressed="true"] {
  color: #1a1408;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-bright));
  border-color: transparent;
}
.toolbar .seg:hover, .toolbar .seg:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}

.card, .block { margin: 16px 0; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  padding: 16px;
}

.hero-label {
  margin: 0 0 8px;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-date {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.05;
}
.hero-count {
  margin: 10px 0 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2.4rem, 10vw, 3.4rem);
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 0.95;
}
.hero-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.block-head h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.block-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

#calendar-block.is-emphasis {
  outline: 1px solid var(--line-strong);
  outline-offset: 8px;
  border-radius: 12px;
}
.is-hidden, [hidden] { display: none !important; }

.cal-list { display: grid; gap: 8px; }
.cal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 14, 6, 0.55);
  padding: 12px 14px;
}
.cal-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.cal-value {
  font-weight: 800;
  text-align: right;
  font-size: 14px;
}
.cal-sources {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.cal-source {
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
}
.cal-source:hover { text-decoration: underline; }

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tool-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--gold-dim);
  color: var(--gold-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}
.tool-pill:hover, .tool-pill:focus-visible {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  outline: none;
}

.race-list { display: grid; gap: 8px; }
.race-row {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 14, 6, 0.55);
  padding: 14px 12px;
  min-height: 56px;
  font: inherit;
  display: grid;
  gap: 4px;
}
.race-row:hover, .race-row:focus-visible {
  border-color: var(--line-strong);
  background: rgba(245, 197, 66, 0.08);
  outline: none;
}
.race-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.race-title { font-weight: 800; font-size: 15px; }
.race-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(245, 197, 66, 0.15);
  color: var(--gold-soft);
}
.race-badge.warn {
  background: rgba(251, 113, 133, 0.15);
  color: #fda4af;
}
.race-scope { color: var(--muted); font-size: 12px; font-weight: 600; }
.race-meta { color: var(--faint); font-size: 11px; }
.empty-races {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  padding: 12px 4px;
}

.note { color: var(--muted); font-size: 13px; line-height: 1.45; }
.note p { margin: 0; }

.site-footer {
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer .signed {
  color: var(--gold-bright);
  font-weight: 700;
}

.sheet {
  width: min(420px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #1a1408;
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow);
}
.sheet::backdrop { background: rgba(8, 6, 2, 0.72); }
.sheet form { margin: 0; padding: 16px; }
.sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sheet h3 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sheet-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}
.sheet-why {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
  margin: 12px 0;
}
.sheet-note {
  color: var(--faint);
  font-size: 12px;
  margin: 8px 0 12px;
}

.cand-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.cand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  background: rgba(18, 14, 6, 0.55);
  border: 1px solid rgba(245, 197, 66, 0.1);
}
.cand.empty { grid-template-columns: 1fr; }
.party-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--ind);
}
.party-pip.dem { background: var(--dem); }
.party-pip.rep { background: var(--rep); }
.party-pip.lib { background: var(--lib); }
.cand-name { font-weight: 700; font-size: 15px; }
.cand-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cand-note { color: var(--faint); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.sos-inline {
  display: inline-flex;
  margin-top: 10px;
  color: var(--gold-bright);
  font-weight: 700;
  font-size: 13px;
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-bright));
  color: #1a1408;
  font-weight: 800;
  text-decoration: none;
  width: 100%;
}

@media (max-width: 420px) {
  .cal-row { flex-direction: column; align-items: flex-start; }
  .cal-value { text-align: left; }
}



/* —— Map tracker —— */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.map-legend .leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.map-legend .leg.dem { color: #93C5FD; }
.map-legend .leg.rep { color: #FCA5A5; }
.map-legend .leg.neu::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--neu);
  display: inline-block;
}
.map-shell {
  padding: 10px !important;
  position: relative;
}
.map-svg-wrap {
  width: 100%;
  aspect-ratio: 1.15 / 1;
  max-height: min(72vw, 520px);
  margin: 0 auto;
}
.map-svg-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}
.cd-path {
  stroke: rgba(255, 246, 224, 0.55);
  stroke-width: 1.1;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease, filter 0.15s ease;
}
.cd-path.lean-D { fill: var(--dem-soft); }
.cd-path.lean-R { fill: var(--rep-soft); }
.cd-path.lean-N { fill: var(--neu-soft); }
.cd-path:hover, .cd-path:focus {
  stroke: var(--gold-bright);
  stroke-width: 2;
  filter: brightness(1.15);
  outline: none;
}
.cd-path.is-selected {
  stroke: var(--gold-bright);
  stroke-width: 2.4;
  filter: brightness(1.2);
}
.cd-path.lean-D.is-selected { fill: rgba(37, 99, 235, 0.55); }
.cd-path.lean-R.is-selected { fill: rgba(220, 38, 38, 0.55); }
.cd-label {
  fill: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 11px;
  pointer-events: none;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(18, 14, 6, 0.85);
  stroke-width: 3px;
}
.cd-mark {
  pointer-events: none;
}
.map-hint {
  margin: 8px 4px 2px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
  font-weight: 600;
}

.statewide-chips, .cd-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chip-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(26, 20, 8, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip-btn img { width: 16px; height: 16px; }
.chip-btn:hover, .chip-btn:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}
.chip-btn.is-active {
  border-color: var(--gold-bright);
  background: rgba(245, 197, 66, 0.12);
  color: var(--gold-soft);
}
.chip-btn.lean-D { box-shadow: inset 3px 0 0 var(--dem); }
.chip-btn.lean-R { box-shadow: inset 3px 0 0 var(--rep); }

.text-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gold-bright);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
}
.detail-card { padding: 14px; }
.detail-card .detail-scope {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 10px;
  line-height: 1.45;
}
.detail-sources {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}
.detail-sources a {
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
}
.detail-sources a:hover { text-decoration: underline; }
.sheet-links {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}
.sheet-links a {
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 600;
}

.party-mark-inline {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

@media (max-width: 420px) {
  .map-svg-wrap { max-height: 70vw; }
  .cd-label { font-size: 10px; }
}
