:root{font-family:system-ui,-apple-system,Segoe UI,sans-serif;color:#17314a;background:#f1f5f9;font-size:16px}*{box-sizing:border-box}body{margin:0}header{background:#102f49;color:#fff;display:flex;justify-content:space-between;align-items:center;padding:20px max(20px,calc((100vw - 1200px)/2));gap:16px}header a{color:#fff;font-weight:800;font-size:24px;text-decoration:none}header a span{font-size:12px;letter-spacing:2px}main{max-width:1240px;margin:auto;padding:28px 20px}h1{font-size:clamp(25px,4vw,38px);margin:0}h2{font-size:21px;margin:0}p{line-height:1.55}.intro,.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.eyebrow{font-size:12px;color:#386581;font-weight:750;letter-spacing:1px}.pill{font-size:12px;padding:7px 12px;border:1px solid #9ab1c2;border-radius:20px}.notice,#status{background:#e2eef8;border-left:4px solid #3174a0;padding:14px 18px;border-radius:6px}#status.error{background:#fff0dc;border-color:#b56a09}#status.demo{background:#fff0dc;border-color:#b56a09;font-weight:700}.filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:14px;margin:22px 0}.filters label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:650;min-width:0}.filters [hidden]{display:none}select,input,button{font:inherit;border:1px solid #93aabc;border-radius:8px;min-height:44px;background:white;color:#17314a;padding:10px;max-width:100%}button{cursor:pointer;font-weight:650}button:disabled{cursor:default;opacity:.5}button:hover:not(:disabled){background:#e2eef8}a{color:#155d8f}section,details{background:#fff;border:1px solid #d9e2eb;border-radius:14px;padding:22px;margin:22px 0;min-width:0}.muted{color:#506477;font-size:14px}.scores{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px}.candidate{padding:20px;border:1px solid #dce5ed;border-radius:12px;border-top:4px solid #3d829a}.candidate h3{margin:0 0 8px;overflow-wrap:anywhere}.candidate strong{font-size:32px;display:block}.candidate .bar{height:6px;border-radius:5px;background:#e7eff5;margin-top:12px;overflow:hidden}.candidate .bar i{height:100%;display:block;background:#3d829a}.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:18px 0}.metric{background:#f2f6fa;border-radius:9px;padding:15px}.metric b{display:block;font-size:25px}.metric small{display:block;margin-top:5px;color:#506477}.row{border:1px solid #dbe5ec;border-radius:10px;padding:15px;margin-bottom:10px}.row-top{display:flex;justify-content:space-between;align-items:start;gap:10px;flex-wrap:wrap}.row p{margin:8px 0 0;font-size:13px}.row strong{overflow-wrap:anywhere}.row .tag{padding:5px 8px;border-radius:6px;font-size:12px;background:#e6eef5}.row .totalizada{background:#d9f2e9;color:#18563f}.row .excecao{background:#ffebdb;color:#7e3a0a}.pager{display:flex;justify-content:center;align-items:center;gap:16px}#sources{max-height:250px;overflow:auto;overflow-wrap:anywhere;font-size:12px}summary{cursor:pointer;min-height:44px;font-weight:700}li{line-height:1.55;margin:6px 0}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #cf8a14;outline-offset:3px}@media(max-width:500px){main{padding:20px 12px}section,details{padding:16px}.scores{grid-template-columns:1fr}.filters{grid-template-columns:1fr 1fr}.filters label{font-size:12px}.metrics{grid-template-columns:1fr 1fr}.candidate strong{font-size:28px}.section-head h2{font-size:19px}header{padding:16px}.intro button{width:100%}}
[hidden]{display:none!important}.map-layout{display:grid;grid-template-columns:2fr 1fr;gap:24px}.map-side label{display:flex;flex-direction:column;gap:8px;font-size:14px}.map-side p{font-size:14px}#map svg{width:100%;max-height:490px}#map path[role=button]{cursor:pointer;transition:fill .2s}#map path[role=button]:hover,#map path[role=button]:focus{stroke:#102f49;stroke-width:3;outline:none}#territory-list{max-height:210px;overflow:auto;margin-top:12px;display:flex;flex-wrap:wrap;gap:6px}#territory-list button{font-size:13px}.difference{font-weight:650;color:#28586b}.candidate:nth-child(2){border-top-color:#8d489e}.candidate:nth-child(2) .bar i{background:#8d489e}.tv main{max-width:1600px}.tv #map-section,.tv #es-sections,.tv #es-bu,.tv details,.tv main>p:last-child,.tv .es-detail,.tv #region-field{display:none!important}.tv .candidate strong{font-size:clamp(48px,9vw,120px)}.tv .candidate h3{font-size:clamp(22px,3vw,40px)}.tv .scores{grid-template-columns:1fr 1fr}.tv .candidate{padding:32px}.tv #status{font-size:18px}.tv .intro p{margin:8px 0}.tv .notice{font-size:14px}@media(max-width:700px){.map-layout{grid-template-columns:1fr}#map svg{max-height:360px}.map-side{border-top:1px solid #d9e2eb;padding-top:16px}.tv .scores{grid-template-columns:1fr}.tv .candidate{padding:20px}}@media(prefers-reduced-motion:reduce){#map path{transition:none}}
.tv header{padding:8px 20px}.tv main{padding:12px 20px}.tv .intro h1{font-size:24px}.tv .intro p:not(.eyebrow){display:none}.tv .eyebrow{font-size:10px;margin:0 0 4px}.tv .notice{padding:7px 12px;margin:10px 0;font-size:13px}.tv #status{padding:8px 12px;font-size:14px}.tv .filters{margin:12px 0;gap:10px}.tv .filters label{font-size:12px;gap:4px}.tv section{padding:16px;margin:12px 0}.tv #score-time{margin:7px 0;font-size:12px}.tv .candidate{padding:16px}.tv .candidate h3{font-size:clamp(20px,2vw,30px)}.tv .candidate strong{font-size:clamp(48px,7vw,92px)}.tv .metrics{margin:10px 0}.tv .metric{padding:10px}.tv .metric b{font-size:22px}.tv #votes{margin:6px 0;font-size:12px}

:root{--surface:#fff;--page:#f1f5f9;--ink:#17314a;--muted:#506477;--tint:#e2eef8;--tile:#f2f6fa;--line:#d9e2eb;--link:#155d8f;--alert:#fff0dc}
:root[data-theme="dark"]{color-scheme:dark;--surface:#172a3b;--page:#0c1926;--ink:#edf3f9;--muted:#bacbd9;--tint:#203e56;--tile:#203447;--line:#3a5267;--link:#9bcffa;--alert:#513c21}
@media(prefers-color-scheme:dark){:root[data-theme="auto"]{color-scheme:dark;--surface:#172a3b;--page:#0c1926;--ink:#edf3f9;--muted:#bacbd9;--tint:#203e56;--tile:#203447;--line:#3a5267;--link:#9bcffa;--alert:#513c21}}
:root{color:var(--ink);background:var(--page)}section,details,select,input,button{background:var(--surface);color:var(--ink);border-color:var(--line)}.muted,.metric small,.eyebrow{color:var(--muted)}a{color:var(--link)}header a{color:#fff}.notice,#status,button:hover:not(:disabled){background:var(--tint)}#status.error,#status.demo{background:var(--alert)}.metric{background:var(--tile)}.difference{color:var(--ink)}.candidate,.row{border-color:var(--line)}.theme-control{font-size:13px;display:flex;gap:8px;align-items:center}#history-chart svg{width:100%;height:auto;max-height:280px}#history-chart p{font-size:13px}.table-scroll{overflow:auto}#history-table table{border-collapse:collapse;width:100%;font-size:13px}#history-table th,#history-table td{padding:10px;text-align:left;border-bottom:1px solid var(--line)}#history-note{font-size:14px}.tv #history-section{display:none}.tv #countdown{font-size:12px;margin:6px 0}@media(max-width:500px){.intro{gap:8px}.theme-control{width:100%}.theme-control select{flex:1}}

#comparison table{border-collapse:collapse;width:100%;font-size:14px}#comparison td,#comparison th{padding:12px;text-align:left;border-bottom:1px solid var(--line)}caption{text-align:left;margin:12px 0;color:var(--muted)}.tv #comparison-section{display:none}

.row .tag{color:#17314a}

.candidate-heading{display:flex;align-items:center;gap:16px;margin-bottom:14px}.candidate-heading>div:last-child{min-width:0}.candidate-portrait{position:relative;flex:0 0 72px;width:72px;height:96px;border-radius:8px;overflow:hidden;background:var(--tile);border:1px solid var(--line);display:grid;place-items:center;font-weight:700}.candidate-portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.tv .candidate-portrait{flex-basis:90px;width:90px;height:120px}

/* Resultado primeiro; controles e histórico permanecem acessíveis abaixo. */
@media(max-width:500px){
 .final-page main{padding-top:10px}.final-page .intro{gap:6px}
 .final-page .intro h1{font-size:23px}.final-page .intro p{margin:4px 0;font-size:12px}
 .final-page .intro button{width:auto;min-height:44px;padding:6px 10px}
 .final-page .theme-control{width:auto}.final-page .notice,.final-page #status{padding:8px 10px;margin:8px 0;font-size:12px}
 .final-page #official-summary{margin:10px 0;padding:10px}
 .final-page #official-summary .scores{grid-template-columns:1fr 1fr;gap:8px}
 .final-page #official-summary .candidate{padding:9px;font-size:12px}
 .final-page #official-summary .candidate h3{font-size:13px;margin:0 0 4px}
 .final-page #official-summary .candidate-portrait{display:none}
 .final-page #official-summary .candidate strong{font-size:24px}
 .final-page #official-summary .section-head h2{font-size:17px}
 .final-page #score-time,.final-page #difference{font-size:12px;margin:6px 0}
}
