:root {
  /* paleta do site de resultados do TSE */
  --tinta: #f0f0f0;     /* fundo da página */
  --tinta-2: #ffffff;   /* cartões */
  --tinta-3: #e3e3e3;   /* trilhos e vazios */
  --linha: #d8d8d8;
  --papel: #1e1e1e;     /* texto */
  --papel-2: #4a4a4a;
  --papel-3: #7a7a7a;
  --sinal: #f0b400;     /* amarelo TSE (preenchimentos) */
  --ouro: #c48d00;      /* amarelo escurecido para texto sobre branco */
  --verde: #a2b93a;     /* barra de progresso TSE */
  --verde-escuro: #6b8e23;
  --erro: #c8381f;
  --c0: #e0a800;
  --c1: #6b8e23;
  --c2: #7b8ed6;
  --c3: #e98a3b;
  --c4: #d9668f;
  --c5: #3f9fb3;
  --cx: #b3b3b3;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Archivo', 'Helvetica Neue', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(240, 180, 0, .08), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(107, 142, 35, .05), transparent 60%),
    var(--tinta);
  color: var(--papel);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}
body::before {
  /* grão de papel-jornal */
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  opacity: .03;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px 32px; align-items: center;
  padding: 14px 40px;
  background: rgba(255, 255, 255, .95);
  border-top: 6px solid var(--sinal);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linha);
}
.marca { display: flex; flex-direction: column; line-height: 1; }
.marca-titulo { font-family: var(--serif); font-size: 30px; letter-spacing: -.01em; }
.marca-titulo em { color: var(--ouro); }
.marca-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--papel-3); margin-top: 5px; font-weight: 600; }
.progresso-geral { max-width: 560px; justify-self: center; width: 100%; }
.progresso-texto { font-size: 13px; color: var(--papel-2); margin-bottom: 7px; }
.progresso-texto strong { color: var(--papel); font-size: 17px; font-weight: 700; margin-right: 2px; }
.trilho { height: 6px; background: var(--tinta-3); border-radius: 3px; overflow: hidden; }
.trilho-fill { height: 100%; width: 0; background: var(--verde); border-radius: 3px; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; }
.ao-vivo { display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--papel-2); }
.ao-vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--papel-3); }
.ao-vivo.on i { background: #ff4d3d; box-shadow: 0 0 0 0 rgba(255, 77, 61, .6); animation: pulso 1.8s infinite; }
.ao-vivo.on { color: var(--papel); }
.ao-vivo.off i { background: var(--erro); }
.status-hora { color: var(--papel-3); }
@keyframes pulso { 70% { box-shadow: 0 0 0 8px rgba(255, 77, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 61, 0); } }

.aviso {
  margin: 16px 40px 0; padding: 10px 14px; border-radius: 8px;
  border: 1px solid rgba(200, 56, 31, .35); background: rgba(200, 56, 31, .06); color: #9b2a14; font-size: 14px;
}
.aviso.info { border-color: rgba(240, 180, 0, .55); background: rgba(240, 180, 0, .12); color: #5e4500; }

main { max-width: 1280px; margin: 0 auto; padding: 8px 40px 40px; }

/* ---------- blocos ---------- */
.bloco { padding: 44px 0 36px; border-bottom: 1px solid var(--linha); animation: sobe .7s both; }
.bloco:nth-child(2) { animation-delay: .08s; }
.bloco:nth-child(3) { animation-delay: .16s; }
.bloco:nth-child(4) { animation-delay: .24s; }
@keyframes sobe { from { opacity: 0; transform: translateY(14px); } }
.bloco-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 26px; flex-wrap: wrap; }
.bloco-cab h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 44px; letter-spacing: -.015em; line-height: 1; }
.bloco-cab h2 span { font-style: italic; color: var(--papel-3); }
.bloco-meta { margin: 0; font-size: 13px; color: var(--papel-3); }

/* ---------- duelo ---------- */
.duelo { display: grid; grid-template-columns: 1fr minmax(210px, 250px) 1fr; gap: 0; align-items: stretch; }
.cand { display: grid; grid-template-columns: 104px 1fr; gap: 22px; align-items: center; padding: 6px 28px 6px 0; }
.cand.dir { grid-template-columns: 1fr 104px; padding: 6px 0 6px 28px; text-align: right; }
.cand.dir .foto { order: 2; }
.duelo.espera .cand-pct { opacity: .22; }
.duelo.espera .cand-votos { visibility: hidden; }

.centro {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 10px 18px; border-left: 1px solid var(--linha); border-right: 1px solid var(--linha);
}
.centro-rot { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--papel-3); font-weight: 700; }
.centro-margem {
  font-stretch: 70%; font-weight: 800; font-size: 64px; line-height: 1; margin-top: 8px; letter-spacing: -.02em;
}
.centro-un { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--papel-2); margin-top: 2px; }
.centro-sub { font-size: 12px; color: var(--papel-3); margin-top: 12px; line-height: 1.5; }
.centro-sub .sep { display: none; }
.centro-nome { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; margin-top: 10px; }
.relogio {
  font-stretch: 62%; font-weight: 700; font-size: 58px; line-height: 1; margin-top: 10px; letter-spacing: .01em;
  color: var(--ouro);
}
.centro[data-modo='fim'] .centro-rot { color: var(--ouro); }
.centro[data-modo='fim'] .centro-nome { font-size: 40px; }
.foto {
  width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: var(--tinta-3);
  border: 3px solid var(--cor, var(--cx)); position: relative;
}
.foto img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.35) contrast(1.05); }
.foto .ini { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 40px; color: var(--papel-3); }
.cand-nome { font-family: var(--sans); font-stretch: 85%; font-weight: 800; font-size: 26px; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; }
.cand-partido { font-size: 13px; color: var(--papel-3); margin-top: 4px; }
.cand-partido b { color: var(--cor); font-weight: 700; }
.cand-pct {
  font-family: var(--sans); font-stretch: 70%; font-weight: 800; font-size: clamp(64px, 9vw, 124px);
  line-height: .9; letter-spacing: -.02em; color: var(--cor); margin-top: 10px;
}
.cand-pct small { font-size: .38em; font-weight: 600; color: var(--papel-2); margin-left: 4px; letter-spacing: 0; }
.cand-votos { font-size: 15px; color: var(--papel-2); margin-top: 6px; }
.selo {
  display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 3px;
  background: var(--cor); color: #fff; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .14em;
}
.cand.lider .foto img { filter: none; }
.cand.lider .foto { box-shadow: 0 0 0 6px color-mix(in srgb, var(--cor) 22%, transparent); }
.cand.eleito .foto { box-shadow: 0 0 0 6px var(--tinta-2), 0 0 0 9px var(--cor), 0 0 40px color-mix(in srgb, var(--cor) 50%, transparent); }
.cand-pct.flash { animation: flash 1s; }
@keyframes flash { 0% { text-shadow: 0 0 24px var(--cor); } 100% { text-shadow: none; } }

/* cabo de guerra */
.cabo { position: relative; margin: 26px 0 8px; height: 40px; }
.cabo-barra { display: flex; height: 100%; border-radius: 4px; overflow: hidden; background: var(--tinta-3); }
.cabo-seg { height: 100%; transition: flex-basis 1.2s cubic-bezier(.2, .8, .2, 1); flex: 0 0 auto; }
.cabo-meio { position: absolute; left: 50%; top: -8px; bottom: -8px; width: 2px; background: var(--papel); transform: translateX(-1px); }
.cabo-meio::before {
  content: '50%'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--papel-2);
}

.outros { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--papel-2); margin-top: 14px; }
.outros:empty { display: none; }
.outros span b { font-weight: 700; color: var(--papel); }
.outros i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--cor); }

.numeros { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 30px 0 0; border-top: 1px solid var(--linha); }
.numeros div { padding: 16px 16px 0 0; }
.numeros div + div { padding-left: 16px; border-left: 1px solid var(--linha); }
.numeros dt { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--papel-3); font-weight: 600; }
.numeros dd { margin: 6px 0 0; font-size: 24px; font-weight: 700; font-stretch: 85%; }
.numeros dd small { display: block; font-size: 12px; font-weight: 400; color: var(--papel-3); font-stretch: 100%; margin-top: 2px; }

/* ---------- gráfico ---------- */
.grafico svg { width: 100%; height: auto; display: block; overflow: visible; }
.grafico .eixo text { fill: var(--papel-3); font-size: 11px; font-family: var(--sans); }
.grafico .eixo line { stroke: var(--linha); }
.grafico .vazio { fill: var(--papel-3); font-family: var(--serif); font-size: 22px; font-style: italic; }

/* ---------- estados ---------- */
.estados-grade { display: grid; grid-template-columns: minmax(300px, 430px) 1fr; gap: 44px; align-items: start; }
.mapa-wrap { position: sticky; top: 100px; }
.mapa { position: relative; }
.mapa svg { width: 100%; height: auto; display: block; overflow: visible; }
.mapa .ufs path, .mapa .marca-df {
  fill: var(--tinta-3); stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; cursor: default;
  transition: fill .9s, filter .2s;
}
.mapa .ufs path.marcada, .mapa .marca-df.marcada { stroke: var(--papel); stroke-width: 2.2; filter: brightness(1.04); }
.mapa .ufs path.marcada { paint-order: stroke; }
.mapa .marca-df { stroke-width: 1.5; }
.mapa .rotulos text { font: 800 11px var(--sans); letter-spacing: .04em; pointer-events: none; }
.mapa .rotulos text.fora { font-size: 10.5px; }
.mapa .fios path { stroke: var(--papel-3); stroke-width: .8; fill: none; opacity: .7; }
.mapa-area { position: relative; }
.exterior { position: absolute; left: 0; bottom: 4px; }
.ext-chip {
  display: inline-flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 6px;
  border: 1px dashed var(--papel-3); font-size: 11px; transition: background-color .9s; cursor: default;
}
.ext-chip b { text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }
.ext-chip span { font-weight: 700; font-size: 13px; }
.ext-chip.marcada { outline: 2px solid var(--papel); }
.mapa-wrap { position: relative; }
.legenda { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 12px; color: var(--papel-2); }
.legenda i { display: inline-block; width: 22px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; background: linear-gradient(90deg, color-mix(in srgb, var(--cor) 35%, var(--tinta)), var(--cor)); }
.legenda i.hach { background: repeating-linear-gradient(45deg, var(--tinta-2) 0 3px, var(--linha) 3px 5px); border: 1px solid var(--linha); }

.tabela-wrap { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th {
  text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--papel-3);
  font-weight: 600; padding: 0 10px 10px; border-bottom: 1px solid var(--linha); cursor: pointer; white-space: nowrap; user-select: none;
}
.tabela th:first-child, .tabela td:first-child { text-align: left; padding-left: 0; }
.tabela th.ord { color: var(--papel); }
.tabela td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
.tabela tr:hover td { background: var(--tinta-2); }
.tabela tr.marcada td { background: var(--tinta-3); }
.tabela .uf-nome { color: var(--papel-2); margin-left: 8px; font-size: 13px; }
.tabela .uf-sigla { font-weight: 800; display: inline-block; width: 26px; }
.mini { display: inline-flex; align-items: center; gap: 8px; }
.mini-trilho { width: 56px; height: 4px; background: var(--tinta-3); border-radius: 2px; overflow: hidden; }
.mini-trilho i { display: block; height: 100%; background: var(--verde); }
.tabela .lider-pct { font-weight: 800; }
.margem { display: inline-block; min-width: 64px; padding: 2px 7px; border-radius: 3px; font-weight: 700; font-size: 12px; color: #fff; }

/* ---------- governadores ---------- */
.gov-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gov {
  background: var(--tinta-2); border: 1px solid var(--linha); border-radius: 10px; padding: 18px 18px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  display: flex; flex-direction: column; gap: 14px;
}
.gov-cab { display: flex; justify-content: space-between; align-items: baseline; }
.gov-uf { font-family: var(--serif); font-size: 28px; line-height: 1; }
.gov-uf small { font-family: var(--sans); font-size: 12px; color: var(--papel-3); margin-left: 8px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.gov-cab { gap: 12px; }
.gov-apur { font-size: 12px; color: var(--papel-3); white-space: nowrap; }
.gov-apur b { color: var(--papel); }
.gov-cand { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.gov-cand .foto { width: 44px; height: 44px; border-width: 2px; }
.gov-cand .foto .ini { font-size: 18px; }
.gov-nome { font-weight: 700; font-stretch: 85%; font-size: 15px; text-transform: uppercase; line-height: 1.1; }
.gov-nome small { display: block; font-weight: 500; font-size: 12px; color: var(--papel-3); text-transform: none; font-stretch: 100%; margin-top: 2px; }
.gov-pct { font-weight: 800; font-stretch: 75%; font-size: 30px; color: var(--cor); text-align: right; line-height: 1; }
.gov-pct small { display: block; font-size: 11px; font-weight: 500; color: var(--papel-3); font-stretch: 100%; margin-top: 3px; }
.gov .cabo { margin: 0; height: 10px; }
.gov .cabo-meio { top: -4px; bottom: -4px; }
.gov .cabo-meio::before { display: none; }
.gov .selo { margin: 0; font-size: 10px; padding: 3px 8px; }
.gov { transition: border-color .6s, box-shadow .6s; }
.gov.decidido { border-color: color-mix(in srgb, var(--cor-vencedor) 60%, var(--linha)); box-shadow: inset 0 3px 0 var(--cor-vencedor); }
.gov-cand { transition: opacity .6s; }
.gov-cand.perdeu { opacity: .45; }
.gov-cand.lider .foto img { filter: none; }

/* ---------- faixa de últimas ---------- */
.ticker {
  grid-column: 1 / -1; display: flex; align-items: stretch; margin: 2px -40px -14px;
  border-top: 1px solid var(--linha); height: 34px; overflow: hidden; font-size: 13px;
}
.ticker[hidden] { display: none; }
.ticker-rotulo {
  flex: none; display: flex; align-items: center; padding: 0 14px 0 40px; background: var(--sinal); color: var(--papel);
  font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-size: 11px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); padding-right: 22px;
}
.ticker-janela { flex: 1; overflow: hidden; position: relative; mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.ticker-trilha { display: inline-flex; white-space: nowrap; height: 100%; align-items: center; animation: rolar 60s linear infinite; }
.ticker:hover .ticker-trilha { animation-play-state: paused; }
@keyframes rolar { to { transform: translateX(-50%); } }
.tk { padding: 0 28px; color: var(--papel-2); position: relative; }
.tk::after { content: '◆'; position: absolute; right: -5px; font-size: 7px; top: 50%; transform: translateY(-50%); color: var(--papel-3); }
.tk b { color: var(--ouro); font-weight: 700; margin-right: 10px; }
.tk-virada, .tk-eleito, .tk-inicio { color: var(--papel); font-weight: 700; }
.tk-eleito b, .tk-virada b { color: var(--erro); }

/* ---------- alerta (virada, eleito) ---------- */
.alerta {
  position: fixed; left: 50%; top: 104px; z-index: 40; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0; max-width: min(920px, calc(100vw - 32px));
  background: var(--tinta-2); color: var(--papel); border-radius: 4px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--linha); box-shadow: 0 24px 60px rgba(0, 0, 0, .18); animation: entra .5s cubic-bezier(.2, .9, .3, 1.2);
}
.alerta[hidden] { display: none; }
.alerta-tipo {
  align-self: stretch; display: flex; align-items: center; padding: 14px 18px; background: #e8402e; color: #fff;
  font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-size: 13px; white-space: nowrap;
}
.alerta-eleito .alerta-tipo { background: var(--sinal); color: var(--papel); }
.alerta-texto { padding: 14px 22px; font-family: var(--serif); font-size: 26px; line-height: 1.15; }
@keyframes entra { from { opacity: 0; transform: translate(-50%, -16px) scale(.97); } }

/* ---------- botão telão ---------- */
.btn-telao {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px;
  background: transparent; color: var(--papel-2); border: 1px solid var(--linha); font: 600 12px var(--sans);
  text-transform: uppercase; letter-spacing: .1em; cursor: pointer; transition: color .2s, border-color .2s;
}
.btn-telao:hover { color: var(--papel); border-color: var(--papel-3); }
.btn-telao svg { width: 16px; height: 16px; }

/* ---------- modo telão (TV / projetor) ---------- */
@media (min-width: 1100px) {
  body.telao { overflow: hidden; }
  body.telao .topo { padding: 12px 32px; }
  body.telao .ticker { margin: 2px -32px -12px; }
  body.telao .ticker-rotulo { padding-left: 32px; }
  body.telao main {
    max-width: none; height: calc(100vh - var(--topo-h, 120px)); padding: 0 32px 20px;
    display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    gap: 0 40px;
  }
  body.telao .bloco { padding: 22px 0 0; border: 0; animation: none; }
  body.telao #presidente { grid-column: 1; grid-row: 1; }
  body.telao #estados { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; min-height: 0; }
  body.telao #governadores { grid-column: 1; grid-row: 2; min-height: 0; }
  body.telao #evolucao, body.telao .rodape, body.telao .tabela-wrap, body.telao .bloco-meta, body.telao .outros, body.telao .aviso { display: none; }
  body.telao .bloco-cab { margin-bottom: 14px; }
  body.telao .bloco-cab h2 { font-size: 32px; }
  body.telao .estados-grade { display: block; flex: 1; min-height: 0; }
  body.telao .mapa-wrap { position: relative; top: 0; max-width: none; height: 100%; display: flex; flex-direction: column; }
  body.telao .mapa-area, body.telao .mapa { flex: 1; min-height: 0; }
  body.telao .mapa svg { height: 100%; width: 100%; }
  body.telao .cand-pct { font-size: clamp(64px, 8.2vh, 120px); }
  body.telao .numeros { margin-top: 18px; }
  body.telao .numeros dd { font-size: 20px; }
  body.telao #governadores { display: flex; flex-direction: column; }
  body.telao .gov-grade { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 12px; flex: 1; min-height: 0; }
  body.telao .gov { padding: 12px 14px; gap: 8px; justify-content: space-between; }
  body.telao .gov-uf { font-size: 22px; }
  body.telao .gov-cand { grid-template-columns: 34px 1fr auto; }
  body.telao .gov-cand .foto { width: 34px; height: 34px; }
  body.telao .gov-pct { font-size: 24px; }
  body.telao .gov-nome { font-size: 13px; }
}

/* ---------- misc ---------- */
.rodape a { color: var(--papel-2); }
.rodape strong { color: var(--papel-2); }
.rodape { max-width: 1280px; margin: 0 auto; padding: 24px 40px 48px; font-size: 12px; color: var(--papel-3); line-height: 1.6; }
.dica {
  position: fixed; z-index: 50; pointer-events: none; min-width: 210px;
  background: var(--tinta-2); border: 1px solid var(--linha); border-radius: 8px; padding: 10px 12px; font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
.dica h4 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 20px; }
.dica p { margin: 3px 0; display: flex; justify-content: space-between; gap: 16px; }
.dica p i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--cor); }
.dica .sub { color: var(--papel-3); font-size: 12px; margin-top: 6px; }

@media (max-width: 1180px) {
  .estados-grade { grid-template-columns: 1fr; }
  .mapa-wrap { position: relative; top: 0; max-width: 520px; }
  .duelo { grid-template-columns: 1fr minmax(180px, 210px) 1fr; }
  .centro-margem { font-size: 52px; }
  .relogio { font-size: 46px; }
}
@media (max-width: 1000px) {
  .topo { grid-template-columns: 1fr auto auto; padding: 12px 20px; gap: 12px 20px; }
  .ticker { margin: 2px -20px -12px; }
  .ticker-rotulo { padding-left: 20px; }
  .btn-telao span { display: none; }
  .progresso-geral { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  main { padding: 8px 20px 32px; }
  .estados-grade { grid-template-columns: 1fr; }
  .mapa-wrap { position: static; max-width: 460px; }
  .gov-grade { grid-template-columns: 1fr 1fr; }
  .numeros { grid-template-columns: repeat(3, 1fr); }
  .numeros div:nth-child(4) { border-left: 0; padding-left: 0; }
  .aviso { margin: 12px 20px 0; }
  .rodape { padding: 20px; }
}
@media (max-width: 640px) {
  /* cabeçalho compacto: continua fixo, mas ocupa ~1/8 da tela */
  .topo { grid-template-columns: 1fr auto; padding: 8px 16px; gap: 6px 12px; border-top-width: 4px; }
  .marca-titulo { font-size: 21px; }
  .marca-sub, .status-hora, .btn-telao { display: none; }
  .ao-vivo { font-size: 11px; }
  .progresso-texto { font-size: 12px; margin-bottom: 5px; }
  .progresso-texto strong { font-size: 14px; }
  .trilho { height: 4px; }
  .ticker { margin: 0 -16px -8px; height: 30px; font-size: 12px; }
  .ticker-rotulo { padding-left: 16px; padding-right: 18px; font-size: 10px; }
  .tk { padding: 0 20px; }
  .aviso { margin: 12px 16px 0; font-size: 13px; }
  .alerta { top: calc(var(--topo-h, 100px) + 8px); }
  .alerta-tipo { padding: 10px 12px; font-size: 11px; }
  .alerta-texto { font-size: 18px; padding: 10px 14px; }

  main { padding: 0 16px 24px; }
  .bloco { padding: 28px 0 24px; }
  .bloco-cab { margin-bottom: 18px; gap: 6px; }
  .bloco-cab h2 { font-size: 32px; }
  .bloco-meta { font-size: 12px; }

  /* duelo lado a lado; o placar central desce para uma linha própria */
  .duelo { grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .cand, .cand.dir { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 0; text-align: left; min-width: 0; }
  .cand.dir { align-items: flex-end; text-align: right; }
  .cand.dir .foto { order: 0; }
  .cand-info { min-width: 0; width: 100%; }
  .foto { width: 64px; height: 64px; border-width: 3px; }
  .foto .ini { font-size: 26px; }
  .cand-nome { font-size: 16px; }
  .cand-partido { font-size: 11px; }
  .cand-partido .vice { display: none; }
  .cand-pct { font-size: clamp(40px, 13.5vw, 58px); margin-top: 6px; }
  .cand-votos { font-size: 12px; margin-top: 4px; }
  .centro { grid-column: 1 / -1; order: 3; border: 0; border-top: 1px solid var(--linha); margin-top: 16px; padding: 14px 0 0; }
  .centro-margem { font-size: 44px; margin-top: 4px; }
  .relogio { font-size: 44px; margin-top: 6px; }
  .centro-nome { font-size: 26px; }
  .centro[data-modo='fim'] .centro-nome { font-size: 30px; }
  .centro-sub { margin-top: 8px; }
  .centro-sub br { display: none; }
  .centro-sub .sep { display: inline; }
  .cabo { height: 28px; margin-top: 34px; }
  .numeros { grid-template-columns: 1fr 1fr; margin-top: 20px; }
  .numeros div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .numeros div:nth-child(even) { border-left: 1px solid var(--linha); padding-left: 14px; }
  .numeros dd { font-size: 20px; }

  /* mapa: siglas maiores (o SVG encolhe ~45% no celular) */
  .mapa .rotulos text { font-size: 17px; }
  .mapa .rotulos text.fora { font-size: 15px; }
  .ext-chip { padding: 6px 9px; }
  .ext-chip span { font-size: 12px; }

  /* tabela cabe na tela: some a coluna de eleitores, a barrinha e o "p.p." */
  .tabela { font-size: 13px; }
  .tabela th { padding: 0 6px 8px; letter-spacing: .06em; font-size: 10px; }
  .tabela td { padding: 9px 6px; }
  .tabela .uf-nome, .tabela .col-eleitores, .mini-trilho, .margem .pp { display: none; }
  .margem { min-width: 0; padding: 2px 6px; font-size: 11px; }

  .gov-grade { grid-template-columns: 1fr; gap: 12px; }
  .gov { padding: 14px; }
  .rodape { padding: 20px 16px 32px; }
}
@media (max-width: 360px) {
  .cand-nome { font-size: 14px; }
  .foto { width: 54px; height: 54px; }
}
