/* Apuração 2026 · Co.jus — identidade da casa: Deep, Paper, Gold; Cormorant, Source Sans 3, IBM Plex Mono */
:root {
  color-scheme: dark;
  --deep: #0A1220;
  --painel: #0E1828;
  --painel-2: #132037;
  --slate: #1A2C46;
  --paper: #F3F0E9;
  --paper-2: rgba(243, 240, 233, 0.74);
  --paper-3: rgba(243, 240, 233, 0.52);
  --linha: rgba(243, 240, 233, 0.10);
  --linha-2: rgba(243, 240, 233, 0.18);
  --gold: #B8913F;
  --gold-claro: #D4B26A;
  --ok: #0ca30c;
  --serif: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
  --logo: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --topo-h: 64px;
  --painel-w: 432px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--deep);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--gold-claro); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- topo */
.topo {
  height: var(--topo-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  border-bottom: 1px solid var(--linha);
  background: var(--deep);
  position: relative;
  z-index: 5;
}
.marca { display: flex; align-items: baseline; gap: 14px; min-width: 0; color: var(--paper); }
.marca:hover { text-decoration: none; }
.logo { font-family: var(--logo); font-style: italic; font-weight: 400; font-size: 30px; letter-spacing: -0.01em; line-height: 1; }
.logo i { color: var(--gold); font-style: normal; }
.titulo { display: flex; flex-direction: column; min-width: 0; }
.titulo b { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.1; white-space: nowrap; }
.titulo span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper-3); white-space: nowrap; }
.abas { display: flex; gap: 4px; margin-left: auto; background: var(--painel); border: 1px solid var(--linha); border-radius: 999px; padding: 3px; }
.abas button {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--paper-2);
}
.abas button[aria-pressed="true"] { background: var(--paper); color: var(--deep); }
.abas button:focus-visible, .ctl button:focus-visible, .linha-lista:focus-visible, .corrida:focus-visible, .voltar:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.noticias { font-size: 14px; font-weight: 600; white-space: nowrap; }

/* ---------------------------------------------------------------- palco */
.palco { display: flex; height: calc(100vh - var(--topo-h)); height: calc(100dvh - var(--topo-h)); min-height: 520px; }
.mapa-area { position: relative; flex: 1; min-width: 0; overflow: hidden; touch-action: none; }
.mapa-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: default; }
.mapa-area canvas.clicavel { cursor: pointer; }
.mapa-area canvas.arrastando { cursor: grabbing; }

.ctl { position: absolute; top: 14px; left: 14px; display: flex; flex-wrap: wrap; gap: 8px; z-index: 2; align-items: center; }
.pilulas { display: flex; background: rgba(14, 24, 40, 0.92); border: 1px solid var(--linha); border-radius: 999px; padding: 3px; backdrop-filter: blur(6px); }
.pilulas button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--paper-2); cursor: pointer; }
.pilulas button[aria-pressed="true"] { background: var(--slate); color: var(--paper); }
.pilulas[hidden] { display: none; }
#comparar[aria-pressed="true"] { background: var(--paper); color: var(--deep); }
.voltar {
  border: 1px solid var(--linha-2); background: rgba(14, 24, 40, 0.92); color: var(--paper);
  padding: 6px 13px 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; display: none;
}
.voltar.visivel { display: inline-flex; align-items: center; gap: 6px; }

.zoom { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.zoom button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--linha-2); background: rgba(14, 24, 40, 0.92); color: var(--paper); font-size: 18px; line-height: 1; cursor: pointer; }

.legenda {
  position: absolute; left: 14px; bottom: 14px; z-index: 2; max-width: calc(100% - 80px);
  background: rgba(14, 24, 40, 0.92); border: 1px solid var(--linha); border-radius: 12px; padding: 10px 12px;
  font-size: 12px; color: var(--paper-2); backdrop-filter: blur(6px);
}
.legenda .lt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-3); margin-bottom: 6px; }
.legenda .lin { display: flex; align-items: center; gap: 8px; margin-top: 4px; white-space: nowrap; }
.legenda .esc { display: flex; gap: 2px; }
.legenda .esc i { display: block; width: 16px; height: 10px; border-radius: 2px; }
.legenda .nota { margin-top: 6px; color: var(--paper-3); }
.legenda .esc i.contorno { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gold-claro); }

.dica {
  position: absolute; z-index: 4; pointer-events: none; min-width: 210px; max-width: 290px;
  background: rgba(10, 18, 32, 0.97); border: 1px solid var(--linha-2); border-radius: 12px; padding: 10px 12px 11px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); font-size: 13px; display: none;
}
.dica.visivel { display: block; }
.dica h4 { margin: 0 0 6px; font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.15; }
.dica h4 small { font-family: var(--mono); font-size: 11px; color: var(--paper-3); font-weight: 400; margin-left: 4px; }
.dica .cr { display: grid; grid-template-columns: 10px 1fr auto; gap: 2px 8px; align-items: center; margin-top: 3px; }
.dica .cr i { width: 10px; height: 10px; border-radius: 3px; }
.dica .cr .pc { font-weight: 700; }
.dica .rod { margin-top: 7px; color: var(--paper-3); font-size: 12px; }

/* comparação 1º × 2º turno: tabela da dica e do município, linhas de placar dos dois turnos */
table.comp { width: 100%; border-collapse: collapse; font-size: 13px; }
table.comp th { font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--paper-3); text-align: right; padding: 0 0 3px 10px; }
table.comp td { padding: 2px 0; }
table.comp td + td { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; padding-left: 10px; }
table.comp td i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
table.comp tr.out td { color: var(--paper-3); font-weight: 400; }
.virou { margin-top: 6px; color: var(--gold-claro); font-weight: 600; font-size: 12.5px; }
.leitura.comp-mun { margin-top: 10px; }
.turno-linha { margin-top: 12px; }
.turno-linha:first-of-type { margin-top: 2px; }
.tl-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; color: var(--paper-2); }
.tl-cab i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.tl-cab b { color: var(--paper); }
.tl-rot { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-3); white-space: nowrap; }
.tl-sep { display: inline-block; width: 12px; }
.turno-linha .barra { margin: 6px 0 0; height: 9px; }
.linha-lista .lv-de { font-size: 12.5px; color: var(--paper-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha-lista .lv-de i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }

.carregando { position: absolute; inset: 0; display: grid; place-items: center; color: var(--paper-3); font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------------------------------------------------------------- painel */
.painel {
  width: var(--painel-w); flex: none; border-left: 1px solid var(--linha); background: var(--painel);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--slate) transparent;
}
.bloco { padding: 18px 20px; border-bottom: 1px solid var(--linha); }
.rot { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper-3); margin: 0 0 10px; display: flex; justify-content: space-between; gap: 10px; }
.rot b { color: var(--paper-2); font-weight: 500; }

.aviso { background: linear-gradient(180deg, rgba(184, 145, 63, 0.13), rgba(184, 145, 63, 0.04)); border-bottom: 1px solid rgba(184, 145, 63, 0.35); }
.aviso h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.1; margin: 0 0 6px; }
.aviso p { margin: 0; color: var(--paper-2); }
.contagem { display: flex; gap: 10px; margin-top: 12px; }
.contagem div { background: rgba(10, 18, 32, 0.55); border: 1px solid var(--linha); border-radius: 10px; padding: 7px 10px; min-width: 64px; text-align: center; }
.contagem b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; }
.contagem span { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--paper-3); }

.escopo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.escopo h1 { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.05; margin: 0; }
.escopo h1 small { display: block; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper-3); margin-bottom: 4px; }

.cands { display: grid; gap: 12px; }
.cand { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; }
.foto { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: var(--slate); border: 2px solid var(--cor, var(--linha-2)); display: grid; place-items: center; font-family: var(--mono); font-weight: 500; font-size: 15px; color: var(--paper-2); }
.foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
.cand .nome { font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1.1; }
.cand .meta { font-family: var(--mono); font-size: 11.5px; color: var(--paper-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.cand .meta i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.cand .pc { text-align: right; }
.cand .pc b { font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1; display: block; }
.cand .pc span { font-size: 12.5px; color: var(--paper-2); }
.cand.lider .nome::after { content: ''; }
.selo { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--linha-2); color: var(--paper); margin-left: 6px; vertical-align: 2px; }
.selo.eleito { border-color: rgba(12, 163, 12, 0.6); color: #8fe08f; }
.selo svg { width: 11px; height: 11px; }

.barra { position: relative; display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: var(--slate); margin: 16px 0 6px; gap: 2px; }
.barra span { height: 100%; }
.barra .meio { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--paper); opacity: 0.55; }
.barra-rot { display: flex; justify-content: space-between; font-size: 12px; color: var(--paper-3); }

.outros { margin-top: 12px; font-size: 13px; color: var(--paper-2); }
.outros details summary { cursor: pointer; color: var(--paper-2); }
.outros table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.outros td { padding: 3px 0; border-bottom: 1px solid var(--linha); }
.outros td:last-child, .outros td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }

.andamento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.andamento > div { background: var(--painel-2); border: 1px solid var(--linha); border-radius: 10px; padding: 8px 10px; }
.andamento b { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.andamento span { font-size: 11.5px; color: var(--paper-3); }
.progresso { height: 4px; background: var(--slate); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.progresso i { display: block; height: 100%; background: var(--paper); }

.leitura { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--painel-2); border: 1px solid var(--linha); font-size: 13.5px; color: var(--paper-2); }
.leitura b { color: var(--paper); }
.atualizado { margin-top: 10px; font-size: 12px; color: var(--paper-3); display: flex; align-items: center; gap: 6px; }
.atualizado .pulso { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.6); animation: pulso 2s infinite; }
.atualizado .pulso.parado { background: var(--paper-3); animation: none; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }

.grafico { position: relative; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico .eixo { fill: var(--paper-3); font-size: 10.5px; font-family: var(--mono); }
.grafico .grade { stroke: var(--linha); stroke-width: 1; }
.grafico .ref { stroke: var(--paper-3); stroke-dasharray: 3 3; stroke-width: 1; }
.grafico .serie { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grafico .mira { stroke: var(--paper-2); stroke-width: 1; }
.grafico .gdica { position: absolute; top: 0; pointer-events: none; background: rgba(10, 18, 32, 0.97); border: 1px solid var(--linha-2); border-radius: 8px; padding: 6px 8px; font-size: 12px; white-space: nowrap; display: none; }

.busca { width: 100%; background: var(--painel-2); border: 1px solid var(--linha-2); border-radius: 10px; padding: 9px 12px; color: var(--paper); font: inherit; font-size: 14px; }
.busca::placeholder { color: var(--paper-3); }
.busca:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.resultados-busca { margin-top: 6px; }

.lista { display: grid; gap: 2px; margin-top: 8px; }
.linha-lista {
  display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr 64px; gap: 10px; align-items: center;
  padding: 7px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer; border: 0; background: transparent; text-align: left; width: calc(100% + 16px);
}
.linha-lista:hover { background: var(--painel-2); }
.linha-lista .ln { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha-lista .ln small { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--paper-3); margin-left: 4px; }
.linha-lista .mini { display: flex; height: 8px; border-radius: 3px; overflow: hidden; background: var(--slate); gap: 2px; }
.linha-lista .mini span { height: 100%; }
.linha-lista .lv { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.linha-lista .lv b { display: block; font-size: 13.5px; }
.linha-lista .lv span { color: var(--paper-3); font-size: 11.5px; }
.linha-lista.ativa { background: var(--painel-2); box-shadow: inset 2px 0 0 var(--gold); }
.ordenar { display: flex; gap: 6px; }
.ordenar button { border: 1px solid var(--linha); background: transparent; color: var(--paper-3); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; cursor: pointer; }
.ordenar button[aria-pressed="true"] { color: var(--paper); border-color: var(--linha-2); background: var(--painel-2); }

.corridas { display: grid; gap: 10px; }
.corrida { display: block; width: 100%; text-align: left; background: var(--painel-2); border: 1px solid var(--linha); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.corrida:hover { border-color: var(--linha-2); }
.corrida.ativa { border-color: var(--gold); }
.corrida .ch { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.corrida .ch b { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.corrida .ch span { font-size: 12px; color: var(--paper-3); }
.corrida .cl { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; margin-top: 4px; font-size: 14px; }
.corrida .cl i { width: 10px; height: 10px; border-radius: 3px; }
.corrida .cl .p { font-weight: 700; font-variant-numeric: tabular-nums; }
.corrida .barra { margin: 9px 0 0; height: 8px; }
.eleitos1t { font-size: 13px; color: var(--paper-2); }
.eleitos1t li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--linha); }
.eleitos1t ul { list-style: none; padding: 0; margin: 0; }
.eleitos1t .u { font-family: var(--mono); font-size: 11.5px; color: var(--paper-3); width: 26px; flex: none; }

.nota { font-size: 12.5px; color: var(--paper-3); }
.nota p { margin: 0 0 8px; }
.rodape-painel { padding: 18px 20px 26px; }
.alerta-fonte { margin: 0; padding: 8px 20px; font-size: 12.5px; background: rgba(184, 145, 63, 0.14); color: var(--paper); border-bottom: 1px solid rgba(184, 145, 63, 0.3); display: none; }
.alerta-fonte.visivel { display: block; }

/* ---------------------------------------------------------------- manchete (notícia de última hora)
   Desktop: caixa sobre o canto superior direito do mapa. Celular: entre o topo e o mapa. */
.manchete {
  position: absolute; z-index: 3;
  top: calc(var(--topo-h) + 14px); right: calc(var(--painel-w) + 14px);
  width: 340px; max-width: calc(100vw - var(--painel-w) - 28px);
  background: rgba(10, 18, 32, 0.95); border: 1px solid rgba(184, 145, 63, 0.5); border-left: 3px solid var(--gold);
  border-radius: 10px; padding: 10px 36px 11px 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); backdrop-filter: blur(6px);
}
.manchete[hidden] { display: none; }
.mh-rot { margin: 0 0 5px; display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-claro); }
.mh-ponto { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.mh-hora { color: var(--paper-3); text-transform: none; }
.mh-titulo { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.15; color: var(--paper); }
.mh-fonte { margin: 6px 0 0; font-size: 12px; color: var(--paper-3); }
.mh-fechar {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 7px;
  background: transparent; color: var(--paper-3); font-size: 18px; line-height: 1; cursor: pointer;
}
.mh-fechar:hover { color: var(--paper); background: var(--painel-2); }
.mh-fechar:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
/* mapa estreito: desce para baixo dos botões do mapa */
@media (min-width: 1000px) and (max-width: 1299px) { .manchete { top: calc(var(--topo-h) + 60px); } }
/* com os dois mapas no desktop, a caixa cobriria o mapa da direita: some enquanto a comparação está aberta */
@media (min-width: 1000px) { body.comparando .manchete { display: none; } }
@media (max-width: 999px) {
  .manchete { position: relative; top: auto; right: auto; width: auto; max-width: none; margin: 10px 16px; }
  .mh-titulo { font-size: 18px; }
}

/* ---------------------------------------------------------------- celular e telas médias */
@media (max-width: 999px) {
  :root { --topo-h: auto; }
  .topo { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px 14px; }
  .marca { flex: 1 1 0; min-width: 0; gap: 10px; }
  .logo { font-size: 26px; }
  .titulo { overflow: hidden; }
  .titulo b { font-size: 17px; }
  .titulo span { overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
  .abas { margin-left: 0; order: 3; width: 100%; }
  .abas button { flex: 1; }
  .noticias { margin-left: 0; font-size: 13px; }
  .legenda { font-size: 11px; padding: 7px 9px; border-radius: 10px; }
  .legenda .lt { font-size: 9.5px; margin-bottom: 4px; }
  .legenda .lin { margin-top: 2px; }
  .legenda .esc i { width: 12px; height: 8px; }
  .legenda .nota { margin-top: 3px; }
  .zoom button { width: 30px; height: 30px; }
  .palco { flex-direction: column; height: auto; min-height: 0; }
  .mapa-area { flex: none; height: 62vh; height: 62svh; min-height: 340px; touch-action: pan-y; }
  .mapa-area.capturando { touch-action: none; }
  .mapa-area.comparando { height: 90vh; height: 90svh; min-height: 600px; }
  .painel { width: 100%; border-left: 0; border-top: 1px solid var(--linha); overflow: visible; }
  .bloco { padding: 16px; }
  .legenda { bottom: 10px; left: 10px; padding: 8px 10px; }
  .ctl { top: 10px; left: 10px; }
  .zoom { right: 10px; bottom: 10px; }
  .dica.fixa { left: 10px !important; right: 10px; top: auto !important; bottom: 10px; max-width: none; pointer-events: auto; }
}
@media (max-width: 420px) {
  .cand { grid-template-columns: 44px 1fr auto; gap: 10px; }
  .foto { width: 44px; height: 44px; }
  .cand .nome { font-size: 18px; }
  .cand .pc b { font-size: 29px; }
  .escopo h1 { font-size: 24px; }
  .andamento b { font-size: 15px; }
  .legenda .esc i { width: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .atualizado .pulso { animation: none; }
}
@media (forced-colors: active) {
  .barra span, .linha-lista .mini span { forced-color-adjust: none; }
}
