:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series: #2a78d6;
  --track: #cde2fb;
  --good: #006300;
  --wash: rgba(11, 11, 11, 0.05);
  /* cor por partido (posições da paleta categórica); veja COR_PARTIDO no script */
  --p-azul: #0b4fff;
  --p-laranja: #eb6834;
  --p-agua: #1baf7a;
  --p-amarelo: #eda100;
  --p-magenta: #e87ba4;
  --p-verde: #008300;
  --p-violeta: #6250d6;
  --p-vermelho: #e8101e;
  --p-outros: #898781;
}
/* Modo escuro: segue o sistema, a não ser que a pessoa escolha no botão de tema (tema.js grava data-tema no <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --series: #3987e5;
    --track: #0d366b;
    --good: #0ca30c;
    --wash: rgba(255, 255, 255, 0.06);
    --p-azul: #2f6bff;
    --p-laranja: #d95926;
    --p-agua: #199e70;
    --p-amarelo: #c98500;
    --p-magenta: #d55181;
    --p-violeta: #9085e9;
    --p-vermelho: #ff2a2a;
  }
}
:root[data-tema="escuro"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --series: #3987e5;
  --track: #0d366b;
  --good: #0ca30c;
  --wash: rgba(255, 255, 255, 0.06);
  --p-azul: #2f6bff;
  --p-laranja: #d95926;
  --p-agua: #199e70;
  --p-amarelo: #c98500;
  --p-magenta: #d55181;
  --p-violeta: #9085e9;
  --p-vermelho: #ff2a2a;
}
:root[data-tema="claro"] { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 1rem/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.pagina { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { margin: 0; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.sub { margin: 2px 0 0; color: var(--ink-2); }
.cabecalho { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; justify-content: space-between; }
.selos { display: flex; flex-wrap: wrap; gap: 8px; }
.selo {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 0.8125rem; color: var(--ink-2);
}
.selo.atencao { color: var(--ink); border-color: var(--ink-2); }
.cabecalho-direita { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ao-vivo[hidden] { display: none; }
.ao-vivo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.ao-vivo.vivo::before { background: var(--good); animation: pulsar 1.6s ease-in-out infinite; }
.ao-vivo.atrasado::before { background: var(--p-amarelo); }
.ao-vivo.offline::before { background: var(--p-vermelho); }
@keyframes pulsar { 50% { opacity: 0.3; } }
/* Tela cheia (painel para TV): sem filtros nem rodapé, letras maiores. */
:fullscreen { font-size: 125%; }
:fullscreen .filtros, :fullscreen .rodape { display: none; }
:fullscreen .pagina { max-width: 1240px; }

.filtros { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 20px 0 16px; }
.filtros label[hidden] { display: none; }
.filtros label.cidade { flex-basis: 14rem; max-width: 20rem; }
.filtros label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 9.5rem; max-width: 15rem; font-size: 0.8125rem; color: var(--ink-2); }
.filtros select, .filtros input {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font: inherit;
}
select:focus-visible, input:focus-visible, button:focus-visible, .linha:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }

.aviso { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--ink-2); background: var(--surface); font-size: 0.9375rem; }
.aviso[hidden] { display: none; }

.painel { transition: opacity 0.15s; }
.painel.carregando { opacity: 0.55; }

.cartao { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.heroi { margin-bottom: 12px; }
.heroi .rotulo { color: var(--ink-2); font-size: 0.875rem; }
.heroi .valor { font-size: 3.25rem; line-height: 1.1; font-weight: 650; letter-spacing: -0.02em; }
.heroi .detalhe { color: var(--ink-2); font-size: 0.875rem; margin-top: 4px; }
.medidor { height: 8px; border-radius: 4px; background: var(--track); margin: 10px 0 8px; overflow: hidden; }
.medidor > i { display: block; height: 100%; background: var(--series); border-radius: 4px; transition: width 0.4s; }

.resumo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; margin-bottom: 12px; }
.resumo[hidden] { display: none; }
.resumo .rotulo { color: var(--ink-2); font-size: 0.875rem; }
.resumo-principal .valor { font-size: 2.25rem; line-height: 1.15; font-weight: 650; letter-spacing: -0.02em; }
.resumo .detalhe { color: var(--ink-2); font-size: 0.875rem; margin-top: 2px; }
.resumo-destaques { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.resumo-destaques .valor { font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.indicador .rotulo { color: var(--ink-2); font-size: 0.8125rem; }
.indicador .valor { font-size: clamp(1.1rem, 2vw + 0.7rem, 1.5rem); font-weight: 600; overflow-wrap: anywhere; }
.indicador .detalhe { color: var(--muted); font-size: 0.8125rem; }

.lista-titulo { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin: 0 0 8px; }
.lista-titulo span { color: var(--ink-2); font-size: 0.875rem; }
.ranking { list-style: none; margin: 0; padding: 4px 0; }
.linha {
  display: grid; align-items: center; gap: 2px 12px;
  grid-template-columns: 2rem minmax(9rem, 17rem) 1fr 7.5rem 4.75rem;
  padding: 8px 12px; border-radius: 8px;
}
.linha:hover, .linha.foco { background: var(--wash); }
.pos { color: var(--muted); font-variant-numeric: tabular-nums; }
.com-foto { display: flex; align-items: center; gap: 10px; min-width: 0; }
.foto {
  position: relative; flex: none; display: grid; place-items: center; overflow: hidden;
  width: 40px; height: 40px; border-radius: 50%; background: var(--wash); color: var(--ink-2);
  font-size: 0.8125rem; font-weight: 600;
}
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nome { font-weight: 600; overflow-wrap: anywhere; }
.meta { color: var(--ink-2); font-size: 0.8125rem; }
.meta .eleito { color: var(--good); font-weight: 600; }
.trilho { border-left: 1px solid var(--baseline); height: 14px; }
.barra { height: 14px; background: var(--series); border-radius: 0 4px 4px 0; transition: width 0.4s; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.num.pct { font-weight: 600; }
.mais { margin: 12px 12px 0; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.mais:hover { background: var(--wash); }
.mais[hidden] { display: none; }
.exportar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 12px 0; color: var(--ink-2); font-size: 0.8125rem; }
.exportar[hidden] { display: none; }
.vazio { padding: 24px 12px; color: var(--ink-2); }

.dica {
  position: fixed; z-index: 10; pointer-events: none; max-width: 260px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-size: 0.8125rem;
}
.dica[hidden] { display: none; }
.dica strong { display: block; font-size: 1rem; }
.dica span { color: var(--ink-2); }

dialog.sobreposicao { width: min(1040px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--page); color: var(--ink); }
dialog.sobreposicao::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog.busca { width: min(560px, calc(100vw - 24px)); margin: 10vh auto auto; padding: 12px; }
.busca input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; }
.busca ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow: auto; }
.busca li[role=option] { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.busca li[aria-selected=true] { background: var(--wash); box-shadow: inset 0 0 0 2px var(--series); }
.busca li.grupo { padding: 8px 10px 2px; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.busca .meta { margin: 8px 4px 0; }
kbd { padding: 0 5px; border: 1px solid var(--border); border-radius: 4px; color: var(--ink-2); font: inherit; font-size: 0.75rem; }
.sobre-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 8px; }
.comparar-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.comparar-lado { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.comparar-lado h3 { margin: 0 0 2px; font-size: 1rem; font-weight: 600; }
.comparar-lado .meta { margin: 4px 0; }
.comparar-lado .ranking { margin: 8px 0; }
.comparar-lado .linha { grid-template-columns: 1.6rem minmax(0, 1fr) auto; grid-template-areas: "pos quem pct" "pos quem votos" ". trilho trilho"; align-items: start; row-gap: 6px; padding: 8px 4px; }
.comparar-lado .linha > .pos { grid-area: pos; }
.comparar-lado .linha > .quem { grid-area: quem; }
.comparar-lado .linha > .trilho { grid-area: trilho; }
.comparar-lado .linha > .votos { grid-area: votos; color: var(--ink-2); font-size: 0.8125rem; }
.comparar-lado .linha > .pct { grid-area: pct; }
.filtros.compactos { margin: 0 0 12px; }
.filtros.compactos label { flex: 1 1 8rem; max-width: none; }
.rodape { margin-top: 28px; color: var(--ink-2); font-size: 0.8125rem; }
.rodape p { margin: 4px 0; }
.rodape a { color: inherit; }

/* ===== bloco: evolução, replay e atualizações ===== */
.evo { margin-bottom: 12px; }
.evo-nota { margin: 4px 0 0; color: var(--ink-2); }
.evo-eixos { margin: 0 0 8px; color: var(--ink-2); font-size: 0.8125rem; }
.evo-legenda { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; padding: 0; color: var(--ink-2); font-size: 0.8125rem; }
.evo-legenda li { display: inline-flex; align-items: center; gap: 6px; }
.evo-legenda svg { flex: none; }
.evo-grafico svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.evo-grafico svg:focus-visible, .evo-rolagem:focus-visible, .evo-tabela summary:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; border-radius: 4px; }
.evo-grafico text { font: 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif; fill: var(--ink-2); }
.evo-grafico .evo-rotulo { fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.evo-grafico .evo-rotulo b { font-weight: 650; }
.evo-tabela { margin-top: 12px; font-size: 0.8125rem; color: var(--ink-2); }
.evo-tabela summary { cursor: pointer; width: fit-content; }
.evo-rolagem { max-height: 18rem; overflow: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); }
.evo-rolagem table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.evo-rolagem th, .evo-rolagem td { padding: 6px 10px; text-align: right; white-space: nowrap; }
.evo-rolagem th:first-child, .evo-rolagem td:first-child { text-align: left; }
.evo-rolagem thead th { position: sticky; top: 0; background: var(--surface); box-shadow: 0 1px 0 var(--border); font-weight: 600; }
.evo-rolagem tbody tr:nth-child(even) { background: var(--wash); }
.dica .evo-dica-linha { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.dica .evo-dica-linha b { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }
.dica .evo-dica-linha svg { flex: none; }
.botao { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.875rem; cursor: pointer; }
.botao:hover { background: var(--wash); }
.botao[aria-pressed="true"] { border-color: var(--series); }
.replay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 4px; }
.replay input[type=range] { flex: 1 1 12rem; min-width: 0; accent-color: var(--series); }
.replay-hora { color: var(--ink-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.replay-quadro { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.replay-quadro[hidden] { display: none; }
.replay-quadro li { display: grid; grid-template-columns: minmax(7rem, 14rem) 1fr 4.5rem; gap: 8px; align-items: center; font-size: 0.875rem; }
.replay-quadro .rq-trilho { border-left: 1px solid var(--baseline); }
.replay-quadro .rq-barra { height: 10px; border-radius: 0 4px 4px 0; transition: width 0.3s; }
.feed { margin-top: 12px; }
.feed-lista { list-style: none; margin: 0; padding: 0; max-height: 26rem; overflow: auto; }
.feed-lista li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 4px 12px; padding: 8px 4px; border-top: 1px solid var(--border); font-size: 0.875rem; }
.feed-lista li:first-child { border-top: 0; }
.feed-lista time { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.feed-lista .destaque { font-weight: 600; }

/* ===== bloco: mapa, regiões, disputas e anúncio ===== */
/* Faixa de anúncio: fica fixa no topo enquanto a página rola. --anuncio-altura (anuncio.js) afasta o que `scrollIntoView` leva para o alto. */
html { scroll-padding-top: calc(var(--anuncio-altura, 0px) + 12px); }
.anuncio { position: sticky; top: 8px; z-index: 5; display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px; padding: 12px 18px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14); align-items: center; text-align: center; }
.anuncio[hidden] { display: none; }
.anuncio-rotulo { color: var(--muted); font-size: 0.8125rem; }   /* em minúsculas, como "Apresentado por" antes do logo */
.anuncio-conteudo { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.anuncio-linha { display: flex; align-items: center; justify-content: center; gap: 10px; }
.anuncio-icone { flex: none; width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.anuncio-texto { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; text-underline-offset: 3px; }
.anuncio a.anuncio-conteudo:hover .anuncio-texto, .anuncio a.anuncio-conteudo:focus-visible .anuncio-texto { text-decoration: underline; }
.anuncio a.anuncio-conteudo:focus-visible { outline: 2px solid var(--series); outline-offset: 4px; border-radius: 6px; }
.anuncio-imagem { display: block; width: 100%; max-width: 970px; max-height: 220px; margin: 0 auto; object-fit: contain; border-radius: 8px; background: var(--wash); }
.anuncio.com-imagem .anuncio-texto { font-size: 1rem; font-weight: 600; color: var(--ink-2); }
@media (max-height: 560px) { .anuncio { position: static; box-shadow: none; } }   /* celular deitado: fixa comeria metade da tela */
.mapa, .regioes, .disputas, .hemiciclo, #maisvotados, .mapa-mun { margin-bottom: 12px; }
.mapa-mun .botao[hidden] { display: none; }
/* Mapa por município: dá zoom (zoom-mapa.js). O traço é em pixels da tela, então fica fino em qualquer ampliação. */
.mapa-mun .mapa-svg { position: relative; }
.mapa-mun .mapa-svg svg { max-width: none; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.mapa-mun .mapa-svg.ampliado svg { touch-action: none; }
.mapa-mun .mapa-svg.arrastando svg, .mapa-mun .mapa-svg.arrastando path { cursor: grabbing; }
.mapa-mun .mapa-svg svg:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; border-radius: 4px; }
.mapa-mun .mapa-svg path { stroke-width: 0.5px; vector-effect: non-scaling-stroke; }
.mapa-mun .mapa-svg path.atual { stroke-width: 2px; }
.mapa-mun .mapa-svg path.sem-dados { cursor: default; }
.mapa-mun .mapa-svg .mun-rotulos text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 600; fill: var(--ink); stroke: var(--surface); stroke-width: 0.25em; stroke-linejoin: round; paint-order: stroke; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.mapa-mun .mapa-svg circle.ponto { stroke: var(--ink); stroke-width: 1px; vector-effect: non-scaling-stroke; cursor: pointer; }
.mapa-mun .mapa-svg circle.ponto.atual { stroke-width: 2px; }
.mundo .mapa-svg { background: var(--wash); border-radius: 8px; overflow: hidden; }
.mundo-pais { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.mundo-pais h3 { margin: 0; font-size: 1rem; }
.mundo-pais .evo-rolagem { margin-top: 8px; }
.mundo .evo-rolagem td:first-child { white-space: normal; }
.mundo .botao-link[aria-current="true"] { font-weight: 600; }
.trilha { margin-bottom: 12px; font-size: 0.875rem; }
.trilha[hidden] { display: none; }
.trilha ol { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0; padding: 0; list-style: none; }
.trilha li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.trilha [aria-current="page"] { font-weight: 600; }
.zoom-botoes { position: absolute; top: 8px; right: 8px; z-index: 1; display: flex; gap: 6px; }
.zoom-botoes .botao { min-width: 36px; min-height: 36px; padding: 4px 10px; font-size: 1.125rem; line-height: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.zoom-botoes .botao[hidden] { display: none; }
.mapa-dica { position: absolute; left: 50%; bottom: 12px; z-index: 1; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 6px 12px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 0.8125rem; text-align: center; pointer-events: none; }
.mapa-dica[hidden] { display: none; }
.hemiciclo-svg svg { display: block; width: 100%; max-width: 720px; height: auto; margin: 0 auto; }
.hemiciclo-svg circle { stroke-width: 0.012px; }
.hemiciclo-svg text { fill: var(--ink); text-anchor: middle; }
.hemiciclo-svg .grande { font: 650 0.2px system-ui, -apple-system, "Segoe UI", sans-serif; }
.hemiciclo-svg .pequeno { font: 0.07px system-ui, -apple-system, "Segoe UI", sans-serif; fill: var(--ink-2); }
.mais-votados { list-style: none; margin: 0; padding: 0; }
.mais-votados li { display: grid; grid-template-columns: 2rem 1fr auto; gap: 2px 12px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--border); font-size: 0.875rem; }
.mais-votados li:first-child { border-top: 0; }
.mais-votados .pos { color: var(--muted); font-variant-numeric: tabular-nums; }
.mais-votados .nome { font-weight: 600; }
.mais-votados .meta .eleito { color: var(--good); font-weight: 600; }
.mapa-svg { display: flex; justify-content: center; margin: 4px 0 8px; }
.mapa-svg svg { display: block; width: 100%; max-width: 520px; height: auto; }
.mapa-svg path { stroke: var(--surface); stroke-width: 1.5px; stroke-linejoin: round; cursor: pointer; transition: opacity 0.4s, fill 0.9s ease, fill-opacity 0.9s ease; }
.mapa-svg path:hover { opacity: 0.78; }
.mapa-svg path.atual { stroke: var(--ink); stroke-width: 3px; }
.mapa-svg text { font: 600 22px/1 system-ui, -apple-system, "Segoe UI", sans-serif; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.amostra-cor { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.mapa .botao { margin: 0 0 8px; }
.mapa .botao[hidden] { display: none; }
.botao-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.botao-link:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; border-radius: 2px; }
.regioes-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px; }
.regiao { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.regiao h3 { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.regiao .meta { margin: 2px 0 0; }
.regiao ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.regiao li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 0.8125rem; }
.regiao .rq-trilho { grid-column: 1 / -1; }
.disputas-lista { list-style: none; margin: 0; padding: 0; }
.disputa { display: grid; grid-template-columns: 3.25rem 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--border); font-size: 0.875rem; }
.disputa:first-child { border-top: 0; }
.disputa .uf { justify-self: start; font-weight: 650; }
.disputa .quem .meta { display: block; }
.disputa .selo { justify-self: end; }

@media (max-width: 760px) {
  .comparar-grade { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cabecalho-direita .botao { padding: 4px 10px; font-size: 0.8125rem; }
  .heroi .valor { font-size: 3rem; }
  .feed-lista li { grid-template-columns: 1fr; }
  .disputa { grid-template-columns: 3rem 1fr; }
  .disputa .selo { grid-column: 2; justify-self: start; }
  .replay-quadro li { grid-template-columns: 1fr 4.5rem; }
  .replay-quadro .rq-trilho { grid-column: 1 / -1; grid-row: 2; }
  .linha {
    grid-template-columns: 1.6rem minmax(0, 1fr) auto;
    grid-template-areas: "pos quem pct" "pos quem votos" ". trilho trilho";
    align-items: start;
    row-gap: 6px;
    padding: 10px 8px;
  }
  .linha > .pos { grid-area: pos; }
  .linha > .quem { grid-area: quem; }
  .linha > .trilho { grid-area: trilho; }
  .linha > .votos { grid-area: votos; color: var(--ink-2); font-size: 0.8125rem; }
  .linha > .pct { grid-area: pct; }
}
@media (prefers-reduced-motion: reduce) {
  .ao-vivo.vivo::before { animation: none; }
  .painel, .medidor > i, .barra { transition: none; }
}

/* ---- Topo: marca, abas por cargo e botões ---- */
.cabecalho { align-items: center; gap: 10px 16px; }
.marca { min-width: 0; }
.abas {
  display: flex; gap: 2px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.abas::-webkit-scrollbar { display: none; }
.abas[hidden] { display: none; }
.abas button {
  appearance: none; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  padding: 6px 14px; border-radius: 999px; font: inherit; font-size: 0.9375rem; font-weight: 600;
}
.abas button:hover { color: var(--ink); }
.abas button[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.abas button:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }
.sub-abas { margin-top: 10px; width: max-content; }
.sub-abas button { padding: 4px 12px; font-size: 0.8125rem; }
.cabecalho-direita { flex: 1 1 auto; justify-content: flex-end; }

/* ---- Duelo: os dois primeiros colocados ---- */
.duelo { margin: 0 0 16px; padding: 14px 16px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.duelo[hidden] { display: none; }
.duelo-linha { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px 20px; }
.duelo-lado { display: flex; align-items: center; gap: 12px; min-width: 0; }
.duelo-lado.direita { flex-direction: row-reverse; text-align: right; }
.duelo-foto { position: relative; flex: none; }
.duelo-foto .foto { width: 64px; height: 64px; font-size: 1.25rem; transition: width 0.4s, height 0.4s, box-shadow 0.4s, filter 0.4s; }
.duelo-nome { font-weight: 650; font-size: 1.0625rem; overflow-wrap: anywhere; }
.duelo-partido { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 0.8125rem; }
.duelo-lado.direita .duelo-partido { justify-content: flex-end; }
.duelo-pct { font-size: clamp(1.7rem, 2.4vw + 0.8rem, 2.6rem); font-weight: 650; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.duelo-votos { color: var(--ink-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.duelo-barra { position: relative; height: 14px; margin: 12px 0 6px; border-radius: 7px; background: var(--track); }
.duelo-barra i { position: absolute; top: 0; bottom: 0; border-radius: 7px; transition: width 0.8s ease; }
.duelo-barra i.esq { left: 0; }
.duelo-barra i.dir { right: 0; }
.duelo-barra b { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
.duelo-rodape { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.75rem; }
@media (max-width: 640px) {
  .abas button { padding: 6px 10px; font-size: 0.875rem; }
  .duelo-linha { display: grid; grid-template-columns: 1fr 1fr; }
  .duelo-lado, .duelo-lado.direita { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
  .duelo-lado.direita .duelo-partido, .duelo-partido { justify-content: center; }
  .duelo-foto .foto { width: 56px; height: 56px; }
  .duelo-rodape span:last-child { display: none; }
}

/* ---- Compartilhar ---- */
dialog.estreita { width: min(560px, calc(100vw - 24px)); }
.sub-titulo { margin: 14px 0 2px; font-size: 0.9375rem; font-weight: 600; }
.campo-copiar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.campo-copiar input { flex: 1 1 14rem; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.875rem; }
#compartilhar-codigo { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: 0.8125rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }

/* ---- Página incorporada (?embed=1): só o placar ---- */
.so-incorporado { display: none; }
html.embed .so-incorporado { display: block; }
html.embed .pagina { max-width: 720px; padding: 12px 12px 20px; }
html.embed :is(.anuncio, .abas, .filtros, .cabecalho-direita .botao, #tema, .painel > .coluna.centro, .painel > .coluna.dir, #indicadores, #evo, #exportar, #mais) { display: none; }
html.embed .cabecalho { margin-bottom: 8px; }
html.embed h1 { font-size: 1.125rem; }
html.embed .painel { display: block; }
html.embed .coluna.esq { display: flex; flex-direction: column; gap: 12px; }
html.embed .rodape p:nth-child(2) { display: none; }

/* ---- Painel em colunas ----
   Até 1179 px: uma coluna só, na mesma ordem de sempre (os invólucros somem e `order` põe cada bloco no lugar). */
.coluna { display: contents; }
@media (max-width: 1179.98px) {
  .painel { display: flex; flex-direction: column; }
  #heroi { order: 1; } #resumo { order: 2; } #indicadores { order: 3; } #trilha { order: 4; } #mundo { order: 5; } #mapa { order: 6; }
  #mapa-mun { order: 7; } #regioes { order: 8; } #hemiciclo { order: 9; } #maisvotados { order: 10; } #evo { order: 11; }
  #lista { order: 12; } #feed { order: 13; } #disputas { order: 14; } #candidato { order: 7; }
}
@media (min-width: 1180px) {
  .pagina { max-width: 1480px; }
  .painel { display: flex; align-items: flex-start; gap: 16px; }
  .painel .coluna { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .painel .coluna > * { margin: 0; }
  .painel .coluna.esq { flex: 0 0 360px; }
  .painel .coluna.centro { flex: 1 1 0; }
  .painel .coluna.dir { flex: 0 0 320px; }
  .painel .coluna:not(:has(> :not([hidden]))) { display: none; }
  /* o ranking cabe na coluna estreita com o mesmo desenho do celular */
  .painel .coluna .linha { grid-template-columns: 1.6rem minmax(0, 1fr) auto; grid-template-areas: "pos quem pct" "pos quem votos" ". trilho trilho"; align-items: start; row-gap: 6px; padding: 10px 8px; }
  .painel .coluna .linha > .pos { grid-area: pos; }
  .painel .coluna .linha > .quem { grid-area: quem; }
  .painel .coluna .linha > .trilho { grid-area: trilho; }
  .painel .coluna .linha > .votos { grid-area: votos; color: var(--ink-2); font-size: 0.8125rem; }
  .painel .coluna .linha > .pct { grid-area: pct; }
  .painel .centro .mapa-svg svg { max-width: 720px; }
  .painel .coluna.esq .heroi .valor { font-size: 2.75rem; }
}

/* ---- Palco: um mapa só, três vistas ---- */
#palco[data-vista="brasil"] > :is(#mapa-mun, #mundo),
#palco[data-vista="uf"] > :is(#mapa, #mundo),
#palco[data-vista="mundo"] > :is(#mapa, #mapa-mun) { display: none; }
#palco > :is(#mapa, #mapa-mun, #mundo):not([hidden]) { animation: entrar-mapa 0.5s ease both; }
@keyframes entrar-mapa { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
/* o estado escolhido fica e os outros apagam enquanto o zoom corre */
.mapa-svg svg.focando path:not(.alvo) { opacity: 0.1; }
.mapa-svg svg.focando text { opacity: 0; transition: opacity 0.3s; }
/* estado que mudou de cor pisca: a apuração andando */
.mapa-svg path.mudou { animation: cintilar 1.6s ease-out; }
@keyframes cintilar { 0% { filter: brightness(2.1) saturate(1.4); } 100% { filter: none; } }
@media (prefers-reduced-motion: reduce) {
  #palco > :is(#mapa, #mapa-mun, #mundo):not([hidden]) { animation: none; }
  .mapa-svg path.mudou { animation: none; }
  .mapa-svg path { transition: none; }
}

/* ===== pele cinematográfica: os mapas e o hemiciclo como telas escuras (nos dois temas) =====
   Os cartões da coluna do meio trocam os tokens de tema pelos do tema escuro: o resto do CSS (legendas, botões, tabelas,
   traços do mapa) já usa os tokens e acompanha. Os números grandes ganham uma serifa do sistema, sem baixar fonte. */
:root { --serifa: ui-serif, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif; }
.duelo-titulo, .duelo-pct, .heroi .valor, .resumo-principal .valor, .resumo-destaques .valor, .indicador .valor { font-family: var(--serifa); font-weight: 600; }
#palco > .cartao {
  --surface: #0f0e0d; --ink: #f3f1ec; --ink-2: #b9b5ab; --muted: #8a867c; --grid: #2c2a26; --baseline: #4a4740;
  --border: rgba(255, 255, 255, 0.11); --wash: rgba(255, 255, 255, 0.06); --series: #3987e5; --track: #0d366b; --good: #34d27b;
  --p-azul: #2f6bff; --p-laranja: #e0652e; --p-agua: #1fb383; --p-amarelo: #d99200; --p-magenta: #dd5d8d;
  --p-verde: #1ab31a; --p-violeta: #9085e9; --p-vermelho: #ff2a2a; --p-outros: #98958c;
  color: var(--ink); border-radius: 18px;
  background: radial-gradient(110% 80% at 30% 8%, #201d18 0%, var(--surface) 62%), var(--surface);
  box-shadow: 0 28px 70px -34px rgba(0, 0, 0, 0.65);
}
#palco > .cartao h2, #palco > .cartao h3 { font-family: var(--serifa); font-weight: 600; letter-spacing: -0.01em; }
#palco > .cartao h2 { font-size: 1.25rem; }
#palco > .cartao .botao, #palco > .cartao .pt-link { background: rgba(255, 255, 255, 0.07); color: var(--ink); border-color: var(--border); }
#palco > .cartao .botao:hover { background: rgba(255, 255, 255, 0.15); }
#palco > .cartao .evo-legenda li { padding: 2px 10px 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, 0.05); font-size: 0.75rem; }
#palco > .cartao .evo-rolagem thead th { background: #181613; }
/* Modo claro: a pele escura vale só no modo escuro. Antes o cartão do mapa ficava escuro nos dois temas, e no celular,
   onde ele ocupa quase a tela toda, trocar o tema parecia não fazer nada. */
:root[data-tema="claro"] #palco > .cartao {
  --surface: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781; --grid: #e1e0d9; --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10); --wash: rgba(11, 11, 11, 0.05); --series: #2a78d6; --track: #cde2fb; --good: #006300;
  --p-azul: #0b4fff; --p-laranja: #eb6834; --p-agua: #1baf7a; --p-amarelo: #eda100; --p-magenta: #e87ba4;
  --p-verde: #008300; --p-violeta: #6250d6; --p-vermelho: #e8101e; --p-outros: #898781;
  background: var(--surface); box-shadow: 0 18px 50px -30px rgba(0, 0, 0, 0.25);
}
:root[data-tema="claro"] #palco > .cartao :is(.botao, .pt-link) { background: rgba(11, 11, 11, 0.04); }
:root[data-tema="claro"] #palco > .cartao .botao:hover { background: rgba(11, 11, 11, 0.09); }
:root[data-tema="claro"] #palco > .cartao .evo-legenda li { background: rgba(11, 11, 11, 0.03); }
:root[data-tema="claro"] #palco > .cartao .evo-rolagem thead th { background: var(--surface); }
@media (prefers-color-scheme: light) {
  :root:not([data-tema="escuro"]) #palco > .cartao {
    --surface: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781; --grid: #e1e0d9; --baseline: #c3c2b7;
    --border: rgba(11, 11, 11, 0.10); --wash: rgba(11, 11, 11, 0.05); --series: #2a78d6; --track: #cde2fb; --good: #006300;
    --p-azul: #0b4fff; --p-laranja: #eb6834; --p-agua: #1baf7a; --p-amarelo: #eda100; --p-magenta: #e87ba4;
    --p-verde: #008300; --p-violeta: #6250d6; --p-vermelho: #e8101e; --p-outros: #898781;
    background: var(--surface); box-shadow: 0 18px 50px -30px rgba(0, 0, 0, 0.25);
  }
  :root:not([data-tema="escuro"]) #palco > .cartao :is(.botao, .pt-link) { background: rgba(11, 11, 11, 0.04); }
  :root:not([data-tema="escuro"]) #palco > .cartao .botao:hover { background: rgba(11, 11, 11, 0.09); }
  :root:not([data-tema="escuro"]) #palco > .cartao .evo-legenda li { background: rgba(11, 11, 11, 0.03); }
  :root:not([data-tema="escuro"]) #palco > .cartao .evo-rolagem thead th { background: var(--surface); }
}
#palco .mapa-svg path { transition: fill 0.8s ease, fill-opacity 0.8s ease, opacity 0.15s, filter 0.2s; }
/* o mapa com o mouse em cima de um estado: os outros recuam */
#mapa .mapa-svg svg:not(.focando) > g:first-child:hover path:not(:hover) { opacity: 0.55; }

/* ondas, entrada e o estado que trocou de líder */
.mapa-svg .onda { fill: none; stroke-width: 2.4px; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; pointer-events: none; animation: onda 1.9s ease-out forwards; }
.mapa-svg .onda-forte { stroke-width: 4px; animation-duration: 2.6s; }
@keyframes onda { from { transform: scale(0.25); opacity: 0.95; } to { transform: scale(7); opacity: 0; } }
.mapa-svg path.virou { animation: virou 1.7s ease-out; }
@keyframes virou { 0%, 100% { filter: none; } 25% { filter: brightness(2.1) saturate(1.4); } }
.mapa-svg svg.entrando path { animation: acender 0.9s ease-out both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes acender { from { opacity: 0; filter: brightness(2.4); } to { opacity: 1; filter: none; } }

/* rever a noite */
.replay-mapa { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 8px; }
.replay-mapa input[type="range"] { flex: 1 1 140px; min-width: 0; accent-color: var(--ink); }
.replay-mapa .replay-hora { color: var(--ink-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.replay-mapa .evo-legenda { flex-basis: 100%; margin: 0; }
.replay-mapa .evo-legenda[hidden] { display: none; }
#mapa.em-replay #mapa-legenda { display: none; }
#mapa.em-replay .mapa-svg path { transition-duration: 0.3s; }
@media (prefers-reduced-motion: reduce) {
  .mapa-svg .onda, .mapa-svg path.virou, .mapa-svg svg.entrando path { animation: none; }
  #palco .mapa-svg path { transition: none; }
}


/* ---- Duelo: quem está na frente salta aos olhos ---- */
.duelo-lado.lider .duelo-foto .foto { width: 88px; height: 88px; box-shadow: 0 0 0 3px var(--cor), 0 0 22px color-mix(in srgb, var(--cor) 55%, transparent); }
.duelo-lado.atras .duelo-foto .foto { filter: grayscale(0.55) brightness(0.85); }
.duelo-lado.atras { opacity: 0.82; }
.duelo-lado.lider .duelo-pct { font-size: clamp(2.1rem, 3vw + 0.8rem, 3.2rem); }
.duelo-lado.atras .duelo-pct { font-size: clamp(1.4rem, 1.6vw + 0.7rem, 2rem); color: var(--ink-2); }
.duelo-selo { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--good); color: #fff; font-size: 0.8125rem; font-weight: 700; border: 2px solid var(--surface); }
.duelo-chip { margin-left: 4px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--ink); font-size: 0.6875rem; line-height: 1.5; }
.duelo-centro { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 7.5rem; color: var(--cor, var(--ink-2)); }
.duelo-setas { width: 34px; height: 34px; flex: none; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.duelo-setas .fraca { opacity: 0.35; }
.duelo-centro[data-para="esq"] .duelo-setas { animation: empurrar-esq 1.6s ease-in-out infinite; }
.duelo-centro[data-para="dir"] .duelo-setas { animation: empurrar-dir 1.6s ease-in-out infinite; }
@keyframes empurrar-esq { 50% { transform: translateX(-5px); } }
@keyframes empurrar-dir { 50% { transform: translateX(5px); } }
.duelo-vantagem { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.duelo-vantagem b { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.duelo-vantagem small { color: var(--muted); font-size: 0.6875rem; }
.duelo-barra i.lider { box-shadow: 0 0 14px color-mix(in srgb, var(--cor) 60%, transparent); z-index: 1; }
@media (max-width: 640px) {
  .duelo-linha { grid-template-columns: 1fr 1fr; }
  .duelo-centro { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .duelo-lado.lider .duelo-foto .foto { width: 72px; height: 72px; }
  .duelo-lado .duelo-foto .foto { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .duelo-centro .duelo-setas { animation: none !important; } }

/* ---- Cartão do mapa (passar o mouse num estado ou cidade) ---- */
.dica:has(.cartao-lugar) { min-width: 17rem; padding: 12px 14px; }
.cartao-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dica .cartao-selo { display: grid; place-items: center; min-width: 2.4rem; height: 2.1rem; padding: 0 6px; border-radius: 6px; color: #fff !important; font-size: 0.8125rem; font-weight: 700; }
.cartao-cab strong { font-size: 1rem; }
.cartao-sub { color: var(--ink-2); font-size: 0.8125rem; }
.cartao-linha { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.cartao-linha .foto { width: 36px; height: 36px; }
.cartao-nome { font-weight: 600; font-size: 0.9375rem; overflow-wrap: anywhere; }
.cartao-partido { font-size: 0.75rem; font-weight: 600; }
.cartao-valores { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.cartao-valores b { font-size: 1rem; }
.cartao-valores small { color: var(--muted); font-size: 0.75rem; }

/* ---- Mapa do Brasil por município ---- */
/* no modo "Municípios" os estados viram só contorno (no replay, voltam a ser pintados) */
#mapa:not(.em-replay) .mapa-svg svg:not([data-modo="estados"]) path[data-uf] { fill: none !important; fill-opacity: 0 !important; stroke: var(--ink); stroke-width: 1.2px; stroke-opacity: 0.8; vector-effect: non-scaling-stroke; pointer-events: stroke; }

/* ---- Rótulos e etiquetas dos estados ---- */
.mapa-svg text.uf-sigla { font-size: 20px; }
.mapa-svg text.uf-pct { font-size: 17px; font-weight: 500; }
/* sigla e percentual por cima das cores dos municípios: letra branca com contorno escuro, em tamanho de tela (px) e não do desenho */
.mapa-svg text:is(.uf-sigla, .uf-pct) { fill: #fff; stroke: rgba(0, 0, 0, 0.82); stroke-linejoin: round; paint-order: stroke; }
.mapa-svg text.uf-sigla { font-size: calc(var(--upp, 1.6) * 10px); font-weight: 800; stroke-width: calc(var(--upp, 1.6) * 2.8px); }
.mapa-svg text.uf-pct { font-size: calc(var(--upp, 1.6) * 8px); font-weight: 700; stroke-width: calc(var(--upp, 1.6) * 2.4px); }
.mapa-svg .uf-cor { stroke: rgba(255, 255, 255, 0.75); stroke-width: calc(var(--upp, 1.6) * 0.9px); paint-order: normal; }   /* o quadradinho do partido de quem lidera, com borda clara */
.mapa-svg .etiquetas-linhas line { stroke: var(--ink-2); stroke-opacity: 0.55; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.mapa-svg .etiqueta { cursor: pointer; }
.mapa-svg .etiqueta[hidden] { display: none; }
.mapa-svg .etiqueta rect { stroke: rgba(0, 0, 0, 0.35); stroke-width: 1px; vector-effect: non-scaling-stroke; transition: fill 0.9s ease, fill-opacity 0.9s ease; }
.mapa-svg .etiqueta:hover rect, .mapa-svg .etiqueta:focus-visible rect { stroke: var(--ink); }
.mapa-svg .etiqueta text { font-size: 15px; font-weight: 700; fill: #fff; stroke: none; paint-order: normal; pointer-events: none; }
.mapa-svg .etiqueta .etiqueta-pct { font-weight: 600; }

/* ---- Modos do mapa: Municípios, Apurado, Vantagem (picos) e Estados ---- */
.mapa-modo { position: relative; display: flex; align-items: center; gap: 4px; margin: 6px 0 8px; }
.mapa-modo[hidden] { display: none; }
.mapa-modo > button, .mais-mapas-abrir {
  appearance: none; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
  padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 0.875rem; font-weight: 600;
}
.mapa-modo > button:hover, .mais-mapas-abrir:hover { color: var(--ink); }
.mapa-modo > button[aria-pressed="true"], .mais-mapas-abrir[aria-pressed="true"] { background: var(--wash); border-color: var(--border); color: var(--ink); }
.mapa-modo button:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }
.mais-mapas { position: relative; }
.mais-mapas-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 17rem; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
.mais-mapas-menu[hidden] { display: none; }
.mais-mapas-menu button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.mais-mapas-menu button:hover, .mais-mapas-menu button[aria-current="true"] { background: var(--wash); }
.mais-mapas-menu strong { display: block; font-size: 0.9375rem; }
.mais-mapas-menu span { color: var(--ink-2); font-size: 0.8125rem; }
.mais-mapas-menu button.com-foto { display: flex; }
.mais-mapas-menu .foto { width: 40px; height: 40px; color: var(--ink-2); font-size: 0.8125rem; box-shadow: 0 0 0 2px var(--cor); }
.mapa-svg svg[data-modo="vantagem"] :is(text.uf-sigla, text.uf-pct, .etiquetas, .etiquetas-linhas) { display: none; }
.escala-picos { display: flex; align-items: flex-end; gap: 10px; }
.escala-pico { display: inline-flex; align-items: flex-end; gap: 3px; font-size: 0.75rem; color: var(--ink-2); }
.escala-pico svg { fill: var(--ink-2); }
.escala-cor { display: inline-flex; align-items: center; gap: 2px; font-size: 0.75rem; color: var(--ink-2); }
.escala-cor .amostra-cor { border-radius: 2px; }

/* ---- Camada dos municípios (canvas por baixo do SVG dos estados) ---- */
.mapa-pilha { display: grid; width: 100%; max-width: 720px; }
.mapa-pilha > * { grid-area: 1 / 1; }
.mapa-pilha svg { max-width: none; }   /* o SVG fica por cima do canvas: contornos, rótulos e etiquetas */
.mapa-canvas { width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 0.7s ease; }
.mapa-pilha:has(svg:not([data-modo="estados"])) .mapa-canvas { opacity: 1; }
#mapa.em-replay .mapa-canvas { display: none; }
/* Ordem de empilhar explícita: o Safari do iPhone pintava o canvas (que tem opacidade animada) por cima do SVG e apagava as siglas e os contornos */
.mapa-pilha > .mapa-canvas { position: relative; z-index: 0; }
.mapa-pilha > svg { position: relative; z-index: 1; }
/* contorno dos estados escuro sobre os municípios coloridos, como no painel de referência; nos modos de base escura (Apurado, Vantagem) segue claro */
#mapa:not(.em-replay) .mapa-svg svg:is([data-modo="municipios"], [data-modo="candidato"]) path[data-uf] { stroke: rgba(6, 6, 10, 0.92); stroke-opacity: 1; stroke-width: 1.4px; }

/* ---- Candidato escolhido no mapa ---- */
.duelo-lado[role="button"] { cursor: pointer; border-radius: 12px; transition: background 0.2s; }
.duelo-lado[role="button"]:hover, .duelo-lado.escolhido { background: color-mix(in srgb, var(--cor) 12%, transparent); }
.duelo-lado[role="button"]:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }
.duelo-lado.escolhido .duelo-foto .foto { box-shadow: 0 0 0 3px var(--cor), 0 0 22px color-mix(in srgb, var(--cor) 55%, transparent); }
.candidato-painel[hidden] { display: none; }
.candidato-painel { display: flex; flex-direction: column; gap: 6px; }
.candidato-cab { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.candidato-cab > div:nth-child(2) { flex: 1; min-width: 0; }
.candidato-foto .foto { width: 56px; height: 56px; }
.candidato-nome { margin: 0; font-size: 1.25rem; line-height: 1.15; }
.candidato-partido { font-size: 0.8125rem; font-weight: 600; }
.candidato-fechar { text-decoration: none; font-size: 1rem; padding: 4px 8px; }
.candidato-pct { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.candidato-pct b { font-size: 2.6rem; line-height: 1; font-weight: 600; letter-spacing: -0.02em; }
.candidato-pct span { color: var(--ink-2); font-size: 0.8125rem; }
.candidato-dado { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 0.875rem; }
.candidato-dado span { color: var(--ink-2); }
.candidato-sub { margin: 12px 0 2px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.candidato-lista { list-style: none; margin: 0; padding: 0; }
.candidato-uf { display: grid; grid-template-columns: 2.2rem 1fr 4.5rem 3.6rem; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.875rem; }
.candidato-sigla { display: grid; place-items: center; height: 1.5rem; border-radius: 4px; background: var(--wash); font-size: 0.6875rem; font-weight: 700; color: var(--ink-2); }
.candidato-uf .num { text-align: right; font-variant-numeric: tabular-nums; }


/* ===== Tela única: tudo cabe na janela, sem rolar a página (o modo incorporado segue o fluxo normal) =====
   A página vira uma pilha da altura da janela: topo, filtros, duelo e, no que sobra, o painel. O mapa ocupa todo o espaço que
   resta (a proporção do desenho vem de --proporcao e o container query tira a largura da altura disponível), e o que for mais
   longo que a janela rola dentro do próprio bloco. Em celular o painel mostra uma tela por vez (telas.js e `data-na-tela`). */
html:not(.embed), html:not(.embed) body { height: 100%; overflow: hidden; }
html:not(.embed) .pagina { height: 100dvh; max-width: 1480px; padding: 8px 12px 0; display: flex; flex-direction: column; gap: 8px; }
html:not(.embed) .pagina > * { flex: none; margin: 0; }
html:not(.embed) .pagina > .painel { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
html:not(.embed) .painel :is(.cartao, .indicadores, .resumo, .trilha) { margin: 0; }
html:not(.embed) .cabecalho { gap: 6px 12px; }
html:not(.embed) .cabecalho .sub { margin: 0; }
html:not(.embed) .sub-abas { margin-top: 0; }
html:not(.embed) .filtros { margin: 0; gap: 6px 12px; align-items: center; }
html:not(.embed) .filtros label { flex-direction: row; align-items: center; gap: 8px; flex: 0 1 auto; max-width: none; }
html:not(.embed) .filtros label.cidade { flex: 1 1 14rem; max-width: 20rem; }
html:not(.embed) .filtros select, html:not(.embed) .filtros input { width: auto; min-width: 0; padding: 6px 8px; }
html:not(.embed) .filtros label.cidade input { width: 100%; }
html:not(.embed) .aviso { margin: 0; padding: 6px 10px; font-size: 0.875rem; }
html:not(.embed) .duelo { padding: 8px 12px 8px; }
html:not(.embed) .duelo-barra { margin: 8px 0 4px; height: 12px; }
html:not(.embed) .duelo-lado.lider .duelo-foto .foto { width: 68px; height: 68px; }
html:not(.embed) .duelo-lado .duelo-foto .foto { width: 52px; height: 52px; }
html:not(.embed) .duelo-pct { font-size: clamp(1.5rem, 2vw + 0.6rem, 2rem); }
html:not(.embed) .duelo-lado.lider .duelo-pct { font-size: clamp(1.7rem, 2.4vw + 0.6rem, 2.4rem); }
html:not(.embed) .duelo-lado.atras .duelo-pct { font-size: clamp(1.3rem, 1.6vw + 0.5rem, 1.7rem); }
html:not(.embed) .duelo-nome { font-size: 1rem; }
html:not(.embed) .anuncio { position: static; padding: 6px 10px; gap: 2px; box-shadow: none; }
html:not(.embed) .anuncio-texto { font-size: 0.9375rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html:not(.embed) .anuncio-conteudo { gap: 4px; }
html:not(.embed) .anuncio-imagem { max-height: 56px; }
html:not(.embed) .rodape { margin: 4px 0 8px; }

/* os mapas enchem o cartão: do cabeçalho do cartão até o fim, o que sobra é do desenho */
html:not(.embed) :is(#mapa, #mapa-mun, #mundo):not([hidden]) { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; padding: 10px 12px; }
html:not(.embed) :is(#mapa-corpo, #mapa-mun-corpo, #mundo-corpo):not([hidden]) { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }
html:not(.embed) :is(#mapa, #mapa-mun, #mundo) .mapa-svg { flex: 1 1 0; min-height: 0; margin: 0; container-type: size; align-items: center; }
html:not(.embed) :is(#mapa, #mapa-mun, #mundo) .mapa-svg > svg,
html:not(.embed) :is(#mapa, #mapa-mun, #mundo) .mapa-pilha { width: min(100cqw, calc(100cqh * var(--proporcao, 1))); max-width: none; height: auto; }
html:not(.embed) :is(#mapa, #mapa-mun, #mundo) .mapa-pilha > svg { width: 100%; height: auto; }
html:not(.embed) :is(#mapa-legenda, #mapa-mun-legenda, #mundo-legenda) { flex: none; }
html:not(.embed) .mundo-pais { flex: none; max-height: 40%; overflow-y: auto; }
html:not(.embed) .evo-nota:empty { display: none; }
html:not(.embed) .painel :is(.heroi, .resumo) { padding: 10px 14px; }
html:not(.embed) .painel .coluna.esq .heroi .valor, html:not(.embed) .heroi .valor { font-size: 2.25rem; }
html:not(.embed) .resumo-principal .valor { font-size: 1.75rem; }

.barra-telas { display: none; }

/* tela larga: as três colunas lado a lado, cada uma rolando por dentro */
@media (min-width: 1180px) {
  html:not(.embed) .pagina > .painel { flex-direction: row; align-items: stretch; overflow: hidden; gap: 12px; }
  html:not(.embed) .painel .coluna { overflow-y: auto; min-height: 0; scrollbar-width: thin; padding-bottom: 8px; }
  html:not(.embed) .painel .coluna.esq { flex: 0 0 340px; }
  html:not(.embed) .painel .coluna.dir { flex: 0 0 300px; }
}

/* celular e tablet: uma tela por vez, trocada pela barra de baixo */
@media (max-width: 1179.98px) {
  html:not(.embed) .pagina[data-tela="centro"] [data-na-tela]:not([data-na-tela="centro"]),
  html:not(.embed) .pagina[data-tela="placar"] [data-na-tela]:not([data-na-tela="placar"]),
  html:not(.embed) .pagina[data-tela="detalhes"] [data-na-tela]:not([data-na-tela="detalhes"]),
  html:not(.embed) .pagina[data-tela="aovivo"] [data-na-tela]:not([data-na-tela="aovivo"]) { display: none !important; }
  html:not(.embed) .rodape { order: 99; }
  html:not(.embed) .barra-telas {
    display: flex; gap: 4px; margin: 0 -12px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border); background: var(--surface);
  }
  html:not(.embed) .barra-telas button {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 5px 0 4px;
    border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: inherit; font-size: 0.6875rem; font-weight: 650; cursor: pointer;
  }
  html:not(.embed) .barra-telas button[aria-pressed="true"] { background: var(--wash); color: var(--ink); }
  html:not(.embed) .barra-telas .icone { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--icone) center / contain no-repeat; mask: var(--icone) center / contain no-repeat; }
  .icone-centro { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E"); }
  .icone-placar { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 13h4v8H4zM10 3h4v18h-4zM16 9h4v12h-4z'/%3E%3C/svg%3E"); }
  .icone-detalhes { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h3v3H4zM9 5.5h11v2H9zM4 10.5h3v3H4zM9 11h11v2H9zM4 16h3v3H4zM9 16.5h11v2H9z'/%3E%3C/svg%3E"); }
  .icone-aovivo { --icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM6.3 6.3l1.4 1.4a6 6 0 0 0 0 8.6l-1.4 1.4a8 8 0 0 1 0-11.4zm11.4 0a8 8 0 0 1 0 11.4l-1.4-1.4a6 6 0 0 0 0-8.6z'/%3E%3C/svg%3E"); }
  html:not(.embed) #mapa-explica, html:not(.embed) :is(#mapa-mun-ajuda, #mundo-ajuda) { display: none; }
  html:not(.embed) :is(#mapa, #mapa-mun, #mundo) details.evo-tabela { display: none; }
  html:not(.embed) :is(#mapa-legenda, #mapa-mun-legenda, #mundo-legenda) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  html:not(.embed) .painel .candidato-painel, html:not(.embed) .painel .cartao { flex: none; }
  html:not(.embed) .painel :is(#mapa, #mapa-mun, #mundo):not([hidden]) { flex: 1 1 0; }
}

@media (max-width: 640px) {
  html:not(.embed) h1 { font-size: 1rem; }
  html:not(.embed) h1 .ano, html:not(.embed) .cabecalho .sub { display: none; }
  html:not(.embed) .filtros { flex-wrap: nowrap; gap: 6px; }
  html:not(.embed) .filtros label { flex: 1 1 0; min-width: 0; font-size: 0; }   /* o rótulo fica para leitor de tela: o valor do campo já diz o que é */
  html:not(.embed) .filtros label:has(#uf) { flex-grow: 1.1; }
  html:not(.embed) .filtros label:has(#turno) { flex-grow: 0.85; }
  html:not(.embed) .filtros label:has(#ambiente) { flex-grow: 1.15; }
  html:not(.embed) .filtros label.cidade { flex: 1.5 1 0; max-width: none; }
  html:not(.embed) .heroi { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 8px 12px; }
  html:not(.embed) .heroi .rotulo { grid-column: 1; }
  html:not(.embed) .heroi .valor { grid-column: 2; grid-row: 1; font-size: 1.75rem; }
  html:not(.embed) .heroi .medidor { grid-column: 1 / -1; margin: 4px 0; }
  html:not(.embed) .heroi .detalhe { grid-column: 1 / -1; margin: 0; font-size: 0.75rem; }
  html:not(.embed) .painel :is(.resumo) { padding: 8px 12px; gap: 6px 16px; }
  html:not(.embed) .resumo-principal .valor { font-size: 1.375rem; }
  html:not(.embed) .resumo-destaques { gap: 4px 18px; }
  html:not(.embed) .resumo-destaques .valor { font-size: 1.125rem; }
  html:not(.embed) .indicadores { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  html:not(.embed) .indicador { padding: 8px 10px; }
  html:not(.embed) .indicador .valor { font-size: 0.9375rem; }
  html:not(.embed) .indicador .detalhe { font-size: 0.6875rem; }
  html:not(.embed) .filtros select, html:not(.embed) .filtros input { width: 100%; font-size: 0.8125rem; text-overflow: ellipsis; }
  html:not(.embed) .duelo { padding: 6px 10px; }
  html:not(.embed) .duelo-linha { grid-template-columns: 1fr auto 1fr; gap: 4px 6px; }
  html:not(.embed) .duelo-lado, html:not(.embed) .duelo-lado.direita { flex-direction: row; gap: 8px; text-align: left; align-items: center; }
  html:not(.embed) .duelo-lado.direita { flex-direction: row-reverse; text-align: right; }
  html:not(.embed) .duelo-lado .duelo-foto .foto { width: 40px; height: 40px; font-size: 0.875rem; }
  html:not(.embed) .duelo-lado.lider .duelo-foto .foto { width: 52px; height: 52px; }
  html:not(.embed) .duelo-nome { font-size: 0.75rem; line-height: 1.15; }
  html:not(.embed) .duelo-partido, html:not(.embed) .duelo-votos { display: none; }
  html:not(.embed) .duelo-pct, html:not(.embed) .duelo-lado.atras .duelo-pct { font-size: 1.375rem; }
  html:not(.embed) .duelo-lado.lider .duelo-pct { font-size: 1.625rem; }
  html:not(.embed) .duelo-centro { grid-column: auto; grid-row: auto; min-width: 0; gap: 2px; }
  html:not(.embed) .duelo-setas { width: 18px; height: 18px; }
  html:not(.embed) .duelo-vantagem b { font-size: 1rem; }
  html:not(.embed) .duelo-rodape { display: none; }
  html:not(.embed) .painel :is(#mapa, #mapa-mun, #mundo):not([hidden]) { padding: 8px 10px; }
  html:not(.embed) :is(#mapa-h, #mapa-mun-h, #mundo-h) { font-size: 0.9375rem; }
  html:not(.embed) .mapa-modo { margin: 2px 0 4px; }
  html:not(.embed) .mapa-modo > button, html:not(.embed) .mais-mapas-abrir { padding: 4px 10px; font-size: 0.8125rem; }
  html:not(.embed) .evo-legenda { margin-bottom: 4px; }
  html:not(.embed) .replay-mapa { margin: 2px 0 0; }
  html:not(.embed) .trilha { font-size: 0.8125rem; }
}
@media (max-width: 640px) and (max-height: 700px) {
  html:not(.embed) :is(#mapa, #mapa-mun, #mundo) .lista-titulo, html:not(.embed) .replay-mapa { display: none; }
}
@media (max-width: 1179.98px) {
  html:not(.embed) #heroi { order: 1; } html:not(.embed) #lista { order: 2; } html:not(.embed) #resumo { order: 3; } html:not(.embed) #indicadores { order: 4; }   /* na tela "Placar", a lista de candidatos vem logo depois do progresso */
}
@media (max-width: 1179.98px) {
  html:not(.embed) .cabecalho { flex-wrap: wrap; align-items: center; }
  html:not(.embed) .marca { flex: none; }
  html:not(.embed) .cabecalho-direita { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  html:not(.embed) .cabecalho-direita::-webkit-scrollbar, html:not(.embed) .abas::-webkit-scrollbar { display: none; }
  html:not(.embed) .cabecalho-direita > * { flex: none; white-space: nowrap; }
  html:not(.embed) .cabecalho .abas { order: 3; flex: 1 1 100%; }
  html:not(.embed) .cabecalho .abas button { flex: 1 1 auto; text-align: center; }
}
@media (min-width: 1180px) and (max-height: 1000px) {   /* notebook: o duelo fica enxuto e o mapa leva o que sobra */
  html:not(.embed) :is(.duelo-votos, .duelo-rodape, #mapa-explica) { display: none; }
  html:not(.embed) .duelo-barra { margin: 6px 0 0; }
  html:not(.embed) .duelo-lado.lider .duelo-foto .foto { width: 60px; height: 60px; }
  html:not(.embed) .duelo-lado .duelo-foto .foto { width: 48px; height: 48px; }
  html:not(.embed) :is(#mapa, #mapa-mun, #mundo) details.evo-tabela { display: none; }
}
@media (max-width: 400px) {
  html:not(.embed) .filtros select, html:not(.embed) .filtros input { font-size: 0.75rem; padding: 6px 4px; }
}
html:not(.embed) .indicador .valor { white-space: nowrap; font-size: clamp(1rem, 1.4vw, 1.25rem); }   /* o número nunca quebra no meio, nem na coluna estreita */
@media (max-width: 640px) { html:not(.embed) .indicador .valor { font-size: 0.9375rem; } }

/* Anúncio na tela única: o texto vem ao lado do rótulo e a imagem cabe numa faixa baixa, para o mapa não perder espaço */
html:not(.embed) .anuncio:not(.com-imagem) { flex-direction: row; align-items: center; justify-content: center; gap: 10px; }
html:not(.embed) .anuncio-rotulo { flex: none; font-size: 0.75rem; }
html:not(.embed) .anuncio-imagem { width: auto; max-width: 100%; }   /* o banner mantém a proporção, sem faixas cinza dos lados */
@media (max-width: 640px) {
  html:not(.embed) .anuncio-imagem { max-height: 44px; }
  html:not(.embed) .anuncio.com-imagem .anuncio-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* a imagem já fala; o texto fica para leitor de tela */
  html:not(.embed) .anuncio.com-imagem { position: relative; }
}

/* ===== Mais espaço para o mapa ===== */
html:not(.embed) .trilha:not(:has(button)) { display: none; }   /* só "Brasil", sem passo para voltar: não ocupa linha */
html:not(.embed) .cabecalho > .filtros { margin: 0; flex: 0 1 auto; }
html:not(.embed) .duelo { padding: 6px 12px; }
html:not(.embed) .duelo-barra { margin: 6px 0 0; height: 10px; }

@media (max-width: 1179.98px) {
  html:not(.embed) .cabecalho > .filtros { order: 5; flex: 1 1 100%; }
}

/* tela larga: o topo cabe em duas linhas (marca, cargos e botões; filtros e estado da apuração) e o mapa leva o resto da altura,
   com os modos e a contagem em cima, a legenda e o "Rever a noite" embaixo, na mesma faixa do cartão */
@media (min-width: 1180px) {
  html:not(.embed) .duelo-texto { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; column-gap: 10px; }
  html:not(.embed) .duelo-lado.direita .duelo-texto { justify-content: end; }
  html:not(.embed) .duelo-texto > .duelo-votos { align-self: end; }
  html:not(.embed) .cabecalho { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
  html:not(.embed) .cabecalho::after { content: ""; flex: 1 0 100%; order: 4; height: 0; }
  html:not(.embed) .cabecalho-direita { display: contents; }
  html:not(.embed) h1 { font-size: 1.25rem; }
  html:not(.embed) .cabecalho .sub { display: none; }
  html:not(.embed) .marca { order: 1; }
  html:not(.embed) .cabecalho .abas { order: 2; }
  html:not(.embed) :is(#abrir-busca, #abrir-comparar, #abrir-exterior, #abrir-compartilhar, #tela-cheia) { order: 3; }
  html:not(.embed) #abrir-busca { margin-left: auto; }
  html:not(.embed) .cabecalho > .filtros { order: 5; }
  html:not(.embed) #selos { order: 6; margin-left: auto; }
  html:not(.embed) #ao-vivo { order: 7; }
  html:not(.embed) #alertas { order: 8; }
  html:not(.embed) .duelo-lado.lider .duelo-foto .foto { width: 60px; height: 60px; }
  html:not(.embed) .duelo-lado .duelo-foto .foto { width: 48px; height: 48px; }

  html:not(.embed) #mapa:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr); column-gap: 8px; padding: 8px 10px; }
  html:not(.embed) #mapa .lista-titulo { grid-column: 2; grid-row: 1; margin: 0; align-self: center; }
  html:not(.embed) #mapa .lista-titulo h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }   /* o título fica para leitor de tela */
  html:not(.embed) #mapa-modo { grid-column: 1; grid-row: 1; margin: 0; }
  html:not(.embed) #mapa-nota { grid-column: 1 / -1; grid-row: 2; }
  html:not(.embed) #mapa-corpo:not([hidden]) { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; column-gap: 12px; }
  html:not(.embed) #mapa-corpo > .mapa-svg { grid-column: 1 / -1; grid-row: 1; align-self: stretch; }
  html:not(.embed) #mapa-corpo > #mapa-legenda { grid-column: 1; grid-row: 2; margin: 4px 0 0; align-self: center; }
  html:not(.embed) #mapa-corpo > .replay-mapa { grid-column: 2; grid-row: 2; margin: 4px 0 0; }
  html:not(.embed) #mapa-corpo > :is(#mapa-explica, #mapa-brasil, details.evo-tabela) { grid-column: 1 / -1; grid-row: 3; }
  html:not(.embed) #mapa-explica { display: none; }
}

/* ===== Celular e tablet: o mapa vira a tela inteira, de ponta a ponta, sem cartão em volta ===== */
@media (max-width: 1179.98px) {
  html:not(.embed) .pagina > .painel { margin: 0 -12px; padding: 0 12px; }
  html:not(.embed) .painel :is(#mapa, #mapa-mun, #mundo):not([hidden]) { margin: 0 -12px; padding: 0; border: 0; border-radius: 0; background: none; }
  html:not(.embed) .painel :is(#mapa, #mapa-mun, #mundo) > :not(#mapa-corpo, #mapa-mun-corpo, #mundo-corpo),
  html:not(.embed) .painel :is(#mapa-corpo, #mapa-mun-corpo, #mundo-corpo) > :not(.mapa-svg) { margin-left: 12px; margin-right: 12px; }
  html:not(.embed) .replay-mapa .botao { border-radius: 999px; }

  /* mapa do Brasil: modos, legenda, desenho e, na última linha, "Rever a noite" e a contagem de municípios */
  html:not(.embed) #mapa:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto minmax(0, 1fr) auto; row-gap: 2px; }
  html:not(.embed) #mapa-corpo:not([hidden]) { display: contents; }
  html:not(.embed) #mapa-modo { grid-column: 1 / -1; grid-row: 1; }
  html:not(.embed) #mapa-nota { grid-column: 1 / -1; grid-row: 2; }
  html:not(.embed) #mapa-legenda { grid-column: 1 / -1; grid-row: 3; }
  html:not(.embed) #mapa .mapa-svg { grid-column: 1 / -1; grid-row: 4; min-height: 0; }
  html:not(.embed) #mapa .replay-mapa { grid-column: 1; grid-row: 5; margin-top: 2px; margin-bottom: 6px; }
  html:not(.embed) #mapa .lista-titulo { grid-column: 2; grid-row: 5; margin: 0 12px 0 0; align-self: center; }
  html:not(.embed) #mapa .lista-titulo h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html:not(.embed) #mapa-corpo > :is(#mapa-explica, #mapa-brasil, details.evo-tabela) { grid-column: 1 / -1; grid-row: 6; }
}

/* ===== Celular: a tela dos mapas por município e do mundo, com o desenho em cima e o texto miúdo embaixo ===== */
html:not(.embed) :is(#mapa-mun, #mundo) .mapa-svg > svg { width: 100%; height: 100%; }   /* a caixa toda é do mapa; o zoom usa o espaço que o formato do estado deixa em cima e embaixo */
html:not(.embed) :is(#mapa-mun-corpo, #mundo-corpo):not([hidden]) { display: contents; }
html:not(.embed) :is(#mapa-mun, #mundo) .lista-titulo { order: 1; margin-top: 4px; margin-bottom: 0; }
html:not(.embed) :is(#mapa-mun-h, #mundo-h) { font-size: 0.875rem; }
html:not(.embed) :is(#mapa-mun, #mundo) .lista-titulo span { font-size: 0.75rem; }
html:not(.embed) :is(#mapa-mun, #mundo) .mapa-svg { order: 2; }
html:not(.embed) :is(#mapa-mun-legenda, #mundo-legenda) { order: 3; margin-top: 2px; margin-bottom: 2px; font-size: 0.75rem; }
html:not(.embed) :is(#mapa-mun-nota, #mundo-nota) { order: 4; margin: 0 0 2px; font-size: 0.6875rem; line-height: 1.3; }
html:not(.embed) :is(#mapa-mun-abrir, #mapa-mun-tentar, #mundo-abrir, #mundo-tentar) { order: 5; }
html:not(.embed) .mundo-pais { order: 6; }
html:not(.embed) :is(#mapa-mun-ajuda, #mundo-ajuda) { display: none; }
html:not(.embed) .filtros label:has(#ambiente option[value="oficial"]:checked) { display: none; }   /* "Dados" só aparece quando não são os oficiais (?ambiente=simulado) */
@media (min-width: 1180px) {   /* os filtros nunca quebram de linha: quem encolhe é o campo da cidade */
  html:not(.embed) .cabecalho > .filtros { flex-wrap: nowrap; min-width: 0; }
  html:not(.embed) .cabecalho > .filtros label.cidade { flex: 1 1 8rem; min-width: 0; max-width: 14rem; }
}
@media (max-width: 1179.98px) {
  html:not(.embed) :is(#mapa-mun-nota, #mundo-nota) { margin: 0 12px 4px; }
  html:not(.embed) :is(#mapa-mun-h, #mundo-h) { font-size: 0.8125rem; }
  html:not(.embed) :is(#mapa-mun-legenda, #mundo-legenda) { font-size: 0.6875rem; }
}
@media (max-width: 640px) and (max-height: 780px) {
  html:not(.embed) .anuncio-texto { -webkit-line-clamp: 1; }
}

/* Anúncio no celular: "Apresentado por" quebra em duas linhas curtas e o texto, alinhado à esquerda, usa até 3 linhas.
   Antes ele ficava centralizado numa linha só, cortado em "...", longe do logo. */
@media (max-width: 640px) {
  html:not(.embed) .anuncio:not(.com-imagem) { gap: 8px; }
  html:not(.embed) .anuncio-rotulo { font-size: 0.6875rem; line-height: 1.2; width: min-content; text-align: right; }
  html:not(.embed) .anuncio-linha { gap: 8px; }
  html:not(.embed) .anuncio-texto { text-align: left; font-size: 0.8125rem; -webkit-line-clamp: 3; }
}
