:root {
  --green-900: #012a22;
  --green-800: #013a2e;
  --green-700: #014C3C;
  --green-600: #025e4a;
  --neon: #03D770;
  --neon-soft: #e6fbf1;
  --ink: #0d1b17;
  --ink-2: #3b4a45;
  --ink-3: #6b7a75;
  --line: #e3e8e6;
  --bg: #f4f6f5;
  --card: #ffffff;
  --red: #d7262e;
  --blank: #b8c2be;
  --null: #6b7a75;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(1, 42, 34, .06), 0 8px 24px -12px rgba(1, 42, 34, .18);
  --font-head: 'Outfit', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--neon); color: var(--green-900); padding: 8px 12px; z-index: 50; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- topo ---------- */
.topstrip { background: var(--green-900); color: #a9c9be; font-size: 12px; }
.topstrip__in { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; }
.topstrip a { text-decoration: none; }
.topstrip a:hover { color: #fff; }
#today::first-letter { text-transform: uppercase; }

.masthead { background: linear-gradient(180deg, var(--green-700), var(--green-800)); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.masthead__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand__mark {
  width: 36px; height: 36px; border-radius: 9px; background: var(--neon); color: var(--green-900);
  display: grid; place-items: center; font: 900 22px/1 var(--font-head); flex: none;
}
.brand__name { font: 700 20px/1 var(--font-head); letter-spacing: -.02em; }
.brand__sep { width: 1px; height: 26px; background: rgba(255,255,255,.25); }
.brand__title { font: 800 22px/1 var(--font-head); letter-spacing: -.02em; text-transform: uppercase; white-space: nowrap; }
.brand__title b { color: var(--neon); font-weight: 900; }

.live { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.live__badge { display: inline-flex; align-items: center; gap: 6px; background: var(--red); color: #fff; font: 800 11px/1 var(--font-head); letter-spacing: .08em; text-transform: uppercase; padding: 6px 9px; border-radius: 4px; }
.live__badge i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
.live--off .live__badge { background: #6b7a75; }
.live--off .live__badge i { animation: none; }
.live__time { color: #cfe5dd; white-space: nowrap; }
.live__refresh { background: rgba(255,255,255,.1); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: background .2s; }
.live__refresh:hover { background: rgba(255,255,255,.2); }
.live__refresh.is-spinning svg { animation: spin .8s linear infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }

.officenav { background: var(--green-900); border-top: 1px solid rgba(255,255,255,.06); }
.officenav__in { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none; border: 0; color: #a9c9be; padding: 13px 14px 11px; cursor: pointer; white-space: nowrap;
  font: 700 14px/1 var(--font-head); letter-spacing: .01em; border-bottom: 3px solid transparent; transition: color .2s, border-color .2s;
}
.tabs button:hover { color: #fff; }
.tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--neon); }
.tabs button:disabled { opacity: .35; cursor: not-allowed; }
.rounds { display: flex; background: rgba(255,255,255,.07); border-radius: 999px; padding: 3px; flex: none; }
.rounds button { background: none; border: 0; color: #a9c9be; padding: 6px 12px; border-radius: 999px; cursor: pointer; font: 700 12px/1 var(--font-head); }
.rounds button.is-active { background: var(--neon); color: var(--green-900); }

/* ---------- plantão ---------- */
.ticker { display: flex; align-items: stretch; background: var(--neon); color: var(--green-900); font: 600 13px/1 var(--font-body); overflow: hidden; }
.ticker__label { background: var(--green-900); color: var(--neon); font: 800 12px/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em; padding: 11px 14px; flex: none; position: relative; z-index: 1; }
.ticker__label::after { content: ''; position: absolute; right: -10px; top: 0; border-left: 10px solid var(--green-900); border-top: 17px solid transparent; border-bottom: 17px solid transparent; }
.ticker__track { overflow: hidden; flex: 1; display: flex; align-items: center; padding-left: 18px; }
.ticker__run { display: inline-flex; gap: 36px; white-space: nowrap; animation: ticker 60s linear infinite; }
.ticker__run span b { font-weight: 800; }
.ticker:hover .ticker__run { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- filtros ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 20px 0 4px; }
.field { display: grid; gap: 4px; min-width: 200px; flex: 0 1 260px; }
.field span { font: 700 11px/1 var(--font-head); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.field select {
  appearance: none; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23014C3C' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 34px 10px 12px; font-weight: 600; cursor: pointer; width: 100%;
}
.field select:focus { outline: 2px solid var(--neon); outline-offset: 1px; }
.field select:disabled { opacity: .55; cursor: not-allowed; }
.crumbs { margin-left: auto; font-size: 13px; color: var(--ink-3); padding-bottom: 10px; }
.crumbs a { color: var(--green-700); font-weight: 700; text-decoration: none; cursor: pointer; }

/* ---------- manchete ---------- */
.hero { padding: 18px 0 8px; }
.kicker { margin: 0 0 8px; color: var(--red); font: 800 13px/1 var(--font-head); text-transform: uppercase; letter-spacing: .08em; }
.headline { margin: 0; font: 800 clamp(30px, 5vw, 52px)/1.04 var(--font-head); letter-spacing: -.03em; color: var(--ink); max-width: 22ch; text-wrap: balance; }
.deck { margin: 12px 0 0; font-size: clamp(16px, 2vw, 19px); color: var(--ink-2); max-width: 62ch; }

.progress { margin-top: 22px; }
.progress__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.progress__head strong { font: 800 26px/1 var(--font-head); color: var(--green-700); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.progress__head span { font-weight: 600; color: var(--ink-2); }
.progress__head em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--ink-3); }
.progress__bar { height: 10px; border-radius: 999px; background: #dfe7e4; overflow: hidden; }
.progress__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green-700), var(--neon)); border-radius: inherit; transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* ---------- placar ---------- */
.board { margin: 22px 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card__head h2 { margin: 2px 0 0; font: 800 22px/1.15 var(--font-head); letter-spacing: -.02em; }
.card__kicker { margin: 0; font: 800 11px/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em; color: var(--green-600); }
.card__note { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }
.card--dark { background: var(--green-700); color: #d9ece5; }
.card--dark .card__kicker { color: var(--neon); }
.card--dark p { margin: 8px 0 0; font-size: 14px; }
.card--dark strong { color: #fff; }

.duel { padding: 0; overflow: hidden; }
.duel__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; padding: 24px 24px 0; }
.duel__side { display: flex; align-items: flex-end; gap: 16px; min-width: 0; }
.duel__side--right { flex-direction: row-reverse; text-align: right; }
.duel__vs { font: 800 14px/1 var(--font-head); color: var(--ink-3); padding-bottom: 54px; }
.duel__info { min-width: 0; padding-bottom: 14px; }
.duel__pct { font: 900 clamp(40px, 7vw, 76px)/.9 var(--font-head); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.duel__pct small { font-size: .45em; font-weight: 800; }
.duel__name { font: 800 clamp(18px, 2.4vw, 26px)/1.1 var(--font-head); margin-top: 6px; letter-spacing: -.01em; }
.duel__meta { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.duel__votes { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.duel__bar { position: relative; display: flex; height: 22px; margin: 0; background: #e5ebe9; }
.duel__bar i { display: block; height: 100%; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.duel--waiting .duel__bar i { opacity: .3; }
.duel__bar::after { content: '50%'; position: absolute; left: 50%; top: -18px; transform: translateX(-50%); font: 700 10px/1 var(--font-head); color: var(--ink-3); }
.duel__bar::before { content: ''; position: absolute; left: 50%; top: -6px; bottom: 0; width: 2px; background: var(--ink); z-index: 1; }
.duel__foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 24px 16px; font-size: 13px; color: var(--ink-3); }

.photo { position: relative; flex: none; width: clamp(92px, 14vw, 150px); aspect-ratio: 4 / 5; border-radius: 12px 12px 0 0; overflow: hidden; background: #dfe7e4; }
.photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: top; background: #dfe7e4; }
.photo__fallback { position: absolute; inset: 0; display: grid; place-items: center; font: 800 34px/1 var(--font-head); color: #fff; }
.photo--sm { width: 52px; border-radius: 10px; }
.photo--sm .photo__fallback { font-size: 18px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font: 800 11px/1 var(--font-head); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 4px; vertical-align: middle; }
.badge--elected { background: var(--neon); color: var(--green-900); }
.badge--runoff { background: #fff4d6; color: #7a5300; }
.badge--muted { background: #eef2f1; color: var(--ink-3); }

.rank { padding: 6px 0; }
.rank__tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px 6px; }
.rank__tools .search { flex: 1 1 220px; }
.rank__list { list-style: none; margin: 0; padding: 0; }
.rank__item { display: grid; grid-template-columns: 28px 52px 1fr auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.rank__item:first-child { border-top: 0; }
.rank__pos { font: 800 16px/1 var(--font-head); color: var(--ink-3); text-align: center; }
.rank__name { font: 700 17px/1.2 var(--font-head); }
.rank__meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.rank__bar { height: 6px; background: #eef2f1; border-radius: 999px; margin-top: 8px; overflow: hidden; }
.rank__bar i { display: block; height: 100%; border-radius: inherit; transition: width .8s; }
.rank__num { text-align: right; font-variant-numeric: tabular-nums; }
.rank__num strong { display: block; font: 800 22px/1 var(--font-head); letter-spacing: -.02em; }
.rank__num span { font-size: 12px; color: var(--ink-3); }
.rank__more { display: flex; justify-content: center; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }

.search { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--bg); min-width: 0; }
.search:focus { outline: 2px solid var(--neon); outline-offset: 1px; background: #fff; }
.btn-ghost { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font: 700 13px/1 var(--font-head); color: var(--green-700); cursor: pointer; white-space: nowrap; }
.btn-ghost:hover { border-color: var(--green-700); }
.btn-ghost:disabled { opacity: .4; cursor: default; }
.btn-link { display: inline-block; margin-top: 12px; color: var(--neon); font: 700 14px/1 var(--font-head); text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; font: 800 20px/1.2 var(--font-head); color: var(--ink); margin-bottom: 6px; }

/* ---------- noite 2026 × 2022 ---------- */
.night { margin: 0 0 22px; }
.night__deck { margin: -4px 0 12px; color: var(--ink-2); max-width: 75ch; }
.night__deck b { color: var(--ink); }
.night__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 600 12px/1 var(--font-head); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin-bottom: 6px; }
.night__legend span { display: inline-flex; align-items: center; gap: 6px; }
.night__legend svg { flex: none; }
.night__chart { position: relative; }
.night__chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.night__chart .grid-line { stroke: #e9eeec; stroke-width: 1; }
.night__chart .mid-line { stroke: #9aa6a2; stroke-width: 1; }
.night__chart .axis-text { fill: var(--ink-3); font: 500 12px var(--font-body); }
.night__chart .end-label { font: 600 13px var(--font-head); fill: var(--ink-2); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.night__chart .end-label tspan.v { font-weight: 800; fill: var(--ink); }
.night__chart .marker-line { stroke: #b8c2be; stroke-width: 1; }
.night__chart .marker-text { fill: var(--ink-3); font: 500 11px var(--font-body); }
.night__chart .hover-line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.night__hours { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.night__hours b { color: var(--ink); font-family: var(--font-head); }
.night__hours .lbl { font: 800 11px/1.6 var(--font-head); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }

/* ---------- grade mapa + lateral ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.side .card + .card { margin-top: 16px; }

.map { position: relative; min-height: 320px; }
.map svg { width: 100%; height: auto; max-height: 560px; display: block; }
.map path { stroke: #fff; stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; transition: opacity .15s; }
.map path:hover, .map path.is-hover { stroke: var(--ink); stroke-width: 1.6; }
.map path.is-selected { stroke: var(--ink); stroke-width: 2.2; }
.map__status { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-weight: 600; text-align: center; padding: 20px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; font-size: 13px; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { width: 12px; height: 12px; border-radius: 3px; }

.turnout { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.ring { --p: 0; flex: none; width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, #fff 76%, transparent 77%), conic-gradient(var(--green-700) calc(var(--p) * 1%), #e5ebe9 0); }
.ring span { font: 800 22px/1 var(--font-head); letter-spacing: -.02em; }
.ring small { font-size: 11px; color: var(--ink-3); }
.kv { margin: 0; display: grid; gap: 8px; flex: 1; min-width: 0; }
.kv div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-3); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kv dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; }
.kv dd small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.kv--dots b { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #e5ebe9; margin: 16px 0 14px; }
.stack i { display: block; height: 100%; width: 0; transition: width .8s; }
.s-valid, .d-valid { background: var(--green-700); }
.s-blank, .d-blank { background: var(--blank); }
.s-null, .d-null { background: var(--null); }

/* ---------- regiões ---------- */
.regions { margin: 16px 0 40px; }
.regions .search { width: 220px; }
.regions__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.region { display: grid; grid-template-columns: 6px 1fr auto; gap: 12px; align-items: center; text-align: left; background: var(--bg); border: 1px solid transparent; border-radius: 12px; padding: 12px 14px 12px 0; cursor: pointer; transition: border-color .2s, background .2s; overflow: hidden; }
.region:hover { border-color: var(--green-700); background: #fff; }
.region__swatch { align-self: stretch; border-radius: 0 4px 4px 0; }
.region__name { font: 700 15px/1.2 var(--font-head); }
.region__lead { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.region__pct { text-align: right; font: 800 18px/1 var(--font-head); font-variant-numeric: tabular-nums; }
.region__pct small { display: block; font: 500 11px/1.4 var(--font-body); color: var(--ink-3); }

.tooltip { position: fixed; z-index: 40; pointer-events: none; background: var(--green-900); color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 260px; }
.tooltip strong { display: block; font: 800 15px/1.2 var(--font-head); margin-bottom: 4px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; }
.tooltip .tt-row b { font-variant-numeric: tabular-nums; }
.tooltip small { display: block; color: #a9c9be; margin-top: 4px; }

/* ---------- rodapé ---------- */
.footer { background: var(--green-900); color: #a9c9be; font-size: 13px; padding: 30px 0; }
.footer__in { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.footer p { margin: 0; }
.footer a { color: var(--neon); text-decoration: none; font-weight: 700; }
.brand--footer { color: #fff; }

.skeleton { background: linear-gradient(90deg, #eef2f1 25%, #f7f9f8 50%, #eef2f1 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .footer__in { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 640px) {
  .brand__name, .brand__sep { display: none; }
  .brand__title { font-size: 19px; }
  .live__time { display: none; }
  .officenav__in { flex-direction: column-reverse; align-items: stretch; gap: 0; padding: 8px 0 0; }
  .rounds { align-self: center; }
  .tabs { padding: 0 16px; }
  .field { flex: 1 1 100%; min-width: 0; }
  .crumbs { margin-left: 0; padding-bottom: 0; }
  .duel__row { grid-template-columns: 1fr 1fr; padding: 18px 14px 0; gap: 8px; }
  .duel__vs { display: none; }
  .duel__side, .duel__side--right { flex-direction: column; align-items: flex-start; gap: 10px; }
  .duel__side--right { align-items: flex-end; }
  .duel__info { padding-bottom: 12px; }
  .photo { width: 84px; border-radius: 10px; }
  .duel__foot { padding: 10px 14px 14px; font-size: 12px; }
  .rank__item { grid-template-columns: 44px 1fr auto; padding: 12px 14px; gap: 10px; }
  .rank__pos { display: none; }
  .photo--sm { width: 44px; }
  .regions .search { width: 100%; }
  .card__head { flex-wrap: wrap; }
  .turnout { flex-direction: column; align-items: stretch; }
  .ring { margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
