/* ============================================================
   ResultsDesk.nz — authoritative dashboard stylesheet
   Rebuilt June 2026.

   This file intentionally replaces the accumulated dashboard
   override layers. It is loaded after style.css and before the
   small compatibility layer in style-consistency.css.
   ============================================================ */

:root {
  --rd-active-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rd-display-font: var(--rd-active-font);

  --rd-brand-size: 15px;
  --rd-election-title-size: 50px;
  --rd-results-label-size: 14px;
  --rd-reporting-size: 68px;
  --rd-reporting-sub-size: 16px;
  --rd-section-title-size: 21px;
  --rd-table-text-size: 13px;
  --rd-table-head-size: 10px;
  --rd-control-title-size: 14px;
  --rd-control-label-size: 10px;
  --rd-control-text-size: 12px;

  --rd-top-card-pad-y: 22px;
  --rd-top-card-pad-x: 26px;
  --rd-table-row-pad-y: 7px;
  --rd-table-row-pad-x: 10px;
  --rd-control-gap: 10px;
  --rd-control-button-h: 32px;

  --rd-radius-xs: 3px;
  --rd-radius-sm: 5px;
  --rd-radius: 7px;
  --rd-radius-lg: 10px;

  --rd-positive: #22c55e;
  --rd-negative: #ef4444;
  --rd-accent: #60a5fa;
  --rd-map-bg: #0a1221;

  --rd-page: #070d19;
  --rd-page-alt: #0a1120;
  --rd-header: #101827;
  --rd-panel: #111d31;
  --rd-panel-2: #15243b;
  --rd-panel-3: #1b2e4d;
  --rd-panel-subtle: rgba(22, 37, 61, .74);
  --rd-text: #f7f9fd;
  --rd-text-soft: #d7e0ee;
  --rd-muted: #9aabc2;
  --rd-faint: #72839b;
  --rd-border: rgba(157, 178, 210, .22);
  --rd-border-strong: rgba(174, 196, 228, .34);
  --rd-rule: rgba(157, 178, 210, .16);
  --rd-active-bg: #f8fafc;
  --rd-active-text: #0f172a;
  --rd-button: #0d192b;
  --rd-button-hover: #172a47;
  --rd-button-selected: #1d477e;
  --rd-shadow-float: 0 18px 40px rgba(0, 0, 0, .30);
  --rd-shadow-soft: 0 6px 20px rgba(0, 0, 0, .18);
}

body.dashboard-body.light-mode,
body.dashboard-body[data-theme-choice="light"] {
  --rd-page: #edf2f8;
  --rd-page-alt: #f4f7fb;
  --rd-header: #ffffff;
  --rd-panel: #ffffff;
  --rd-panel-2: #f7f9fc;
  --rd-panel-3: #eaf0f8;
  --rd-panel-subtle: rgba(247, 249, 252, .92);
  --rd-text: #111827;
  --rd-text-soft: #334155;
  --rd-muted: #64748b;
  --rd-faint: #94a3b8;
  --rd-border: rgba(100, 116, 139, .24);
  --rd-border-strong: rgba(71, 85, 105, .34);
  --rd-rule: rgba(100, 116, 139, .18);
  --rd-active-bg: #152238;
  --rd-active-text: #ffffff;
  --rd-button: #ffffff;
  --rd-button-hover: #edf3fb;
  --rd-button-selected: #dbeafe;
  --rd-shadow-float: 0 18px 42px rgba(15, 23, 42, .18);
  --rd-shadow-soft: 0 6px 20px rgba(15, 23, 42, .10);
}

/* ---------- baseline ---------- */
html,
body.dashboard-body {
  min-height: 100%;
  margin: 0 !important;
  background: var(--rd-page) !important;
  color: var(--rd-text) !important;
}

body.dashboard-body,
body.dashboard-body *,
body.dashboard-body *::before,
body.dashboard-body *::after {
  box-sizing: border-box !important;
  text-shadow: none !important;
}

body.dashboard-body,
body.dashboard-body button,
body.dashboard-body input,
body.dashboard-body select,
body.dashboard-body textarea {
  font-family: var(--rd-active-font) !important;
}

body.dashboard-body {
  overflow-x: hidden !important;
  font-size: 13px !important;
  line-height: 1.28 !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.dashboard-body button,
body.dashboard-body input,
body.dashboard-body select,
body.dashboard-body textarea {
  font-size: inherit;
}

body.dashboard-body button { cursor: pointer; }
body.dashboard-body .num,
body.dashboard-body th,
body.dashboard-body td,
body.dashboard-body .overall-big,
body.dashboard-body .current-results-stat strong,
body.dashboard-body .bloc-result strong {
  font-variant-numeric: tabular-nums !important;
}

body.dashboard-body .muted { color: var(--rd-muted) !important; }
body.dashboard-body .sr-only-controls,
body.dashboard-body .sr-only-shadow { display: none !important; }
body.dashboard-body .sidebar-resizer,
body.dashboard-body .dashboard-column-resizer { display: none !important; }

/* ---------- header ---------- */
body.dashboard-body .app-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1800 !important;
  height: 50px !important;
  background: var(--rd-header) !important;
  border-bottom: 1px solid var(--rd-border) !important;
  box-shadow: none !important;
}

body.dashboard-body .app-header-inner {
  width: 100% !important;
  height: 50px !important;
  padding: 0 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
}

body.dashboard-body .app-brand {
  display: inline-flex !important;
  align-items: center !important;
  color: var(--rd-text) !important;
  text-decoration: none !important;
}

body.dashboard-body .app-brand-mark { display: none !important; }
body.dashboard-body .app-brand-text,
body.dashboard-body .app-brand-text.app-title-kicker {
  display: inline-block !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--rd-text) !important;
  font-family: var(--rd-active-font) !important;
  font-size: var(--rd-brand-size) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: -.035em !important;
  text-transform: uppercase !important;
}

body.dashboard-body .app-header-nav {
  display: flex !important;
  align-items: center !important;
  gap: 18px !important;
}

body.dashboard-body .nav-btn {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  min-height: 30px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--rd-muted) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .11em !important;
  text-transform: uppercase !important;
}
body.dashboard-body .nav-btn svg { display: none !important; }
body.dashboard-body .nav-btn:hover,
body.dashboard-body .nav-btn.active { color: var(--rd-text) !important; }

/* ---------- shell / general cards ---------- */
body.dashboard-body .dashboard-shell {
  width: min(1440px, calc(100vw - 36px)) !important;
  max-width: none !important;
  margin: 18px auto 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

body.dashboard-body .card,
body.dashboard-body .coalition-hero,
body.dashboard-body .map-card,
body.dashboard-body .settings-modal,
body.dashboard-body .help-modal,
body.dashboard-body .all-electorates-card {
  background: var(--rd-panel) !important;
  color: var(--rd-text) !important;
  border: 1px solid var(--rd-border) !important;
  border-radius: var(--rd-radius) !important;
  box-shadow: none !important;
}

body.dashboard-body .card-head {
  min-height: 34px !important;
  padding: 8px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  border-bottom: 1px solid var(--rd-rule) !important;
}

body.dashboard-body .card-title,
body.dashboard-body .control-label,
body.dashboard-body .map-legend-title {
  margin: 0 !important;
  color: var(--rd-muted) !important;
  font-size: var(--rd-control-label-size) !important;
  font-weight: 700 !important;
  line-height: 1.12 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
}

/* ---------- shared tabs / buttons ---------- */
body.dashboard-body .dashboard-view-tabs {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
  margin: 0 0 8px !important;
}

body.dashboard-body .dashboard-view-tab,
body.dashboard-body .toggle-btn,
body.dashboard-body .panel-btn,
body.dashboard-body .map-data-filter-btn,
body.dashboard-body .lower-panel-tab,
body.dashboard-body .map-view-btn,
body.dashboard-body .map-option-section-btn,
body.dashboard-body .bloc-toggle-btn,
body.dashboard-body .bloc-reset-btn,
body.dashboard-body .clear-search-btn,
body.dashboard-body .settings-reset-btn {
  min-height: var(--rd-control-button-h) !important;
  padding: 0 11px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--rd-border) !important;
  border-radius: var(--rd-radius-sm) !important;
  background: var(--rd-button) !important;
  color: var(--rd-text-soft) !important;
  box-shadow: none !important;
  font-size: var(--rd-control-text-size) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease !important;
}

body.dashboard-body .dashboard-view-tab:hover,
body.dashboard-body .toggle-btn:hover,
body.dashboard-body .panel-btn:hover,
body.dashboard-body .map-data-filter-btn:hover,
body.dashboard-body .lower-panel-tab:hover,
body.dashboard-body .map-view-btn:hover,
body.dashboard-body .map-option-section-btn:hover,
body.dashboard-body .bloc-toggle-btn:hover,
body.dashboard-body .bloc-reset-btn:hover,
body.dashboard-body .clear-search-btn:hover,
body.dashboard-body .settings-reset-btn:hover {
  background: var(--rd-button-hover) !important;
  border-color: var(--rd-border-strong) !important;
  color: var(--rd-text) !important;
}

body.dashboard-body .dashboard-view-tab.active,
body.dashboard-body .dashboard-view-tab[aria-pressed="true"],
body.dashboard-body .toggle-btn.active,
body.dashboard-body .map-data-filter-btn.active,
body.dashboard-body .map-view-btn.active,
body.dashboard-body .lower-panel-tab.active,
body.dashboard-body .map-option-section-btn.active,
body.dashboard-body .bloc-toggle-btn.active {
  background: var(--rd-active-bg) !important;
  border-color: var(--rd-active-bg) !important;
  color: var(--rd-active-text) !important;
}

body.dashboard-body .link-btn {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--rd-accent) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}
body.dashboard-body .link-btn:hover { text-decoration: underline !important; }

/* ============================================================
   HOME
   ============================================================ */
body.dashboard-body[data-dashboard-view="home"] .dashboard-shell > .dashboard-view-tabs { display: none !important; }
body.dashboard-body[data-dashboard-view="home"] .dashboard-grid { display: block !important; }
body.dashboard-body[data-dashboard-view="home"] .col-center,
body.dashboard-body[data-dashboard-view="home"] .col-right { display: none !important; }

body.dashboard-body[data-dashboard-view="home"] .col-left {
  display: grid !important;
  grid-template-columns: minmax(0, 47%) minmax(0, 53%) !important;
  grid-template-rows: auto 1fr !important;
  min-width: 0 !important;
  gap: 0 !important;
}

body.dashboard-body[data-dashboard-view="home"] .results-identity-card {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  min-height: 568px !important;
  padding: var(--rd-top-card-pad-y) var(--rd-top-card-pad-x) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: var(--rd-radius) 0 0 var(--rd-radius) !important;
  border-right-color: var(--rd-border-strong) !important;
}

body.dashboard-body[data-dashboard-view="home"] .results-identity-block {
  padding: 22px 4px 30px !important;
  border-bottom: 1px solid var(--rd-border-strong) !important;
}

body.dashboard-body[data-dashboard-view="home"] .app-title-main,
body.dashboard-body[data-dashboard-view="home"] .app-header-title-main {
  color: var(--rd-text) !important;
  font-family: var(--rd-display-font) !important;
  font-size: var(--rd-election-title-size) !important;
  font-weight: 700 !important;
  line-height: .98 !important;
  letter-spacing: -.045em !important;
  text-transform: uppercase !important;
  white-space: normal !important;
  overflow: visible !important;
}
body.dashboard-body[data-dashboard-view="home"] .rd-title-line { display: block !important; }

body.dashboard-body .app-header-status {
  margin-top: 17px !important;
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  color: var(--rd-muted) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
body.dashboard-body .live-dot {
  width: 9px !important;
  height: 9px !important;
  flex: 0 0 9px !important;
  border-radius: 999px !important;
  background: var(--rd-positive) !important;
  box-shadow: none !important;
  animation: none !important;
}
body.dashboard-body .live-indicator {
  color: var(--rd-positive) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: .04em !important;
}
body.dashboard-body .live-indicator.is-final-result { color: var(--rd-positive) !important; }
body.dashboard-body .live-indicator.is-cached-result { color: #f59e0b !important; }
body.dashboard-body .live-indicator.is-error-result { color: var(--rd-negative) !important; }
body.dashboard-body .live-sep,
body.dashboard-body .last-updated { color: var(--rd-muted) !important; }
body.dashboard-body .data-state-note {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: fit-content !important;
  max-width: 100% !important;
  margin-top: 8px !important;
  padding: 5px 8px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(245, 158, 11, .42) !important;
  background: rgba(245, 158, 11, .10) !important;
  color: #fbbf24 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}
body.dashboard-body .data-state-note[hidden] { display: none !important; }
body.dashboard-body .data-state-note.is-error {
  border-color: color-mix(in srgb, var(--rd-negative) 48%, transparent) !important;
  background: color-mix(in srgb, var(--rd-negative) 12%, transparent) !important;
  color: var(--rd-negative) !important;
}
body.dashboard-body .data-state-retry {
  height: 22px !important;
  padding: 0 8px !important;
  border: 1px solid currentColor !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: inherit !important;
  font: inherit !important;
  cursor: pointer !important;
}
body.dashboard-body .overall-electorate-note { display: none !important; }

body.dashboard-body[data-dashboard-view="home"] .home-controls-card {
  margin-top: 14px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}
body.dashboard-body[data-dashboard-view="home"] .home-controls-grid,
body.dashboard-body[data-dashboard-view="home"] .home-control-group { display: block !important; }
body.dashboard-body[data-dashboard-view="home"] .home-controls-card .control-label { margin-bottom: 7px !important; }
body.dashboard-body[data-dashboard-view="home"] .home-controls-card .toggle-bar {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 7px !important;
}
body.dashboard-body[data-dashboard-view="home"] .home-controls-card .toggle-btn {
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 8px !important;
}

body.dashboard-body[data-dashboard-view="home"] .results-current-block {
  flex: 1 1 auto !important;
  padding-top: 12px !important;
}
body.dashboard-body[data-dashboard-view="home"] .results-current-block .card-head {
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
}
body.dashboard-body[data-dashboard-view="home"] .overall-grid { display: block !important; }
body.dashboard-body[data-dashboard-view="home"] .overall-primary { min-width: 0 !important; }
body.dashboard-body[data-dashboard-view="home"] .overall-big {
  margin-top: 9px !important;
  color: var(--rd-text) !important;
  font-size: var(--rd-reporting-size) !important;
  font-weight: 700 !important;
  line-height: .96 !important;
  letter-spacing: -.055em !important;
}
body.dashboard-body[data-dashboard-view="home"] .overall-sub {
  margin-top: 4px !important;
  color: var(--rd-text) !important;
  font-size: var(--rd-reporting-sub-size) !important;
  font-weight: 500 !important;
}
body.dashboard-body[data-dashboard-view="home"] .reporting-progress,
body.dashboard-body[data-dashboard-view="home"] .reporting-progress-label { display: none !important; }
body.dashboard-body[data-dashboard-view="home"] .current-results-stats {
  margin-top: 12px !important;
  padding-top: 11px !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  border-top: 1px solid var(--rd-rule) !important;
}
body.dashboard-body[data-dashboard-view="home"] .current-results-stat {
  min-width: 0 !important;
  padding: 0 10px !important;
  text-align: center !important;
  border-right: 1px solid var(--rd-rule) !important;
}
body.dashboard-body[data-dashboard-view="home"] .current-results-stat:first-child { padding-left: 0 !important; }
body.dashboard-body[data-dashboard-view="home"] .current-results-stat:last-child { padding-right: 0 !important; border-right: 0 !important; }
body.dashboard-body[data-dashboard-view="home"] .current-results-stat span {
  display: block !important;
  color: var(--rd-muted) !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: .05em !important;
  text-transform: uppercase !important;
}
body.dashboard-body[data-dashboard-view="home"] .current-results-stat strong {
  display: block !important;
  margin-top: 6px !important;
  color: var(--rd-text) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

body.dashboard-body[data-dashboard-view="home"] .home-dashboard-view-tabs {
  grid-column: 2 !important;
  grid-row: 1 !important;
  margin: 0 !important;
  padding-left: 0 !important;
  background: transparent !important;
}
body.dashboard-body[data-dashboard-view="home"] .home-dashboard-view-tabs .dashboard-view-tab {
  height: 42px !important;
  min-height: 42px !important;
  border-radius: var(--rd-radius-sm) var(--rd-radius-sm) 0 0 !important;
}

body.dashboard-body[data-dashboard-view="home"] .votes-seats-card {
  grid-column: 2 !important;
  grid-row: 2 !important;
  min-width: 0 !important;
  min-height: 526px !important;
  border-radius: 0 0 var(--rd-radius) 0 !important;
  overflow: hidden !important;
}
body.dashboard-body[data-dashboard-view="home"] .votes-seats-card > .card-head {
  min-height: 40px !important;
  padding: 7px 11px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  background: var(--rd-panel-2) !important;
  border-bottom: 1px solid var(--rd-border-strong) !important;
}
body.dashboard-body[data-dashboard-view="home"] .seat-main-heading {
  color: var(--rd-text) !important;
  font-family: var(--rd-display-font) !important;
  font-size: var(--rd-section-title-size) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: -.02em !important;
  text-transform: uppercase !important;
}
body.dashboard-body[data-dashboard-view="home"] .home-seat-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}
body.dashboard-body[data-dashboard-view="home"] .home-seat-party-toggle {
  display: inline-grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 5px !important;
  width: 178px !important;
}
body.dashboard-body[data-dashboard-view="home"] .home-seat-party-toggle .toggle-btn {
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 8px !important;
  font-size: 10.5px !important;
}
body.dashboard-body[data-dashboard-view="home"] .electorate-level-results-btn { display: none !important; }
body.dashboard-body[data-dashboard-view="home"] #seatSummaryView,
body.dashboard-body[data-dashboard-view="home"] #seatSummary,
body.dashboard-body[data-dashboard-view="home"] .seat-table-scroll { width: 100% !important; overflow: visible !important; }

body.dashboard-body .seat-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: transparent !important;
}
body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-party { width: 35% !important; }
body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-votes { width: 16% !important; }
body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-pct { width: 10% !important; }
body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-change { width: 12% !important; }
body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-elec { width: 7% !important; }
body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-seats { width: 7% !important; }
body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-seat-change { width: 13% !important; }

body.dashboard-body .seat-table th,
body.dashboard-body .seat-table td {
  height: auto !important;
  padding: var(--rd-table-row-pad-y) var(--rd-table-row-pad-x) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rd-rule) !important;
  background: transparent !important;
  color: var(--rd-text-soft) !important;
  font-size: var(--rd-table-text-size) !important;
  font-weight: 500 !important;
  line-height: 1.12 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  vertical-align: middle !important;
}
body.dashboard-body .seat-table th {
  color: var(--rd-muted) !important;
  font-size: var(--rd-table-head-size) !important;
  font-weight: 700 !important;
  line-height: 1.05 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
}
body.dashboard-body .seat-table th:first-child,
body.dashboard-body .seat-table td:first-child { text-align: left !important; }
body.dashboard-body .seat-table th.num,
body.dashboard-body .seat-table td.num { text-align: right !important; }
body.dashboard-body .seat-table tbody tr:hover td { background-color: rgba(96, 165, 250, .055) !important; }

body.dashboard-body .seat-table td.party-name-cell {
  position: relative !important;
  padding-left: 20px !important;
  isolation: isolate !important;
  overflow: hidden !important;
}
body.dashboard-body .seat-table td.party-name-cell::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 auto 0 6px !important;
  z-index: -1 !important;
  width: calc((100% - 6px) * var(--party-row-width-value, 0)) !important;
  background: var(--party-row-color, transparent) !important;
  opacity: .78 !important;
}
body.dashboard-body.light-mode .seat-table td.party-name-cell::before,
body.dashboard-body[data-theme-choice="light"] .seat-table td.party-name-cell::before { opacity: .18 !important; }
body.dashboard-body .seat-table td.party-name-cell .party-line {
  position: absolute !important;
  inset: 0 auto 0 0 !important;
  width: 6px !important;
  min-width: 6px !important;
  height: auto !important;
  background: var(--party-row-color, currentColor) !important;
  border-radius: 0 !important;
  transform: none !important;
}
body.dashboard-body .seat-table .party-name-text {
  position: relative !important;
  z-index: 1 !important;
  color: var(--rd-text) !important;
  font-size: var(--rd-table-text-size) !important;
  font-weight: 600 !important;
}
body.dashboard-body .seat-table td.num,
body.dashboard-body .seat-table td.num strong { color: var(--rd-text) !important; font-weight: 600 !important; }
body.dashboard-body .seat-table tfoot td,
body.dashboard-body .seat-table tfoot td strong {
  color: var(--rd-text) !important;
  font-weight: 700 !important;
  border-top: 1px solid var(--rd-border-strong) !important;
  border-bottom: 0 !important;
}

body.dashboard-body .pct-align {
  display: inline-flex !important;
  align-items: baseline !important;
  justify-content: flex-end !important;
  white-space: nowrap !important;
}
body.dashboard-body .pct-align-symbol-hidden { visibility: visible !important; }

/* coloured movements */
body.dashboard-body .change-indicator {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 2px !important;
  white-space: nowrap !important;
  color: inherit !important;
  font-weight: 600 !important;
}
body.dashboard-body .change-indicator.change-up,
body.dashboard-body .change-indicator.change-up .change-arrow { color: var(--rd-positive) !important; }
body.dashboard-body .change-indicator.change-down,
body.dashboard-body .change-indicator.change-down .change-arrow { color: var(--rd-negative) !important; }
body.dashboard-body .change-arrow { font-size: .82em !important; line-height: 1 !important; }

/* coalition builder */
body.dashboard-body .bloc-summary {
  margin: 10px 11px 11px !important;
  padding: 9px !important;
  background: var(--rd-panel-subtle) !important;
  border: 1px solid var(--rd-border) !important;
  border-radius: var(--rd-radius-sm) !important;
}
body.dashboard-body .bloc-summary-head-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}
body.dashboard-body .bloc-collapse-btn {
  display: none !important;
  height: 24px !important;
  padding: 0 8px !important;
  border: 1px solid var(--rd-border) !important;
  border-radius: var(--rd-radius-sm) !important;
  background: var(--rd-button) !important;
  color: var(--rd-text) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}
body.dashboard-body .bloc-simple-grid[hidden] { display: none !important; }
body.dashboard-body .bloc-summary-head {
  display: flex !important;
  justify-content: space-between !important;
  gap: 10px !important;
  color: var(--rd-muted) !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: .07em !important;
  text-transform: uppercase !important;
}
body.dashboard-body .bloc-summary-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 6px !important;
}
body.dashboard-body .bloc-card {
  min-width: 0 !important;
  min-height: 43px !important;
  padding: 7px 9px !important;
  display: grid !important;
  grid-template-columns: 4px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  background: var(--rd-panel) !important;
  border: 1px solid var(--rd-rule) !important;
  border-radius: var(--rd-radius-sm) !important;
}
body.dashboard-body .bloc-colours { display: flex !important; flex-direction: column !important; align-self: stretch !important; gap: 1px !important; }
body.dashboard-body .bloc-colours span { flex: 1 1 0 !important; min-height: 3px !important; }
body.dashboard-body .bloc-name { color: var(--rd-text) !important; font-size: 12px !important; font-weight: 700 !important; }
body.dashboard-body .bloc-parties { margin-top: 2px !important; color: var(--rd-muted) !important; font-size: 9.5px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
body.dashboard-body .bloc-result { display: flex !important; align-items: baseline !important; gap: 4px !important; white-space: nowrap !important; }
body.dashboard-body .bloc-result strong { color: var(--rd-text) !important; font-size: 24px !important; font-weight: 700 !important; line-height: 1 !important; }
body.dashboard-body .bloc-result span { color: var(--rd-muted) !important; font-size: 9.5px !important; }
body.dashboard-body .bloc-scenario-controls {
  margin-top: 7px !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
}
body.dashboard-body .bloc-scenario-controls > span { color: var(--rd-muted) !important; font-size: 9px !important; font-weight: 700 !important; letter-spacing: .06em !important; text-transform: uppercase !important; }
body.dashboard-body .bloc-toggle-groups {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 7px !important;
}
body.dashboard-body .bloc-toggle-group {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  flex-wrap: wrap !important;
}
body.dashboard-body .bloc-toggle-divider {
  width: 1px !important;
  min-height: 30px !important;
  background: var(--rd-border-strong) !important;
}
body.dashboard-body .bloc-empty {
  align-self: center !important;
  color: var(--rd-faint) !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}
body.dashboard-body .bloc-toggle-btn,
body.dashboard-body .bloc-reset-btn { min-height: 28px !important; padding: 0 11px !important; font-size: 10.5px !important; }
body.dashboard-body .bloc-toggle-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}
body.dashboard-body .bloc-toggle-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 999px !important;
  flex: 0 0 auto !important;
}
body.dashboard-body .bloc-simple-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 8px !important;
}
body.dashboard-body .bloc-column {
  min-width: 0 !important;
  padding: 8px !important;
  display: grid !important;
  align-content: start !important;
  gap: 7px !important;
  background: var(--rd-panel) !important;
  border: 1px solid var(--rd-rule) !important;
  border-radius: var(--rd-radius-sm) !important;
}
body.dashboard-body .bloc-column-head {
  min-width: 0 !important;
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  white-space: nowrap !important;
}
body.dashboard-body .bloc-column-head span {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  color: var(--rd-text) !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.dashboard-body .bloc-column-head strong {
  color: var(--rd-text) !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}
body.dashboard-body .bloc-column-head em {
  color: var(--rd-muted) !important;
  font-size: 9.5px !important;
  font-style: normal !important;
}
body.dashboard-body .bloc-column .bloc-toggle-group {
  align-items: flex-start !important;
  justify-content: flex-start !important;
}
body.dashboard-body .bloc-column .bloc-toggle-btn {
  min-height: 30px !important;
  padding: 0 8px !important;
}
body.dashboard-body .bloc-party-label {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.dashboard-body .bloc-party-seats {
  margin-left: 2px !important;
  min-width: 20px !important;
  padding: 2px 5px !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--rd-panel-3) 86%, transparent) !important;
  color: var(--rd-text) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
}

/* ============================================================
   MAP
   ============================================================ */
body.dashboard-body:not([data-dashboard-view="home"]) .home-dashboard-view-tabs { display: none !important; }
body.dashboard-body:not([data-dashboard-view="home"]) .dashboard-shell > .dashboard-view-tabs { display: grid !important; }
body.dashboard-body[data-dashboard-view="map"] .dashboard-grid,
body.dashboard-body[data-dashboard-view="electorates"] .dashboard-grid,
body.dashboard-body[data-dashboard-view="trends"] .dashboard-grid { display: block !important; }
body.dashboard-body[data-dashboard-view="map"] .col-left,
body.dashboard-body[data-dashboard-view="map"] .col-right,
body.dashboard-body[data-dashboard-view="electorates"] .col-left,
body.dashboard-body[data-dashboard-view="electorates"] .col-right,
body.dashboard-body[data-dashboard-view="trends"] .col-left,
body.dashboard-body[data-dashboard-view="trends"] .col-right { display: none !important; }
body.dashboard-body[data-dashboard-view="map"] .col-center,
body.dashboard-body[data-dashboard-view="electorates"] .col-center,
body.dashboard-body[data-dashboard-view="trends"] .col-center { display: block !important; min-width: 0 !important; }

body.dashboard-body .map-card {
  position: relative !important;
  overflow: hidden !important;
}
body.dashboard-body .map-head { display: none !important; }
body.dashboard-body[data-dashboard-view="map"] .map-card { height: calc(100vh - 130px) !important; min-height: 620px !important; }
body.dashboard-body[data-dashboard-view="map"] .map-card-body,
body.dashboard-body[data-dashboard-view="map"] .map-wrap,
body.dashboard-body[data-dashboard-view="map"] #map {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
body.dashboard-body .map-wrap,
body.dashboard-body #map {
  background: var(--rd-map-bg) !important;
  border: 0 !important;
  border-radius: 0 !important;
}
body.dashboard-body .seat-comparison-hint {
  margin: 7px 12px 0 !important;
  color: var(--rd-muted) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .03em !important;
}
body.dashboard-body .map-stage-texture { display: none !important; }
body.dashboard-body .leaflet-control-attribution {
  background: rgba(248, 250, 252, .82) !important;
  color: #64748b !important;
  font-size: 10px !important;
}
body.dashboard-body .leaflet-tooltip {
  padding: 1px 3px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-family: var(--rd-active-font) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px #0f172a, 0 0 4px #0f172a !important;
}
body.dashboard-body .leaflet-tooltip::before { display: none !important; }

/* fixed map result panel */
body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel {
  position: absolute !important;
  z-index: 720 !important;
  top: 14px !important;
  left: 14px !important;
  width: min(610px, calc(100% - 292px)) !important;
  max-width: 610px !important;
  background: var(--rd-panel) !important;
  color: var(--rd-text) !important;
  border: 1px solid var(--rd-border-strong) !important;
  border-radius: var(--rd-radius-lg) !important;
  box-shadow: var(--rd-shadow-float) !important;
  overflow: hidden !important;
}
body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel:not(.has-result):not(.has-national-summary) { display: none !important; }
body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel .popup { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
body.dashboard-body .popup-header {
  min-height: 58px !important;
  padding: 12px 14px 10px !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
  border-bottom: 1px solid var(--rd-border-strong) !important;
}
body.dashboard-body .popup-header h3,
body.dashboard-body .floating-popup h3,
body.dashboard-body #mapDetailPanel h3 {
  margin: 0 !important;
  color: var(--rd-text) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.12 !important;
  letter-spacing: -.025em !important;
}
body.dashboard-body .map-selection-eyebrow {
  grid-column: 1 / -1 !important;
  color: var(--rd-muted) !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}
body.dashboard-body .popup-reporting-wrap {
  flex: 0 0 170px !important;
  min-width: 170px !important;
  color: var(--rd-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-align: right !important;
}
body.dashboard-body .popup-reporting-bar {
  width: 100% !important;
  height: 4px !important;
  margin-top: 5px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: var(--rd-border) !important;
}
body.dashboard-body .popup-reporting-fill { height: 100% !important; background: var(--rd-accent) !important; }
body.dashboard-body .popup-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  background: transparent !important;
}
body.dashboard-body .popup-table th,
body.dashboard-body .popup-table td {
  padding: 7px 10px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rd-rule) !important;
  background: transparent !important;
  color: var(--rd-text-soft) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.16 !important;
  vertical-align: middle !important;
}
body.dashboard-body .popup-table th {
  color: var(--rd-muted) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .065em !important;
  text-transform: uppercase !important;
}
body.dashboard-body .popup-table th.num,
body.dashboard-body .popup-table td.num { text-align: right !important; }
body.dashboard-body .popup-table td.bold,
body.dashboard-body .popup-table td.num,
body.dashboard-body .popup-table td.num strong { color: var(--rd-text-soft) !important; font-weight: 600 !important; }
body.dashboard-body .popup-party-pct-row {
  background-image: none !important;
}
body.dashboard-body .popup-party-pct-cell {
  background-image: linear-gradient(
    90deg,
    color-mix(in srgb, var(--popup-party-accent, var(--popup-party-bar-color, transparent)) 78%, transparent) 0 var(--popup-party-bar-width, 0%),
    transparent var(--popup-party-bar-width, 0%)
  ) !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
}
body.dashboard-body.light-mode .popup-party-pct-cell,
body.dashboard-body[data-theme-choice="light"] .popup-party-pct-cell {
  background-image: linear-gradient(
    90deg,
    color-mix(in srgb, var(--popup-party-accent, var(--popup-party-bar-color, transparent)) 20%, transparent) 0 var(--popup-party-bar-width, 0%),
    transparent var(--popup-party-bar-width, 0%)
  ) !important;
}
body.dashboard-body .candidate-cell {
  position: relative !important;
  padding-left: 20px !important;
  color: var(--rd-text-soft) !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.dashboard-body .vertical-party-bar {
  position: absolute !important;
  inset: 0 auto 0 0 !important;
  width: 6px !important;
}
body.dashboard-body .party-label-text {
  color: var(--rd-text-soft) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.dashboard-body .popup-winner-margin { margin-top: 2px !important; color: var(--rd-muted) !important; font-size: 10px !important; font-weight: 600 !important; }
body.dashboard-body .popup-footer { padding: 8px 14px 10px !important; color: var(--rd-muted) !important; font-size: 11px !important; line-height: 1.25 !important; }

/* map controls */
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card {
  position: absolute !important;
  z-index: 740 !important;
  right: 14px !important;
  bottom: 14px !important;
  width: 252px !important;
  max-height: calc(100% - 28px) !important;
  padding: 8px !important;
  overflow-y: auto !important;
  background: var(--rd-panel) !important;
  border: 1px solid var(--rd-border-strong) !important;
  border-radius: var(--rd-radius) !important;
  box-shadow: var(--rd-shadow-float) !important;
}
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel > .card-head,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel > .map-card-minimize,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel > #mapOptionsToggle { display: none !important; }
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .map-options-section-menu {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 5px !important;
}
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .map-option-section-btn,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .toggle-btn,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .region-btn {
  width: 100% !important;
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
}
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .controls-body.has-open-map-sections { margin-top: 9px !important; }
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .control-group {
  display: block !important;
  margin-top: 11px !important;
}
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .control-group[hidden] { display: none !important; }
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .control-label { margin-bottom: 7px !important; }
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .toggle-bar,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .year-toggle-bar,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .region-toggle-bar,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel .toggle-bar.toggle-bar-4 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 5px !important;
}
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel #resetZoomBtn { grid-column: 1 / -1 !important; }
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel::-webkit-scrollbar { width: 7px !important; }
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel::-webkit-scrollbar-track { background: transparent !important; }
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel::-webkit-scrollbar-thumb { background: var(--rd-border-strong) !important; border-radius: 999px !important; }

body.dashboard-body .map-view-toggle,
body.dashboard-body .map-legend,
body.dashboard-body .map-toolbar-tabs,
body.dashboard-body .map-overlay-panel,
body.dashboard-body .lower-panel-tabs { display: none !important; }

/* ============================================================
   ELECTORATES TABLE VIEW
   ============================================================ */
body.dashboard-body[data-dashboard-view="electorates"] .map-card {
  height: auto !important;
  min-height: 680px !important;
  overflow: hidden !important;
}
body.dashboard-body[data-dashboard-view="electorates"] .map-card-body,
body.dashboard-body[data-dashboard-view="electorates"] .map-wrap {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  min-height: 680px !important;
  overflow: visible !important;
  background: var(--rd-panel) !important;
}
body.dashboard-body[data-dashboard-view="electorates"] #map,
body.dashboard-body[data-dashboard-view="electorates"] #mapDetailPanel,
body.dashboard-body[data-dashboard-view="electorates"] #topLeftPanel,
body.dashboard-body[data-dashboard-view="electorates"] #voteShareCard,
body.dashboard-body[data-dashboard-view="electorates"] #recentElectoratesCard,
body.dashboard-body[data-dashboard-view="electorates"] #lowerInsightsTabs,
body.dashboard-body[data-dashboard-view="electorates"] .map-legend { display: none !important; }
body.dashboard-body[data-dashboard-view="electorates"] #mapDataView,
body.dashboard-body[data-dashboard-view="electorates"] .map-data-view {
  display: block !important;
  position: static !important;
  width: 100% !important;
  height: auto !important;
  padding: 14px !important;
  background: var(--rd-panel) !important;
  color: var(--rd-text) !important;
}
body.dashboard-body .map-data-toolbar {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  padding: 8px !important;
  background: var(--rd-panel-2) !important;
  border: 1px solid var(--rd-rule) !important;
  border-radius: var(--rd-radius-sm) !important;
}
body.dashboard-body .map-data-toolbar-group { display: inline-flex !important; align-items: center !important; gap: 4px !important; }
body.dashboard-body .map-data-filter-btn { min-height: 28px !important; height: 28px !important; padding: 0 10px !important; font-size: 11px !important; }
body.dashboard-body .map-data-table-wrap { margin-top: 10px !important; overflow: auto !important; }
body.dashboard-body .map-data-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}
body.dashboard-body .map-data-col-electorate { width: 25% !important; }
body.dashboard-body .map-data-col-leader { width: 26% !important; }
body.dashboard-body .map-data-col-party { width: 14% !important; }
body.dashboard-body .map-data-col-margin { width: 12% !important; }
body.dashboard-body .map-data-col-report { width: 10% !important; }
body.dashboard-body .map-data-col-updated { width: 13% !important; }
body.dashboard-body .map-data-col-party.is-hidden,
body.dashboard-body .map-data-party-head.is-hidden { display: none !important; }
body.dashboard-body .map-data-table th,
body.dashboard-body .map-data-table td {
  height: 38px !important;
  padding: 7px 10px !important;
  border-bottom: 1px solid var(--rd-rule) !important;
  background: transparent !important;
  color: var(--rd-text-soft) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.16 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.dashboard-body .map-data-party-cell { color: var(--rd-muted) !important; font-weight: 700 !important; }
body.dashboard-body .map-data-table th {
  color: var(--rd-muted) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .065em !important;
  text-transform: uppercase !important;
}
body.dashboard-body .map-data-table th.num,
body.dashboard-body .map-data-table td.num { text-align: right !important; }
body.dashboard-body .map-data-table tbody tr:hover > td { background: rgba(96, 165, 250, .055) !important; }
body.dashboard-body .map-data-sort-btn {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  text-transform: inherit !important;
}
body.dashboard-body .map-data-detail-row > td {
  height: auto !important;
  padding: 0 10px 10px !important;
  background: rgba(96, 165, 250, .045) !important;
}
body.dashboard-body .map-data-inline-detail { padding-top: 9px !important; border-top: 1px solid var(--rd-rule) !important; }
body.dashboard-body .map-data-inline-detail .popup-header { min-height: 44px !important; padding: 0 0 8px !important; }
body.dashboard-body .map-data-inline-detail .popup-header h3 { font-size: 15px !important; }
body.dashboard-body .map-data-inline-detail .popup-reporting-wrap { flex-basis: 150px !important; min-width: 150px !important; }
body.dashboard-body .map-data-inline-detail .popup-footer { padding: 7px 0 0 !important; }

/* ============================================================
   TRENDS VIEW
   ============================================================ */
body.dashboard-body[data-dashboard-view="trends"] .map-card {
  height: auto !important;
  min-height: 680px !important;
  padding: 0 !important;
  overflow: visible !important;
  background: var(--rd-panel) !important;
}
body.dashboard-body[data-dashboard-view="trends"] .map-card-body,
body.dashboard-body[data-dashboard-view="trends"] .map-wrap {
  position: static !important;
  height: auto !important;
  min-height: 680px !important;
  overflow: visible !important;
  background: var(--rd-panel) !important;
}
body.dashboard-body[data-dashboard-view="trends"] #map,
body.dashboard-body[data-dashboard-view="trends"] #mapDetailPanel,
body.dashboard-body[data-dashboard-view="trends"] #topLeftPanel,
body.dashboard-body[data-dashboard-view="trends"] #mapDataView,
body.dashboard-body[data-dashboard-view="trends"] #recentElectoratesCard,
body.dashboard-body[data-dashboard-view="trends"] #lowerInsightsTabs,
body.dashboard-body[data-dashboard-view="trends"] .map-legend { display: none !important; }
body.dashboard-body[data-dashboard-view="trends"] #voteShareCard,
body.dashboard-body[data-dashboard-view="trends"] .vote-share-card {
  display: block !important;
  position: static !important;
  width: 100% !important;
  min-height: 680px !important;
  margin: 0 !important;
  padding: 17px !important;
  background: var(--rd-panel) !important;
  color: var(--rd-text) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.dashboard-body[data-dashboard-view="trends"] .map-card-minimize,
body.dashboard-body[data-dashboard-view="trends"] .broadcast-card-tab { display: none !important; }
body.dashboard-body[data-dashboard-view="trends"] .trend-chart-stack { display: grid !important; gap: 22px !important; }
body.dashboard-body[data-dashboard-view="trends"] .trend-chart-panel { min-width: 0 !important; }
body.dashboard-body[data-dashboard-view="trends"] .trend-chart-panel h3 {
  margin: 0 0 8px !important;
  color: var(--rd-text) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}
body.dashboard-body[data-dashboard-view="trends"] .vote-share-svg { width: 100% !important; height: auto !important; }
body.dashboard-body[data-dashboard-view="trends"] .vote-share-grid,
body.dashboard-body[data-dashboard-view="trends"] .vote-share-axis { stroke: var(--rd-border-strong) !important; }
body.dashboard-body[data-dashboard-view="trends"] .vote-share-axis-label { fill: var(--rd-muted) !important; color: var(--rd-muted) !important; font-family: var(--rd-active-font) !important; font-size: 11px !important; }
body.dashboard-body[data-dashboard-view="trends"] .vote-share-end-label { font-family: var(--rd-active-font) !important; font-size: 12px !important; font-weight: 700 !important; }

/* ---------- footer ---------- */
body.dashboard-body .dashboard-footer {
  margin-top: 8px !important;
  min-height: 25px !important;
  background: var(--rd-header) !important;
  color: var(--rd-muted) !important;
  border-top: 1px solid var(--rd-border) !important;
}
body.dashboard-body .dashboard-footer-inner {
  min-height: 25px !important;
  padding: 0 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  color: var(--rd-muted) !important;
  font-size: 10px !important;
}
body.dashboard-body .foot-right { margin-left: auto !important; }
body.dashboard-body .dot-sep { margin: 0 4px !important; }
body.dashboard-body .foot-version { margin-left: 6px !important; }

/* ============================================================
   MODALS
   ============================================================ */
body.dashboard-body.modal-open { overflow: hidden !important; }
body.dashboard-body .settings-backdrop,
body.dashboard-body .help-backdrop,
body.dashboard-body .all-electorates-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1900 !important;
  display: none;
  background: rgba(3, 7, 18, .66) !important;
  backdrop-filter: blur(3px) !important;
}
body.dashboard-body .settings-backdrop.is-open,
body.dashboard-body .help-backdrop.is-open,
body.dashboard-body .all-electorates-backdrop.is-open { display: block !important; }
body.dashboard-body .settings-modal,
body.dashboard-body .help-modal,
body.dashboard-body .all-electorates-card {
  position: fixed !important;
  z-index: 1910 !important;
  display: none;
  overflow: hidden !important;
  box-shadow: var(--rd-shadow-float) !important;
}
body.dashboard-body .settings-modal.is-open,
body.dashboard-body .help-modal.is-open,
body.dashboard-body .all-electorates-card.is-open { display: block !important; }
body.dashboard-body .settings-modal {
  top: 50% !important;
  left: 50% !important;
  width: min(560px, calc(100vw - 28px)) !important;
  transform: translate(-50%, -50%) !important;
}
body.dashboard-body .help-modal {
  top: 50% !important;
  left: 50% !important;
  width: min(760px, calc(100vw - 28px)) !important;
  max-height: min(760px, calc(100vh - 36px)) !important;
  transform: translate(-50%, -50%) !important;
}
body.dashboard-body .settings-modal-head,
body.dashboard-body .help-modal-head {
  min-height: 48px !important;
  padding: 0 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  border-bottom: 1px solid var(--rd-border) !important;
}
body.dashboard-body .settings-modal-title,
body.dashboard-body .help-modal-title {
  margin: 0 !important;
  color: var(--rd-text) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
body.dashboard-body .settings-close-btn,
body.dashboard-body .help-close-btn {
  width: 30px !important;
  height: 30px !important;
  border: 1px solid var(--rd-border) !important;
  border-radius: var(--rd-radius-sm) !important;
  background: var(--rd-button) !important;
  color: var(--rd-text-soft) !important;
  font-size: 18px !important;
  line-height: 1 !important;
}
body.dashboard-body .settings-modal-body { padding: 16px !important; }
body.dashboard-body .help-modal-body { max-height: calc(100vh - 116px) !important; padding: 18px !important; overflow-y: auto !important; color: var(--rd-text-soft) !important; line-height: 1.55 !important; }
body.dashboard-body .settings-field { margin-top: 12px !important; }
body.dashboard-body .settings-field:first-child { margin-top: 0 !important; }
body.dashboard-body .settings-field label {
  display: block !important;
  margin-bottom: 6px !important;
  color: var(--rd-muted) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .07em !important;
  text-transform: uppercase !important;
}
body.dashboard-body .settings-field select,
body.dashboard-body .search-input {
  width: 100% !important;
  min-height: 38px !important;
  padding: 0 11px !important;
  border: 1px solid var(--rd-border) !important;
  border-radius: var(--rd-radius-sm) !important;
  background: var(--rd-button) !important;
  color: var(--rd-text) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}
body.dashboard-body .settings-actions { margin-top: 15px !important; }
body.dashboard-body .settings-hint { margin: 13px 0 0 !important; color: var(--rd-muted) !important; font-size: 11px !important; line-height: 1.4 !important; }

/* all-electorates modal retained for legacy route */
body.dashboard-body .all-electorates-card {
  top: 50% !important;
  left: 50% !important;
  width: min(1140px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 40px) !important;
  transform: translate(-50%, -50%) !important;
}
body.dashboard-body .all-electorates-card .table-wrap { max-height: calc(100vh - 210px) !important; overflow: auto !important; }
body.dashboard-body .all-electorates-toolbar { display: flex !important; flex-wrap: wrap !important; gap: 7px !important; padding: 10px !important; }
body.dashboard-body .search-row { display: flex !important; gap: 6px !important; min-width: 260px !important; flex: 1 1 320px !important; }
body.dashboard-body .ae-scope-toggle,
body.dashboard-body .ae-mode-toggle { display: inline-flex !important; gap: 5px !important; }

/* ---------- light-theme Leaflet / colour corrections ---------- */
body.dashboard-body.light-mode .leaflet-tooltip,
body.dashboard-body[data-theme-choice="light"] .leaflet-tooltip {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(15,23,42,.95), 0 0 4px rgba(15,23,42,.9) !important;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  body.dashboard-body .dashboard-shell { width: min(1120px, calc(100vw - 22px)) !important; margin-top: 11px !important; }
  body.dashboard-body[data-dashboard-view="home"] .col-left { grid-template-columns: minmax(0, 46%) minmax(0, 54%) !important; }
  body.dashboard-body[data-dashboard-view="home"] .app-title-main,
  body.dashboard-body[data-dashboard-view="home"] .app-header-title-main { font-size: min(var(--rd-election-title-size), 46px) !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table th,
  body.dashboard-body[data-dashboard-view="home"] .seat-table td,
  body.dashboard-body[data-dashboard-view="home"] .seat-table .party-name-text { font-size: min(var(--rd-table-text-size), 12px) !important; }
}

@media (max-width: 900px) {
  body.dashboard-body .dashboard-shell { width: min(100%, calc(100vw - 16px)) !important; margin-top: 8px !important; }
  body.dashboard-body[data-dashboard-view="home"] .col-left { display: block !important; }
  body.dashboard-body[data-dashboard-view="home"] .results-identity-card {
    min-height: auto !important;
    border-radius: var(--rd-radius) !important;
  }
  body.dashboard-body[data-dashboard-view="home"] .home-dashboard-view-tabs { margin-top: 8px !important; }
  body.dashboard-body[data-dashboard-view="home"] .votes-seats-card { min-height: auto !important; border-radius: var(--rd-radius) !important; }
  body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel { width: min(560px, calc(100% - 202px)) !important; }
  body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card { width: 178px !important; }
}

@media (max-width: 660px) {
  body.dashboard-body .app-header-inner { padding: 0 11px !important; }
  body.dashboard-body .dashboard-view-tab { padding: 0 6px !important; font-size: 10px !important; }
  body.dashboard-body[data-dashboard-view="home"] .results-identity-card { padding: 17px !important; }
  body.dashboard-body[data-dashboard-view="home"] .results-identity-block { padding: 11px 0 18px !important; }
  body.dashboard-body[data-dashboard-view="home"] .app-title-main,
  body.dashboard-body[data-dashboard-view="home"] .app-header-title-main { font-size: 42px !important; }
  body.dashboard-body[data-dashboard-view="home"] .overall-big { font-size: 58px !important; }
  body.dashboard-body[data-dashboard-view="home"] .current-results-stat span { font-size: 8px !important; }
  body.dashboard-body[data-dashboard-view="home"] .current-results-stat strong { font-size: 14px !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table th,
  body.dashboard-body[data-dashboard-view="home"] .seat-table td,
  body.dashboard-body[data-dashboard-view="home"] .seat-table .party-name-text { font-size: 11px !important; padding-left: 6px !important; padding-right: 6px !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table td.party-name-cell { padding-left: 14px !important; }
  body.dashboard-body[data-dashboard-view="home"] .bloc-collapse-btn { display: inline-flex !important; align-items: center !important; justify-content: center !important; }
  body.dashboard-body[data-dashboard-view="home"] .bloc-summary.is-collapsed { padding-bottom: 9px !important; }
  body.dashboard-body[data-dashboard-view="home"] .bloc-summary.is-collapsed .bloc-simple-grid { display: none !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-party { width: 31% !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-votes { width: 18% !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-pct { width: 11% !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-change { width: 13% !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-elec { width: 7% !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-seats { width: 7% !important; }
  body.dashboard-body[data-dashboard-view="home"] .seat-table col.seat-col-seat-change { width: 13% !important; }
  body.dashboard-body[data-dashboard-view="map"] .map-card { min-height: 620px !important; }
  body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel { left: 8px !important; top: 8px !important; width: calc(100% - 16px) !important; max-width: none !important; }
  body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card { right: 8px !important; bottom: 8px !important; width: 164px !important; }
  body.dashboard-body .popup-header h3,
  body.dashboard-body #mapDetailPanel h3 { font-size: 16px !important; }
  body.dashboard-body .popup-reporting-wrap { flex-basis: 126px !important; min-width: 126px !important; }
  body.dashboard-body .popup-table th { font-size: 9px !important; }
  body.dashboard-body .popup-table td { padding: 6px 7px !important; font-size: 11px !important; }
  body.dashboard-body .foot-right { display: none !important; }
}

/* Map-only refinement pass: contained accordion controls, readable labels, and
   responsive stage sizing without horizontal clipping. */
html,
body.dashboard-body {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

body.dashboard-body[data-dashboard-view="map"] .app-header,
body.dashboard-body[data-dashboard-view="map"] .app-header-inner,
body.dashboard-body[data-dashboard-view="map"] .app-brand {
  min-width: 0 !important;
}

body.dashboard-body[data-dashboard-view="map"] .app-header-inner {
  padding-left: clamp(12px, 1.6vw, 24px) !important;
  padding-right: clamp(12px, 1.6vw, 24px) !important;
}

body.dashboard-body[data-dashboard-view="map"] .app-brand-mark {
  overflow: visible !important;
}

body.dashboard-body[data-dashboard-view="map"] .dashboard-shell {
  width: min(1320px, calc(100vw - 32px)) !important;
  padding-bottom: 18px !important;
}

body.dashboard-body[data-dashboard-view="map"] .map-card,
body.dashboard-body[data-dashboard-view="map"] .map-card-body,
body.dashboard-body[data-dashboard-view="map"] #mapWrap {
  height: min(640px, calc(100vh - var(--dd-header-h) - 126px)) !important;
  min-height: 520px !important;
  overflow: hidden !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card {
  right: 14px !important;
  bottom: 18px !important;
  width: min(220px, calc(100% - 28px)) !important;
  max-width: 220px !important;
  max-height: calc(100% - 36px) !important;
  padding: 10px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border-radius: 8px !important;
  background: rgba(15, 23, 42, .76) !important;
  border: 1px solid rgba(148, 163, 184, .38) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24) !important;
}

body.dashboard-body[data-theme-choice="light"][data-dashboard-view="map"] #topLeftPanel.controls-card,
body.dashboard-body.light-mode[data-dashboard-view="map"] #topLeftPanel.controls-card {
  background: rgba(248, 250, 252, .9) !important;
  border-color: rgba(148, 163, 184, .5) !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card > .card-head,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card > .map-card-minimize,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card > #mapOptionsToggle,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .control-label {
  display: none !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .map-options-section-menu {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
  width: 100% !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .map-option-section {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .map-option-section-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 11px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(148, 163, 184, .42) !important;
  background: rgba(15, 23, 42, .78) !important;
  color: #f8fafc !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  text-align: left !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .map-option-section-btn::after {
  content: "+" !important;
  font-weight: 800 !important;
  opacity: .72 !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .map-option-section-btn[aria-expanded="true"]::after {
  content: "-" !important;
}

body.dashboard-body[data-theme-choice="light"][data-dashboard-view="map"] #topLeftPanel.controls-card .map-option-section-btn,
body.dashboard-body.light-mode[data-dashboard-view="map"] #topLeftPanel.controls-card .map-option-section-btn {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .control-group {
  width: 100% !important;
  margin: 6px 0 0 !important;
  padding: 7px !important;
  border: 1px solid rgba(148, 163, 184, .24) !important;
  border-radius: 6px !important;
  background: rgba(2, 6, 23, .18) !important;
}

body.dashboard-body[data-theme-choice="light"][data-dashboard-view="map"] #topLeftPanel.controls-card .control-group,
body.dashboard-body.light-mode[data-dashboard-view="map"] #topLeftPanel.controls-card .control-group {
  background: rgba(241, 245, 249, .82) !important;
  border-color: rgba(148, 163, 184, .32) !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .control-group[hidden] {
  display: none !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .toggle-bar,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .year-toggle-bar,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .toggle-bar.toggle-bar-4 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .region-toggle-bar {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .toggle-btn,
body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .region-btn {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 9px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card #resetZoomBtn {
  grid-column: auto !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .map-control-select {
  width: 100% !important;
  min-height: 32px !important;
  padding: 0 10px !important;
  border: 1px solid var(--rd-border) !important;
  border-radius: 6px !important;
  background: var(--rd-button) !important;
  color: var(--rd-text) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
}

body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .map-control-select:focus {
  outline: none !important;
  border-color: var(--rd-accent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--rd-accent) 24%, transparent) !important;
}

body.dashboard-body[data-dashboard-view="map"] .leaflet-tooltip,
body.dashboard-body[data-theme-choice="dark"][data-dashboard-view="map"] .leaflet-tooltip,
body.dashboard-body.dark-mode[data-dashboard-view="map"] .leaflet-tooltip {
  color: #f8fafc !important;
  text-shadow: 0 1px 2px #020617, 0 0 5px #020617, 0 0 8px #020617 !important;
}

body.dashboard-body[data-theme-choice="light"][data-dashboard-view="map"] .leaflet-tooltip,
body.dashboard-body.light-mode[data-dashboard-view="map"] .leaflet-tooltip {
  color: #1f2937 !important;
  text-shadow: 0 1px 2px #ffffff, 0 0 5px #ffffff, 0 0 8px #ffffff !important;
}

body.dashboard-body[data-dashboard-view="map"] .poi-label-icon,
body.dashboard-body[data-dashboard-view="map"] .map-place-label,
body.dashboard-body[data-theme-choice="dark"][data-dashboard-view="map"] .poi-label-icon,
body.dashboard-body[data-theme-choice="dark"][data-dashboard-view="map"] .map-place-label,
body.dashboard-body.dark-mode[data-dashboard-view="map"] .poi-label-icon,
body.dashboard-body.dark-mode[data-dashboard-view="map"] .map-place-label {
  color: #f8fafc !important;
  text-shadow: 0 1px 2px #020617, 0 0 5px #020617, 0 0 8px #020617 !important;
}

body.dashboard-body[data-theme-choice="light"][data-dashboard-view="map"] .poi-label-icon,
body.dashboard-body[data-theme-choice="light"][data-dashboard-view="map"] .map-place-label,
body.dashboard-body.light-mode[data-dashboard-view="map"] .poi-label-icon,
body.dashboard-body.light-mode[data-dashboard-view="map"] .map-place-label {
  color: #1f2937 !important;
  text-shadow: 0 1px 2px #ffffff, 0 0 5px #ffffff, 0 0 8px #ffffff !important;
}

body.dashboard-body[data-dashboard-view="map"] .leaflet-control-attribution {
  right: 8px !important;
  bottom: 6px !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  background: rgba(15, 23, 42, .55) !important;
  color: rgba(248, 250, 252, .78) !important;
  font-size: 9px !important;
}

body.dashboard-body[data-theme-choice="light"][data-dashboard-view="map"] .leaflet-control-attribution,
body.dashboard-body.light-mode[data-dashboard-view="map"] .leaflet-control-attribution {
  background: rgba(255, 255, 255, .72) !important;
  color: rgba(71, 85, 105, .86) !important;
}

body.dashboard-body[data-dashboard-view="map"] .dashboard-footer {
  margin-top: 14px !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel {
  width: min(470px, calc(100% - 260px)) !important;
  max-width: 470px !important;
  top: 16px !important;
  left: 16px !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel.has-national-summary {
  width: min(470px, calc(100% - 260px)) !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel .popup-header {
  min-height: 48px !important;
  padding: 10px 12px 8px !important;
  gap: 12px !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel h3 {
  font-size: 18px !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel .popup-reporting-wrap {
  flex-basis: 154px !important;
  min-width: 154px !important;
  font-size: 10px !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel .popup-table th,
body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel .popup-table td {
  padding: 6px 8px !important;
  font-size: 11px !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel .popup-table th {
  font-size: 9px !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel .popup-footer {
  padding: 7px 12px 9px !important;
  font-size: 10px !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel .popup-party-pct-row {
  background-image: none !important;
}

body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel .popup-party-pct-cell {
  background-image: linear-gradient(
    90deg,
    color-mix(in srgb, var(--popup-party-accent, var(--popup-party-bar-color, transparent)) 78%, transparent) 0 var(--popup-party-bar-width, 0%),
    transparent var(--popup-party-bar-width, 0%)
  ) !important;
}

body.dashboard-body.light-mode[data-dashboard-view="map"] #mapDetailPanel .popup-party-pct-cell,
body.dashboard-body[data-theme-choice="light"][data-dashboard-view="map"] #mapDetailPanel .popup-party-pct-cell {
  background-image: linear-gradient(
    90deg,
    color-mix(in srgb, var(--popup-party-accent, var(--popup-party-bar-color, transparent)) 20%, transparent) 0 var(--popup-party-bar-width, 0%),
    transparent var(--popup-party-bar-width, 0%)
  ) !important;
}

@media (max-width: 900px) {
  body.dashboard-body[data-dashboard-view="map"] .dashboard-shell {
    width: calc(100vw - 16px) !important;
  }

  body.dashboard-body[data-dashboard-view="map"] #mapDetailPanel {
    width: min(420px, calc(100% - 174px)) !important;
  }

  body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card {
    width: 156px !important;
    max-width: 156px !important;
  }

  body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .toggle-bar,
  body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .year-toggle-bar,
  body.dashboard-body[data-dashboard-view="map"] #topLeftPanel.controls-card .toggle-bar.toggle-bar-4 {
    grid-template-columns: 1fr !important;
  }
}
