/* APURA — painel de apuração. Branco-gelo, largura total, grade de 12 colunas, cor só onde é informação. */
:root {
  --bg: #f4f6f9;
  --paper: #fff;
  --ink: #15181d;
  --ink-2: #3c434c;
  --muted: #6c737d;
  --line: #e2e6ec;
  --line-2: #edf0f4;
  --c1: #1f2937;   /* candidato A (ordem fixa por identificador) — grafite */
  --c2: #0e9ac2;   /* candidato B — ciano da marca */
  --c3: #8b93a0;   /* demais — cinza */
  --neutral: #cfd4da;
  --accent: #0d1f3f;   /* azul-marinho da logo */
  --accent-2: #19b5d8; /* ciano da logo, só em detalhes */
  --ok: #2f7d4f; --warn: #a66b00; --bad: #a93434;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, Menlo, monospace;
  --r: 12px;
  --max: 1680px;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 14px; } }
main.wrap { flex: 1; padding-top: 26px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 1099px) { main.wrap { padding-top: 20px; } }
.page-head { padding-bottom: 6px; }
.page-head h1 { margin-top: 4px; }
.sync[hidden] { display: none; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 6px 10px; }
.skip:focus { left: 8px; z-index: 50; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
code { font: 12.5px var(--mono); background: var(--line-2); padding: 1px 5px; border-radius: 4px; }

/* Navbar */
.navbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.navbar-row { display: flex; align-items: center; gap: 28px; min-height: 76px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand-logo { width: 64px; height: 64px; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-weight: 900; font-size: 26px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.brand-name b { color: var(--accent-2); font-weight: 900; }
.brand-tag { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { text-decoration: none; font-size: 14.5px; font-weight: 600; color: var(--ink-2); padding: 10px 14px; border-radius: 8px; white-space: nowrap; position: relative; }
.nav a:hover { color: var(--accent); background: var(--bg); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--accent-2); }
.navbar-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.presence { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.presence b { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.presence .pdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 5px; box-shadow: 0 0 0 3px rgba(47,125,79,.15); }
.presence .sep { color: var(--line); }
.sync { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neutral); }
.sync.ok .dot { background: var(--accent-2); } .sync.bad .dot { background: var(--bad); }
@media (max-width: 1000px) {
  .navbar-row { flex-wrap: wrap; gap: 8px 16px; padding-block: 8px; min-height: 0; }
  .nav { order: 3; width: 100%; margin: 0 -14px; padding: 0 14px 4px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .brand-logo { width: 48px; height: 48px; } .brand-name { font-size: 20px; } .brand-tag { font-size: 10px; }
  .navbar-right { flex-direction: row; align-items: center; gap: 10px; }
  .sync { display: none; }
}
@media (max-width: 480px) { .brand-tag { display: none; } .presence { font-size: 11.5px; padding: 3px 9px; } }

/* Cartões / grade */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
select, input[type="search"], input[type="text"], textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; min-width: 0; max-width: 100%; }
select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 38px; min-width: 190px; font-weight: 600; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236c737d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select:hover { border-color: var(--muted); }
select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(25,181,216,.18); outline: none; }
select::-ms-expand { display: none; }
.btn { font: inherit; font-size: 14px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-plain { font: inherit; background: none; border: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); cursor: pointer; padding: 0; }
.btn-plain:hover { text-decoration-color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; background: var(--paper); }
.seg button { font: inherit; font-size: 13.5px; font-weight: 600; background: var(--paper); color: var(--ink-2); border: 0; padding: 8px 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* Etiquetas */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); }
.chip.parcial::before { background: var(--warn); }
.chip.final_oficial::before, .chip.totalizacao_encerrada::before { background: var(--ok); }
.chip.indisponivel::before { background: var(--bad); }
.chip.historico::before { background: var(--ink-2); }
.notice { border-left: 3px solid var(--warn); background: #fbf7ee; padding: 10px 12px; font-size: 13.5px; border-radius: 0 8px 8px 0; }
.notice.bad { border-left-color: var(--bad); background: #fbf0f0; }
.notice.info { border-left-color: var(--accent-2); background: #eef8fb; }
.notes { font-size: 13px; color: var(--ink-2); padding-left: 18px; margin: 8px 0 0; }
.notes li { margin-bottom: 4px; }

/* Painel ao vivo — 12 colunas no desktop; no celular, ordem pensada para leitura (candidatos primeiro) */
.dash { display: grid; gap: 18px; grid-template-columns: 1fr; }
.dash > * { min-width: 0; }
@media (max-width: 1099px) {
  .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; } .o7 { order: 7; } .o8 { order: 8; }
  .card { padding: 14px; }
  h1 { font-size: 21px; }
  .cand { grid-template-columns: 64px 1fr; padding: 12px; }
  .cand img, .cand .noimg { width: 64px; height: 80px; }
  .cand .pct { font-size: 36px; }
  .ring-wrap { gap: 14px; }
  .ring-wrap svg { width: 104px; height: 104px; }
  .ring-v { font-size: 34px; }
  .ring-meta { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .ring-meta .num { font-size: 13.5px; }
  .countdown .big { font-size: 30px; }
  .page-head { gap: 8px; }
  .page-head .toolbar { width: 100%; }
  .page-head select { flex: 1; }
  .ufbars { gap: 4px; }
  main { padding-top: 12px; gap: 12px; }
}
.triple-head { display: grid; grid-template-columns: 30px 1fr 1fr 1fr; gap: 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.ufrow.triple { grid-template-columns: 30px 1fr 1fr 1fr; }
.maps3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .maps3 { grid-template-columns: 1fr 1fr 1fr; } }
.maps3 .kicker { margin-bottom: 6px; }
.gbar { display: grid; grid-template-columns: 1fr; gap: 10px; }
.gbar .lab { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.gbar .line { display: grid; grid-template-columns: 220px 1fr 92px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 3px 0; }
.gbar .line .yr { display: inline-block; min-width: 40px; font-weight: 700; color: var(--ink-2); }
@media (max-width: 640px) { .gbar .line { grid-template-columns: 1fr 72px; } .gbar .line .tr { grid-column: 1 / -1; order: 3; } }
.gbar .line .tr { height: 12px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.gbar .line .tr > span { display: block; height: 100%; border-radius: 6px; }
.gbar .line .v { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.hint { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; display: inline-block; }
@media (min-width: 1100px) {
  .dash { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; }
}
/* Faixa fina de contagem regressiva */
.strip { display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap; background: #eaf7fb; border: 1px solid #cfe9f1; border-left: 4px solid var(--accent-2); border-radius: 10px; padding: 12px 18px; font-size: 14.5px; color: var(--ink-2); }
.strip .big { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.strip .lbl { font-weight: 700; color: var(--accent); }
.strip p { margin: 0; flex: 1; min-width: 240px; }
/* Régua de indicadores */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(5, 1fr); } }
.kpi { padding: 14px 18px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .v { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .v.sm { font-size: 16px; }
.kpi .kicker button { font-size: inherit; letter-spacing: inherit; text-transform: inherit; font-weight: inherit; color: inherit; }
.kpi .track { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.kpi .track > span { display: block; height: 100%; background: var(--accent-2); border-radius: 3px; }
/* Presença escondida por padrão; Alt+V mostra */
.presence { display: none; }
body.show-presence .presence { display: flex; }
.cands { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cands { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }
.cand { display: grid; grid-template-columns: 104px 1fr; gap: 12px 20px; align-items: center; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); position: relative; overflow: hidden; }
.cand::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cc, var(--neutral)); }
.cand img, .cand .noimg { width: 104px; height: 128px; object-fit: cover; border-radius: 10px; background: var(--line-2); }
.cand .name { font-weight: 800; font-size: 21px; line-height: 1.15; letter-spacing: -0.01em; }
.cand .party { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cand .pct { font-size: 58px; font-weight: 900; letter-spacing: -0.035em; line-height: 1; margin-top: 10px; color: var(--cc, var(--ink)); }
.cand .votes { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.cand .ref { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.cand .bar { grid-column: 1 / -1; height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.cand .bar > span { display: block; height: 100%; border-radius: 5px; background: var(--cc, var(--neutral)); }
.cands.two { grid-template-columns: 1fr; }
@media (min-width: 760px) { .cands.two { grid-template-columns: 1fr 1fr; } }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.gap-line { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 14px; font-size: 14px; }
.ring-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ring-wrap > button { line-height: 0; }
.ring-v { font-size: 30px; font-weight: 900; fill: var(--ink); letter-spacing: -0.02em; }
.ring-l { font-size: 11px; fill: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.ring-meta { display: grid; gap: 10px; flex: 1; min-width: 160px; }
.ring-meta .num { font-size: 15px; font-weight: 600; }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); margin-right: 6px; vertical-align: 1px; }
.live-dot.blink::before { animation: blink .8s ease-out; }
@keyframes blink { 0% { transform: scale(1.8); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .ax { font-size: 11px; fill: var(--muted); }
.chart .lbl { font-size: 12px; font-weight: 700; }
.chart .area { fill: var(--line-2); opacity: .7; }
.chart-empty { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 13.5px; border: 1px dashed var(--line); border-radius: 8px; }
.map { width: 100%; height: auto; display: block; max-height: 72vh; }
.map path { stroke: #fff; stroke-width: .6; cursor: pointer; }
.map path:hover, .map path:focus { stroke: var(--ink); stroke-width: 1.2; outline: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legend .hatch { background: repeating-linear-gradient(45deg, #d9dde3 0 2px, #f4f6f9 2px 4px); }
.ufbars { display: grid; gap: 6px; }
.ufrow { display: grid; grid-template-columns: 30px 1fr 44px; gap: 8px; align-items: center; text-decoration: none; font-size: 12.5px; color: var(--ink-2); padding: 1px 0; }
.ufrow:hover .uf { color: var(--ink); font-weight: 800; }
.ufrow .uf { font-weight: 700; letter-spacing: .04em; }
.ufrow .bar { display: flex; height: 13px; border-radius: 3px; overflow: hidden; background: var(--line-2); gap: 2px; }
.ufrow .bar.empty { background: repeating-linear-gradient(45deg, #e4e7eb 0 2px, #f4f6f9 2px 4px); }
.ufrow .bar > span { display: block; height: 100%; }
.ufrow .ps { text-align: right; color: var(--muted); font-size: 11.5px; }
.ufrow.dual { grid-template-columns: 30px 1fr 1fr; }
.dual-head { display: grid; grid-template-columns: 30px 1fr 1fr; gap: 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.maps2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .maps2 { grid-template-columns: 1fr 1fr; } }
.maps2 .kicker { margin-bottom: 6px; }

/* Bloco do 1º turno */
.r1 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .r1 { grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr); } }
.r1-list { display: grid; gap: 6px; }
.r1-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) 2fr 70px 110px; gap: 10px; align-items: center; font-size: 13.5px; padding: 4px 0; }
.r1-row.in2 .r1-name { font-weight: 700; }
.r1-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r1-bar { height: 12px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.r1-bar > span { display: block; height: 100%; border-radius: 6px; }
.r1-p { text-align: right; font-weight: 700; }
.r1-v { text-align: right; font-size: 12.5px; }
.r1-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; background: var(--bg); border-radius: 10px; padding: 14px; }
.r1-side .v { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
@media (max-width: 640px) { .r1-row { grid-template-columns: minmax(110px, 1fr) 1.4fr 62px; } .r1-v { display: none; } }

/* Radar (visual de varredura) */
.radar-head { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: center; }
@media (min-width: 760px) { .radar-head { grid-template-columns: 170px 1fr; } }
.scope { width: 150px; height: 150px; border-radius: 50%; position: relative; background: radial-gradient(circle, #0f2a3f 0%, #0b1f30 70%, #081827 100%); border: 2px solid #1e4a63; box-shadow: inset 0 0 30px rgba(25,181,216,.15), 0 0 0 6px var(--paper); overflow: hidden; margin: 0 auto; }
.scope::before { content: ""; position: absolute; inset: 0; background:
  repeating-radial-gradient(circle at center, transparent 0 24px, rgba(25,181,216,.25) 24px 25px),
  linear-gradient(rgba(25,181,216,.25), rgba(25,181,216,.25)) center/1px 100% no-repeat,
  linear-gradient(rgba(25,181,216,.25), rgba(25,181,216,.25)) center/100% 1px no-repeat; }
.scope .sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(25,181,216,0) 0deg, rgba(25,181,216,0) 300deg, rgba(25,181,216,.55) 360deg); animation: sweep 3s linear infinite; }
.scope .blip { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #5ee0ff; box-shadow: 0 0 8px #5ee0ff; animation: blip 3s ease-out infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes blip { 0%, 60% { opacity: 1; } 100% { opacity: .15; } }
.radar-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.radar-stats b { font-size: 20px; font-weight: 800; color: var(--ink); margin-right: 4px; font-variant-numeric: tabular-nums; }

/* Glossário */
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.term { background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; }
.term h3 { font-size: 14.5px; margin-bottom: 4px; }
.term p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* Indicadores */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .stats { grid-template-columns: repeat(8, 1fr); } }
.stat { background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.stat:hover { border-color: var(--line); background: #fff; }
.stat .v { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.stat .s { font-size: 12px; color: var(--muted); }

/* Tabelas */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; white-space: nowrap; }
th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
th.group { text-align: center; border-bottom: 0; color: var(--ink-2); background: var(--bg); }
th.sortable { cursor: pointer; user-select: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #fafbfc; }
.inline-bar { display: inline-block; height: 8px; vertical-align: middle; border-radius: 2px; margin-right: 6px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* Listas / eventos / seções recolhíveis */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.ev { border-bottom: 1px solid var(--line-2); padding: 10px 0; display: grid; grid-template-columns: 1fr; gap: 4px; }
@media (min-width: 640px) { .ev { grid-template-columns: 110px 1fr; gap: 12px; } }
.ev .t { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev .tag { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); margin-right: 8px; }
.ev.warn .tag { color: var(--warn); } .ev.notice .tag { color: var(--ok); }
.ev details { margin-top: 4px; font-size: 13px; } .ev summary { cursor: pointer; color: var(--muted); }
details.sec { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); padding: 0 20px; }
details.sec > summary { padding: 14px 0; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; }
details.sec[open] > summary::after { content: "–"; }
details.sec > .body { padding: 0 0 16px; }
pre.json { font: 12px/1.45 var(--mono); background: var(--bg); border: 1px solid var(--line-2); padding: 10px; overflow: auto; max-height: 260px; margin: 6px 0; border-radius: 8px; white-space: pre-wrap; }

/* Análise */
.summary { font-size: 15.5px; line-height: 1.6; }
.summary-meta { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* Painel lateral / tooltip / estados */
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(480px, 100%); background: var(--paper); border-left: 1px solid var(--line); z-index: 40; display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0,0,0,.06); }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 14px 16px; overflow: auto; font-size: 14px; }
.drawer-body dt { font-weight: 700; margin-top: 12px; } .drawer-body dd { margin: 2px 0 0; color: var(--ink-2); }
.progress { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.tip { position: fixed; z-index: 60; background: var(--ink); color: #fff; font-size: 12.5px; padding: 6px 9px; border-radius: 6px; pointer-events: none; max-width: 280px; line-height: 1.4; }
.tip[hidden] { display: none; }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
.loading { color: var(--muted); font-size: 13.5px; } .loading::after { content: "…"; }
.gloss dt { font-weight: 700; margin-top: 14px; } .gloss dd { margin: 2px 0 0; color: var(--ink-2); max-width: 75ch; }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.cats .card { padding: 12px 14px; }
.foot { border-top: 1px solid var(--line); padding: 16px 0 24px; font-size: 12.5px; color: var(--muted); background: var(--paper); }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.foot .dev { margin: 0; white-space: nowrap; } .foot .dev a { font-weight: 700; text-decoration: none; color: var(--accent); } .foot .dev a:hover { text-decoration: underline; }
@media print { .navbar, .foot, .drawer, .toolbar { display: none !important; } }
.notes.sources li { margin-bottom: 10px; line-height: 1.7; }
.notes.sources a { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(13,31,63,.25); text-underline-offset: 2px; }
.notes.sources a:hover { text-decoration-color: var(--accent); }
