:root{--yellow:#efc400;--yellow-dark:#d8ad00;--olive:#718e24;--olive2:#96b82c;--ink:#303030;--muted:#747474;--bg:#f5f5f5;--card:#fff;--line:#e4e4e4;--red:#ef3f4b;--blue:#5f88aa;--purple:#d9b7ec;--shadow:0 3px 14px rgba(0,0,0,.08)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:Arial,Helvetica,sans-serif}.site-head{background:#84242e;box-shadow:0 5px 18px rgba(0,0,0,.12);position:relative;z-index:5}.top-line{height:5px;background:var(--yellow)}.head-main{height:85px;display:flex;align-items:center;max-width:1660px;margin:auto;padding:0 26px;gap:34px; background: #84242e;}.sot-brand{width:112px;display:flex;align-items:center}.sot-brand img{width:92px;max-height:48px;object-fit:contain}.election-title{font-size:23px;white-space:nowrap; color: #f5f5f5;}.election-title strong{font-weight:800}.election-title span{font-size:14px;color:#f5f5f5;margin-left:14px}.head-nav{margin-left:auto;display:flex;align-items:center;height:100%;gap:42px}.head-nav a{height:100%;display:flex;align-items:center;text-decoration:none;color:#444;font-weight:500;font-size:16px;border-bottom:5px solid transparent}.head-nav a.active{font-weight:800;border-color:var(--yellow)}.head-nav button{border:0;background:var(--yellow);width:38px;height:38px;border-radius:5px;font-size:23px;cursor:pointer}.location-bar{background:#fafafa;border-top:1px solid #eee}.location-inner{max-width:1660px;margin:auto;height:67px;display:flex;align-items:center;padding:0 26px;gap:38px}.place{height:100%;min-width:210px;display:flex;align-items:center;position:relative;font-size:20px;font-weight:700}.place .pin{color:var(--yellow);font-size:23px;margin-right:20px}.place select{appearance:none;border:0;background:transparent;font-size:19px;font-weight:700;width:120px;outline:none}.chev{font-size:28px;color:var(--yellow);margin-left:auto}.turno-box{display:flex;flex-direction:column;gap:3px;font-size:15px;font-weight:700}.turno-box select{appearance:none;border:0;background:var(--yellow);border-radius:5px;color:#222;font-size:17px;font-weight:800;padding:8px 13px;outline:none}.mobile-cargo{display:none}.page{max-width:1660px;margin:auto;padding:16px 26px 50px}.notice{padding:12px 15px;background:#fff8df;border:1px solid #ecd680;color:#705b10;border-radius:6px;font-size:13px;margin-bottom:10px}.hidden{display:none}.toolbar{display:flex;align-items:center;justify-content:space-between;min-height:58px}.cargo-pill{background:var(--olive);color:#fff;font-size:17px;font-weight:800;border-radius:5px;padding:11px 16px}.toolbar-actions{display:flex;align-items:center;gap:10px}.toolbar-actions select{height:38px;border:1px solid #ddd;border-radius:5px;background:#fff;padding:0 10px}.icon-btn{width:36px;height:36px;border:0;background:var(--yellow);border-radius:5px;font-weight:900;font-size:18px}.live-status{font-size:11px;color:#777;margin-left:4px}.live-status i{display:inline-block;width:8px;height:8px;background:#5e9824;border-radius:50%;margin-right:5px}.dashboard-grid{display:grid;grid-template-columns:400px 1fr;gap:58px}.side-column{min-width:0}.panel{background:var(--card);border-radius:17px;box-shadow:var(--shadow);border:1px solid #eee}.general{padding:18px 16px 13px;margin-bottom:14px}.panel-title{font-size:27px;font-weight:800;margin-bottom:15px}.panel-title.small{font-size:19px;margin-bottom:14px;color:#777}.updated{font-size:12px;color:#777;margin-bottom:22px}.general-row{display:flex;justify-content:space-between;align-items:center;font-size:18px;margin:17px 0}.general-row strong{font-size:20px}.progress-track{height:25px;background:#eee;border-radius:6px;overflow:hidden;margin-top:7px}.progress{height:100%;width:0;background:var(--olive2);transition:width .5s}.progress-value{text-align:center;font-size:16px;font-weight:800;margin-top:-22px;position:relative}.voting{padding:14px 16px;margin-bottom:14px}.vote-bar{height:13px;border-radius:8px;overflow:hidden;background:#eee;display:flex;margin-bottom:7px}.vote-bar span{display:block;height:100%;transition:width .4s}.vote-bar .valid{background:var(--olive2)}.vote-bar .null{background:var(--red)}.vote-bar .blank{background:#f5d21f}.vote-bar .other{background:var(--blue)}.vote-total{font-size:14px;color:#777;margin-bottom:14px}.vote-total span{font-weight:700}.vote-row{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center;margin:10px 0;font-size:15px}.vote-row strong{font-size:16px}.vote-row em{font-style:normal;color:#666;font-size:14px}.source-note{padding:14px 16px;font-size:12px;color:#777}.source-note p{margin:6px 0 0;line-height:1.5}.results-column{min-width:0}.results-head{display:flex;justify-content:space-between;align-items:flex-end;margin:20px 0 18px}.section-kicker{font-size:12px;color:var(--yellow-dark);font-weight:900;letter-spacing:.8px}.results-head h1{font-size:28px;margin:4px 0 0}.results-head>span{color:#777;font-size:13px}.candidate-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.candidate.featured{grid-column:span 2;min-height:280px;border:2px solid var(--yellow);border-radius:16px;background:#fff;display:flex;align-items:center;padding:24px 22px;box-shadow:var(--shadow);position:relative}.candidate.featured:nth-child(2){grid-column:span 3}.candidate.featured .candidate-photo{width:112px;height:112px;min-width:112px;border-radius:50%;background:#eee;border:7px solid #f1f1f1;overflow:hidden;display:flex;align-items:center;justify-content:center;color:#aaa;font-size:10px}.candidate.featured .candidate-photo img{width:100%;height:100%;object-fit:cover}.candidate-data{flex:1;text-align:right}.candidate-percent{font-size:31px;color:#e1ad00;font-weight:900}.candidate-votes-large{font-size:19px;color:#5f6875;margin-top:3px}.candidate-id{font-size:12px;font-weight:800;color:#59606b;margin-top:19px}.candidate-name-large{font-size:24px;font-weight:900;margin-top:9px;line-height:1.08}.badges{display:flex;justify-content:flex-end;gap:6px;margin-top:12px}.badge{background:#ececec;border-radius:14px;padding:5px 10px;font-size:11px;font-weight:800}.badge.round{background:#e4a326;color:#fff}.candidate.mini{grid-column:span 1;min-height:138px;background:#fff;border-radius:15px;padding:12px;display:flex;gap:9px;align-items:center;box-shadow:var(--shadow);border:1px solid #eee}.mini-photo{width:60px;height:60px;border-radius:50%;background:#eee;overflow:hidden;display:flex;align-items:center;justify-content:center;color:#aaa;font-size:10px;flex:none}.mini-photo img{width:100%;height:100%;object-fit:cover}.mini-main{min-width:0;flex:1}.mini-top{display:flex;flex-direction:column;align-items:flex-end}.mini-top strong{color:#e1ad00;font-size:20px}.mini-top span{font-size:11px;color:#687180;margin-top:2px}.mini-name{font-size:15px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:6px}.mini-badge{display:inline-block;background:#ececec;border-radius:12px;padding:4px 9px;font-size:10px;font-weight:800;margin-top:7px}.history{margin-top:42px}.history-head{display:flex;justify-content:space-between;align-items:end;margin-bottom:13px}.history-head h2{margin:5px 0 0;font-size:25px}.history-head>span{font-size:12px;color:#888}.history-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.chart-panel{padding:16px}.chart-panel h3{margin:0 0 8px;font-size:16px}.chart-area{height:230px;position:relative}.chart-area canvas{width:100%;height:100%}.chart-empty{position:absolute;inset:0;display:grid;place-items:center;color:#999;font-size:12px}.chart-empty.hidden{display:none}.loading,.empty{text-align:center;padding:40px;color:#888}.footer{max-width:1660px;margin:auto;padding:0 26px 30px;color:#888;font-size:11px}.footer strong{color:#222}@media(max-width:1250px){.dashboard-grid{grid-template-columns:320px 1fr;gap:25px}.candidate-grid{grid-template-columns:repeat(4,1fr)}.candidate.featured,.candidate.featured:nth-child(2){grid-column:span 2}.head-nav{gap:20px}}@media(max-width:900px){.head-main{height:70px;padding:0 15px;gap:12px;background: #c92536; }.election-title{font-size:17px; color: #f5f5f5;}.election-title span,.head-nav a{display:none}.head-nav{gap:8px}.location-inner{padding:0 15px;gap:15px}.place{min-width:140px}.dashboard-grid{grid-template-columns:1fr}.side-column{order:2}.results-column{order:1}.candidate-grid{grid-template-columns:repeat(2,1fr)}.candidate.featured,.candidate.featured:nth-child(2){grid-column:span 1}.history-grid{grid-template-columns:1fr}.toolbar-actions>select:first-of-type{max-width:160px}.page{padding:10px 15px 40px}}@media(max-width:620px){.sot-brand{width:70px}.sot-brand img{width:66px}.election-title{font-size:15px}.head-nav{margin-left:auto}.head-nav button{width:34px;height:34px}.location-inner{height:auto;min-height:62px;flex-wrap:wrap;padding:8px 12px}.place{min-width:120px;height:44px}.turno-box{height:44px}.mobile-cargo{display:block;flex:1}.mobile-cargo select{width:100%;height:40px;border:1px solid #ddd;border-radius:5px;background:#fff}.page{padding:7px 10px 35px}.toolbar{align-items:flex-start;gap:8px;flex-direction:column}.toolbar-actions{width:100%;flex-wrap:wrap}.toolbar-actions select{flex:1}.candidate-grid{grid-template-columns:1fr}.candidate.featured,.candidate.featured:nth-child(2){grid-column:span 1;min-height:205px;padding:16px}.candidate.featured .candidate-photo{width:82px;height:82px;min-width:82px}.candidate-percent{font-size:25px}.candidate-votes-large{font-size:15px}.candidate-name-large{font-size:19px}.results-head h1{font-size:24px}.general{padding:15px}.panel-title{font-size:24px}.vote-row{font-size:14px}.history-head{display:block}.history-head>span{display:block;margin-top:5px}.history-grid{gap:10px}}
/* V7.3 — barra de filtros e identidade SOT */
:root{--yellow:#d52b3a;--yellow-dark:#b8202f;--olive:#c92536;--olive2:#d52b3a;--red:#e33b4b;--blue:#5f88aa;--purple:#d9b7ec}
.top-line{background:#c92536}
.head-nav a.active{border-color:#c92536}
.head-nav button{background:#c92536;color:#fff}
.location-bar{background:#fff;border-top:1px solid #eee;border-bottom:1px solid #e6e6e6}
.location-inner{height:78px;gap:14px;align-items:stretch}
.filter-group{display:flex;flex-direction:column;justify-content:center;gap:5px;min-width:0}
.filter-group label{font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:#777;font-weight:800}
.filter-group select{height:40px;border:1px solid #ddd;border-radius:6px;background:#fff;color:#303030;padding:0 34px 0 12px;font-size:15px;font-weight:700;outline:none;min-width:0;cursor:pointer}
.filter-group select:focus{border-color:#c92536;box-shadow:0 0 0 2px rgba(201,37,54,.10)}
.cargo-filter{width:245px}.state-filter{width:220px}.municipality-filter{width:min(430px,35vw);flex:1}.turno-filter{width:165px}
.select-wrap{position:relative}.select-wrap .pin{position:absolute;left:12px;top:10px;color:#c92536;font-size:15px;z-index:1;pointer-events:none}.select-wrap select{width:100%;padding-left:32px}
.toolbar{min-height:58px}.cargo-pill{background:#c92536;border-radius:6px}.scope-caption{margin-top:6px;font-size:12px;color:#777;font-weight:700}.live-status i{background:#c92536}
.results-head .section-kicker{color:#c92536}.progress{background:#c92536}.vote-bar .valid{background:#c92536}
.candidate.featured{border-color:#c92536}.candidate-percent,.mini-top strong{color:#c92536}.badge.round{background:#c92536}
/* evita qualquer estouro horizontal */
.page,.dashboard-grid,.results-column,.candidate-grid,.candidate,.candidate-data,.mini-main{min-width:0;max-width:100%}.candidate-name-large,.candidate-id,.mini-name,.mini-top span,.candidate-votes-large{overflow-wrap:anywhere;word-break:break-word}.candidate.featured{overflow:hidden}.candidate.mini{overflow:hidden}.mini-top{min-width:0}.mini-top span{max-width:100%;text-align:right}.mini-name{white-space:normal;overflow-wrap:anywhere}
@media(max-width:900px){.location-inner{height:auto;min-height:82px;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:9px 15px}.cargo-filter,.state-filter,.municipality-filter,.turno-filter{width:auto;min-width:0}.municipality-filter{grid-column:1/-1}.filter-group select{width:100%}}
@media(max-width:620px){.location-inner{grid-template-columns:1fr 1fr;padding:8px 10px}.cargo-filter,.state-filter,.municipality-filter,.turno-filter{width:auto}.filter-group select{font-size:13px;padding-left:9px;padding-right:25px}.select-wrap .pin{left:9px}.select-wrap select{padding-left:26px}.toolbar{min-height:auto;margin-top:8px}.toolbar-actions{justify-content:flex-end}.scope-caption{font-size:11px}.candidate.featured{flex-wrap:wrap;align-content:center}.candidate.featured .candidate-data{min-width:0}.candidate.featured .candidate-photo{flex:none}.candidate-name-large{font-size:18px}.candidate-votes-large{font-size:14px}.candidate-percent{font-size:24px}}

/* V7.5 — ajustes sobre a base V7.3: responsividade e barras de progresso */
.progress-track{height:10px;width:100%;background:#ededed;border-radius:999px;overflow:hidden;margin-top:12px}
.progress{height:100%;width:0;min-width:0;background:#c92536;border-radius:inherit;transition:width .55s ease}
.progress-value{margin-top:7px;text-align:right;font-size:13px;font-weight:800;color:#c92536}
.vote-bar{width:100%;height:10px;display:flex;overflow:hidden;border-radius:999px;background:#ededed}
.vote-bar span{display:block;height:100%;min-width:0;transition:width .45s ease}
.vote-bar .valid{background:#c92536}.vote-bar .null{background:#777}.vote-bar .blank{background:#c8c8c8}.vote-bar .other{background:transparent}
.location-inner{width:100%;max-width:1660px;margin:0 auto;padding-left:26px;padding-right:26px;display:flex;box-sizing:border-box}
.filter-group{min-width:0}.cargo-filter{flex:0 1 245px}.state-filter{flex:0 1 220px}.municipality-filter{flex:1 1 430px;width:auto}.turno-filter{flex:0 1 165px}
.filter-group select{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
.page{width:100%;max-width:1660px;margin:0 auto;padding-left:26px;padding-right:26px;overflow-x:hidden}
.dashboard-grid{min-width:0}.side-column,.results-column{min-width:0;max-width:100%}.candidate-grid{width:100%;min-width:0;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:stretch}.candidate{min-width:0;max-width:100%;overflow:hidden}.candidate.featured{grid-column:span 2;min-width:0}.candidate.featured:nth-child(2){grid-column:span 2}.candidate-data,.mini-main{min-width:0;max-width:100%;overflow:hidden}.candidate-photo,.mini-photo{flex:0 0 auto}.candidate-name-large,.candidate-id,.candidate-votes-large,.mini-name,.mini-top,.mini-top span,.mini-badge{min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word}
@media(max-width:1250px){.location-inner{padding-left:20px;padding-right:20px}.page{padding-left:20px;padding-right:20px}.candidate-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.candidate.featured,.candidate.featured:nth-child(2){grid-column:span 1}.dashboard-grid{min-width:0}}
@media(max-width:900px){.location-inner{height:auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;padding:10px 15px}.cargo-filter,.state-filter,.municipality-filter,.turno-filter{width:auto;min-width:0;max-width:none}.municipality-filter{grid-column:1/-1}.page{padding-left:15px;padding-right:15px}.candidate-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.candidate.featured,.candidate.featured:nth-child(2){grid-column:span 1}.candidate.mini{min-width:0}.results-head{min-width:0}.results-head>div{min-width:0}}
@media(max-width:620px){.location-inner{grid-template-columns:minmax(0,1fr);padding:8px 10px}.municipality-filter{grid-column:auto}.page{padding-left:10px;padding-right:10px}.candidate-grid{grid-template-columns:minmax(0,1fr);gap:10px}.candidate.featured,.candidate.featured:nth-child(2){grid-column:1/-1;min-width:0;width:100%}.candidate.mini{grid-column:1/-1;width:100%;min-width:0}.candidate.featured .candidate-data{flex:1 1 auto;min-width:0}.results-head{display:flex;align-items:flex-end;gap:10px}.results-head h1{max-width:100%;overflow-wrap:anywhere}.results-head #count{flex:0 0 auto;white-space:nowrap}.general,.voting,.source-note{min-width:0;max-width:100%;overflow:hidden}.vote-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:7px;align-items:center}.vote-row span,.vote-row strong,.vote-row em{min-width:0}.progress-value{font-size:12px}}

/* V7.6 — deputados federal/estadual em listagem */
.candidate-grid.candidate-list-mode{display:flex;flex-direction:column;gap:8px;grid-template-columns:none}
.candidate-list-mode .list-item{width:100%;min-width:0;display:grid;grid-template-columns:64px minmax(0,1fr) auto auto;align-items:center;gap:16px;background:#fff;border:1px solid #e7e7e7;border-left:4px solid #c92536;border-radius:10px;padding:10px 16px;box-shadow:0 2px 8px rgba(0,0,0,.05);overflow:hidden}
.list-photo{width:54px;height:54px;border-radius:50%;background:#eee;overflow:hidden;display:flex;align-items:center;justify-content:center;color:#aaa;font-size:10px;flex:none}
.list-photo img{width:100%;height:100%;object-fit:cover}
.list-main{min-width:0;overflow:hidden}
.list-name{font-size:18px;font-weight:900;line-height:1.15;overflow-wrap:anywhere;word-break:break-word}
.list-main .candidate-id{margin-top:5px;font-size:11px}
.list-votes{display:flex;flex-direction:column;align-items:flex-end;white-space:nowrap}
.list-votes strong{font-size:18px;color:#333}
.list-votes span{font-size:10px;color:#777}
.list-percent{font-size:20px;font-weight:900;color:#c92536;min-width:82px;text-align:right}
.results-head .section-kicker{color:#c92536}
@media(max-width:620px){.candidate-grid.candidate-list-mode{gap:7px}.candidate-list-mode .list-item{grid-template-columns:48px minmax(0,1fr) auto;gap:10px;padding:9px 10px}.list-photo{width:44px;height:44px}.list-name{font-size:15px}.list-votes{display:none}.list-percent{font-size:16px;min-width:62px}.list-main .candidate-id{font-size:10px;margin-top:4px}}

/* V7.7 — percentual dentro da barra de seções totalizadas */
.progress-track{position:relative;height:28px;background:#ededed;border-radius:7px;overflow:hidden;margin-top:8px;border:1px solid #e3e3e3}
.progress{height:100%;width:0;min-width:0;background:linear-gradient(90deg,#aebf32,#c92536);transition:width .55s ease;display:flex;align-items:center;justify-content:flex-end;padding-right:9px;box-sizing:border-box}
.progress span{color:#fff;font-size:13px;font-weight:900;line-height:1;white-space:nowrap;text-shadow:0 1px 2px rgba(0,0,0,.35)}
@media(max-width:620px){.progress-track{height:26px}.progress span{font-size:12px;padding-right:7px}}
/* Statuses TSE */
.badge.elected{background:#c92536;color:#fff}.badge.round{background:#c92536;color:#fff}.badge.status{background:#ececec;color:#555}.list-badge{grid-column:3;display:flex;justify-content:flex-end;align-items:center}.list-badge .badge{white-space:nowrap}
@media(max-width:620px){.list-badge{grid-column:2/-1;justify-content:flex-start;margin-top:-3px}.candidate-list-mode .list-item{grid-template-columns:48px minmax(0,1fr) auto;grid-template-rows:auto auto}.candidate-list-mode .list-percent{grid-column:3;grid-row:1;align-self:center}.candidate-list-mode .list-badge{grid-column:2/-1;grid-row:2}}

/* V8.0 — atualização automática de 30s + atualização manual */
.head-nav{gap:12px}.auto-refresh{display:flex;align-items:center;gap:7px;color:#fff;font-size:11px;line-height:1.15;text-align:right}.auto-refresh span{opacity:.85}.auto-refresh strong{font-size:15px;min-width:28px}.head-nav button{width:auto;min-width:38px;padding:0 11px;display:flex;align-items:center;justify-content:center;gap:7px;background:#c92536;color:#fff;border:1px solid rgba(255,255,255,.35)}.refresh-icon{font-size:21px;line-height:1}.head-nav button:disabled{opacity:.65;cursor:wait}.head-nav button:hover{filter:brightness(1.08)}
@media(max-width:900px){.auto-refresh{display:none}.head-nav button{width:38px;min-width:38px;padding:0}.head-nav button #refreshLabel{display:none}}
@media(max-width:620px){.head-nav button{width:36px;height:36px}.head-nav{gap:6px}}

/* V8.1 — desempenho da consolidação + agrupamento por legenda */
.candidate-mode{display:flex;gap:4px;margin-top:10px;flex-wrap:wrap}.mode-btn{border:1px solid #ddd;background:#fff;color:#666;border-radius:6px;padding:7px 12px;font-size:12px;font-weight:800;text-transform:uppercase;cursor:pointer}.mode-btn.active{background:#c92536;border-color:#c92536;color:#fff}.candidate-list-mode.by-party-mode{display:flex;flex-direction:column;gap:14px}.party-group{background:#fff;border:1px solid #e5e5e5;border-radius:12px;overflow:hidden}.party-head{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:13px 16px;background:#fafafa;border-bottom:1px solid #eee;border-left:4px solid #c92536}.party-head div{display:flex;align-items:baseline;gap:12px;min-width:0}.party-head strong{font-size:18px;color:#c92536}.party-head span{font-size:12px;color:#777}.party-head>b{font-size:12px;color:#555;white-space:nowrap}.party-candidates{padding:8px}.party-candidates .list-item{box-shadow:none;border-left:3px solid #eee;border-radius:7px}.party-candidates .list-item:has(.badge.elected){border-left-color:#c92536}.party-candidates .list-item + .list-item{margin-top:6px}@media(max-width:620px){.party-head{padding:10px 12px}.party-head div{gap:7px;flex-wrap:wrap}.party-head strong{font-size:16px}.party-head span{font-size:11px}.party-head>b{font-size:11px}.candidate-mode{margin-top:8px}}
.municipality-filter.hidden{display:none!important}
.candidate-mode{display:flex;gap:8px;margin-top:10px}.candidate-mode.hidden{display:none}.mode-btn{border:1px solid #ddd;background:#fff;border-radius:999px;padding:7px 12px;font-weight:700;cursor:pointer}.mode-btn.active{background:#c51f2a;color:#fff;border-color:#c51f2a}
.by-party-mode{display:flex;flex-direction:column;gap:12px}.party-group{background:#fff;border:1px solid #e8e8e8;border-radius:14px;overflow:hidden}.party-head{display:flex;justify-content:space-between;gap:12px;padding:14px 16px;border-left:4px solid #c51f2a;background:#fafafa}.party-head div{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.party-head span{font-size:12px;color:#777}.party-candidates{padding:0 10px}
