/* ============================================================
   CONSTITUENCY PROFILE MONITORING TOOL — style.css
   Design system: Zimbabwe Parliament Constituency Profile
   Theme: Zimbabwean Modern — forest green · gold · terracotta · cream
   Fonts: Times New Roman (headings + body) · DM Mono (data)
   ============================================================ */

:root {
  --green-dark:  #10402f;   /* deep forest green — shell, controls, tab active */
  --green-mid:   #1d5c43;   /* mid forest green  — accents, gradients          */
  --green-light: #2f8a5e;   /* bright forest green — positive/hover states     */
  --gold:        #c8922a;
  --gold-light:  #e8b84b;
  --terracotta:  #c1592c;   /* warm clay accent — secondary highlight          */
  --teal:        #1d7a8c;   /* info / water accent                             */
  --red:         #b8432f;
  --bg:          #f6f2e8;   /* warm cream — right panel bg                     */
  --bg-card:     #fffdf8;   /* warm white — cards                              */
  --text:        #1c2b22;
  --text-muted:  #6b6357;
  --border:      #e2dcc8;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Times New Roman', Times, serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ============================================================
   APP SHELL — same flex split as original
   ============================================================ */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ============================================================
   LEFT PANEL — dark green, controls + map
   ============================================================ */
.left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 0% 0%, rgba(232,184,75,0.07) 0%, transparent 45%),
    linear-gradient(165deg, var(--green-dark) 0%, #0b2e21 100%);
  border-right: 2px solid rgba(0,0,0,0.25);
  min-width: 0;
}

/* Controls bar — compact column, all items visible, no scroll */
.controls {
  flex: 0 0 auto;
  padding: 8px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  border-top: 3px solid var(--gold);
  border-bottom: 1px solid rgba(0,0,0,0.25);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}

/* Logo inside controls */
.controls-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 0;
}

.logo-badge {
  width: 19px;
  height: 19px;
  background: linear-gradient(145deg, var(--gold-light) 0%, var(--gold) 60%, #a87420 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
}

.logo-text {
  font-family: 'Times New Roman', Times, serif;
  color: #fff;
  font-size: 9px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Parliament of Zimbabwe badge (SVG inline logo) */
.parl-badge {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
}
.parl-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.parl-logo-name {
  font-family: 'Times New Roman', Times, serif;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.parl-logo-dept {
  font-family: 'Times New Roman', Times, serif;
  color: var(--gold-light);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.82;
}

/* Field group — label + select pairing */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.field-label {
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0.75;
  padding-left: 1px;
  line-height: 1.3;
}

/* Selects */
.controls select {
  width: 100%;
  padding: 3px 26px 3px 10px;
  background-color: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 7px;
  color: #fff;
  font-family: 'Times New Roman', Times, serif;
  font-size: 11.5px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='rgba(232,184,75,0.85)' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.18);
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.controls select:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.controls select:not(:disabled):hover {
  background-color: rgba(255,255,255,0.12);
  border-color: rgba(232,184,75,0.4);
}

.controls select:not(:disabled):focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,146,42,0.25), inset 0 1px 2px rgba(0,0,0,0.18);
}

.controls select option {
  background: var(--green-dark);
  color: #fff;
}

/* Zoom button */
.zoom-btn {
  padding: 4px 10px;
  margin-top: 0;
  background: linear-gradient(160deg, var(--gold-light) 0%, var(--gold) 100%);
  color: #2a1d05;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Times New Roman', Times, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.zoom-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}

.zoom-btn:active {
  transform: translateY(0);
}

/* Map shell — framed viewport with depth around the OL map */
.map-shell {
  flex: 3;
  min-height: 0;
  padding: 4px;
  position: relative;
}

/* Map — fills the shell, rounded + shadowed for a premium viewport feel */
.map-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #ece7d8;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0,0,0,0.4), 0 0 0 1px rgba(232,184,75,0.18);
}

/* Fullscreen toggle button — floats over the top-right of the map */
.map-fullscreen-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 50;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 7px;
  background: rgba(16,64,47,0.82);
  color: var(--gold-light);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: background 0.15s, transform 0.15s;
}
.map-fullscreen-btn:hover {
  background: var(--green-mid);
  transform: scale(1.06);
}

/* Basemap selector — floats over the bottom-left of the map, optional layer */
.basemap-control {
  position: absolute;
  bottom: 18px;
  left: 18px;
  z-index: 50;
  padding: 7px 24px 7px 10px;
  border: none;
  border-radius: 7px;
  background-color: rgba(16,64,47,0.82);
  color: var(--gold-light);
  font-family: 'Times New Roman', Times, serif;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='rgba(232,184,75,0.85)' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  outline: none;
  transition: background-color 0.15s, transform 0.15s;
}
.basemap-control:hover {
  background-color: var(--green-mid);
}
.basemap-control option {
  background: var(--green-dark);
  color: #fff;
}

/* Fullscreen map mode — left panel takes over the whole app, right panel
   and controls are hidden so the map fills the viewport */
.app-container.map-fullscreen .right-panel,
.app-container.map-fullscreen .controls {
  display: none !important;
}
.app-container.map-fullscreen .left-panel {
  flex: 1 1 100%;
  border-right: none;
}
.app-container.map-fullscreen .map-shell {
  flex: 1;
  padding: 0;
}
.app-container.map-fullscreen .map-container {
  border-radius: 0;
  box-shadow: none;
}

/* ============================================================
   RIGHT PANEL — parchment background, scrollable
   ============================================================ */
.right-panel {
  flex: 1.5;
  background: var(--bg);
  overflow-y: auto;
  padding: 0 28px 40px;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.right-panel::-webkit-scrollbar { width: 8px; }
.right-panel::-webkit-scrollbar-track { background: transparent; }
.right-panel::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}
.right-panel::-webkit-scrollbar-thumb:hover { background: var(--gold-light); }

/* ============================================================
   MAIN TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 6px;
  padding: 16px 0 14px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tabs button {
  padding: 7px 13px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.tabs button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.tabs button.active {
  background: var(--green-dark);
  color: #fff;
  border-color: var(--green-dark);
  border-bottom: 3px solid var(--gold);
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Sub-tabs (Welfare, Health etc.) — slightly smaller, no sticky */
.sub-tabs {
  position: static;
  background: transparent;
  border-bottom: none;
  padding: 0 0 14px;
  margin-bottom: 14px;
  margin-top: 4px;
}

.sub-tabs button {
  font-size: 12px;
  padding: 6px 12px;
}

.sub-tabs button.active {
  background: var(--gold);
  border-color: var(--gold);
}

/* Secondary toggle row stacked under a .sub-tabs row (e.g. data-year picker) */
.year-toggle {
  padding-bottom: 10px;
  margin-top: -8px;
  margin-bottom: 10px;
}

.year-toggle button {
  font-size: 10.5px;
  padding: 4px 11px;
}

.year-toggle button.active {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
h1 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--green-dark);
  margin-top: 4px;
}

.subtitle {
  font-family: 'Times New Roman', Times, serif;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 14px;
  display: inline-block;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 10px;
}

hr {
  display: none; /* subtitle border-bottom replaces <hr> */
}

/* ============================================================
   INFO CARD
   ============================================================ */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(13,27,42,0.07);
}

.info-card h3 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 10px;
}

.info-card p {
  font-size: 13px;
  color: var(--text);
  margin: 5px 0;
  line-height: 1.55;
}

.info-card p strong {
  color: var(--green-dark);
  font-weight: 600;
}

/* ============================================================
   CHART WRAPPER CARD
   ============================================================ */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 20px;
  box-shadow: 0 2px 8px rgba(13,27,42,0.07);
}

.chart-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 2px;
}

.chart-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ============================================================
   LEGENDS
   ============================================================ */
.legend {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 14px;
  margin-bottom: 4px;
  box-shadow: 0 1px 4px rgba(13,27,42,0.06);
}

.legend h4 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Times New Roman', Times, serif;
}

/* Filled rectangle swatch */
.legend-swatch {
  display: inline-block;
  width: 22px;
  height: 11px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.14);
  flex-shrink: 0;
}

/* Circle dot */
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Road line */
.legend-line {
  display: inline-block;
  height: 3px;
  width: 38px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ============================================================
   ANALYTICS BOX  (renderAnalytics() output)
   ============================================================ */
.analytics-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0 8px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 13px;
  line-height: 1.65;
  box-shadow: 0 2px 8px rgba(13,27,42,0.07);
}

.analytics-summary {
  margin-bottom: 10px;
  color: var(--text);
}

.analytics-summary b {
  color: var(--green-dark);
}

.analytics-highlight-good { color: #1a7a3a; font-weight: 600; }
.analytics-highlight-warn { color: var(--gold); font-weight: 600; }
.analytics-highlight-bad  { color: var(--red); font-weight: 600; }

.analytics-recommendations {
  margin-top: 10px;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  border-radius: 8px;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
}

.analytics-recommendations strong {
  display: none; /* title removed — bullets are self-explanatory */
}

/* ── Analytics section titles ── */
.analytics-section {
  margin-top: 14px;
  margin-bottom: 4px;
}

.analytics-section-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  margin-bottom: 8px;
}

.analytics-recommendations ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analytics-recommendations li {
  margin: 0;
  color: rgba(255,255,255,0.85);
  font-size: 12.5px;
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.analytics-recommendations li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--gold-light);
  font-weight: 700;
}

/* ============================================================
   OVERVIEW INFOGRAPHICS
   ============================================================ */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.overview-no-data {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.sector-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(13,27,42,0.08), 0 1px 3px rgba(13,27,42,0.05);
  transition: box-shadow 0.2s ease;
}

.sector-card:hover {
  box-shadow: 0 6px 20px rgba(13,27,42,0.13), 0 2px 6px rgba(13,27,42,0.07);
}

.sector-header {
  padding: 9px 14px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.sector-pop    { background: linear-gradient(90deg, #1a6e3c 0%, #2d8a50 100%); }
.sector-pov    { background: linear-gradient(90deg, var(--red) 0%, #c43030 100%); }
.sector-health { background: linear-gradient(90deg, #b07010 0%, #d4921a 100%); }
.sector-water  { background: linear-gradient(90deg, var(--teal) 0%, #2a96ab 100%); }
.sector-roads  { background: linear-gradient(90deg, #5c5347 0%, #756b5c 100%); }
.sector-edu    { background: linear-gradient(90deg, #2c2b26 0%, #45433c 100%); }
.sector-dip    { background: linear-gradient(90deg, var(--terracotta) 0%, #d4703f 100%); }

.kpi-row {
  display: flex;
  padding: 10px 10px 6px;
  gap: 6px;
}

.kpi-tile {
  flex: 1;
  text-align: center;
  padding: 10px 4px 8px;
  background: #fbf7ef;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(13,27,42,0.04);
}

.kpi-value {
  font-family: 'DM Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: 'Times New Roman', Times, serif;
  margin-top: 4px;
  line-height: 1.3;
  font-weight: 500;
}

.kpi-good { color: #1a7a3a; }
.kpi-warn { color: #c8922a; }
.kpi-bad  { color: #b83232; }

.mini-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 10px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'Times New Roman', Times, serif;
}

.mini-bar-label {
  min-width: 70px;
  font-size: 10px;
}

.mini-bar {
  flex: 1;
  height: 7px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a6e3c, #2d8a50);
  border-radius: 4px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.mini-bar-fill-warn { background: linear-gradient(90deg, #b07010, #d4921a); }
.mini-bar-fill-bad  { background: linear-gradient(90deg, #a02020, #c43030); }

.mini-bar-pct {
  min-width: 28px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-align: right;
}

.kpi-no-data {
  padding: 10px 12px 12px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

.kpi-no-data b {
  color: var(--green-dark);
  font-style: normal;
}

/* ============================================================
   HERO BANNER  (dynamic overview header with live stats)
   ============================================================ */
.hero-banner {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  border-radius: 14px;
  padding: 20px 22px 18px;
  color: #fff;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.hero-banner::after {
  content: 'ZW';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  font-family: 'Times New Roman', Times, serif;
  font-size: 80px;
  font-weight: 700;
  color: rgba(255,255,255,0.04);
  pointer-events: none;
  line-height: 1;
}
.hero-location {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 3px;
}
.hero-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.2;
}
.hero-meta-row {
  font-size: 11.5px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  align-items: center;
}
.hero-meta-row strong { color: rgba(255,255,255,0.88); font-weight: 600; }
.hero-meta-sep { margin: 0 10px; color: rgba(255,255,255,0.25); }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.hero-stat .val {
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  display: block;
  line-height: 1.2;
}
.hero-stat .lbl {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  display: block;
  margin-top: 2px;
}
.hero-divider {
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,0.14);
  margin: 0 14px;
  flex-shrink: 0;
}

/* ============================================================
   ALERT CARDS  (danger / warn / info banners)
   ============================================================ */
.alert-card {
  border-radius: 9px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 12.5px;
  border-left: 3px solid;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}
.alert-icon { font-size: 14px; flex-shrink: 0; padding-top: 1px; }
.alert-card.warn   { background: #fff8e8; border-color: var(--gold);  color: #6b5000; }
.alert-card.danger { background: #fff2f0; border-color: var(--red);   color: #5a1505; }
.alert-card.info   { background: #eaf6f6; border-color: var(--teal);  color: #0a3d40; }
.alert-card strong { font-weight: 600; color: inherit; }
.alert-cards { margin-bottom: 12px; }

/* ============================================================
   INSIGHT BOX  (dark gradient recommendation panel)
   ============================================================ */
.insight-box {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  border-radius: 10px;
  padding: 14px 18px;
  color: #fff;
  margin-top: 14px;
  border-left: 3px solid var(--gold);
}
.insight-box h3 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 9px;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}
.insight-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.insight-list li {
  font-size: 12.5px;
  line-height: 1.55;
  padding-left: 16px;
  position: relative;
  color: rgba(255,255,255,0.85);
}
.insight-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--gold-light);
  font-weight: 700;
}

/* ============================================================
   TAB HERO  (compact section header for each sector tab)
   ============================================================ */
.tab-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(13,27,42,0.06);
}
.tab-hero.pop  { border-left-color: #1a6e3c; }
.tab-hero.pov  { border-left-color: var(--red); }
.tab-hero.hlth { border-left-color: #b07010; }
.tab-hero.wtr  { border-left-color: var(--teal); }
.tab-hero.rds  { border-left-color: #5c5347; }
.tab-hero.edu  { border-left-color: #2c2b26; }
.tab-hero.dip  { border-left-color: var(--terracotta); }
.tab-hero.cmp  { border-left-color: #3182bd; }
.tab-hero.abt  { border-left-color: #234d8c; }
.tab-hero-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 2px;
}
.tab-hero-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 9px;
}
.tab-hero-meta {
  font-size: 12px;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
}
.tab-hero-meta strong { color: var(--green-dark); font-weight: 600; }

/* ============================================================
   NAMED PROGRESS BARS  (labeled, two-column header + bar)
   ============================================================ */
.prog-section { margin-bottom: 18px; }
.prog-section-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.prog-row { margin-bottom: 11px; }
.prog-row-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 500;
}
.prog-row-header .pv {
  font-family: 'DM Mono', monospace;
  font-weight: 600;
  color: var(--green-dark);
  font-size: 12px;
}
.prog-bg {
  background: var(--border);
  border-radius: 5px;
  height: 9px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.prog-fill.g { background: linear-gradient(90deg, #1a6e3c, #2d8a50); }
.prog-fill.w { background: linear-gradient(90deg, #b07010, #d4921a); }
.prog-fill.b { background: linear-gradient(90deg, #a02020, #c43030); }
.prog-fill.u { background: linear-gradient(90deg, var(--teal), #2a96ab); }

/* ============================================================
   CHART PAIR  (two-column side-by-side chart layout)
   ============================================================ */
.chart-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.chart-pair .chart-card { margin: 0; }
.chart-wrap-140 { position: relative; height: 140px; }
.chart-wrap-180 { position: relative; height: 180px; }
.chart-wrap-220 { position: relative; height: 220px; }
.chart-wrap-260 { position: relative; height: 260px; }

/* Printed-report stand-in for a live Chart.js <canvas> — fills the same
   .chart-wrap-* box the canvas used to occupy. Screen-hidden; only shown
   inside the print report (see captureSectionHTML in main.js). */
.print-chart-image {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============================================================
   DONUT CHART CUSTOM LEGEND
   ============================================================ */
.demo-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
}
.demo-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}
.demo-legend-item span {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  display: inline-block;
}

/* ============================================================
   LARGE KPI CARDS  (Overview infographic grid — matches dashboard style)
   ============================================================ */
.kpi-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.kpi-big-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 14px 11px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  box-shadow: 0 1px 6px rgba(13,27,42,0.06);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}
.kpi-big-card:hover { box-shadow: 0 3px 12px rgba(13,27,42,0.11); }
.kpi-big-card.top-green { border-top-color: #1a6e3c; }
.kpi-big-card.top-gold  { border-top-color: var(--gold); }
.kpi-big-card.top-red   { border-top-color: var(--red); }
.kpi-big-card.top-blue  { border-top-color: #3182bd; }
.kpi-big-card.top-pink  { border-top-color: #fc6ea8; }

/* ============================================================
   COMPARE CONSTITUENCIES
   ============================================================ */
.compare-picker {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.compare-picker-col { flex: 1; min-width: 220px; }
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.compare-section-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--green-dark);
  margin: 22px 0 10px;
}
.compare-col-heading {
  font-family: 'Times New Roman', Times, serif;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}
.compare-col-heading.a { color: var(--green-dark); }
.compare-col-heading.b { color: var(--gold); }

/* ── Compare: Picker column A/B identity ── */
.compare-picker-col:nth-child(1) { border-left: 3px solid var(--green-mid); padding-left: 12px; }
.compare-picker-col:nth-child(2) { border-left: 3px solid var(--gold);      padding-left: 12px; }

/* ── Compare: Constituency header banners ── */
.cmp-banner-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.cmp-banner {
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;
}
.cmp-banner::after {
  content: attr(data-letter);
  position: absolute;
  right: 12px;
  bottom: -8px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 72px;
  font-weight: 700;
  opacity: 0.08;
  line-height: 1;
  pointer-events: none;
}
.cmp-banner.a {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  border-bottom: 3px solid var(--gold);
}
.cmp-banner.b {
  background: linear-gradient(135deg, #6b3f00 0%, var(--gold) 100%);
  border-bottom: 3px solid var(--gold-light);
}
.cmp-banner-badge {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.cmp-banner-name {
  font-family: 'Times New Roman', Times, serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 2px;
}
.cmp-banner-prov {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 10px;
}
.cmp-banner-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.cmp-banner-stat .sv {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  display: block;
  line-height: 1.1;
}
.cmp-banner-stat .sl {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.45);
  display: block;
  margin-top: 1px;
}

/* ── Compare: Section headers using sector gradient palette ── */
.cmp-section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 10px;
  padding: 7px 14px;
  border-radius: 8px;
  color: #fff;
  font-family: 'Times New Roman', Times, serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.cmp-section-hdr.pop  { background: linear-gradient(90deg, #1a6e3c 0%, #2d8a50 100%); }
.cmp-section-hdr.pov  { background: linear-gradient(90deg, var(--red) 0%, #c43030 100%); }
.cmp-section-hdr.hlth { background: linear-gradient(90deg, #b07010 0%, #d4921a 100%); }
.cmp-section-hdr.wtr  { background: linear-gradient(90deg, var(--teal) 0%, #2a96ab 100%); }
.cmp-section-hdr.rds  { background: linear-gradient(90deg, #5c5347 0%, #756b5c 100%); }
.cmp-section-hdr.edu  { background: linear-gradient(90deg, #2c2b26 0%, #45433c 100%); }
.cmp-section-hdr.dip  { background: linear-gradient(90deg, var(--terracotta) 0%, #d4703f 100%); }

/* ── Compare: Dual-bar metric layout ── */
.cmp-metrics-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.cmp-metric-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 10px;
}
.cmp-metric-block.full { margin-bottom: 10px; }
.cmp-metric-label {
  font-family: 'Times New Roman', Times, serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.cmp-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.cmp-bar-id {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cmp-bar-id.a { background: var(--green-dark); color: var(--gold-light); }
.cmp-bar-id.b { background: #6b3f00;           color: var(--gold-light); }
.cmp-bar-track {
  flex: 1;
  height: 11px;
  background: rgba(0,0,0,0.07);
  border-radius: 5px;
  overflow: hidden;
}
.cmp-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.55s cubic-bezier(0.4,0,0.2,1);
  min-width: 3px;
}
.cmp-bar-fill.a { background: linear-gradient(90deg, var(--green-dark), var(--green-light)); }
.cmp-bar-fill.b { background: linear-gradient(90deg, #7a4a00, var(--gold)); }
.cmp-bar-val {
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  min-width: 58px;
  text-align: right;
  color: var(--text);
  flex-shrink: 0;
}
.cmp-win-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.6;
}
.cmp-win-badge.hi { background: #e0f2e9; color: #1a7a3a; }
.cmp-win-badge.lo { background: #fef0e6; color: #8a4000; }
.cmp-win-badge.eq { background: var(--border); color: var(--text-muted); }

/* ── Compare: Mini maps ── */
.cmp-map-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 6px;
}
.cmp-map-slot { display: flex; flex-direction: column; }
.cmp-map-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 6px 6px 0 0;
  color: #fff;
}
.cmp-map-label.a { background: var(--green-mid); }
.cmp-map-label.b { background: #7a4a00; }
.cmp-mini-map {
  position: relative;
  height: 320px;
  border: 2px solid;
  border-top: none;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  background: #f5f2ec;
}
.cmp-mini-map .ol-viewport { background: #f5f2ec; }
.cmp-map-slot:first-child .cmp-mini-map { border-color: var(--green-mid); }
.cmp-map-slot:last-child  .cmp-mini-map { border-color: #7a4a00; }
/* Compare sub-tab buttons (secondary row under main layer buttons) */
#cmp-sub-layer-tabs .cmp-sub-btn,
#cmp-sub-layer-tabs .cmp-year-btn {
  font-size: 11px;
  padding: 3px 10px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Times New Roman', Times, serif;
  transition: background 0.15s, color 0.15s;
}
#cmp-sub-layer-tabs .cmp-sub-btn:hover { background: var(--green-light); color: var(--green-dark); }
#cmp-sub-layer-tabs .cmp-sub-btn.active { background: var(--green-mid); color: #fff; border-color: var(--green-mid); font-weight: 700; }
#cmp-sub-layer-tabs .cmp-year-btn:hover { background: var(--gold-light); color: #5a3800; }
#cmp-sub-layer-tabs .cmp-year-btn.active { background: var(--gold); color: #fff; border-color: var(--gold); font-weight: 700; }
#cmp-sub-layer-tabs .cmp-subtab-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  vertical-align: middle;
}
/* Zoom control styling inside mini maps */
.cmp-mini-map .ol-zoom {
  top: auto;
  bottom: 8px;
  left: 8px;
  right: auto;
}
.cmp-mini-map .ol-zoom button {
  width: 22px;
  height: 22px;
  font-size: 14px;
  line-height: 22px;
  background: rgba(255,255,255,0.88);
  color: var(--green-dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: block;
  margin-bottom: 3px;
  cursor: pointer;
  font-family: 'Times New Roman', Times, serif;
  font-weight: 700;
  padding: 0;
}
.cmp-mini-map .ol-zoom button:hover { background: var(--green-light); }
.cmp-mini-map .ol-zoom-in  { border-radius: 4px 4px 0 0 !important; }
.cmp-mini-map .ol-zoom-out { border-radius: 0 0 4px 4px !important; margin-bottom: 0 !important; }
.cmp-map-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
  font-family: 'Times New Roman', Times, serif;
}
.cmp-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,0.18);
}
.cmp-dot.hlth { background: #c0392b; }
.cmp-dot.wtr  { background: #2980b9; }
.cmp-dot.edu  { background: #d4a017; }
.kpi-big-icon {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 7px;
}
.kpi-big-value {
  font-family: 'Times New Roman', Times, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.1;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}
.kpi-big-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.kpi-big-detail {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: auto;
}
.kpi-big-card.kpi-sm                    { padding: 8px 10px 7px; }
.kpi-big-card.kpi-sm .kpi-big-icon      { font-size: 15px; margin-bottom: 4px; }
.kpi-big-card.kpi-sm .kpi-big-value     { font-size: 16px; margin-bottom: 2px; }
.kpi-big-card.kpi-sm .kpi-big-label     { font-size: 8px; }
.kpi-big-card.kpi-sm .kpi-big-detail    { font-size: 10px; }

/* ============================================================
   WELFARE INFOGRAPHIC ELEMENTS
   ============================================================ */
.welfare-bench-track {
  position: relative;
  height: 8px;
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
  overflow: visible;
  margin: 6px 0 2px;
}
.welfare-bench-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.welfare-bench-nat {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: var(--green-dark);
  border-radius: 1px;
  transform: translateX(-50%);
}
.welfare-bench-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.welfare-gap-scale {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 8px;
}
.welfare-gap-dot {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.06);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.welfare-gap-dot.wg-active { color: #fff; }
.welfare-status-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  color: #fff;
  padding: 3px 9px;
  border-radius: 20px;
  margin-top: 2px;
}
.hfac-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
}
.hsa-split-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #4a4a4a;
  border: 1px solid rgba(0,0,0,0.15);
  margin: 6px 0 2px;
}
.hsa-split-served   { background: #ffffff; height: 100%; }
.hsa-split-unserved { background: #4a4a4a; height: 100%; }
.hsa-ward-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.hsa-ward-row:last-child { border-bottom: none; }
.hsa-ward-label { font-weight: 700; color: var(--red); min-width: 48px; }
.hsa-ward-pop   { color: var(--text-muted); }
.hsa-ward-pov   { color: #b07010; font-weight: 600; }

/* ============================================================
   SCHOOL POPUP
   ============================================================ */
#popup {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-left: 4px solid var(--gold) !important;
  border-radius: 9px !important;
  font-family: 'Times New Roman', Times, serif !important;
  font-size: 12.5px !important;
  line-height: 1.6 !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
  min-width: 220px !important;
  padding: 12px 14px !important;
}

#popup strong {
  color: var(--green-dark);
  font-weight: 600;
}

/* ============================================================
   MAIN TABS — scrollable on narrow panels
   ============================================================ */
.tabs {
  overflow-x: auto;
  flex-wrap: nowrap;        /* override the wrap — scroll instead */
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;    /* leave room for scrollbar */
}
.tabs::-webkit-scrollbar { height: 3px; }
.tabs::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

/* ============================================================
   LOADING BAR
   ============================================================ */
@keyframes loadingSlide {
  0%   { transform: translateX(-100%); width: 60%; }
  50%  { transform: translateX(70%);  width: 60%; }
  100% { transform: translateX(200%); width: 60%; }
}
#loading-bar-fill {
  height: 3px;
  width: 60%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  animation: loadingSlide 1.4s ease-in-out infinite;
}

/* ============================================================
   ERROR TOAST
   ============================================================ */
#error-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--red);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Times New Roman', Times, serif;
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
  max-width: 320px;
  line-height: 1.5;
  border-left: 4px solid #e8a48f;
}

/* ============================================================
   PRINT BUTTON BAR
   ============================================================ */
.print-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 10px;
  margin-top: -10px;
}
.print-btn {
  font-size: 11px;
  font-family: 'Times New Roman', Times, serif;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: border-color .15s, color .15s;
}
.print-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ============================================================
   ABOUT US PANEL
   ============================================================ */
.about-org-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, var(--green-dark) 0%, #0b2e21 100%);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.about-org-emblem {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.about-org-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.about-org-desc {
  font-size: 12.5px;
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
}
.about-mvvc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.about-mvvc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px 16px;
  border-top: 3px solid var(--border);
  box-shadow: 0 1px 6px rgba(13,27,42,0.06);
}
.about-mvvc-card.mission { border-top-color: var(--green-mid); }
.about-mvvc-card.vision  { border-top-color: #234d8c; }
.about-mvvc-card.values  { border-top-color: var(--gold); }
.about-mvvc-card.commitment { border-top-color: var(--terracotta); }
.about-mvvc-icon {
  font-size: 18px;
  margin-bottom: 7px;
  line-height: 1;
}
.about-mvvc-label {
  font-family: 'Times New Roman', Times, serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.about-mvvc-card p {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
}
.about-section-heading {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--green-dark);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
  margin: 22px 0 14px;
  letter-spacing: 0.02em;
}
.about-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
.about-feature-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
}
.about-feature-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.about-feature-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 4px;
}
.about-feature-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.55;
}
.about-steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}
.about-steps li {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
}
.about-steps li strong { color: var(--green-dark); }
.about-steps li em { color: var(--text-muted); font-style: italic; }
.about-sources-grid {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 6px;
}
.about-source-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.55;
}
.about-source-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.about-source-dot.pop  { background: #1a6e3c; }
.about-source-dot.hlth { background: #b07010; }
.about-source-dot.rds  { background: #5c5347; }
.about-source-dot.wtr  { background: var(--teal); }
.about-source-dot.edu  { background: #2c2b26; }
.about-source-dot.dip  { background: var(--terracotta); }
.about-source-dot.bnd  { background: #234d8c; }
.about-footer-note {
  margin: 24px 0 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
  font-style: italic;
}

/* Map snapshot embedded into the printed/downloaded report — hidden on
   screen, only ever shown inside @media print below. */
.print-map-block { display: none; }

/* Full, formal multi-sector report (cover page + numbered sections),
   built fresh for every download — hidden on screen, only ever shown
   inside @media print below for the Overview tab's full-report download. */
.print-report-root { display: none; }

/* ============================================================
   PRINT STYLES — replaces the live map with a static snapshot,
   plus the analytics for the relevant report
   ============================================================ */
@media print {
  /* Chrome strips background-color/background-image from every element when
     printing unless told otherwise (it's the "Background graphics" checkbox
     in the print dialog, off by default) — without this, every colour-coded
     legend swatch, KPI status tag, donut-legend dot and benchmark bar in
     this app (all plain CSS backgrounds, not images) prints as blank white,
     since that's exactly what those rely on to show colour. */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { height: auto !important; overflow: visible !important; background: #fff; }
  /* .app-container is the single-page-app shell — height:100vh + overflow:hidden
     on screen, which was clipping every page after the first one since only
     .app-container's display was reset here before, not its height/overflow. */
  .app-container { display: block !important; height: auto !important; overflow: visible !important; }
  .left-panel    { display: none !important; }
  .right-panel   {
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
    flex: none !important;
    padding: 0 !important;
  }
  .tabs, .sub-tabs, .year-toggle, .print-bar, .legend,
  #loading-bar, #error-toast, .tab-hero-meta { display: none !important; }

  /* Static map snapshot, captured at the moment of download — sits right
     under the print header, relevant to whichever report is downloading
     (overview choropleth for the full report, that tab's map otherwise). */
  .print-map-block {
    display: block !important;
    margin-bottom: 18px;
    break-inside: avoid;
  }
  .print-map-item {
    margin-bottom: 14px;
    break-inside: avoid;
  }
  .print-map-caption {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
  }
  .print-map-image {
    display: block;
    width: 100%;
    max-height: 340px;
    object-fit: contain;
    background: #f4f1e8;
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  /* Legend copied alongside its map snapshot — same look as the on-screen
     .legend card, but under a different class so the blanket .legend
     { display:none } print rule above doesn't hide it too. */
  .print-legend-copy {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 6px;
  }
  .print-legend-copy h4 {
    font-family: 'Times New Roman', Times, serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--green-dark);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
  }

  /* Overview download = full report: it is built entirely from
     #print-report-root (cover page + numbered sections below), which
     already contains a copy of each section's narrative — so the live
     tab divs and the bunched-up print-map-block must stay hidden to
     avoid printing everything twice. Any other tab = partial download:
     leave the existing inline display:none/block from switchTab() alone,
     so only the section the user was viewing prints. */
  .right-panel[data-print-scope="full"] #overview-content,
  .right-panel[data-print-scope="full"] #demography-content,
  .right-panel[data-print-scope="full"] #welfare-content,
  .right-panel[data-print-scope="full"] #health-content,
  .right-panel[data-print-scope="full"] #roads-content,
  .right-panel[data-print-scope="full"] #water-content,
  .right-panel[data-print-scope="full"] #education-content,
  .right-panel[data-print-scope="full"] #diptanks-content,
  .right-panel[data-print-scope="full"] #tab-ai,
  .right-panel[data-print-scope="full"] .print-map-block {
    display: none !important;
  }
  .right-panel[data-print-scope="full"]::before { display: none !important; }
  .right-panel[data-print-scope="full"] #print-report-root { display: block !important; }

  /* ---- Full report layout: cover page, table of contents, numbered
     sections, figure captions, Key Observations / Recommendations /
     Data Sources — styled to resemble a printed constituency profile
     document rather than the on-screen KPI-card view. ---- */
  .print-report-root {
    font-family: 'Times New Roman', Times, serif;
    color: #000;
  }
  .print-cover-page {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    page-break-after: always;
    break-after: page;
  }
  .print-cover-eyebrow {
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 26px;
  }
  .print-cover-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 10px;
  }
  .print-cover-subtitle {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #000;
    margin-bottom: 34px;
  }
  .print-cover-date {
    font-size: 12px;
    color: var(--text-muted);
  }
  .print-toc {
    page-break-after: always;
    break-after: page;
  }
  .print-toc h2 {
    font-size: 18px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 6px;
    margin-bottom: 14px;
    color: var(--green-dark);
  }
  .print-toc ol {
    padding-left: 22px;
    line-height: 1.9;
    font-size: 13px;
  }
  .print-section {
    margin-bottom: 22px;
  }
  .print-section-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--green-dark);
    background: #f4f1e8;
    padding: 6px 10px;
    border-left: 4px solid var(--gold);
    margin-bottom: 12px;
    break-after: avoid;
  }
  .print-section-body { margin-bottom: 10px; }
  .print-figure {
    margin: 14px 0 18px;
    break-inside: avoid;
  }
  .print-figure-caption {
    font-size: 11px;
    font-weight: 700;
    margin-top: 6px;
    color: #000;
  }
  .print-chart-image { display: block !important; }
  .chart-wrap-140, .chart-wrap-180, .chart-wrap-220, .chart-wrap-260 {
    break-inside: avoid;
  }
  .print-observations li,
  .print-recommendations li {
    margin-bottom: 8px;
    font-size: 12.5px;
    line-height: 1.5;
  }
  .print-data-sources li {
    margin-bottom: 6px;
    font-size: 12.5px;
  }

  /* Keep KPI cards side-by-side on paper */
  .kpi-overview-grid { grid-template-columns: repeat(3,1fr) !important; }
  .kpi-big-card { break-inside: avoid; }
  .insight-box  { break-inside: avoid; color: #000 !important; background: #f0f0f0 !important; border-left-color: #999 !important; }
  .insight-list li { color: #333 !important; }

  /* Print header injected via ::before on the right-panel */
  .right-panel::before {
    content: 'Constituency Profile Monitoring Tool — ' attr(data-print-title);
    display: block;
    font-family: 'Times New Roman', Times, serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--green-dark);
    border-bottom: 2px solid var(--gold);
    padding-bottom: 8px;
    margin-bottom: 16px;
  }
}