:root {
  --color-wind: #38BDF8;
  --color-solar: #FBBF24;
  --color-battery: #A78BFA;
  --color-pumped-hydro: #34D399;
  --color-primary: #3B82F6;
  --color-primary-hover: #2563EB;
  --color-text: #E2E8F0;
  --color-text-muted: #94A3B8;
  --color-text-dim: #64748B;
  --color-surface: #1E293B;
  --color-surface-dark: #0F172A;
  --color-border: rgba(51, 65, 85, 0.6);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ── Reset & Base ────────────────────────────────────────────── */
html, body {
  height: 100%;
  min-height: 100%;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #111827;
  color: #E2E8F0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Toolbar (2-row glassmorphism bar) ───────────────────────── */
.toolbar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: rgba(30, 41, 59, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.toolbar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 20px;
}
.toolbar-row-1 {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.35);
}
.toolbar-row-2 {
  padding-top: 6px;
}

/* Vertical separator between groups */
.toolbar-sep {
  width: 1px;
  height: 22px;
  background: rgba(100, 116, 139, 0.35);
  border-radius: 1px;
  flex-shrink: 0;
}

/* Flexible spacer pushes trailing items right */
.toolbar-spacer {
  flex: 1;
}

/* EMD-320 — Progressive disclosure filter toggle */
.filter-toggle-btn {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(59, 130, 246, 0.1);
  color: #94A3B8;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: background 150ms ease, color 150ms ease;
}
.filter-toggle-btn:hover { background: rgba(59, 130, 246, 0.2); color: #E2E8F0; }
.filter-toggle-btn[aria-expanded="true"] { background: rgba(59, 130, 246, 0.2); color: #E2E8F0; }
.toolbar-filters { display: contents; }
.toolbar-filters.hidden { display: none; }

/* Group wrapper (label + controls) */
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 7px;
}
.toolbar-group-label {
  font-size: 9px;
  font-weight: 600;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ── Title ───────────────────────────────────────────────────── */
.toolbar-title {
  flex-shrink: 0;
}
.toolbar h1 {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.toolbar .sub {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 1px;
}

/* ── Toolbar link (Energy map) ───────────────────────────────── */
.toolbar a {
  color: #60A5FA;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 200ms ease, color 200ms ease;
}
.toolbar a:hover {
  background: rgba(96, 165, 250, 0.1);
  color: #93C5FD;
}

/* ── Button toggles (shared) ────────────────────────────────── */
.tech-toggle { display: flex; gap: 5px; }
.mode-toggle { display: flex; gap: 4px; }
.level-toggle { display: flex; gap: 4px; flex-wrap: wrap; }
.metric-toggle { display: flex; gap: 4px; flex-wrap: wrap; }
.chart-mode-toggle { display: flex; gap: 4px; }

.level-btn, .metric-btn, .chart-mode-btn {
  padding: 5px 11px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid rgba(71, 85, 105, 0.7);
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}
.level-btn:hover, .metric-btn:hover, .chart-mode-btn:hover {
  border-color: #64748B;
  color: #CBD5E1;
  background: rgba(51, 65, 85, 0.3);
}
.level-btn:focus-visible, .metric-btn:focus-visible, .chart-mode-btn:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 1px;
}
.level-btn.active, .metric-btn.active, .chart-mode-btn.active {
  border-color: #3B82F6;
  background: rgba(59, 130, 246, 0.15);
  color: #F8FAFC;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.mode-btn {
  padding: 5px 11px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid rgba(71, 85, 105, 0.7);
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}
.mode-btn:hover {
  border-color: #64748B;
  color: #CBD5E1;
  background: rgba(51, 65, 85, 0.3);
}
.mode-btn:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 1px;
}
.mode-btn.active {
  border-color: #3B82F6;
  background: rgba(59, 130, 246, 0.15);
  color: #F8FAFC;
  font-weight: 600;
}

/* EMD-130 — Copy share link button */
#emd-copy-link { padding: 5px 10px; font-size: 11px; }
#emd-copy-link.emd-copied {
  background: rgba(6, 78, 59, 0.6);
  color: #D1FAE5;
  border-color: #10B981;
}

/* ── Tech pills (colored) ───────────────────────────────────── */
.tech-btn {
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.7);
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  transition: all 200ms ease;
  white-space: nowrap;
}
.tech-btn:hover {
  border-color: #64748B;
  color: #CBD5E1;
  background: rgba(51, 65, 85, 0.3);
}
.tech-btn:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 1px;
}
.tech-btn.active { border-color: transparent; color: #0F172A; font-weight: 600; }
.tech-btn[data-tech="wind"].active { background: var(--color-wind); box-shadow: 0 0 8px rgba(56, 189, 248, 0.3); }
.tech-btn[data-tech="solar"].active { background: var(--color-solar); color: #422006; box-shadow: 0 0 8px rgba(251, 191, 36, 0.3); }
.tech-btn[data-tech="battery"].active { background: var(--color-battery); color: #1E1B4B; box-shadow: 0 0 8px rgba(167, 139, 250, 0.3); }
.tech-btn[data-tech="pumped_hydro"].active { background: var(--color-pumped-hydro); color: #052E16; box-shadow: 0 0 8px rgba(52, 211, 153, 0.3); }

/* ── Month controls (slider + play) ─────────────────────────── */
.month-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
}
#month-slider {
  flex: 1;
  min-width: 120px;
  accent-color: #3B82F6;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
#month-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #1E293B 0%, #334155 40%, #3B82F6 100%);
  border: 1px solid rgba(51, 65, 85, 0.5);
}
#month-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #1E293B 0%, #334155 40%, #3B82F6 100%);
  border: 1px solid rgba(51, 65, 85, 0.5);
}
#month-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3B82F6;
  border: 2px solid #F8FAFC;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  margin-top: -6px;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
#month-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3B82F6;
  border: 2px solid #F8FAFC;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: box-shadow 200ms ease, transform 200ms ease;
}
#month-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 1px 4px rgba(0, 0, 0, 0.35);
  transform: scale(1.1);
}
#month-slider::-moz-range-thumb:hover {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 1px 4px rgba(0, 0, 0, 0.35);
  transform: scale(1.1);
}
#month-label {
  font-size: 13px;
  font-weight: 600;
  min-width: 72px;
  text-align: center;
  color: #E2E8F0;
}
.play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
.play-btn:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
  transform: scale(1.05);
}
.play-btn:active {
  transform: scale(0.97);
}

/* ── Main layout ─────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}
#map-wrap {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
#map {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 320px;
  position: relative;
}

/* ── Panel (right sidebar) ───────────────────────────────────── */
.panel {
  flex: 0 0 auto;
  width: clamp(320px, 38vw, 520px);
  display: flex;
  flex-direction: column;
  background: #1A2332;
  border-left: 1px solid rgba(51, 65, 85, 0.5);
  align-self: stretch;
  min-height: 0;
}
.panel-head {
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.panel-head h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.panel-head p {
  font-size: 11px;
  color: #94A3B8;
  line-height: 1.45;
}
.new-stat {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 10px;
}
.new-stat strong { color: #F8FAFC; }

/* ── Stats cards (with hover lift) ───────────────────────────── */
.stats-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.stat {
  flex: 1;
  min-width: 80px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(71, 85, 105, 0.7);
}
.stat .lbl {
  font-size: 10px;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat .val {
  font-size: 18px;
  font-weight: 700;
  margin-top: 3px;
}
.stat.wind .val { color: #38BDF8; }
.stat.solar .val { color: #FBBF24; }
.stat.battery .val { color: #A78BFA; }
.stat.pumped_hydro .val { color: #34D399; }
.stat .stat-sub {
  font-size: 9px;
  color: #94A3B8;
  margin-top: 4px;
  line-height: 1.35;
  font-weight: 400;
}
.stat .lbl .state-tag {
  display: block;
  font-size: 8px;
  color: #64748B;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 1px;
}

/* ── Map legend (frosted glass) ──────────────────────────────── */
.map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 10px;
  color: #CBD5E1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.map-legend .row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.map-legend .row.hidden { display: none; }
.map-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-legend .dot.new { box-shadow: 0 0 0 2px #F8FAFC; }

/* ── Colorbar (frosted glass) ────────────────────────────────── */
.colorbar-wrap {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 10px;
  color: #CBD5E1;
  min-width: 120px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.colorbar-wrap.hidden { display: none; }
.colorbar-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 10px;
}
.colorbar-gradient {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(to right, #304060, #38BDF8);
  border: 1px solid rgba(71, 85, 105, 0.5);
}
.colorbar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 9px;
  color: #94A3B8;
}

/* ── Hover tooltip ───────────────────────────────────────────── */
.map-hover-tip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 10px;
  color: #E2E8F0;
  min-width: 168px;
  max-width: 240px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.map-hover-tip.hidden { display: none; }
.map-hover-title {
  font-weight: 600;
  font-size: 11px;
  margin-bottom: 6px;
  color: #F8FAFC;
}
.map-hover-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.map-hover-table th {
  text-align: left;
  color: #94A3B8;
  font-weight: 500;
  padding: 2px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.map-hover-table th:last-child, .map-hover-table td:last-child { text-align: right; }
.map-hover-table td { padding: 3px 0; vertical-align: middle; }
.map-hover-table tr.total td {
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  padding-top: 5px;
  font-weight: 600;
  color: #F8FAFC;
}
.map-hover-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.map-hover-sub { font-size: 9px; color: #94A3B8; padding-left: 14px; }
.map-hover-foot { margin-top: 6px; font-size: 9px; color: #94A3B8; }
.map-hover-gen {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}
.map-hover-gen.hidden { display: none; }
.map-hover-gen canvas { display: block; }
.map-hover-gen-cap { margin-top: 3px; font-size: 9px; color: #94A3B8; }

/* ── Country switcher (dropdown) ─────────────────────────────── */
.country-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.country-switch-label {
  font-size: 9px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#country-switcher {
  font-size: 12px;
  padding: 4px 8px;
  background: rgba(15, 23, 42, 0.6);
  color: #E2E8F0;
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
#country-switcher:hover {
  border-color: #64748B;
}
#country-switcher:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 1px;
}
#country-switcher option[disabled] { color: #64748B; }

/* EMD-155 — custom country dropdown */
.country-dd { position: relative; display: inline-block; }
.country-dd-btn {
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.6);
  color: #E2E8F0;
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.country-dd-btn:hover { border-color: #64748B; }
.country-dd-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.country-dd-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  margin: 0;
  padding: 4px;
  list-style: none;
  min-width: 250px;
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.country-dd-list.hidden { display: none; }
.country-dd-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #E2E8F0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease;
}
.country-dd-option:hover, .country-dd-option.active, .country-dd-option:focus {
  background: rgba(59, 130, 246, 0.15);
  outline: none;
}
.country-dd-option[aria-selected="true"] .country-dd-name { color: #93C5FD; }
.country-dd-option.pending { color: #64748B; cursor: default; }
.country-dd-option.pending .country-dd-name { color: #64748B; }

/* Tier chips */
.tier-chip {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.tier-chip.tier-registry { color: #34D399; border-color: #34D399; background: rgba(52, 211, 153, 0.12); }
.tier-chip.tier-aggregate { color: #FBBF24; border-color: #FBBF24; background: rgba(251, 191, 36, 0.12); }
.tier-chip.tier-synthetic { color: #94A3B8; border-color: #64748B; background: rgba(100, 116, 139, 0.18); }

/* Country dropdown info panel */
.country-dd-info {
  position: absolute;
  top: calc(100% + 4px);
  left: 262px;
  z-index: 31;
  width: 290px;
  max-width: 60vw;
  padding: 10px 12px;
  font-size: 10px;
  color: #E2E8F0;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  line-height: 1.5;
}
.country-dd-info.hidden { display: none; }
.country-dd-info-title {
  font-weight: 600;
  font-size: 11px;
  color: #F8FAFC;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.country-dd-info-line { color: #CBD5E1; }

/* ── Operator badge + panel ──────────────────────────────────── */
.operator-badge {
  font-size: 11px;
  color: #93C5FD;
  background: rgba(30, 58, 95, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.operator-badge:hover {
  background: rgba(30, 58, 95, 0.9);
  border-color: #3B82F6;
}
.operator-badge.hidden { display: none; }
.operator-panel { margin-top: 12px; }
.operator-panel.hidden { display: none; }
.operator-panel h3 {
  font-size: 11px;
  color: #94A3B8;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.operator-panel .operator-scope {
  font-size: 10px;
  font-weight: 400;
  color: #64748B;
  text-transform: none;
  letter-spacing: 0;
}
.operator-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}
.operator-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(15, 23, 42, 0.5);
  color: #CBD5E1;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}
.operator-row:hover {
  border-color: #475569;
  background: rgba(30, 41, 59, 0.6);
}
.operator-row.active {
  border-color: #3B82F6;
  background: rgba(59, 130, 246, 0.12);
}
.operator-mw { color: #94A3B8; white-space: nowrap; }
.operator-empty { font-size: 10px; color: #64748B; padding: 4px 0; }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 4px;
  line-height: 1.5;
}
.breadcrumb a {
  color: #60A5FA;
  cursor: pointer;
  text-decoration: none;
  transition: color 200ms ease;
}
.breadcrumb a:hover { color: #93C5FD; text-decoration: underline; }
.breadcrumb .crumb-sep { margin: 0 5px; color: #475569; }
.breadcrumb .crumb-kind {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748B;
  margin-right: 4px;
}
.breadcrumb .crumb-name { color: #CBD5E1; }

/* ── Map status overlay ──────────────────────────────────────── */
.map-status {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  color: #CBD5E1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.map-status.error { border-color: #F87171; color: #FCA5A5; }
.map-status.hidden { display: none; }

/* ── BESS / pumpspeicher notes ───────────────────────────────── */
.bess-pumpspeicher-note { margin: 8px 0; font-size: 9px; line-height: 1.45; }
.bess-pumpspeicher-note p { margin: 0 0 6px; }
.bess-info-table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 9px; }
.bess-info-table th, .bess-info-table td {
  text-align: left;
  padding: 3px 6px 3px 0;
  vertical-align: top;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.bess-info-table th { color: #64748B; font-weight: 500; }
.bess-info-summary { color: #94A3B8; }

/* ── Pipeline & lifecycle panels ─────────────────────────────── */
.pipeline-subtitle {
  font-size: 10px;
  color: #94A3B8;
  margin-top: 10px;
  line-height: 1.35;
}
.lifecycle-panel {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 10px;
  font-size: 10px;
  color: #94A3B8;
  line-height: 1.4;
}
.lifecycle-panel strong { color: #E2E8F0; font-weight: 600; }
.lifecycle-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 9px; }
.lifecycle-table th {
  text-align: left;
  color: #64748B;
  font-weight: 500;
  padding: 2px 4px 4px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.lifecycle-table td { padding: 3px 4px 3px 0; vertical-align: top; }
.lifecycle-table .yes { color: #34D399; }
.lifecycle-table .no { color: #64748B; }

.pipeline-panel { margin-top: 12px; }
.pipeline-panel h3 {
  font-size: 10px;
  font-weight: 600;
  color: #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.pipeline-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.pipeline-table th {
  text-align: right;
  color: #64748B;
  font-weight: 500;
  padding: 3px 6px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.pipeline-table th:first-child { text-align: left; }
.pipeline-table td {
  text-align: right;
  padding: 4px 6px;
  color: #CBD5E1;
  border-bottom: 1px solid rgba(26, 35, 50, 0.6);
}
.pipeline-table td:first-child { text-align: left; color: #94A3B8; }
.pipeline-table tr:last-child td { border-bottom: none; }
.pipeline-note {
  font-size: 9px;
  color: #94A3B8;
  margin-top: 6px;
  line-height: 1.35;
}

/* ── Detail links + sources ──────────────────────────────────── */
.panel-detail-source { display: none; }
.panel-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 12px;
}
.detail-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 10px;
  color: #64748B;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 200ms ease;
}
.detail-link-btn:hover { color: #CBD5E1; }

/* ── Region tag ──────────────────────────────────────────────── */
.region-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(51, 65, 85, 0.5);
  font-size: 11px;
  color: #E2E8F0;
}
.region-tag.empty { display: none; }

/* EMD-291 — region drill-down action + aggregate-only message */
.region-actions {
  margin-top: 8px;
  display: none;
  font-size: 11px;
  line-height: 1.5;
}
.region-actions.visible { display: block; }
.region-actions .view-assets-btn {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  background: #1E40AF;
  color: #E2E8F0;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: background 200ms ease, box-shadow 200ms ease;
}
.region-actions .view-assets-btn:hover {
  background: #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.region-actions .aggregate-note {
  font-size: 10px;
  color: #94A3B8;
  margin-top: 4px;
}

/* ── Chart area ──────────────────────────────────────────────── */
.chart-wrap {
  flex: 1;
  min-height: 0;
  padding: 10px 14px 14px;
  position: relative;
}
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ── Modal ───────────────────────────────────────────────────── */
.growth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.growth-modal.hidden { display: none; }
.growth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.growth-modal-box {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(85vh, 720px);
  overflow: auto;
  background: #1A2332;
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.growth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.growth-modal-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #E2E8F0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.35;
}
.growth-modal-close {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color 200ms ease;
}
.growth-modal-close:hover { color: #E2E8F0; }
.growth-modal-body {
  padding: 14px 16px 16px;
  font-size: 10px;
  color: #94A3B8;
}
.growth-modal-body .lifecycle-panel,
.growth-modal-body .pipeline-panel { margin-top: 0; }
.growth-modal-body .lifecycle-table,
.growth-modal-body .pipeline-table { font-size: 10px; }

/* ── Footer ──────────────────────────────────────────────────── */
.foot {
  padding: 8px 20px;
  font-size: 10px;
  color: #64748B;
}

/* ── EMD-185 — country availability hover tooltip ────────────── */
.country-hover-tip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 10px;
  color: #E2E8F0;
  max-width: 260px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  line-height: 1.45;
}
.country-hover-tip.hidden { display: none; }
.country-hover-tip-title {
  font-weight: 600;
  font-size: 11px;
  color: #F8FAFC;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.country-hover-tip-line { color: #CBD5E1; margin-top: 2px; font-size: 9px; }
.country-hover-tip-foot {
  margin-top: 5px;
  font-size: 9px;
  color: #64748B;
  border-top: 1px solid rgba(51, 65, 85, 0.4);
  padding-top: 4px;
}

/* ── EMD-287 — Asset search & filter ─────────────────────────── */
.asset-search { display: inline-flex; align-items: center; }
.search-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(71, 85, 105, 0.7);
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
}
.search-toggle:hover {
  border-color: #3B82F6;
  color: #F8FAFC;
  background: rgba(59, 130, 246, 0.1);
}
.search-panel {
  display: flex;
  gap: 0;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 8px;
  position: relative;
  transition: border-color 200ms ease;
}
.search-panel:focus-within {
  border-color: #3B82F6;
}
.search-panel.hidden { display: none; }
#search-input {
  width: 240px;
  background: transparent;
  color: #E2E8F0;
  border: none;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}
#search-input::placeholder { color: #64748B; }
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 320px;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-top: none;
  border-radius: 0 0 10px 10px;
  list-style: none;
  padding: 4px;
  margin: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.search-results.hidden { display: none; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  color: #CBD5E1;
  transition: background 150ms ease;
}
.search-result-item:hover, .search-result-item.active {
  background: rgba(59, 130, 246, 0.15);
}
.search-result-type {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.search-result-name { font-weight: 500; color: #F8FAFC; }
.search-result-detail { font-size: 10px; color: #64748B; }
.search-no-results {
  padding: 8px 10px;
  font-size: 11px;
  color: #64748B;
  font-style: italic;
}
@keyframes searchPulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* EMD-316 — Responsive layout */
@media (max-width: 1024px) {
  .panel { width: clamp(280px, 34vw, 400px); }
}
@media (max-width: 768px) {
  .main { flex-direction: column; }
  .panel {
    width: 100%;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    overflow-y: auto;
  }
  .toolbar-row-2 { overflow-x: auto; flex-wrap: nowrap; gap: 8px; }
  .toolbar-row-2::-webkit-scrollbar { height: 3px; }
  .toolbar-row-2::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 2px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  #month-slider { min-width: 120px; }
  input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; }
  input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; }
}
@media (max-width: 480px) {
  .toolbar { padding: 8px 12px; }
  .toolbar h1 { font-size: 13px; }
  .toolbar .sub { display: none; }
  .toolbar-group-label { display: none; }
  .month-controls { min-width: 160px; }
}

/* EMD-296 — Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
