/* Display identities share the existing result rows and headline. No data colours change. */
.candidate-identity-content{display:inline-flex;align-items:center;gap:5px;min-width:0;max-width:100%}
.candidate-colour-dot{display:inline-block;flex:none;width:9px;height:9px;border-radius:50%;border:1px solid #0003}
.candidate-identity-content .candidate-portrait{display:block;flex:none;width:25px;height:29px;max-width:25px;max-height:29px;object-fit:contain;object-position:center bottom;margin:0;border:1px solid currentColor;border-radius:3px;background:#ffffff15}
.candidate-identity-content .candidate-label{display:inline-flex;align-items:baseline;gap:4px;min-width:0;max-width:100%;overflow:hidden;white-space:nowrap}
.candidate-short-name{overflow:hidden;text-overflow:ellipsis;font-weight:750}
.candidate-party-label{flex:none;font-size:.84em;font-weight:600}
.candidate-identity-accessible{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.candidate-name .rank-number,.party-ranking .rank-number{font-weight:850;font-variant-numeric:tabular-nums;border:1px solid currentColor}
.ranking .candidate-name{flex:0 1 auto;min-width:0}
.ranking .candidate-name .candidate-identity-content{overflow:hidden}
.ranking .candidate-name .candidate-label{display:inline-flex}

/* A full cycle immediately follows the preceding cycle; the runtime measures distance. */
.results-ticker .ticker-line.ticker-loop{display:flex;align-items:center;gap:0;width:max-content;max-width:none;animation:none;transform:none}
.results-ticker .ticker-line.ticker-loop.ticker-loop-animated{animation:headline-loop var(--ticker-loop-duration,30s) linear infinite}
.ticker-cycle{display:inline-flex;align-items:center;flex:none;width:max-content;gap:0;white-space:nowrap}
.ticker-repeat{display:inline-flex;align-items:center;flex:none;gap:0;white-space:nowrap}
.ticker-candidate{font-family:"Election Score Numbers","Arial Narrow","Segoe UI",Arial,sans-serif;font-size:1.05em;display:inline-flex;align-items:center;gap:7px;flex:none;white-space:nowrap;padding:0 8px}
.ticker-candidate:first-child{padding-left:2px}
.ticker-candidate .candidate-identity-content{gap:5px}
.ticker-candidate .candidate-portrait{width:24px;height:28px;max-width:24px;max-height:28px}
.ticker-candidate .ticker-portrait-frame{position:relative;display:block;flex:none;width:var(--ticker-portrait-size,42px);height:var(--ticker-portrait-size,42px);overflow:hidden;border:1px solid currentColor;border-radius:3px;background:transparent}
.ticker-candidate .candidate-identity-content .ticker-portrait-frame>.candidate-portrait{position:absolute;left:0;bottom:0;display:block;width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;border-radius:0;object-fit:contain;object-position:center bottom;background:transparent}
.ticker-candidate .ticker-portrait-frame[data-bundled-portrait=npp]>.candidate-portrait{height:111.1112%;object-fit:cover}
.ticker-candidate .ticker-portrait-frame[data-bundled-portrait=udp]>.candidate-portrait{height:104.1667%;object-fit:cover}
.ticker-candidate .rank-number{display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:22px;padding:0 4px;border:1px solid currentColor;border-radius:3px;font-size:12px;font-weight:850;background:transparent;color:inherit}
.ticker-candidate .ticker-votes{font-size:1.05em;font-weight:800;font-variant-numeric:tabular-nums}
.ticker-candidate .ticker-share{font-size:.66em;font-family:"Election Share Text","Segoe UI",Arial,sans-serif;font-style:normal;font-synthesis:none;font-weight:400;font-variant-numeric:tabular-nums;color:inherit}
.ticker-divider{display:inline-block;flex:none;width:1px;height:19px;margin:0 10px;background:currentColor;opacity:.5;font-size:0;line-height:0}
.results-ticker .ticker-locality{flex:0 1 auto;min-width:0;width:auto;max-width:25%;padding-right:0}
.results-ticker{column-gap:8px;min-height:81px;padding-block:12px}
.results-ticker .ticker-line{font-size:22.5px}
.projection:not(.desktop-fit) .results-ticker{min-height:81px;padding-block:7.5px}
@keyframes headline-loop{to{transform:translateX(calc(-1 * var(--ticker-loop-distance,1000px)))}}
.results-ticker .ticker-window.ticker-paused{overflow-x:auto}
.results-ticker .ticker-window.ticker-paused .ticker-line.ticker-loop{animation:none;transform:none;width:max-content;flex-wrap:nowrap}
.results-ticker .ticker-window.ticker-paused :is(.ticker-cycle[aria-hidden=true],.ticker-repeat){display:none}

/* Small, labelled bands distinguish turnout from an independent review state. */
:is(.turnout-band,.leader-band){--turnout-bg:#edf1f5;--turnout-ink:#304154;--turnout-line:#aebac7;display:inline-flex;align-items:center;gap:4px;border:1px solid var(--turnout-line);border-radius:4px;padding:2px 5px;line-height:1.25;background:var(--turnout-bg);color:var(--turnout-ink);font-variant-numeric:tabular-nums;font-weight:650;white-space:nowrap}
.project-stats>div>strong>:is(.turnout-band,.leader-band){font-size:inherit;line-height:1;padding:0 4px;margin:0;color:var(--turnout-ink)}
:root[data-theme] .project-stats :is(.turnout-band,.leader-band){color:var(--turnout-ink)}
/* Reuse the turnout treatment for a readable observed-leader name. This is
   presentation emphasis only; approval and declaration status stay separate. */
.leader-band{--turnout-bg:#ffe28a;--turnout-ink:#122b3f;--turnout-line:#fff5c7;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.leader-headline strong.leader-band{display:inline-flex;color:var(--turnout-ink)}
.results-ticker .ticker-metrics .ticker-turnout{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;overflow-wrap:normal}
.results-ticker .ticker-metrics .turnout-band{display:inline-flex;max-width:none;padding:0 4px;font-size:inherit;line-height:1.2}
:is(.turnout-band,.entry-quality)[data-turnout-band=low],:is(.turnout-band,.entry-quality)[data-turnout-band=over]{--turnout-bg:#fff0ef;--turnout-ink:#852b30;--turnout-line:#d49a9b}
:is(.turnout-band,.entry-quality)[data-turnout-band=mid]{--turnout-bg:#fff8d9;--turnout-ink:#69520c;--turnout-line:#c8b669}
:is(.turnout-band,.entry-quality)[data-turnout-band=high]{--turnout-bg:#eaf7ef;--turnout-ink:#1d603e;--turnout-line:#8fbaa1}
.entry-quality[data-turnout-band]{background:var(--turnout-bg,#edf1f5);color:var(--turnout-ink,#304154);border-color:var(--turnout-line,#aebac7);--muted:var(--turnout-ink,#304154)}
:root[data-theme=night] .entry-quality[data-turnout-band]{background:var(--turnout-bg,#edf1f5);color:var(--turnout-ink,#304154);border-color:var(--turnout-line,#aebac7)}
.entry-quality[data-turnout-band] :is(h3,p,small){color:inherit}
.entry-quality .quality-values{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px}
.review-mark{display:inline-flex;align-items:center;gap:3px;padding:2px 5px;border:1px solid currentColor;border-radius:4px;font-size:10px;font-weight:700;line-height:1.25;white-space:nowrap;background:#f3f5f7;color:#47596b}
.review-mark[data-review-state=approved]{background:#e5f5eb;color:#205d3b}
.review-mark[data-review-state=pending]{background:#fff8df;color:#68500f}
.review-mark[data-review-state=mixed]{background:#edf2f8;color:#344d6b}
:root[data-theme] .project-stats .review-mark[data-review-state=approved]{color:#205d3b}
:root[data-theme] .project-stats .review-mark[data-review-state=pending]{color:#68500f}
:root[data-theme] .project-stats .review-mark[data-review-state=mixed]{color:#344d6b}

/* One brief entrance per actual result update, with a persistent readable label. */
.results-update-bar>.live-banner.result-update-active{background:#fff0bd;color:#493609;border-bottom-color:#bf9541;border-left:4px solid #b57c12;font-weight:650;animation:result-update-arrive 850ms ease-out both}
.result-update-label{display:inline-block;margin-right:7px;padding:2px 5px;border-radius:3px;background:#674a12;color:#fff;font-size:.9em;font-weight:850;letter-spacing:.045em;white-space:nowrap}
:root[data-theme=night] .results-update-bar>.live-banner.result-update-active{background:#fff0bd;color:#493609}
@keyframes result-update-arrive{from{box-shadow:inset 0 0 0 2px #bf9541;opacity:.65}to{box-shadow:inset 0 0 0 0 #bf954100;opacity:1}}

#candidate-presentation-settings .candidate-presentation-row{display:grid;grid-template-columns:minmax(100px,1fr) minmax(140px,1.5fr) minmax(100px,1fr);gap:10px;align-items:end;padding:10px 0;border-top:1px solid var(--line,#b7c6d3)}
#candidate-presentation-settings .candidate-presentation-row label{min-width:0;margin:0}
#candidate-presentation-settings .candidate-presentation-row legend{padding:0 5px;font-size:12px;font-weight:750}
#candidate-presentation-settings .candidate-presentation-options{display:flex;flex-wrap:wrap;gap:8px 18px;margin-bottom:14px}
#candidate-presentation-settings .candidate-presentation-options label{display:inline-flex;align-items:center;gap:5px;margin:0}
#candidate-presentation-settings .candidate-presentation-row :is(input,select){width:100%;min-width:0}
.brand-preview-body figure img{object-fit:contain;object-position:center bottom;border:1px solid currentColor;border-radius:4px}

@media(min-width:1200px){
 .desktop-fit .results-ticker .ticker-locality{flex-basis:auto;max-width:22%;font-size:12px}
 .desktop-fit .candidate-identity-content{gap:4px}
 .desktop-fit .candidate-identity-content .candidate-portrait{width:21px;height:25px;max-width:21px;max-height:25px}
 .desktop-fit .candidate-identity-content .candidate-label{gap:3px}
 .desktop-fit .ticker-candidate .candidate-portrait{width:23px;height:27px;max-width:23px;max-height:27px}
 .desktop-fit .ticker-candidate .ticker-portrait-frame{width:var(--ticker-portrait-size,40.5px);height:var(--ticker-portrait-size,40.5px)}
 .desktop-fit .ticker-candidate{gap:6px;padding-inline:7px}
 .desktop-fit .ticker-candidate:first-child{padding-left:2px}
 .desktop-fit .ticker-divider{margin-inline:8px}
 .desktop-fit .top>.application-brand-portrait{--leader-portrait-size:48px;flex-basis:48px}
 .desktop-fit .review-mark{font-size:9px;padding:1px 4px}
}
@media(min-width:1200px) and (max-height:760px){
 .desktop-fit .top>.application-brand-portrait{--leader-portrait-size:44px;flex-basis:44px}
 .desktop-fit .ticker-candidate .candidate-portrait{width:20px;height:24px;max-width:20px;max-height:24px}
 .desktop-fit .ticker-candidate .ticker-portrait-frame{width:var(--ticker-portrait-size,36px);height:var(--ticker-portrait-size,36px)}
}
@media(max-width:700px){
 .results-ticker .ticker-line{font-size:21px}
 .candidate-identity-content{gap:4px}
 .candidate-identity-content .candidate-portrait{width:20px;height:25px;max-width:20px;max-height:25px}
 .candidate-identity-content .candidate-label{gap:3px}
 .candidate-party-label{font-size:.82em}
 .ticker-candidate .ticker-portrait-frame{width:var(--ticker-portrait-size,37.5px);height:var(--ticker-portrait-size,37.5px)}
 .results-ticker .ticker-locality{order:-1;flex-basis:100%;width:100%;max-width:none}
 .results-ticker .ticker-window.ticker-paused{overflow-x:auto;flex:1 0 100%}
 #candidate-presentation-settings .candidate-presentation-row{grid-template-columns:1fr 1fr}
 #candidate-presentation-settings .candidate-presentation-row>label:first-child{grid-column:1/-1}
}
@media(prefers-reduced-motion:reduce){
 .results-ticker .ticker-line.ticker-loop.ticker-loop-animated,.results-update-bar>.live-banner.result-update-active{animation:none!important;transform:none!important}
 .results-ticker .ticker-window{overflow-x:auto}
 .results-ticker :is(.ticker-cycle[aria-hidden=true],.ticker-repeat){display:none}
}

/* A compact single-row chart heading reserves the right side for its locality.
   Exceptional labels retain their full title and accessible name. */
.card-head.standings-head{align-items:center}
.card-head.standings-head .standings-heading{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;min-width:0;width:100%;max-width:100%;margin:0;line-height:1.15}
.standings-heading .standings-caption{display:block;flex:none;font-size:14px;font-weight:750;line-height:1.2;white-space:nowrap;color:var(--muted)}
.standings-heading .standings-locality{display:block;flex:0 1 auto;min-width:0;max-width:100%;margin-left:auto;font-size:16px;font-weight:800;line-height:1.15;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#145d45;border-bottom:3px solid #b52335;padding-bottom:2px}
.standings-heading .standings-locality-long{font-size:14px}
[data-theme=night] .standings-heading .standings-locality{color:#b6f1d7;border-bottom-color:#f07c8b}
@media(min-width:1200px) and (max-height:760px){
 .desktop-fit .card-head.standings-head{padding-top:5px;padding-bottom:5px}
 .desktop-fit .standings-heading .standings-caption{font-size:13px}
 .desktop-fit .standings-heading .standings-locality{font-size:15px;border-bottom-width:2px;padding-bottom:1px}
 .desktop-fit .standings-heading .standings-locality-long{font-size:14px}
}
@media(max-width:480px){
 .card-head.standings-head{padding-inline:14px}
 .card-head.standings-head .standings-heading{gap:7px}
 .standings-heading .standings-caption{font-size:12px}
 .standings-heading .standings-locality{font-size:13px;border-bottom-width:2px}
 .standings-heading .standings-locality-long{font-size:12px}
}
@media(min-width:701px) and (max-width:1199px){
 .card-head.standings-head .standings-heading{gap:8px}
 .standings-heading .standings-caption{font-size:13px}
 .standings-heading .standings-locality{font-size:14px}
 .standings-heading .standings-locality-long{font-size:12px}
}

/* Party tint is a bounded, validated 16% colour / 84% white mix generated by
   candidateLabelTint. All themes use dark text on the same pale text plates;
   the underlying proportional bar and its track are unchanged. */
:root[data-theme] .ranking .candidate[data-standing]{--result-label-bg:var(--candidate-label-tint,#edf1f5);--result-label-text:#102f49;--result-label-muted:#31465b}
:root[data-theme] .ranking .candidate[data-standing] :is(.candidate-name,.candidate-number){background:var(--result-label-bg);color:var(--result-label-text)}
:root[data-theme] .ranking .candidate[data-standing] .candidate-number small{color:var(--result-label-muted)}
:root[data-theme] .ranking .candidate[data-standing] .rank-number{background:transparent;color:var(--result-label-text)}
.ranking .candidate-portrait-frame{position:relative;display:block;flex:none;overflow:hidden;width:36px;height:36px;border:1px solid currentColor;border-radius:3px;background:transparent}
.ranking .candidate-portrait-frame>.candidate-portrait{position:absolute;left:0;bottom:0;display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;object-position:center bottom;margin:0;border:0;border-radius:0;background:transparent}
/* These offsets remove only known blank top margins; faces and source files are
   untouched. Bottom-anchored cover makes the bundled leaders clear in the frame. */
.ranking .candidate-portrait-frame[data-bundled-portrait=npp]>.candidate-portrait{height:111.1112%;object-fit:cover}
.ranking .candidate-portrait-frame[data-bundled-portrait=udp]>.candidate-portrait{height:104.1667%;object-fit:cover}
@media(min-width:1200px){
 .desktop-fit .project-standings .candidate{padding-block:2px}
 .desktop-fit .project-standings .candidate .candidate-top{padding-block:2px}
 .desktop-fit .project-standings .candidate-name{padding-block:1px}
 .desktop-fit .project-standings .candidate-portrait-frame{width:36px;height:36px}
}
@media(min-width:1200px) and (max-height:760px){
 .desktop-fit .project-standings .candidate-portrait-frame{width:32px;height:32px}
}
@media(max-width:700px){
 .ranking .candidate-name{padding-block:2px}
 .ranking .candidate-identity-content{gap:3px}
 .ranking .candidate-portrait-frame{width:30px;height:30px}
}

/* Artwork configuration shows the same effective photo as results, at a useful
   inspection size. Full images remain uncropped here, including transparent edges. */
#candidate-presentation-settings .candidate-artwork-editor{grid-column:1/-1;display:grid;grid-template-columns:136px minmax(0,1fr);gap:16px;align-items:start;padding-top:5px}
.candidate-artwork-preview{display:flex;align-items:center;justify-content:center;margin:0;width:136px;min-height:145px;border:1px solid #9aaebe;border-radius:5px;background:repeating-conic-gradient(#edf2f6 0 25%,#fff 0 50%) 50%/16px 16px;color:#31465b}
.candidate-artwork-preview img{display:block;width:132px;height:150px;object-fit:contain;object-position:center bottom;padding:3px}
.candidate-artwork-preview>span{padding:14px;font-size:12px;text-align:center}
:root[data-theme] .candidate-artwork-preview>span,:root[data-theme] .candidate-effective-portrait .portrait-preview>span{color:#31465b}
.candidate-artwork-controls{display:grid;gap:9px;min-width:0}
.candidate-artwork-source{font-size:12px}
.candidate-artwork-controls label small{line-height:1.4;font-weight:400}
.candidate-artwork-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.candidate-artwork-actions :is(button,a){font-size:12px}
.candidate-artwork-actions a,.candidate-artwork-dialog a{color:#165876;text-decoration:underline;text-underline-offset:3px}
.candidate-artwork-actions [hidden]{display:none}
.candidate-artwork-status{font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.candidate-artwork-controls input[type=file]{max-width:100%;font-size:12px}
.candidate-portraits-visibility{margin-bottom:12px;font-size:12px}
.candidate-effective-portrait .portrait-preview{display:flex;align-items:center;justify-content:center;width:80px;min-height:86px;border:1px solid #9aaebe;border-radius:4px;background:#eef3f7;color:#31465b}
.candidate-effective-portrait .portrait-preview .candidate-portrait{width:76px;height:82px;max-width:76px;max-height:82px;margin:0;object-fit:contain;object-position:center bottom}
.candidate-effective-portrait .portrait-preview>span{padding:6px;font-size:11px;text-align:center}
.candidate-artwork-dialog{width:min(760px,calc(100vw - 24px));max-height:90dvh;padding:18px;border:1px solid #6c8295;border-radius:8px;background:#fff;color:#102f49;overflow:auto}
.candidate-artwork-dialog::backdrop{background:#081b2bc9}
.candidate-artwork-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:12px}
.candidate-artwork-dialog-head h2{font-size:18px;overflow-wrap:anywhere}
.candidate-artwork-dialog-image{display:block;max-width:100%;max-height:65dvh;margin:0 auto 12px;object-fit:contain;border:1px solid #9aaebe;background:repeating-conic-gradient(#edf2f6 0 25%,#fff 0 50%) 50%/20px 20px}
.candidate-artwork-dialog>p{font-size:12px;margin-bottom:10px}
:root[data-theme=night] .candidate-artwork-actions a{color:#b9e3f8}
:root[data-theme=night] .candidate-artwork-source,:root[data-theme=night] .candidate-artwork-status{color:#e8f1f8}
@media(max-width:600px){
 #candidate-presentation-settings .candidate-artwork-editor{grid-template-columns:minmax(0,1fr);gap:12px}
 .candidate-artwork-preview{justify-self:start;width:112px;min-height:118px}
 .candidate-artwork-preview img{width:108px;height:122px}
 .candidate-artwork-actions{gap:6px}
 .candidate-artwork-actions button{padding:8px 9px}
 .candidate-artwork-dialog{padding:12px}
 .candidate-artwork-dialog-head h2{font-size:16px}
}

/* Presentation adjustments share the existing style-control width. */
.top-right .display-adjustments{display:flex;align-items:center;flex-wrap:wrap;gap:5px 9px;flex:none}
.top-right .display-adjustments .theme-picker{display:flex;justify-content:space-between;gap:4px;font-size:10px}
.top-right .display-adjustments .theme-picker select{padding:3px 6px;font-size:10px;max-width:98px}
body.projection .display-adjustments .theme-picker,body.presentation-only .display-adjustments .theme-picker{display:flex!important}
.top-right .text-size-controls{display:flex;align-items:center;justify-content:center;gap:3px;color:inherit}
.top-right .text-size-label{font-size:10px;font-weight:650}
.top-right .text-size-controls button{font-size:10px;line-height:1.1;padding:2px 5px;min-width:25px;min-height:20px;border-radius:3px}
.top-right .text-size-controls output{display:inline-block;min-width:33px;text-align:center;font-size:10px;line-height:1.2;font-variant-numeric:tabular-nums}

/* Native selects reserve room for both the complete style name and its arrow. */
@media(max-width:1199px){
 html:is([data-text-scale="125"],[data-text-scale="150"]) .top-right .display-adjustments .theme-picker select{width:120px;max-width:120px}
}

/* A missing portrait is an explicit, neutral availability marker inside the
   same square slot. It never substitutes a generated person or an image URL. */
.candidate-portrait-frame.portrait-placeholder{
 position:relative;display:flex;align-items:center;justify-content:center;
 background:transparent;overflow:hidden;
}
.portrait-unavailable{
 display:flex;flex:none;align-items:center;justify-content:center;
 width:72%;height:72%;aspect-ratio:1;border:1px solid #84919b;border-radius:50%;
 background:#e0e4e7;color:#26343f;font-family:Arial,sans-serif;
 font-size:clamp(8px,16cqh,14px);font-weight:600;font-style:normal;
 line-height:1;white-space:nowrap;letter-spacing:0;
}
.candidate-artwork-preview>.candidate-portrait-frame.portrait-placeholder{width:112px;height:112px;padding:0}
.candidate-effective-portrait .portrait-preview>.candidate-portrait-frame.portrait-placeholder{width:76px;height:76px}
