/* Election Atlas v2 additions: no framework, no trackers or paid services */
.nav-extras{display:flex;align-items:center;gap:9px}.theme-toggle{height:39px;min-width:41px;display:grid;place-items:center;background:#142943;color:#d8e4f7;border:1px solid #35475e;border-radius:9px;font-size:20px;transition:background .2s}.theme-toggle:hover{background:#23405f}.topbar nav{gap:21px;margin-right:10px}.city-link{color:inherit;display:inline-flex;align-items:center;gap:7px}.city-link:hover{color:#4376d4}.city-link span{font-size:12px;color:#87a2ca;opacity:.8}
.map-section{padding-bottom:12px}.map-shell{overflow:hidden;border-radius:18px;border:1px solid #dce5ef;box-shadow:0 14px 50px #12304a08}.map-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:19px 25px;border-bottom:1px solid #e8edf5}.map-subtitle{display:grid;gap:5px}.map-subtitle strong{font-size:14px}.map-subtitle span{font-size:11px;color:#8393a6}.map-actions{display:flex;align-items:center;gap:10px}.map-select{height:39px;min-width:182px}.map-stage{position:relative;background:radial-gradient(ellipse 60% 80% at 50% 45%,#f7faff 0%,#ecf3fa 100%);min-height:535px;display:grid;place-items:center;overflow:hidden}.map-stage:before{content:"";position:absolute;inset:0;opacity:.12;background-image:linear-gradient(#c7d5e6 1px,transparent 1px),linear-gradient(90deg,#c7d5e6 1px,transparent 1px);background-size:45px 45px;pointer-events:none}.map-stage svg{position:relative;width:100%;height:auto;max-height:555px;padding:14px 12px;overflow:visible;stroke:none}.map-stage svg[hidden]{display:none}.municipality-shape{cursor:pointer;transition:filter .12s,stroke-width .12s}.municipality-shape:hover,.municipality-shape.active{stroke:#173659!important;stroke-width:2.7!important;filter:brightness(.92) drop-shadow(0 2px 3px #10254442)}.municipality-shape.unmatched{cursor:default}.map-tooltip{position:absolute;z-index:2;min-width:215px;max-width:235px;padding:14px 16px;pointer-events:none;background:#0f233c;color:white;border:1px solid #324d72;border-radius:10px;box-shadow:0 12px 30px #07172950;display:grid;gap:5px}.map-tooltip[hidden]{display:none}.map-tooltip strong{font-size:15px}.map-tooltip small{color:#adbed2;font-size:11px}.map-tooltip b{font-size:13px;color:#cde2ff}.map-tooltip span{font-size:10px;color:#9cb0c9}.map-loading{z-index:1;text-align:center;color:#60748e;font-size:13px;line-height:1.65;max-width:490px;padding:40px}.map-loading.map-failure{display:flex;align-items:center;flex-direction:column;gap:17px}.map-footer{display:flex;justify-content:space-between;gap:15px;align-items:center;border-top:1px solid #e8edf5;padding:16px 25px;color:#8794a6;font-size:10px}.map-footer a{color:#4875c5;text-decoration:underline;text-underline-offset:3px}.map-legend{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-weight:700}.map-legend-red,.map-legend-green,.map-legend-neutral{display:inline-block;width:11px;height:11px;border-radius:3px;background:#e997a3}.map-legend-green{background:#52bda2}.map-legend-neutral{background:#cbd4e4;margin-left:9px}.small-action{display:inline-flex;align-items:center;justify-content:center;border-radius:9px;border:1px solid #ccdaef;color:#4169a7;background:#f3f7ff;font-size:11px;font-weight:800;min-height:39px;padding:0 15px;white-space:nowrap}.small-action:hover{background:#e5efff}
.chart-extras{display:flex;gap:12px;margin-top:16px}.chart-extras label{display:inline-flex;gap:9px;align-items:center;font-size:11px;color:#7b8ba0;font-weight:700}.chart-extras select{border:1px solid #dae4f1;border-radius:7px;padding:8px 9px;background:#fff;color:#394d65;font-weight:800;font-size:11px}.chart-card .surface-heading{flex-wrap:wrap}.compare-section{padding-top:80px;padding-bottom:78px}.compare-shell{border-radius:18px;padding:28px;background:white}.compare-inputs{display:grid;grid-template-columns:1fr 47px 1fr;gap:16px;align-items:end}.compare-inputs label{font-size:10px;letter-spacing:1px;color:#8495ad;font-weight:800;display:flex;flex-direction:column;gap:10px}.compare-inputs select{width:100%;min-width:0;padding:13px;background:#f8fbff;border:1px solid #d9e2ed;border-radius:9px;font-size:13px;font-weight:800;color:#203a54}.compare-swap{height:45px;border:1px solid #d0ddef;border-radius:10px;color:#406dd5;background:#eef4ff;font-size:22px}.compare-cards{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:25px}.compare-card{background:#f8fafc;border:1px solid #e4eaf3;border-radius:14px;padding:25px}.compare-overline{color:#97a7bb;font-size:10px;font-weight:800;letter-spacing:1px;min-height:16px}.compare-title-row{display:flex;justify-content:space-between;align-items:center;gap:9px}.compare-title-row h3{font-size:23px;margin:10px 0 10px;letter-spacing:-.6px}.compare-title-row a{font-size:11px;color:#5279c2;font-weight:800;white-space:nowrap}.compare-number{font-size:clamp(31px,4vw,51px);font-weight:800;letter-spacing:-1.3px;margin:13px 0 7px}.compare-number.decline{color:#d86675}.compare-number.gain{color:#119579}.compare-caption{font-size:12px;color:#77869b;font-weight:600}.compare-percent{padding:6px 8px;border-radius:6px;background:#e9f0fb;color:#345fa3;font-weight:800;margin-left:10px}.compare-bars{margin-top:31px}.compare-bars>div:not(.line){display:flex;justify-content:space-between;align-items:center;gap:15px;font-size:10px;font-weight:800;color:#708096;margin:12px 0 9px}.compare-bars b{font-size:12px;color:#2e4769}.compare-bars .line{width:100%;height:9px;background:#e5ebf5;border-radius:5px;overflow:hidden}.compare-bars .line i{height:100%;display:block;background:#5a85e8;border-radius:5px}.compare-bars .line.red i{background:#e28a97}.compare-share{margin-top:25px;width:100%}.compare-bottom{margin-top:22px;display:flex;align-items:center;justify-content:space-between;gap:16px}.compare-bottom p{font-size:11px;color:#8b9bb0;margin:0}
.advanced-filters{display:flex;align-items:center;gap:13px;flex-wrap:wrap;padding:18px 24px;border-bottom:1px solid #e9edf2;background:#fafcff}.advanced-label{font-size:9px;font-weight:800;letter-spacing:1.2px;color:#7f95b0;margin-right:4px}.advanced-filters label{font-size:10px;color:#7287a1;display:flex;align-items:center;gap:7px;font-weight:700}.advanced-filters input{max-width:115px;height:35px;border-radius:7px;border:1px solid #d9e3f0;background:white;padding:5px 8px;min-width:0;font-size:11px;color:#2a4567}.advanced-filters input:focus-visible{outline:3px solid #a8c3ff}.quick-filters{width:100%;display:flex;gap:7px;flex-wrap:wrap}.quick-pill{border:1px solid #dbe4ef;background:white;color:#52729e;font-weight:800;font-size:10px;border-radius:30px;padding:8px 12px}.quick-pill:hover{background:#eaf2ff}
/* Individual static municipality profiles */
.profile-banner{background:linear-gradient(115deg,#071523 10%,#193958 100%);padding:45px 0 75px;color:#fff}.profile-crumb{font-size:11px;color:#a7bcda;margin-bottom:40px;display:flex;gap:12px}.profile-crumb a:hover{text-decoration:underline}.profile-crumb span{color:#7087a8}.profile-banner .small-label{color:#9ab8e7}.profile-banner h1{font-size:clamp(43px,5vw,73px);letter-spacing:-2px;line-height:1.1;margin:17px 0 12px}.profile-banner p{color:#b4c7dd;font-size:14px}.profile-wrap{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(270px,1fr);gap:19px;align-items:start;margin-top:-41px;position:relative;padding-bottom:55px}.profile-summary,.profile-rank,.profile-note{background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:0 9px 30px #08172b0a}.profile-summary{padding:28px}.profile-topline{display:flex;justify-content:space-between;gap:15px;font-size:9px;font-weight:800;letter-spacing:.9px;color:#97a7bb;padding-bottom:21px;border-bottom:1px solid var(--line)}.profile-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:25px}.profile-metrics>div{min-width:0;display:flex;flex-direction:column;gap:11px}.profile-metrics .label-small{line-height:1.5;font-size:10px;letter-spacing:.3px;font-weight:800;color:#7b8da7;min-height:34px}.profile-metrics strong{font-size:clamp(23px,2.5vw,34px);letter-spacing:-1.2px;white-space:nowrap;font-weight:850}.profile-metrics small{color:#8496aa;font-size:11px}.profile-red{color:#df6173}.profile-green{color:#0f9b79}.profile-bars{margin-top:47px}.profile-bars>div:not(.track){display:flex;justify-content:space-between;gap:20px;color:#6b7e97;font-size:11px;font-weight:800;margin:17px 0 10px}.profile-bars b{color:var(--ink)}.profile-bars .track{height:12px;border-radius:8px;background:#e6ecf6;overflow:hidden}.profile-bars .track i{height:100%;display:block;border-radius:8px;background:linear-gradient(90deg,#4574db,#91afff)}.profile-bars .track.red i{background:linear-gradient(90deg,#c8586b,#f6a3aa)}.profile-actions{margin-top:34px;display:flex;gap:10px;flex-wrap:wrap}.profile-side{display:grid;gap:18px}.profile-rank,.profile-note{padding:26px}.profile-rank>span{font-size:10px;letter-spacing:1px;color:#8192a8;font-weight:800}.profile-rank strong{display:block;color:var(--ink);font-size:74px;letter-spacing:-4px;line-height:1.25}.profile-rank p,.profile-note p{font-size:12px;line-height:1.8;color:#72839b}.profile-note h2{font-size:16px;margin:0 0 13px}.profile-note a{color:#5178c5;font-size:11px;font-weight:800}.profile-related{padding-bottom:85px}.profile-related h2{font-size:20px}.profile-related-links{display:flex;gap:10px;flex-wrap:wrap}.profile-related-links a{font-size:12px;font-weight:800;color:#3e68bc;padding:13px 16px;border:1px solid #dbe5f5;background:#eef4ff;border-radius:9px}
/* social graphics drawer */
body.modal-open{overflow:hidden}.share-overlay{position:fixed;inset:0;z-index:1000;background:#051022be;display:flex;align-items:center;justify-content:center;padding:18px;overflow-y:auto}.share-dialog{width:min(1050px,100%);max-height:min(94vh,1000px);overflow-y:auto;background:var(--surface);color:var(--ink);border-radius:18px;box-shadow:0 20px 85px #050f27a0;border:1px solid var(--line);padding:25px}.share-dialog-top{display:flex;justify-content:space-between;gap:20px;align-items:start;border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:18px}.share-dialog-top h2{font-size:24px;letter-spacing:-.7px;margin:8px 0 0}.share-close{width:40px;height:40px;border-radius:9px;border:1px solid #dce4f0;background:transparent;color:var(--ink);font-size:20px}.share-layout{display:grid;grid-template-columns:minmax(245px,290px) minmax(0,1fr);gap:25px;align-items:start}.share-controls{display:flex;flex-direction:column;gap:14px}.share-controls label{display:grid;gap:8px;color:#7c8fa7;font-weight:800;font-size:11px}.share-controls select{width:100%;padding:12px;border-radius:9px;border:1px solid #d2deee;background:var(--surface);color:var(--ink)}.share-help{font-size:12px;line-height:1.75;color:#7a8aa1;padding:10px 0}.share-controls>.btn{width:100%}.share-preview{background:#e9eef6;display:grid;place-items:center;border-radius:11px;padding:16px;min-height:300px}.share-preview canvas{display:block;width:auto;max-width:100%;height:auto;max-height:min(60vh,640px);box-shadow:0 10px 25px #10204028;border-radius:3px}.v2-toast{position:fixed;z-index:2000;bottom:28px;left:50%;transform:translate(-50%,30px);opacity:0;background:#122b44;color:white;border-radius:9px;padding:13px 18px;font-size:12px;font-weight:800;pointer-events:none;transition:transform .2s,opacity .2s}.v2-toast.show{opacity:1;transform:translate(-50%,0)}
/* Dark theme */
html[data-theme="dark"]{--bg:#0c1725;--surface:#162437;--ink:#eaf2fc;--muted:#a5b4c7;--line:#314257}html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}html[data-theme="dark"] .section-intro p,html[data-theme="dark"] .region-explainer{color:#a9b7ca}html[data-theme="dark"] .surface,html[data-theme="dark"] .stat-card,html[data-theme="dark"] .data-surface,html[data-theme="dark"] .compare-shell,html[data-theme="dark"] .profile-summary,html[data-theme="dark"] .profile-rank,html[data-theme="dark"] .profile-note{background:var(--surface);border-color:var(--line)}html[data-theme="dark"] .region-section{background:#111e2e}html[data-theme="dark"] .region-button,html[data-theme="dark"] .stat-foot,html[data-theme="dark"] .region-city,html[data-theme="dark"] .table-meta,html[data-theme="dark"] .table-footer,html[data-theme="dark"] .filters,html[data-theme="dark"] .map-toolbar,html[data-theme="dark"] .map-footer,html[data-theme="dark"] .region-detail .region-city{border-color:var(--line)}html[data-theme="dark"] .region-button:hover,html[data-theme="dark"] tbody tr:hover{background:#20334d}html[data-theme="dark"] .region-button.selected{background:#25416b}html[data-theme="dark"] .region-stat,html[data-theme="dark"] .compare-card,html[data-theme="dark"] .advanced-filters,html[data-theme="dark"] table thead{background:#20324a;border-color:var(--line)}html[data-theme="dark"] th,html[data-theme="dark"] .cell-region,html[data-theme="dark"] .muted-small{color:#a8b8ce}html[data-theme="dark"] td .cell-name,html[data-theme="dark"] td .cell-number,html[data-theme="dark"] .region-city b,html[data-theme="dark"] .region-stat strong,html[data-theme="dark"] .compare-bars b{color:#e6f0fd}html[data-theme="dark"] tbody tr{border-color:#2e4055}html[data-theme="dark"] .search-field,html[data-theme="dark"] .select-field,html[data-theme="dark"] .sort-control select,html[data-theme="dark"] .chart-extras select,html[data-theme="dark"] .advanced-filters input,html[data-theme="dark"] .quick-pill,html[data-theme="dark"] .compare-inputs select,html[data-theme="dark"] .share-controls select{background:#102035;color:#e2eaf7;border-color:#3d516b}html[data-theme="dark"] .search-field input{color:#fff}html[data-theme="dark"] .compare-percent{background:#2a4567;color:#bed3ff}html[data-theme="dark"] .region-comparison,html[data-theme="dark"] .bar-track{background:#2b405e}html[data-theme="dark"] .map-stage{background:radial-gradient(ellipse,#203149,#111d2e)}html[data-theme="dark"] .map-stage:before{opacity:.05}html[data-theme="dark"] .methodology{background:#182941;border-color:#31445d}html[data-theme="dark"] .methodology p{color:#abbad0}html[data-theme="dark"] .stat-foot>span:first-child{color:#e9f3ff}html[data-theme="dark"] .section-intro h2 span{color:#99b2d7}html[data-theme="dark"] .advanced-label{color:#b4c7df}html[data-theme="dark"] .profile-related-links a{background:#1b304f;border-color:#3b5376;color:#b0caff}
@media(max-width:1050px){.topbar nav{gap:15px}.map-stage{min-height:400px}.map-stage svg{max-height:480px}.profile-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.profile-metrics strong{font-size:27px}.profile-wrap{grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr)}}
@media(max-width:790px){.profile-wrap{grid-template-columns:1fr}.profile-side{grid-template-columns:1fr 1fr}.profile-rank strong{font-size:55px}.share-layout{grid-template-columns:1fr 1.25fr}.map-stage{min-height:330px}}
@media(max-width:650px){.map-section{padding-top:53px}.map-toolbar{align-items:start;flex-direction:column;padding:17px}.map-actions{width:100%}.map-select{flex:1}.map-stage{min-height:220px}.map-stage svg{padding:0;min-height:230px}.map-footer{flex-direction:column;align-items:start;padding:14px 17px;gap:10px}.map-tooltip{transform:scale(.86);transform-origin:top left}.chart-extras{gap:8px;flex-wrap:wrap}.chart-extras label{font-size:10px}.compare-section{padding-top:62px}.compare-shell{padding:15px}.compare-inputs{grid-template-columns:1fr 43px 1fr;gap:8px}.compare-inputs select{font-size:11px}.compare-inputs label{font-size:9px}.compare-cards{grid-template-columns:1fr;gap:10px}.compare-card{padding:19px}.compare-bottom{align-items:start;flex-direction:column}.advanced-filters{padding:15px;gap:12px}.advanced-label{width:100%}.advanced-filters label{flex:1;min-width:115px;align-items:start;flex-direction:column}.advanced-filters label input{max-width:100%;width:100%}.advanced-filters>.small-action{align-self:end}.profile-banner{padding:35px 0 70px}.profile-crumb{margin-bottom:35px}.profile-wrap{margin-top:-32px;padding-bottom:25px}.profile-summary{padding:19px}.profile-topline{font-size:8px}.profile-metrics{grid-template-columns:1fr 1fr}.profile-metrics>div:last-child{grid-column:1/-1;border-top:1px solid var(--line);padding-top:20px}.profile-metrics strong{font-size:30px}.profile-bars{margin-top:24px}.profile-side{grid-template-columns:1fr}.profile-related{padding-bottom:55px}.share-overlay{padding:8px}.share-dialog{padding:16px;max-height:96vh}.share-dialog-top h2{font-size:20px}.share-layout{grid-template-columns:1fr}.share-preview canvas{max-height:39vh}.share-help{display:none}}
@media(max-width:370px){.nav-extras{gap:4px}.theme-toggle{min-width:35px;height:35px}.advanced-filters label{min-width:100px}.profile-actions>*{flex:1}}
/* Map fallback and mobile region explorer */
.map-country-outline{fill:#e8eef8;stroke:#7290ba;stroke-width:2.6;stroke-linejoin:round}
.map-region-symbol{cursor:pointer;outline:none}
.map-region-symbol>circle:first-child{stroke:#fff;filter:drop-shadow(0 2px 4px #0d274d33);transition:stroke .16s,transform .16s;transform-box:fill-box;transform-origin:center}
.map-region-symbol:hover>circle:first-child,.map-region-symbol:focus>circle:first-child{stroke:#203d65;stroke-width:4;transform:scale(1.15)}
.map-region-select{display:block;margin:12px 20px 0;padding:10px 12px;background:#fff;border:1px solid #d0def0;border-radius:9px;color:#29496d;font:inherit;font-size:13px;max-width:calc(100% - 40px);width:300px}
.map-region-panel{background:var(--surface,#fff);border-top:1px solid #dfebf6;padding:20px 24px}
.map-region-panel[hidden]{display:none}
.map-region-head{display:flex;justify-content:space-between;align-items:start;gap:14px;padding-bottom:18px}
.map-region-head h3{font-size:22px;margin:4px 0;font-weight:850}
.map-region-head small{font-weight:800;color:#788daa;font-size:10px;letter-spacing:1.5px}
.map-region-head p{font-size:13px;color:var(--muted,#667b9a)}
.map-region-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;max-height:290px;overflow:auto;padding:2px}
.map-region-grid a{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px;background:var(--bg,#f7f9fc);border:1px solid var(--line,#dce5ef);border-radius:8px;color:var(--ink,#1b2c44);text-decoration:none;font-size:13px}
.map-region-grid a:hover{border-color:#6f99d5;background:#e8f0ff}
.map-region-grid strong{white-space:nowrap;font-variant-numeric:tabular-nums}
.map-region-grid strong small{font-size:10px;color:inherit;letter-spacing:0}
.map-neg{color:#d45b70}.map-pos{color:#008874}
html[data-theme="dark"] .map-country-outline{fill:#1d3550;stroke:#6d88ac}
html[data-theme="dark"] .map-region-select,html[data-theme="dark"] .map-region-grid a{background:#1a2b42;border-color:#405876;color:#e9f2ff}
html[data-theme="dark"] .map-region-grid a:hover{background:#29476e}
@media(max-width:800px){.map-region-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.map-region-grid{grid-template-columns:1fr}.map-region-panel{padding:16px}.map-region-grid a{font-size:12px}.map-stage{min-height:210px}}

/* V3: real geospatial boundaries / accurate outline fallback. */
.precise-country-outline {stroke:#607fae;stroke-width:2.8;fill:#dfe9f7;filter:drop-shadow(0 4px 5px rgba(38,72,115,.16));vector-effect:non-scaling-stroke}
.map-stage .municipality-shape {stroke-width:1.15;stroke-linejoin:round;stroke:#f6f8fe}
.map-local-help {font-size:13px; padding:10px 16px; color:#64748b}
#map-stage + .map-local-help + input[type=file] {display:block;padding:10px 16px;font-size:13px}

/* v3.1 — simpler map toolbar and PDF access */
.data-downloads{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}.data-downloads .download-link{white-space:nowrap}.map-toolbar{justify-content:flex-start}.map-stage svg{display:block}.map-stage svg[hidden]{display:none}@media(max-width:650px){.data-downloads{justify-content:flex-start}.map-toolbar{flex-direction:row}.map-stage{min-height:250px}}
