/* Separate, readable historical analysis; current party and map palettes survive. */
.election-comparison{--ec-surface:#fff;--ec-soft:#f2f5f8;--ec-text:#172d42;--ec-muted:#506174;--ec-border:#c5d0dc;--ec-highlight:#e6eef7;color:var(--ec-text);font-variant-numeric:tabular-nums;min-width:0}
:root[data-theme=editorial] .election-comparison{--ec-surface:#fffdf8;--ec-soft:#f1eee6;--ec-text:#302f2c;--ec-muted:#5f5b53;--ec-border:#ccc6b9;--ec-highlight:#e9e4d8}
:root[data-theme=night] .election-comparison{--ec-surface:#132337;--ec-soft:#1d3046;--ec-text:#f3f5f8;--ec-muted:#c0cede;--ec-border:#52677e;--ec-highlight:#2b4460}
.ec-heading,.ec-context,.ec-table-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.ec-heading{margin-bottom:20px}.ec-heading h1{margin:4px 0 8px}.ec-heading p{margin:5px 0;color:var(--ec-muted)}
.ec-actions,.ec-controls-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.ec-controls{display:flex;gap:16px;align-items:flex-end;flex-wrap:wrap;background:var(--ec-surface);border:1px solid var(--ec-border);padding:16px}
.ec-controls label{flex:1;min-width:160px;color:var(--ec-muted)}.ec-controls select{width:100%;margin-top:6px}
.ec-controls-actions{margin-left:auto}.ec-update-status{min-height:1.5em;font-size:13px;color:var(--ec-muted);margin:12px 0}
.ec-error{border:1px solid #ab4054;color:#782238;background:#fff0f2;padding:12px;margin:12px 0}:root[data-theme=night] .ec-error{color:#ffdde4;background:#442732;border-color:#df91a1}
.ec-context h2{font-size:22px;line-height:1.2;margin:0 0 7px}.ec-context p{margin:0;color:var(--ec-muted);font-size:14px}
.ec-approved{padding:6px 9px;border:1px solid var(--ec-border);font-size:12px;background:var(--ec-soft);font-weight:650}
.ec-reason{font-size:13px;line-height:1.6;color:var(--ec-muted);margin:12px 0 16px}
.ec-party-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.ec-party{border:1px solid var(--ec-border);border-top:4px solid #34383d;background:var(--ec-surface);padding:18px;min-width:0}
.ec-party[data-party=UDP]{border-top-color:#dcb522}:root[data-theme=night] .ec-party[data-party=NPP]{border-top-color:#cfd5dd}
.ec-party h3{font-size:20px;margin:0 0 18px;display:flex;gap:12px;align-items:baseline;flex-wrap:wrap}.ec-party h3 small{font-size:12px;font-weight:400;color:var(--ec-muted);overflow-wrap:anywhere}
.ec-cycle-values{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:0}.ec-cycle-values dt{color:var(--ec-muted);font-size:12px}.ec-cycle-values dd{font-size:clamp(23px,2.2vw,34px);line-height:1.2;letter-spacing:-.025em;font-weight:750;margin:7px 0 14px;overflow-wrap:anywhere}
.ec-cycle-values dd small{display:block;font-size:13px;letter-spacing:0;font-weight:450;color:var(--ec-muted);margin-top:7px}
.ec-deltas{display:flex;gap:12px;justify-content:space-between;flex-wrap:wrap;border-top:1px solid var(--ec-border);padding-top:14px;font-size:13px;color:var(--ec-muted)}.ec-deltas strong{font-size:20px;font-weight:700;color:var(--ec-text);margin-right:4px}
.ec-margin{border:1px solid var(--ec-border);background:var(--ec-soft);padding:16px 18px;margin-top:16px}.ec-margin h3{margin:0 0 14px;font-size:16px}.ec-margin dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:0}.ec-margin dt{font-size:12px;color:var(--ec-muted)}.ec-margin dd{margin:6px 0 0;font-size:23px;font-weight:700;overflow-wrap:anywhere}.ec-margin dd small{display:block;font-size:13px;margin-top:4px;font-weight:450}.ec-margin p{font-size:12px;color:var(--ec-muted);line-height:1.5;margin:14px 0 0}
.ec-reference,.ec-method{padding:13px 16px;border:1px solid var(--ec-border);background:var(--ec-surface);margin:16px 0;color:var(--ec-muted);font-size:13px;line-height:1.6}.ec-reference summary,.ec-method summary{cursor:pointer;font-weight:650;color:var(--ec-text)}.ec-reference p,.ec-method p{margin:10px 0}.ec-hash{overflow-wrap:anywhere;font-size:12px}
.ec-table-section{margin-top:24px}.ec-table-heading h2{font-size:20px;margin:0}.ec-table-section>p{font-size:12px;color:var(--ec-muted);line-height:1.5}.ec-table-wrap{max-width:100%;overflow:auto;border:1px solid var(--ec-border);background:var(--ec-surface);scrollbar-gutter:stable}
.ec-table{border-collapse:collapse;width:100%;min-width:780px;font-size:13px;table-layout:auto}.ec-table caption{text-align:left;padding:12px 14px;color:var(--ec-muted);background:var(--ec-soft);font-size:12px}.ec-table th,.ec-table td{padding:12px;text-align:right;border-bottom:1px solid var(--ec-border);color:var(--ec-text);white-space:nowrap}.ec-table thead th{background:var(--ec-soft);color:var(--ec-text);font-size:12px}.ec-table th:first-child{text-align:left}.ec-table tbody th{min-width:165px;white-space:normal;font-weight:550}.ec-table tbody th button{padding:4px 0;text-align:left;border:0;background:transparent;color:var(--ec-text);font-weight:650;text-decoration:underline;text-underline-offset:3px;font-size:13px;max-width:210px;line-height:1.4}.ec-table small{display:block;font-size:11px;color:var(--ec-muted);margin-top:5px;line-height:1.4;white-space:normal}.ec-table .ec-selected th,.ec-table .ec-selected td{background:var(--ec-highlight)}.ec-table tr:hover td,.ec-table tr:hover th{background:var(--ec-soft)}.ec-table tr.ec-selected:hover td,.ec-table tr.ec-selected:hover th{background:var(--ec-highlight)}
.ec-mappings{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin-top:18px}.ec-mappings label{flex:1;min-width:160px;color:var(--ec-muted)}.ec-mappings select{margin-top:6px;width:100%}
.election-comparison button{font-size:13px;min-height:38px}.election-comparison :focus-visible{outline:3px solid #427bad;outline-offset:3px}:root[data-theme=night] .election-comparison :focus-visible{outline-color:#b9dfff}
.ec-presenting .ec-party-grid{gap:22px}.ec-presenting .ec-cycle-values dd{font-size:clamp(28px,3vw,46px)}.ec-presenting .ec-deltas strong{font-size:25px}.ec-presenting .ec-method,.ec-presenting .ec-reference{display:none}.ec-presenting .ec-table-wrap{max-height:340px}.ec-presenting .ec-context h2{font-size:28px}
.ec-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:700px){.ec-party-grid{grid-template-columns:1fr}.ec-heading h1{font-size:26px}.ec-heading{align-items:flex-start}.ec-controls{gap:12px;padding:12px}.ec-controls label{min-width:120px}.ec-controls-actions{width:100%;margin:0}.ec-controls-actions button{flex:1}.ec-party{padding:16px}.ec-margin dl{gap:10px}.ec-margin dd{font-size:19px}.ec-table-heading{align-items:flex-start}.ec-table-heading .ec-actions{gap:6px}.ec-table-heading button{font-size:11px;padding:8px}.ec-presenting .ec-context h2{font-size:23px}.ec-presenting .ec-table-wrap{max-height:420px}}
@media(prefers-reduced-motion:reduce){.election-comparison *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media print{.ec-controls,.ec-actions,.ec-controls-actions,.ec-mappings,.ec-method{display:none!important}.ec-table-wrap{overflow:visible;max-height:none}.ec-table{min-width:0;font-size:9px}.ec-table th,.ec-table td{padding:5px}.ec-party,.ec-margin{break-inside:avoid}}
.ec-margin dd small{color:var(--ec-muted)}
/* Presenter view keeps the selected figures in one frame; the ordinary view
   retains every table row. Previous/Next and the area selector remain usable. */
.ec-presenting .ec-table-wrap,.ec-presenting .ec-table-section>p{display:none}
.ec-presenting .ec-heading{margin-bottom:12px}.ec-presenting .ec-controls{padding:10px 14px}.ec-presenting .ec-party{padding:14px 18px}.ec-presenting .ec-party h3{margin-bottom:12px}.ec-presenting .ec-margin{padding:12px 18px}.ec-presenting .ec-table-section{margin-top:16px}
.election-comparison:fullscreen{overflow:auto;background:var(--ec-surface);padding:20px 28px;box-sizing:border-box}
@media(max-width:700px){.election-comparison:fullscreen{padding:12px}.ec-presenting .ec-cycle-values dd{font-size:28px}}

/* The historical comparison is a first-class results view, including in the
   projector deck. Colour, arrow, signed figure and text all convey direction. */
.ec-change{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;color:#17364a}
.ec-change-icon{display:inline-flex;align-items:center;justify-content:center;width:1.2em;height:1.2em;border-radius:3px;font-weight:850;font-size:1.15em;background:#e6ecf1;color:#172b3b}
.ec-change-gain{color:#07603e}.ec-change-gain .ec-change-icon{background:#dcf6e9;color:#075238}
.ec-change-loss{color:#a21c32}.ec-change-loss .ec-change-icon{background:#ffe4e7;color:#89172a}
.ec-change-same .ec-change-icon{background:#283643;color:#fff}
.ec-change-unknown{color:var(--ec-muted)}.ec-change-unknown .ec-delta-value{font-size:14px}
.ec-deltas>div{display:flex;flex-direction:column;gap:3px}.ec-deltas>div>small{font-size:11px}
.ec-deltas .ec-change strong{color:inherit;margin:0}
:root[data-theme=night] .ec-change-gain{color:#9defc5}:root[data-theme=night] .ec-change-loss{color:#ffb8c5}:root[data-theme=night] .ec-change-same{color:#e5eff6}
.ec-scope-actions{display:flex;flex-wrap:wrap;gap:6px}.ec-scope-actions [aria-pressed=true]{border-bottom:3px solid #28865a}
.ec-table-details{margin-top:8px}.ec-table-details>summary{cursor:pointer;font-weight:650;font-size:12px}
.ec-table-details>p{font-size:12px}.ec-table-details .ec-table-wrap{max-height:290px}
.ec-presenting .ec-table-details .ec-table-wrap{display:block}.ec-table .ec-delta-value{font-size:12px}.ec-table small .ec-delta-value{font-size:11px}
.ec-embedded .ec-heading{margin:0 0 8px}.ec-embedded .ec-heading h1{font-size:22px}.ec-embedded .ec-heading .eyebrow,.ec-embedded .ec-heading p:last-child{display:none}
.ec-embedded .ec-controls{padding:6px 10px;gap:8px}.ec-embedded .ec-controls label{min-width:110px;font-size:11px}.ec-embedded .ec-controls select{padding:5px;font-size:12px;max-width:240px}
.ec-embedded .ec-controls button,.ec-embedded .ec-actions button{min-height:28px;padding:4px 8px;font-size:11px}
.ec-embedded .ec-update-status{font-size:11px;margin:5px 0;min-height:1.2em}
.ec-embedded .ec-context h2{font-size:24px;border-bottom:3px solid #c74e68;padding-bottom:3px;display:inline-block;color:var(--ec-text)}
.ec-embedded .ec-context p{font-size:12px}.ec-embedded .ec-approved{font-size:10px;padding:3px 7px}
.ec-embedded .ec-reason{font-size:11px;margin:4px 0 8px;line-height:1.3}
.ec-embedded .ec-party{padding:10px 14px}.ec-embedded .ec-party-grid{gap:12px}
.ec-embedded .ec-party h3{font-size:18px;margin-bottom:8px}.ec-embedded .ec-party h3 small{font-size:11px}
.ec-embedded .ec-cycle-values dd{font-size:30px;margin:3px 0 7px;white-space:nowrap;overflow-wrap:normal}
.ec-embedded .ec-cycle-values dd small{font-size:12px;margin-top:2px}
.ec-embedded .ec-deltas{padding-top:7px;gap:8px}.ec-embedded .ec-deltas strong{font-size:22px}
.ec-embedded .ec-margin{padding:8px 14px;margin-top:9px}.ec-embedded .ec-margin h3{font-size:13px;margin-bottom:5px}
.ec-embedded .ec-margin dd{font-size:20px;margin-top:3px}.ec-embedded .ec-margin dd small{display:inline;margin-left:8px;font-size:11px}
.ec-embedded .ec-margin p{font-size:10px;margin-top:5px}
.ec-embedded .ec-reference,.ec-embedded .ec-method{margin:6px 0 0;padding:4px 8px;font-size:11px;line-height:1.3}
.ec-embedded .ec-table-section{margin-top:6px}.ec-embedded .ec-table-heading h2{font-size:15px}.ec-embedded .ec-table-heading{gap:8px}
/* Details intentionally open into an internally scrolling inspection panel;
   summary figures, next/previous views and the footer stay in the window. */
@media(min-width:1200px){
 .desktop-fit #election-comparison{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}
 .desktop-fit .ec-heading{flex:none}.desktop-fit .ec-content{flex:1;min-height:0;display:flex;flex-direction:column}
 .desktop-fit .ec-party-grid{flex:1;min-height:0}.desktop-fit .ec-party{display:flex;flex-direction:column;justify-content:center}
 .desktop-fit .ec-reason{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .desktop-fit .ec-method[open],.desktop-fit .ec-reference[open],.desktop-fit .ec-table-details[open]{position:absolute;z-index:120;bottom:5px;left:0;right:0;max-height:80%;overflow:auto;padding:12px;background:var(--ec-surface);border:1px solid var(--ec-border);box-shadow:0 4px 15px #0004}
 .desktop-fit .ec-method[open]>summary,.desktop-fit .ec-table-details[open]>summary{position:sticky;top:0;background:var(--ec-surface);padding-bottom:10px}
 .desktop-fit .ec-presenting .ec-reference,.desktop-fit .ec-presenting .ec-method{display:block}
 .desktop-fit .ec-cycle-values dd{font-size:26px}.desktop-fit .ec-deltas strong{font-size:20px}
 .desktop-fit .ec-controls{flex-wrap:nowrap}.desktop-fit .ec-controls-actions{gap:5px}
 .desktop-fit .ec-error{margin:4px 0;padding:6px;font-size:12px}
}
@media(max-width:700px){
 .ec-embedded .ec-heading{flex-wrap:wrap;gap:8px}.ec-embedded .ec-controls{flex-wrap:wrap}
 .ec-embedded .ec-controls-actions{width:auto;margin:0}.ec-embedded .ec-cycle-values dd{font-size:26px}
 .ec-embedded .ec-controls label{max-width:100%;flex:1}.ec-embedded .ec-controls select{max-width:100%;width:100%}
 .ec-embedded .ec-deltas{flex-wrap:wrap}.ec-embedded .ec-cycle-values{gap:8px}
 .ec-embedded .ec-margin dl{grid-template-columns:1fr}.ec-embedded .ec-margin dl>div{display:flex;justify-content:space-between;align-items:center;gap:6px}
 .ec-embedded .ec-table-heading{flex-wrap:wrap}.ec-embedded .ec-table-wrap{width:100%;overflow:auto}
}
.ec-controls [hidden]{display:none!important}
@media(min-width:1200px){
 .desktop-fit .ec-embedded .ec-controls label{display:flex;align-items:center;gap:6px;min-width:0;font-size:11px}
 .desktop-fit .ec-embedded .ec-controls select{margin:0;max-width:220px;height:29px}
 .desktop-fit .ec-embedded .ec-heading h1{font-size:19px;line-height:1.15}
 .desktop-fit .ec-embedded .ec-heading{margin-bottom:5px;min-height:28px}
 .desktop-fit .ec-embedded .ec-controls{min-height:40px;padding:4px 9px}
 .desktop-fit .ec-embedded .ec-party{min-height:145px;padding:7px 12px;justify-content:space-evenly}
 .desktop-fit .ec-embedded .ec-party-grid{min-height:145px}
 .desktop-fit .ec-embedded .ec-context{min-height:42px}.desktop-fit .ec-embedded .ec-context h2{margin:0;font-size:21px}
 .desktop-fit .ec-embedded .ec-context p{font-size:11px;display:inline;margin-left:12px}
 .desktop-fit .ec-embedded .ec-margin{padding:5px 12px;margin-top:5px}
 .desktop-fit .ec-embedded .ec-margin h3{margin-bottom:2px}
 .desktop-fit .ec-embedded .ec-margin dd{font-size:17px;margin-top:0}
 .desktop-fit .ec-embedded .ec-margin p{margin-top:2px}
 .desktop-fit .ec-embedded .ec-reference,.desktop-fit .ec-embedded .ec-method{margin-top:4px}
}

/* Shared viewers may navigate readonly result views, without saving settings. */
.presentation-only .dashboard-views{display:flex!important}
