:root{color-scheme:light;--bg:#faf7f0;--surface:#fff;--surface-soft:#f5ead3;--ink:#121212;--muted:#625b4e;--gold:#e5b25d;--gold-dark:#775515;--border:#ded6c6;--red:#a33b32;--red-soft:#faeeeb;--blue:#315e84;--blue-soft:#eaf1f6;--shadow:0 12px 32px rgba(37,31,22,.06)}
html[data-theme="dark"]{color-scheme:dark;--bg:#121212;--surface:#202020;--surface-soft:#292720;--ink:#f4f0e8;--muted:#d1c7b5;--gold:#e5b25d;--gold-dark:#e5b25d;--border:#494337;--red:#edb4ac;--red-soft:#352220;--blue:#a9cce8;--blue-soft:#202e38;--shadow:0 12px 32px rgba(0,0,0,.18)}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.55 Inter,system-ui,-apple-system,"Segoe UI",sans-serif;font-variant-numeric:tabular-nums}a{color:var(--gold-dark);text-underline-offset:3px}a:hover{text-decoration-thickness:2px}button,input,select{font:inherit}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--gold);outline-offset:2px}.site-header{border-bottom:1px solid var(--border);background:var(--surface)}.header-inner{max-width:1240px;min-height:88px;margin:auto;padding:12px 32px;display:flex;align-items:center;justify-content:space-between;gap:24px}.brand{display:flex;align-items:center;gap:14px;color:var(--ink);font-size:12px;line-height:1.35;text-decoration:none}.brand img{width:64px;height:64px;object-fit:contain}.brand strong{font-weight:700}.header-actions{display:flex;align-items:center;gap:14px}.icon-nav{display:flex;align-items:center;gap:6px}.icon-nav a{width:44px;height:44px;display:grid;place-items:center;border-radius:50%;color:var(--ink)}.icon-nav a:hover{background:var(--surface-soft)}.icon-nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.icon-nav .fill-dot{fill:currentColor;stroke:none}.theme-toggle{min-height:44px;padding:0 13px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--ink);font-size:13px;font-weight:600;cursor:pointer}.page-shell{width:min(100% - 48px,1120px);margin:0 auto}.intro{padding:62px 0 36px;max-width:850px}.eyebrow{margin:0 0 9px;color:var(--gold-dark);font-size:11px;font-weight:700;letter-spacing:.13em;text-transform:uppercase}.intro h1,.section-heading h2{font-family:Newsreader,Georgia,serif;letter-spacing:-.025em}.intro h1{max-width:770px;margin:0;font-size:clamp(42px,7vw,72px);line-height:.99;font-weight:500}.dek{max-width:770px;margin:21px 0 0;color:var(--muted);font-size:18px;line-height:1.55}.interpretation{max-width:800px;margin:20px 0 0;padding:13px 16px;border-left:3px solid var(--gold);background:var(--surface-soft);font-size:14px}.panel{margin:0 0 24px;padding:28px;border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:var(--shadow)}.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.section-heading h2{margin:0;font-size:clamp(26px,4vw,36px);line-height:1.12;font-weight:500}.section-heading .eyebrow{margin-bottom:5px}.status-pill{flex:none;padding:6px 10px;border:1px solid var(--border);border-radius:99px;color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.status-pill.independent{border-color:var(--gold);color:var(--gold-dark)}.national-grid{display:grid;grid-template-columns:1fr 1fr .8fr;gap:12px;margin-top:23px}.candidate,.difference-card{min-height:134px;padding:19px;border-radius:10px;display:flex;flex-direction:column;justify-content:center;gap:4px}.candidate strong,.difference-card strong{font-size:clamp(25px,3.5vw,36px);line-height:1.1;letter-spacing:-.04em}.candidate span:last-child,.difference-card span:last-child{font-size:13px;color:var(--muted)}.candidate-name{font-size:13px;font-weight:700}.lula-card{background:var(--red-soft);border-left:4px solid var(--red)}.flavio-card{background:var(--blue-soft);border-left:4px solid var(--blue)}.difference-card{background:var(--surface-soft)}.difference-card span:first-child{font-size:12px;color:var(--muted)}.turnout-line{display:flex;align-items:center;gap:13px;flex-wrap:wrap;margin-top:15px;padding:13px 15px;border-top:1px solid var(--border);font-size:13px}.turnout-line span:first-child{color:var(--muted)}.turnout-line strong{margin-left:auto}.section-lead{max-width:850px;margin:14px 0 22px;color:var(--muted)}.flip-summary{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:12px}.flip-count,.flip-direction{min-height:108px;padding:17px 20px;border-radius:10px;display:flex;align-items:center;gap:14px}.flip-count{background:var(--surface-soft)}.flip-count strong{font-size:42px;line-height:1;color:var(--gold-dark)}.flip-count span,.flip-direction span{font-size:13px;color:var(--muted)}.flip-direction{justify-content:space-between;border:1px solid var(--border)}.flip-direction strong{font-size:31px}.direction-lula strong{color:var(--red)}.direction-flavio strong{color:var(--blue)}.control-row{display:grid;grid-template-columns:minmax(180px,1.5fr) repeat(3,minmax(150px,1fr)) auto;align-items:end;gap:10px;margin-top:25px}.control-row label{display:flex;flex-direction:column;gap:5px;color:var(--muted);font-size:11px;font-weight:700}.control-row input,.control-row select{width:100%;height:42px;padding:0 11px;border:1px solid var(--border);border-radius:7px;background:var(--bg);color:var(--ink);font-size:13px}.button{min-height:40px;padding:0 13px;border:1px solid var(--gold);border-radius:7px;background:var(--gold);color:#121212;font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer}.button:hover{filter:brightness(.96)}.button:disabled{opacity:.5;cursor:not-allowed}.button.secondary{border-color:var(--border);background:var(--surface);color:var(--ink)}.table-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 9px;font-size:12px;color:var(--muted)}.table-wrap{width:100%;overflow:auto;border:1px solid var(--border);border-radius:8px}.table-wrap table{width:100%;min-width:810px;border-collapse:collapse;text-align:left;font-size:12px}.table-wrap th{position:sticky;top:0;padding:11px 12px;background:var(--surface-soft);font-size:10px;letter-spacing:.035em;color:var(--muted);text-transform:uppercase}.table-wrap td{padding:10px 12px;border-top:1px solid var(--border);white-space:nowrap}.table-wrap tbody tr:hover{background:var(--surface-soft)}.city-name{font-weight:700}.leader-pill{padding:3px 7px;border-radius:99px;font-size:10px;font-weight:700}.leader-pill.lula{background:var(--red-soft);color:var(--red)}.leader-pill.flavio{background:var(--blue-soft);color:var(--blue)}.leader-pill.none{background:var(--surface-soft);color:var(--muted)}.pagination{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:14px;font-size:12px;color:var(--muted)}.table-note{margin:12px 0 0;color:var(--muted);font-size:11px;line-height:1.5}.late-grid{display:grid;grid-template-columns:1.35fr 1fr 1fr;gap:12px;margin-top:22px}.late-grid article{padding:19px;border:1px solid var(--border);border-radius:10px}.late-grid article span{display:block;color:var(--muted);font-size:12px;font-weight:600}.late-grid article strong{display:block;margin:5px 0;font-size:clamp(29px,4vw,43px);line-height:1.1;letter-spacing:-.045em}.late-grid article p{margin:8px 0 0;color:var(--muted);font-size:12px}.late-main{background:var(--surface-soft);border-color:var(--gold)!important}.late-main strong{color:var(--gold-dark)}.late-secondary strong{color:var(--ink)}.late-cities{margin-top:28px}.section-heading.compact h3{margin:0;font-family:Newsreader,Georgia,serif;font-size:24px;font-weight:500}.section-heading.compact p{margin:4px 0 0;color:var(--muted);font-size:12px}.bar-list{display:grid;gap:10px;margin-top:16px}.bar-row{display:grid;grid-template-columns:minmax(145px,1fr) minmax(120px,2fr) 70px;align-items:center;gap:12px;font-size:12px}.bar-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bar-track{height:10px;overflow:hidden;border-radius:99px;background:var(--surface-soft)}.bar-fill{height:100%;border-radius:99px;background:var(--gold)}.bar-value{text-align:right;font-family:Consolas,monospace;font-weight:700}.method-note{margin-top:27px;padding:15px 17px;border-left:3px solid var(--gold);background:var(--surface-soft);font-size:13px;line-height:1.55}.source-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:17px;margin-top:22px}.source-grid p{margin:0;color:var(--muted);font-size:12px;line-height:1.65}.source-grid strong{color:var(--ink)}.source-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 24px;margin:22px 0 0;padding:17px 0 0;border-top:1px solid var(--border);list-style:none;font-size:12px}.data-stamp{margin:18px 0 0;color:var(--muted);font-size:11px}.site-footer{margin-top:40px;border-top:1px solid var(--border);background:var(--surface)}.site-footer .page-shell{min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:15px;font-size:11px;color:var(--muted)}.site-footer a{font-weight:700}
@media(max-width:900px){.control-row{grid-template-columns:repeat(2,minmax(0,1fr))}.control-row label:first-child{grid-column:span 2}.source-grid{grid-template-columns:1fr 1fr}.source-grid p:last-child{grid-column:span 2}}
@media(max-width:640px){.header-inner{padding:10px 16px;flex-wrap:wrap;gap:8px}.brand img{width:52px;height:52px}.brand{font-size:10px}.header-actions{gap:6px}.icon-nav{gap:0}.icon-nav a{width:40px;height:40px}.theme-toggle{padding:0 9px;font-size:11px}.page-shell{width:min(100% - 28px,1120px)}.intro{padding:42px 0 26px}.intro h1{font-size:clamp(40px,13vw,60px)}.dek{font-size:16px}.panel{padding:19px 15px;border-radius:11px}.section-heading{gap:10px;flex-wrap:wrap}.status-pill{font-size:9px}.national-grid{grid-template-columns:1fr 1fr}.difference-card{grid-column:span 2;min-height:92px}.candidate{min-height:118px;padding:14px}.candidate strong{font-size:25px}.turnout-line{gap:8px}.turnout-line strong{margin-left:0}.flip-summary{grid-template-columns:1fr 1fr}.flip-count{grid-column:span 2;min-height:78px}.flip-count strong{font-size:35px}.flip-direction{min-height:80px;padding:12px}.flip-direction span{max-width:110px}.flip-direction strong{font-size:25px}.control-row{grid-template-columns:1fr 1fr;gap:9px}.control-row label:first-child{grid-column:span 2}.control-row .button{grid-column:span 2}.table-tools{align-items:flex-start}.late-grid{grid-template-columns:1fr 1fr}.late-main{grid-column:span 2}.late-secondary{min-height:115px}.source-grid{grid-template-columns:1fr}.source-grid p:last-child{grid-column:auto}.source-links{grid-template-columns:1fr}.bar-row{grid-template-columns:minmax(110px,1fr) minmax(55px,1fr) 55px;gap:8px;font-size:11px}.site-footer .page-shell{padding:15px 0;align-items:flex-start;flex-direction:column;justify-content:center}}
@media(prefers-reduced-motion:no-preference){a,button{transition:background-color .15s ease,color .15s ease,filter .15s ease}}
.muted{color:var(--muted);font-size:11px}
.vote-pair{display:flex;flex-direction:column;gap:1px}.vote-pair small{font-size:10px;font-weight:700}.vote-pair .increase{color:var(--red)}.vote-pair .decrease{color:var(--blue)}
.brand img{object-fit:cover;border-radius:50%}.citation-block{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:-14px 0 24px;padding:12px 15px;border-left:3px solid var(--gold);background:var(--surface-soft);font-size:12px}.citation-block p{margin:0;max-width:85ch}.citation-actions{display:flex;align-items:center;gap:8px;flex:none}.citation-actions .button{min-height:34px}.download-actions{display:flex;flex-wrap:wrap;gap:8px}.export-status{min-height:0;margin:0;color:var(--muted);font-size:11px}.export-status:empty{display:none}
@media(max-width:640px){.citation-block{flex-direction:column}.citation-actions{flex-wrap:wrap}.download-actions{width:100%}.download-actions .button{flex:1}.section-heading.compact{align-items:flex-end}}
.map-mode-label{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:11px;font-weight:600}.map-mode-label select{max-width:210px;min-height:38px;padding:0 9px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--ink);font-size:11px}.map-legend{display:flex;flex-wrap:wrap;gap:12px 20px;margin:12px 0;color:var(--muted);font-size:11px}.map-legend span{display:inline-flex;align-items:center;gap:7px}.legend-swatch{width:13px;height:13px;border:1px solid var(--border);border-radius:3px}.lula-swatch{background:#a33b32}.flavio-swatch{background:#315e84}.neutral-swatch{background:#e9e4da}.late-swatch{background:linear-gradient(90deg,#f5dc9b,#ad8746)}.map-frame{position:relative;min-height:260px;border:1px solid var(--border);border-radius:10px;background:var(--bg);overflow:hidden}.map-frame canvas{display:block;width:100%;height:min(62vw,560px);min-height:260px;cursor:pointer}.map-status{position:absolute;inset:0;display:grid;place-items:center;margin:0;padding:20px;color:var(--muted);font-size:13px;text-align:center;pointer-events:none}.map-status:empty{display:none}.map-tooltip{position:absolute;z-index:2;display:grid;gap:4px;max-width:270px;padding:11px 13px;border:1px solid var(--border);border-radius:8px;background:var(--surface);box-shadow:var(--shadow);color:var(--ink);font-size:11px;pointer-events:none}.map-tooltip strong{font-size:13px}.map-tooltip[hidden]{display:none}
@media(max-width:640px){.map-mode-label{width:100%;justify-content:space-between}.map-mode-label select{flex:1;max-width:none}.download-actions{align-items:stretch}.map-frame canvas{height:78vw;min-height:260px}}
.dataset-citation{margin:12px 0 18px;padding:11px 14px;border-left:3px solid var(--gold);background:var(--surface-soft);font-size:12px;line-height:1.6}.legend-gradient{display:inline-block;width:118px;height:13px;border:1px solid var(--border);border-radius:3px;background:linear-gradient(90deg,#f5dc9b,#ad8746)}
.map-access{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(260px,1.2fr);align-items:center;gap:8px 14px;margin-top:14px}.map-access label{font-size:12px;font-weight:700}.map-access select{min-height:40px;padding:0 10px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--ink);font:inherit;font-size:12px}.map-access p{grid-column:1/-1;margin:0;padding:11px 13px;border-left:3px solid var(--gold);background:var(--surface-soft);font-size:12px;line-height:1.55;white-space:pre-line}.map-access select:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
@media(max-width:640px){.map-access{grid-template-columns:1fr}.map-access p{grid-column:auto}}
