.rehearsal-banner {
  background: var(--yellow); border-bottom: 2px solid var(--ink); text-align: center; padding: 8px 16px;
  font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 13px;
}

.needle-hero { padding-bottom: 32px; border-bottom: 2px solid var(--ink); }
.needle-hero__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.needle-hero__title { font-size: clamp(30px, 4vw, 44px); }

.live-pill {
  display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink); padding: 4px 12px; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
}
.live-pill__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); animation: live-pulse 1.6s ease-in-out infinite; }
.live-pill--stale .live-pill__dot { background: var(--faint); animation: none; }
.live-pill--waiting .live-pill__dot { background: var(--yellow); animation: none; }
@keyframes live-pulse { 50% { opacity: .25; } }

.needle-card {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: stretch;
  border: 2px solid var(--ink); box-shadow: var(--shadow); background: var(--paper);
}
.needle-card__gauge {
  display: flex; align-items: center; justify-content: center; padding: 26px 18px 22px;
  background: var(--paper-2); border-right: 2px solid var(--ink);
  background-image: radial-gradient(var(--rule-soft) 1px, transparent 1.2px); background-size: 14px 14px;
}
.needle-card__readout { display: flex; flex-direction: column; justify-content: center; padding: 30px 36px; min-width: 0; }
.needle__tick { stroke: var(--ink); stroke-width: 2; }
.needle__tick--minor { stroke-width: 1.5; }
.needle__tick-label { font-family: var(--mono); font-size: 13px; font-weight: 600; fill: var(--ink); text-anchor: end; }
.needle__tick-label.is-d { fill: var(--blue-ink); }
.needle__tick-label.is-r { fill: var(--red-ink); }
.needle__forecast path { fill: var(--yellow); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.needle__forecast text { font-family: var(--sans); font-size: 12px; font-weight: 800; fill: var(--ink); }
.needle__forecast .needle__forecast-value { font-family: var(--mono); font-weight: 600; font-size: 12px; fill: var(--muted); }


.demo { width: 100%; max-width: 300px; height: auto; display: block; overflow: visible; --liquid: #8a35d9; }
.demo__shadow { fill: var(--ink); }
.demo__glass > rect, .demo__glass > circle { fill: #fff; }
.demo__glass-edge { fill: var(--ink); stroke: var(--ink); stroke-width: 6; }
.demo__liquid { fill: var(--liquid); transition: fill 1.2s ease; }
.demo__liquid--front { opacity: .5; stroke: var(--ink); stroke-width: 2; }
.demo__level { transition: transform 1.6s cubic-bezier(.2, .9, .25, 1.2); }
.demo__slosh { animation: demo-slosh 2.4s linear infinite; }
.demo__slosh--front { animation-duration: 1.7s; animation-direction: reverse; }
.demo__bob { transform-box: fill-box; transform-origin: 50% 70%; animation: demo-bob 3.2s ease-in-out infinite; }
.demo__shine { stroke: #fff; stroke-width: 6; stroke-linecap: round; opacity: .55; }
@keyframes demo-slosh { from { transform: translateX(-40px); } to { transform: translateX(0); } }
@keyframes demo-bob {
  0%, 100% { transform: translateY(0) rotate(-9deg); }
  35% { transform: translateY(6px) rotate(4deg); }
  70% { transform: translateY(2px) rotate(9deg); }
}
@media (prefers-reduced-motion: reduce) {
  .demo__slosh, .demo__bob { animation: none; }
  .demo__level { transition: none; }
}

.needle-card__big { margin: 0; font-family: var(--display); font-weight: 400; line-height: .9; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.needle-card__party { display: block; font-size: clamp(30px, 3.4vw, 46px); letter-spacing: .01em; }
.needle-card__pct { display: block; font-size: clamp(88px, 11vw, 168px); letter-spacing: -.01em; }
.needle-card__sub { margin: 14px 0 22px; font-size: 17px; line-height: 1.45; color: var(--muted); max-width: 46ch; }
.needle-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border: 2px solid var(--ink); background: var(--paper); }
.needle-facts div { padding: 12px 14px; border-bottom: 2px solid var(--ink); }
.needle-facts div:nth-child(odd) { border-right: 2px solid var(--ink); }
.needle-facts div:nth-last-child(-n+2) { border-bottom: 0; }
.needle-facts dt { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.needle-facts dd { margin: 4px 0 0; font-family: var(--display); font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }

.trail { margin-top: 30px; }
.trail__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.trail__title { font-size: 26px; margin: 0; }
.trail__story { margin: 6px 0 0; font-size: 17px; line-height: 1.45; max-width: 58ch; }
.trail__stats { display: flex; margin: 0; border: 2px solid var(--ink); background: var(--paper); box-shadow: var(--shadow-sm); }
.trail__stats div { padding: 8px 16px; min-width: 96px; }
.trail__stats div + div { border-left: 2px solid var(--ink); }
.trail__stats dt { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.trail__stats dd { margin: 3px 0 0; font-family: var(--display); font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.trail__card { border: 2px solid var(--ink); box-shadow: var(--shadow); background: var(--paper); padding: 0 14px 6px; }
.trail__readout { margin: 0 -14px 10px; padding: 9px 14px; border-bottom: 2px solid var(--ink); background: var(--paper-2); font-size: 14px; min-height: 1.45em; }
.trail__readout strong { font-weight: 800; }
.trail__readout .is-d { color: var(--blue-ink); font-weight: 800; }
.trail__readout .is-r { color: var(--red-ink); font-weight: 800; }
.trail__chart { width: 100%; height: 320px; display: block; overflow: visible; touch-action: pan-y; cursor: crosshair; }
.trail__zone--d { fill: var(--blue); opacity: .05; }
.trail__zone--r { fill: var(--red); opacity: .05; }
.trail__zone-label { font-family: var(--display); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; opacity: .55; }
.trail__zone-label.is-d, .trail__y.is-d { fill: var(--blue-ink); }
.trail__zone-label.is-r, .trail__y.is-r { fill: var(--red-ink); }
.trail__future { fill: url(#trail-hatch); }
.trail__hatch { fill: var(--rule-soft); opacity: .6; }
.trail__future-label { font-family: var(--mono); font-size: 12px; fill: var(--muted); text-anchor: middle; }
.trail__grid { stroke: var(--rule-soft); stroke-width: 1; }
.trail__half { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 5; }
.trail__hour { stroke: var(--rule-soft); stroke-width: 1; stroke-dasharray: 2 4; }
.trail__y, .trail__x { font-family: var(--mono); font-size: 12px; font-weight: 600; fill: var(--muted); }
.trail__y { fill: var(--ink); }
.trail__closes-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; fill: var(--muted); }
.trail__close line { stroke: var(--ink); stroke-width: 1.5; }
.trail__close rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.trail__close.is-past rect { fill: var(--yellow); }
.trail__close text { font-family: var(--mono); font-size: 11px; font-weight: 600; text-anchor: middle; fill: var(--ink); }
.trail__line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.trail__d { fill: var(--blue); opacity: .28; }
.trail__r { fill: var(--red); opacity: .28; }
.trail__dot { stroke: var(--ink); stroke-width: 2.5; }
.trail__dot--start { fill: var(--yellow); }
.trail__dot.is-d { fill: var(--blue); }
.trail__dot.is-r { fill: var(--red); }
.trail__now { font-family: var(--display); font-size: 18px; fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.trail__guide line { stroke: var(--ink); stroke-width: 1.5; }
.trail__guide circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.trail__moves-wrap { margin-top: 18px; }
.trail__moves-title { margin: 0 0 8px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.trail__moves { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.trail__move { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 12px; border: 2px solid var(--ink); background: var(--paper); }
.trail__move-when { font-family: var(--mono); font-size: 12px; color: var(--muted); align-self: center; }
.trail__move-delta { font-family: var(--display); font-size: 20px; text-align: right; }
.trail__move-delta.is-d, #trail-change.is-d { color: var(--blue-ink); }
.trail__move-delta.is-r, #trail-change.is-r { color: var(--red-ink); }
.trail__move-what { grid-column: 1 / -1; font-weight: 600; font-size: 14px; }
.trail__move-odds { grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; color: var(--muted); }

.seat--called { box-shadow: inset 0 -6px 0 var(--ink); }
.seat--wait { opacity: .45; }

.live-workspace { margin-top: 8px; }
.chip--static { cursor: default; }
.chip--static:hover { background: var(--paper); }
.swatch--wait { background: repeating-linear-gradient(45deg, var(--paper-3) 0 3px, var(--paper) 3px 6px); }
.map-state--wait { fill: url(#wait-hatch); }
.map-state--called { stroke-width: 2.4; }
.map-state--pending { opacity: .55; }

.live-filters { display: flex; flex-wrap: wrap; gap: 6px; }

.live-workspace { flex-direction: column; align-items: stretch; }
.live-workspace .map-panel, .live-workspace .live-races { flex: none; width: 100%; }
.live-workspace .state-map { max-width: 1060px; margin: 0 auto; }
.live-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: stretch; }
.live-card {
  display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 2px; background: var(--paper); box-shadow: var(--shadow-sm); padding: 12px 14px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.live-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.live-card[aria-pressed="true"] { box-shadow: 6px 6px 0 var(--blue); background: var(--paper-2); }
.live-card--flash { animation: card-flash 1.8s ease-out; }
@keyframes card-flash { 0% { background: var(--yellow); } 100% { background: var(--paper); } }
.live-card__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.live-card__name { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1; text-transform: uppercase; }
.status {
  display: inline-block; border: 2px solid var(--ink); padding: 2px 8px; font-size: 11px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: var(--paper);
}
.status--called-d { background: var(--blue); color: #fff; }
.status--called-r { background: var(--red); color: #fff; }
.status--counting { background: var(--yellow); }
.status--too_early { background: var(--paper-2); }
.status--polls_open { background: var(--paper); color: var(--muted); }

.cand { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 2px 12px; font-variant-numeric: tabular-nums; }
.cand__name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.cand__name b { font-weight: 800; }
.cand__pct { font-family: var(--display); font-size: 20px; line-height: 1; }
.cand__votes { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 80px; text-align: right; }
.cand__win::after { content: " ✓"; font-weight: 800; }
.cand--d .cand__pct { color: var(--blue-ink); }
.cand--r .cand__pct { color: var(--red-ink); }

.vote-bar { display: flex; height: 14px; border: 2px solid var(--ink); background: var(--paper-3); }
.vote-bar span { display: block; transition: width .8s ease; }
.vote-bar__d { background: var(--blue); }
.vote-bar__o { background: var(--faint); }
.vote-bar__r { background: var(--red); margin-left: auto; }
.expected { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.expected__track { flex: 1; height: 6px; border: 1.5px solid var(--ink); background: var(--paper); }
.expected__fill { height: 100%; background: var(--ink); transition: width .8s ease; }

.live-card__foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; border-top: 2px solid var(--ink); padding-top: 8px; }
.live-card__odds b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.live-card__muted { color: var(--muted); font-weight: 400; }
.county-line { font-size: 12px; color: var(--muted); line-height: 1.35; font-variant-numeric: tabular-nums; }
.county-line--out { color: var(--ink); }
.county-line b { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.county-line .is-d, .county-line .is-r { font-weight: 700; }
.out-table { grid-column: 1 / -1; display: flex; flex-direction: column; border-top: 1.5px solid var(--ink); padding-top: 8px; }
.out-table__title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.out-table__row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 110px 64px; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line, rgba(0,0,0,.12)); font-size: 13px; font-variant-numeric: tabular-nums; }
.out-table__row span:not(:first-child) { text-align: right; font-family: var(--mono); font-size: 12px; }
.out-table__row .is-d, .out-table__row .is-r { font-weight: 700; }
.out-table__in { color: var(--muted); }
@media (max-width: 560px) {
  .out-table__row { grid-template-columns: minmax(0, 1fr) 52px 92px 56px; gap: 6px; }
}
.live-empty { border: 2px dashed var(--ink); padding: 18px; text-align: center; color: var(--muted); font-weight: 600; }

.live-method { margin-top: 40px; border: 2px solid var(--ink); background: var(--paper-2); padding: 18px 22px; }
.live-method .section-title { font-size: 22px; margin-bottom: 6px; }
.live-method p { margin: 0; max-width: 820px; }

@media (max-width: 900px) {
  .needle-card { grid-template-columns: 1fr; }
  .needle-card__gauge { border-right: 0; border-bottom: 2px solid var(--ink); padding: 20px 16px 16px; }
  .demo { max-width: 240px; }
  .needle-card__readout { padding: 22px 22px 24px; }
}
@media (max-width: 640px) {
  .needle-card { box-shadow: var(--shadow-sm); }
  .needle-card__readout { padding: 18px 16px 20px; }
  .needle-facts dd { font-size: 24px; }
  .needle-card__sub { margin-bottom: 12px; font-size: 14px; }
  .trail__stats { width: 100%; }
  .trail__stats div { flex: 1; min-width: 0; padding: 8px 10px; }
  .trail__stats dd { font-size: 22px; }
  .trail__story { font-size: 15px; }
  .trail__card { padding: 0 8px 4px; box-shadow: var(--shadow-sm); }
  .trail__readout { margin: 0 -8px 8px; padding: 8px; font-size: 13px; }
  .cand__votes { min-width: 0; }
  .live-method { padding: 14px; }
}
