/* Display controls share one row; flags keep their original colours and ratio. */
:root { color-scheme:light; }
.display-controls { display:flex; align-items:center; gap:7px; }
.display-controls #lite-toggle { flex:1; min-width:0; width:auto; margin:0; }
.theme-toggle { flex:0 0 29px; width:29px; height:29px; border:1px solid var(--line); }
.theme-toggle .theme-sun { display:none; }
[data-theme=dark] .theme-toggle .theme-sun { display:block; }
[data-theme=dark] .theme-toggle .theme-moon { display:none; }
.party-flag { display:inline-flex; align-items:center; justify-content:center; width:76px; height:50px; flex-shrink:0; border:1px solid var(--line); border-radius:7px; padding:3px; background:#fff; overflow:hidden; }
.party-flag img { display:block; width:100%; height:100%; object-fit:contain; }
.party-flag-note,.party-imagery-note { font-size:10px; line-height:1.8; color:var(--muted); }
.party-flag-note a,.party-imagery-note a { text-decoration:underline; text-underline-offset:3px; }
.party-imagery-note { margin:13px 0 20px; }
.party-monogram.flag-unavailable { color:var(--muted); background:var(--bg); }

:root[data-theme=dark] {
  color-scheme:dark;
  --bg:#11161b;
  --surface:#1b2229;
  --ink:#e5eaee;
  --muted:#acb4bd;
  --line:#343d47;
  --green:#a3bad1;
  --light:#29343f;
  --lime:#9ac3ed;
  --shadow:0 7px 26px #00000018;
}
html[data-theme=dark] body { background:var(--bg); }
html[data-theme=dark] :is(.sidebar,.topbar,.stats-row,.quick-card,.panel,.party-card,.compare-column,.table-wrap,.law-card,.faq-list details,.empty-full,dialog,.search-input-wrap,.history-cycle-card,.history-notes,.deputy-party-card,.deputy-coverage,.gov-entry) { background:var(--surface); border-color:var(--line); }
html[data-theme=dark] :is(select,.field,input[type=search],input[type=text],input[type=url],input[type=number],input[type=date],textarea) { background:var(--surface); color:var(--ink); border-color:var(--line); }
html[data-theme=dark] #election-year { background:#252e37; border-color:var(--line); }
html[data-theme=dark] :is(.deputy-search input,.gov-search-control input,.search-input-wrap input) { background:transparent; }
html[data-theme=dark] :is(.nav-link:hover,.nav-link.active,.filter-chip.active,.search-result:hover,.history-year-links a:hover,.gov-cycle-links button:hover,.deputy-party-card.selected,.coverage-selected) { background:#2a3540; color:var(--green); border-color:#4a6076; }
html[data-theme=dark] :is(.hero,.deputy-intro,.gov-hero) { background:#242d37; border-color:#3b4651; }
html[data-theme=dark] :is(.map-panel,.results-map-wrap,.history-context,.history-ribbon,.deputy-entry,.verified-strip,.deputy-document,.gov-context-note,.map-help) { background:#212a33; border-color:#3a4551; }
html[data-theme=dark] :is(.map-floating,.map-tag) { background:#222a33; color:var(--ink); border-color:#3d4a56; }
html[data-theme=dark] :is(.history-indirect,.notice.amber) { background:#342e20; border-color:#5a4c2f; }
html[data-theme=dark] .notice { background:#252f39; color:#b8c4d0; border-color:#384756; }
html[data-theme=dark] .notice strong { color:#c4d4e5; }
html[data-theme=dark] .notice.amber { color:#d8c79b; }
html[data-theme=dark] .notice.amber strong { color:#ebd294; }
html[data-theme=dark] .notice.blue { background:#24343c; color:#b5ccda; border-color:#3b5360; }
html[data-theme=dark] .notice.blue strong { color:#cbe0ed; }
html[data-theme=dark] :is(th,.deputy-table th,.gov-table th) { background:#242d36; color:#b6c4d2; }
html[data-theme=dark] td { color:#bbc6d1; border-color:var(--line); }
html[data-theme=dark] tr:hover td { background:#26303b; }
html[data-theme=dark] :is(.chart-track,.toggle-dot,.timeline-item:not(:last-child):after,.deputy-dataset-tabs,.gov-view-tabs) { background:#2b333c; }
html[data-theme=dark] :is(.timeline-date,.quick-icon,.empty-icon) { color:#9fb8d2; background:#2c3640; border-color:#3c4b5a; }
html[data-theme=dark] .quick-card:nth-child(2) .quick-icon { color:#bac7ee; background:#2e3447; }
html[data-theme=dark] .quick-card:nth-child(3) .quick-icon { color:#dfc18e; background:#3d3529; }
html[data-theme=dark] .quick-card:nth-child(4) .quick-icon { color:#d2b6df; background:#3a3043; }
html[data-theme=dark] :is(.pill,.pill.neutral) { color:#b7c2cd; background:#2b343d; }
html[data-theme=dark] .pill.amber { color:#e2c58e; background:#453924; }
html[data-theme=dark] .pill.blue { color:#b1cfe1; background:#2b3c4a; }
html[data-theme=dark] .pill.outline { background:transparent; border-color:#445465; }
html[data-theme=dark] :is(.filter-chip,.history-year-links a,.gov-cycle-links button) { background:var(--surface); color:var(--muted); border-color:var(--line); }
html[data-theme=dark] :is(.deputy-dataset-tabs button.active,.gov-view-tabs button.active) { background:#3c4854; color:#dae4ef; }
html[data-theme=dark] :is(.button,.gov-cycle-links button.active) { color:#f1f4f8; background:#41566a; border-color:#53687d; }
html[data-theme=dark] .button:hover { color:#fff; background:#4d637a; }
html[data-theme=dark] :is(.button.light,.button.secondary) { background:#2b3540; color:#c1d2e3; border-color:#3e4d5d; }
html[data-theme=dark] :is(.button.light:hover,.button.secondary:hover) { background:#35424f; color:#dce8f4; }
html[data-theme=dark] .button.ghost { background:transparent; color:#9eb7d1; border-color:var(--line); }
html[data-theme=dark] :is(.text-link,.party-card-bottom button,.source-item a,.deputy-source,.history-notes summary,.deputy-intro-links,.gov-hero-foot,.gov-entry>span:last-child) { color:#9fb8d1; }
html[data-theme=dark] :is(.detail-stat strong,.history-card-year,.deputy-intro-stat>strong,.gov-hero-stat>strong,.empty-state h3,.faq-list summary,.gov-context-note strong,.deputy-data-note strong) { color:#c3d3e4; }
html[data-theme=dark] .brand small,
html[data-theme=dark] .edition-label,
html[data-theme=dark] .nav-link,
html[data-theme=dark] .nav-section-label,
html[data-theme=dark] .independence,
html[data-theme=dark] .independence small,
html[data-theme=dark] .breadcrumb,
html[data-theme=dark] .search-trigger,
html[data-theme=dark] .eyebrow,
html[data-theme=dark] .heading-meta,
html[data-theme=dark] .hero-kicker,
html[data-theme=dark] .hero-copy p,
html[data-theme=dark] .map-floating small,
html[data-theme=dark] .stat-label,
html[data-theme=dark] .stat-label .icon,
html[data-theme=dark] .stat-note,
html[data-theme=dark] .quick-card p,
html[data-theme=dark] .panel-subtitle,
html[data-theme=dark] .chart-others,
html[data-theme=dark] .panel-footer,
html[data-theme=dark] .source-label,
html[data-theme=dark] .timeline-body p,
html[data-theme=dark] .verified-copy,
html[data-theme=dark] .verified-sources,
html[data-theme=dark] .site-footer,
html[data-theme=dark] .site-footer a,
html[data-theme=dark] .filter-chip,
html[data-theme=dark] .results-count,
html[data-theme=dark] .party-card>p,
html[data-theme=dark] .party-card-bottom,
html[data-theme=dark] .candidate-line,
html[data-theme=dark] .candidate-line small,
html[data-theme=dark] .compare-column-head small,
html[data-theme=dark] .empty-state,
html[data-theme=dark] .proposal-item p,
html[data-theme=dark] .inline-info,
html[data-theme=dark] .map-attribution,
html[data-theme=dark] .map-help p,
html[data-theme=dark] .detail-stat,
html[data-theme=dark] .legend,
html[data-theme=dark] .results-toolbar label,
html[data-theme=dark] .results-bars .chart-meta,
html[data-theme=dark] .tab,
html[data-theme=dark] .law-card p,
html[data-theme=dark] .law-card small,
html[data-theme=dark] .faq-list details p,
html[data-theme=dark] .article-panel p,
html[data-theme=dark] .article-panel li,
html[data-theme=dark] .source-item p,
html[data-theme=dark] .form-field label,
html[data-theme=dark] .editor-record p,
html[data-theme=dark] .loading,
html[data-theme=dark] .icon-button,
html[data-theme=dark] #dialog-body p,
html[data-theme=dark] .search-result small,
html[data-theme=dark] .search-help,
html[data-theme=dark] .search-empty,
html[data-theme=dark] .metric-caption,
html[data-theme=dark] .comparison-metric small,
html[data-theme=dark] .history-ribbon small,
html[data-theme=dark] .history-card-date,
html[data-theme=dark] .history-card-description,
html[data-theme=dark] .history-card-meta,
html[data-theme=dark] .history-context p,
html[data-theme=dark] .history-document-panel>p,
html[data-theme=dark] .history-notes p,
html[data-theme=dark] .deputy-intro p,
html[data-theme=dark] .deputy-intro-stat>span,
html[data-theme=dark] .deputy-intro-stat>small,
html[data-theme=dark] .deputy-document small,
html[data-theme=dark] .deputy-document-note,
html[data-theme=dark] .deputy-filters>label,
html[data-theme=dark] .deputy-results-heading span,
html[data-theme=dark] .deputy-order,
html[data-theme=dark] .deputy-pagination,
html[data-theme=dark] .deputy-data-note p,
html[data-theme=dark] .deputy-coverage>summary>span:last-child,
html[data-theme=dark] .deputy-profile-sub,
html[data-theme=dark] .deputy-dates dt,
html[data-theme=dark] .gov-hero p,
html[data-theme=dark] .gov-hero-stat>span,
html[data-theme=dark] .gov-hero-stat>small,
html[data-theme=dark] .gov-cycle-links small,
html[data-theme=dark] .gov-view-tabs button,
html[data-theme=dark] .gov-context-note p,
html[data-theme=dark] .gov-filters>label,
html[data-theme=dark] .gov-modal-source>small,
html[data-theme=dark] .gov-timeline li>span,
html[data-theme=dark] .gov-timeline li small,
html[data-theme=dark] .gov-hero .eyebrow,
html[data-theme=dark] .deputy-intro .eyebrow,
html[data-theme=dark] .deputy-dataset-tabs button { color:var(--muted); }
html[data-theme=dark] :is(.hero-year,.map-north) { color:#566c82; }
html[data-theme=dark] .map-outline { fill:#6a86a3; }
html[data-theme=dark] .history-country .map-outline { fill:#637689; }
html[data-theme=dark] :is(.hero-visual:before,.deputy-intro-stat,.gov-hero-stat) { border-color:#3a4857; }
html[data-theme=dark] :is(.search-trigger kbd,.icon-button:hover) { background:#2c3640; }
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder { color:#909aa3; }
html[data-theme=dark] .party-monogram { background:color-mix(in srgb,var(--party) 15%,var(--surface)); color:#d2d8df; }
html[data-theme=dark] .party-monogram.flag-unavailable { background:#2b333b; color:var(--muted); }
html[data-theme=dark] .editor-record-actions button { color:#dfa69b; }
html[data-theme=dark] :is(.gov-date-conflict,.deputy-dates dd) { color:#dfc58b; }
html[data-theme=dark] dialog::backdrop { background:#03060ab8; }
html[data-theme=dark] #toast { background:#c6d6e7; color:#1c2835; }
html[data-theme=dark] .lite .toggle-dot { background:#6182a3; }
html[data-theme=dark] a:hover { color:#b8d2ec; }

@media(max-width:980px) {
  .display-controls { gap:3px; }
  .display-controls #lite-toggle { padding-left:7px; padding-right:4px; gap:6px; }
  .theme-toggle { flex-basis:28px; width:28px; height:28px; }
}
@media(max-width:720px) {
  .party-flag { width:70px; height:46px; }
  .display-controls #lite-toggle { font-size:11px; }
  .theme-toggle { flex-basis:30px; width:30px; height:30px; }
}
@media(max-width:550px) {
  .party-grid { grid-template-columns:minmax(0,1fr); }
  .party-card { padding:21px; }
  .party-card-top { flex-wrap:wrap; gap:12px; }
  .party-card h2 { font-size:14px; }
  .party-card>p { font-size:11px; }
  .party-card-top .pill { font-size:9px; padding:6px 8px; }
  .party-card-bottom { font-size:10px; }
  .party-card-bottom button { font-size:11px; }
}
@media print {
  :root[data-theme=dark] { color-scheme:light; --bg:#fff; --surface:#fff; --ink:#1b2734; --muted:#525a61; --line:#c4c9ce; --green:#005ebd; }
  html[data-theme=dark] :is(body,article,section,th,td,.panel,.notice,.hero,.history-context,.history-notes) { color:#1b2734!important; background:#fff!important; }
}

.theme-toggle .icon{width:16px;height:16px}.display-controls .toggle-dot{flex-shrink:0}

.site-footer,.site-footer>div{flex-wrap:wrap}
.site-footer .developer-credit{display:inline-flex;align-items:center;gap:7px;min-height:36px;font-size:11px;line-height:1.5;color:var(--muted);border-radius:4px}
.developer-credit svg{flex-shrink:0}
.site-footer .developer-credit:hover{color:#005ebd}
.developer-credit:focus-visible{outline:2px solid #005ebd;outline-offset:4px}
html[data-theme=dark] .site-footer .developer-credit:hover{color:#a7ceff}
@media(max-width:550px){.site-footer .developer-credit{flex-basis:100%}}
