:root {
  --bg: #0b0e14;
  --panel: #11141c;
  --panel-alt: #0f121a;
  --nav: #080a0f;
  --border: #232730;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --accent: #6366f1;
  --accent-2: #06b6d4;
  --accent-3: #a855f7;
  --danger: #ef4444;
  --gold: #eab308;
  --shadow: 0 14px 40px rgba(0,0,0,0.35);
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --font: "Public Sans","Inter var","Space Grotesk","Segoe UI",system-ui,-apple-system,sans-serif;
  --sidebar-width-collapsed: 90px;
  --sidebar-width-open: 218px;
  --sidebar-width: var(--sidebar-width-collapsed);
  --side-panel-width: 360px;
  --side-panel-current-width: var(--side-panel-width);
  --detail-panel-width: calc(var(--sidebar-width-collapsed) + var(--side-panel-width));
  --detail-panel-current-width: var(--detail-panel-width);
  --panel-toggle-width: 5px;
  --left-panel-map-gutter: 18px;
  --right-panel-map-gutter: 16px;
  --panel-toggle-away-center: 2px;
  --panel-toggle-inset-left: calc((var(--left-panel-map-gutter) - var(--panel-toggle-width)) / 2 + var(--panel-toggle-away-center));
  --panel-toggle-inset-right: calc((var(--right-panel-map-gutter) - var(--panel-toggle-width)) / 2 + var(--panel-toggle-away-center));
  --panel-toggle-center-adjust: 12px;
  --topbar-height: 68px;
  --topbar-control-height: 40px;
  --topbar-pill-bg: rgba(12,19,36,0.92);
  --topbar-pill-border: rgba(148,163,184,0.25);
  --topbar-pill-shadow: 0 12px 28px rgba(2,6,23,0.5), inset 0 0 0 1px rgba(17,24,39,0.45);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: calc(100% - var(--topbar-height));
  font-family: var(--font);
  background: var(--bg); color: var(--text);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

.sidebar {
  position: absolute;
  left: 0;
  top: var(--topbar-height);
  bottom: 0;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: calc(100% - var(--topbar-height));
  background: linear-gradient(180deg, rgba(10,13,19,0.95) 0%, rgba(9,12,18,0.95) 100%);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.02), var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: width 0.35s ease, min-width 0.35s ease, box-shadow 0.25s ease, background 0.25s ease;
  z-index: 5;
}

.sidebar:hover { background: linear-gradient(180deg, rgba(7,9,13,0.98) 0%, rgba(6,8,12,0.96) 100%); }
.sidebar.is-open {
  overflow: visible;
}
.sidebar.layout-open {
  width: var(--sidebar-width-open);
  min-width: var(--sidebar-width-open);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav.view-nav {
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-item[data-type="demographics"] { --icon-color: #7c3aed; --icon-color-hi: #a855f7; }
.sidebar-item[data-type="economics"] { --icon-color: #22c55e; --icon-color-hi: #4ade80; }
.sidebar-item[data-type="education"] { --icon-color: #3b82f6; --icon-color-hi: #60a5fa; }
.sidebar-item[data-type="environment"] { --icon-color: #15803d; --icon-color-hi: #22c55e; }
.sidebar-item[data-type="politics"] { --icon-color: #ef4444; --icon-color-hi: #f87171; }
.sidebar-item[data-type="redistricting"] { --icon-color: #f97316; --icon-color-hi: #fb923c; }

.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--icon-color, var(--muted));
  padding: 10px 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-align: left;
  min-height: 44px;
}

.sidebar-item .icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--icon-color, currentColor);
  font-size: 14px;
  font-weight: 800;
  margin-left: 0;
  margin-right: 0;
  transform: translateX(-4px);
  will-change: color;
}
.sidebar-item .icon svg {
  display: block;
  width: 40px;
  height: 40px;
}
.sidebar-item .icon img { width: 28px; height: 28px; display: block; object-fit: contain; }
.sidebar-item .label {
  opacity: 0;
  transform: none;
  transition: opacity 0.15s ease;
  font-weight: 800;
}
.sidebar.is-open .sidebar-item .label {
  opacity: 1;
  transform: none;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.sidebar-item[data-type]:hover { color: var(--icon-color-hi, var(--icon-color)); }
.sidebar-item.active {
  background: rgba(255,255,255,0.06);
  color: var(--icon-color-hi, var(--icon-color, var(--text)));
}
.sidebar-item.active .icon { color: var(--icon-color-hi, var(--icon-color)); }

.sidebar-item[data-type] .icon .ws-icon-sheen {
  opacity: 0;
  transition: opacity 160ms ease;
}

.sidebar-item[data-type] .icon svg.ws-icon-sheen-ready {
  isolation: isolate;
}

.sidebar-item[data-type] .icon .ws-icon-sheen-shape {
  mix-blend-mode: normal;
}

/* Show moving sheen only while icons are in their colored state:
   - expanded/hover-open sidebar: all data-type icons
   - condensed sidebar: active data-type icon only */
.sidebar.is-open .sidebar-item[data-type] .icon .ws-icon-sheen,
.sidebar:not(.is-open) .sidebar-item[data-type].active .icon .ws-icon-sheen {
  opacity: 1;
}

.sidebar-kicker { display:none;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 6px;
  font-weight: 700;
}
.sidebar-divider { display:none;
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 6px 4px;
  border-radius: 999px;
}
.sidebar:not(.is-open) .sidebar-kicker,
.sidebar:not(.is-open) .sidebar-divider { display:none;
  display: none;
}
.sidebar-spacer { flex: 1 1 auto; }

.sidebar-item { justify-content: flex-start; position: relative; }
.sidebar-item .label-wrap { display: flex; flex-direction: column; gap: 2px; transition: opacity 0.2s ease; pointer-events: none; }
.sidebar:not(.is-open) .sidebar-item .label-wrap { width: 0; opacity: 0; overflow: hidden; }
.sidebar.is-open .sidebar-item .label-wrap { width: auto; opacity: 1; }
.sidebar:not(.layout-open) .sidebar-item {
  justify-content: flex-start;
  gap: 0;
}
.sidebar:not(.layout-open) .sidebar-item .icon {
  margin-left: 0;
  margin-right: 0;
}
.sidebar:not(.layout-open) .sidebar-item .label-wrap {
  position: static;
  transform: none;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar.layout-open .sidebar-item .label-wrap {
  position: static;
  transform: none;
  width: auto;
  white-space: nowrap;
  pointer-events: auto;
}
 .sidebar.layout-open .sidebar-item .label {
  white-space: nowrap;
 }



.sidebar-item.ghost { background: transparent; border-color: transparent; }
.sidebar-item.ghost:hover { background: rgba(255,255,255,0.06); border-color: transparent; color: var(--text); }
.sidebar-item.ghost .label { opacity: 1; transform: none; }
.sidebar-nav.library-nav .sidebar-item .icon,
.sidebar-nav.footer-nav .sidebar-item .icon { background: transparent; }


.side-panel {
  position: absolute;
  left: calc(var(--sidebar-width) - 1px);
  pointer-events: auto;
  transition: left 0.35s ease, width 0.28s ease, min-width 0.28s ease, max-width 0.28s ease, padding 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  top: var(--topbar-height);
  bottom: 0;
  width: var(--side-panel-current-width);
  min-width: min(320px, var(--side-panel-current-width));
  max-width: var(--side-panel-current-width);
  height: calc(100% - var(--topbar-height));
  background: var(--panel);
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.02), var(--shadow);
  padding: 12px 18px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  z-index: 4;
}

.brand .title {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.section {
  background: rgba(11,14,20,0.9);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.section-title { font-weight: 800; letter-spacing: 0.01em; color: var(--text); font-size: 14px; }
.section-hint { color: var(--muted); font-size: 12px; letter-spacing: 0.01em; }

#typeSubtypes {
  margin: 8px 0 12px;
}
#statusLine {
  display: none;
}

/* Do not show transient dataset status card above the demographics list. */
#demogrStatus {
  display: none !important;
}


.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.control-grid .full { grid-column: 1 / -1; }

#colorLabControls {
  grid-template-columns: 1fr;
}
#colorLabControls .control,
#colorLabControls .control select,
#colorLabControls .control input,
#colorLabControls .ghost-btn {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.control label { color: var(--text); font-weight: 700; font-size: 13px; }
.control select, .control button {
  border: 1px solid rgba(255,255,255,0.08);
  background: #0b1018;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.control input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
}
.year-slider {
  --year-track-height: 8px;
  --year-thumb-size: 14px;
  --year-hit-height: 26px;
  --year-half-thumb: calc(var(--year-thumb-size) / 2);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 18px;
}
.year-slider input[type="range"] {
  width: 100%;
  margin: 0;
  padding: 0;
  height: var(--year-hit-height);
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  z-index: 2;
  cursor: grab;
}
.year-slider input[type="range"]:active {
  cursor: grabbing;
}
.year-slider input[type="range"]::-webkit-slider-runnable-track {
  height: var(--year-track-height);
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(15,23,42,0.75);
}
.year-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--year-thumb-size);
  height: var(--year-thumb-size);
  margin-top: calc((var(--year-track-height) - var(--year-thumb-size)) / 2);
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.55);
  background: #e2e8f0;
  box-shadow: 0 1px 4px rgba(2,6,23,0.45);
}
.year-slider input[type="range"]::-moz-range-track {
  height: var(--year-track-height);
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(15,23,42,0.75);
}
.year-slider input[type="range"]::-moz-range-thumb {
  width: var(--year-thumb-size);
  height: var(--year-thumb-size);
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.55);
  background: #e2e8f0;
  box-shadow: 0 1px 4px rgba(2,6,23,0.45);
}
.year-ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: calc((var(--year-hit-height) - var(--year-thumb-size)) / 2);
  min-height: var(--year-thumb-size);
  height: var(--year-thumb-size);
  overflow: visible;
  gap: 0;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
  pointer-events: none;
}
.year-tick {
  position: absolute;
  left: calc(var(--year-half-thumb) + (100% - var(--year-thumb-size)) * var(--year-pos-ratio, 0));
  top: 0;
  height: var(--year-thumb-size);
  transform: translateX(-50%);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 16px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  appearance: none;
  cursor: default;
  pointer-events: none;
}
.year-tick-dot {
  width: 2px;
  height: 2px;
  border-radius: 999px;
  background: rgba(203,213,225,0.75);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.year-tick-label {
  position: absolute;
  top: calc(var(--year-thumb-size) + 2px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  line-height: 1;
  pointer-events: none;
}
.year-tick.major .year-tick-label {
  opacity: 0.88;
}
.year-tick.edge-start .year-tick-label {
  left: 0;
  transform: none;
}
.year-tick.edge-end .year-tick-label {
  left: auto;
  right: 0;
  transform: none;
}
.year-ticks.year-dense .year-tick-label {
  font-size: 9px;
}
.year-tick.active .year-tick-dot {
  background: var(--text);
  transform: scale(1.35);
}
.year-tick.active .year-tick-label {
  color: var(--text);
  font-weight: 700;
}
.year-tick:focus-visible {
  outline: 1px solid rgba(56,189,248,0.75);
  outline-offset: 2px;
  border-radius: 6px;
}
.control button { cursor: pointer; transition: background 0.2s ease, border 0.2s ease, transform 0.1s ease; }
.control button:hover { background: #141a24; border-color: rgba(255,255,255,0.15); transform: translateY(-1px); }

.ghost-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border 0.15s ease, transform 0.1s ease;
}
.ghost-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); transform: translateY(-1px); }
.ghost-btn.is-on {
  background: rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.5);
  color: #ecfccb;
}
.ghost-small { padding: 6px 10px; font-size: 12px; border-radius: 10px; }

.segpill {
  position: relative;
  display: inline-flex;
  background: #0f192d;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
}
.segpill button {
  position: relative;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease;
}
.segpill button[aria-selected="true"] {
  color: var(--text);
}
.segpill button.geo-auto-pill {
  margin-left: 6px;
  padding-left: 14px;
  padding-right: 14px;
}
.segpill button.geo-auto-pill::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: rgba(148, 163, 184, 0.24);
}
.segpill button.geo-auto-pill[aria-selected="true"] {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.18);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.28);
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.42);
}
.segpill button.is-temporarily-unavailable {
  color: rgba(148, 163, 184, 0.86);
  opacity: 0.62;
  filter: saturate(0.55);
}
.segpill button:disabled {
  color: rgba(148, 163, 184, 0.82);
  opacity: 0.56;
  cursor: not-allowed;
}
.segpill .knob {
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: 80px;
  background: var(--knob-surface, rgba(148,163,184,0.3));
  border: 1px solid var(--knob-border, rgba(148,163,184,0.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 1px 8px rgba(2,6,23,0.3), 0 0 12px var(--knob-glow, rgba(148,163,184,0.24));
  border-radius: var(--radius-pill);
  transition: transform 0.2s ease, width 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  z-index: 0;
}
.segpill button { z-index: 1; }

.geo-float .segpill {
  background: var(--topbar-pill-bg);
  border: 1px solid var(--topbar-pill-border);
  box-shadow: var(--topbar-pill-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.geo-float .segpill button {
  font-size: 13px;
}


.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 12px;
}
.chip.export-preset {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.chip.export-preset.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.55);
  background: rgba(99,102,241,0.12);
}


.chip.candidate {
  border-color: var(--chip);
}
.chip.candidate .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--chip);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
.chip.candidate.active {
  box-shadow: 0 0 0 1px var(--chip), inset 0 1px 0 rgba(255,255,255,0.08);
}
.chip.candidate.inactive {
  opacity: 0.45;
}
.chip.candidate.absent:not(.active) {
  opacity: 0.25;
  filter: grayscale(0.4);
}
.mode-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
}
.mode-label {
  font-size: 11px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.mode-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 11px;
}
.slate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}
.slate-row .chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.slate-label {
  font-size: 11px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.chip.slate.active {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245,158,11,0.6);
}
.chip.slate.compare-a {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.6);
}
.chip.slate.compare-b {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.6);
}

.slate-rename {
  width: 120px;
  background: rgba(10,13,20,0.7);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12px;
}
.slate-count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted-2);
}


.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ef4444, #a855f7);
  font-weight: 800;
  font-size: 16px;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 800; font-size: 26px; color: var(--text); letter-spacing: 0.01em; }
.brand-sub { font-size: 11px; color: var(--muted-2); letter-spacing: 0.03em; text-transform: uppercase; }
.topbar-center { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: center; }
.topbar-right { gap: 12px; }
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); }
.toolbar-icon-btn,
.settings-btn {
  width: 40px;
  height: 40px;
  border-radius: 0;
  line-height: 0;
  color: var(--text);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.toolbar-icon-btn:hover,
.toolbar-icon-btn:focus-visible,
.settings-btn:hover,
.settings-btn:focus-visible {
  background: transparent;
  border: none;
  border-color: transparent;
  box-shadow: none;
}
.density3d-chip.is-on {
  color: #93c5fd;
}
.density3d-chip:disabled {
  opacity: 0.55;
  cursor: default;
}
.toolbar-icon-btn svg,
.toolbar-icon-btn .tabler-icon,
.settings-btn svg,
.settings-btn .tabler-icon {
  width: 24px;
  height: 24px;
  display: block;
}
.tabler-icon {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabler-icon.tabler-icon-filled,
.tabler-icon-settings-filled,
.tabler-icon-camera-filled {
  fill: currentColor;
  stroke: none;
}
.sidebar-item .icon .tabler-icon {
  width: 40px;
  height: 40px;
}
#settingsBtnSidebar .icon .tabler-icon {
  width: 24px;
  height: 24px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.geo-float { box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.3); }
.topbar-search { min-width: 280px; }
.topbar-search input { min-width: 180px; }
.topbar-status { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
  min-width: 0;
  justify-self: end;
  position: relative;
  z-index: 2;
}

.topbar .crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.topbar-status {
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.map-wrap { position: relative; flex: 1; }
#map { position: absolute; inset: 0; }
.map-load-glow {
  --map-load-accent: #2f7bff;
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--sidebar-width) + var(--side-panel-current-width));
  right: var(--detail-panel-current-width);
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  overflow: hidden;
  transition: opacity 0.28s ease, left 0.28s ease, right 0.28s ease;
}
.map-load-glow.is-active {
  opacity: 1;
}
.map-load-glow span {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--map-load-accent) 44%, transparent) 0%,
      color-mix(in srgb, var(--map-load-accent) 20%, transparent) 3%,
      transparent 18%,
      transparent 82%,
      color-mix(in srgb, var(--map-load-accent) 20%, transparent) 97%,
      color-mix(in srgb, var(--map-load-accent) 44%, transparent) 100%),
    linear-gradient(0deg,
      color-mix(in srgb, var(--map-load-accent) 48%, transparent) 0%,
      color-mix(in srgb, var(--map-load-accent) 22%, transparent) 3%,
      transparent 18%,
      transparent 82%,
      color-mix(in srgb, var(--map-load-accent) 22%, transparent) 97%,
      color-mix(in srgb, var(--map-load-accent) 48%, transparent) 100%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--map-load-accent) 48%, transparent),
    inset 0 0 38px color-mix(in srgb, var(--map-load-accent) 30%, transparent),
    inset 0 0 92px color-mix(in srgb, var(--map-load-accent) 18%, transparent);
  will-change: opacity;
  animation: mapLoadPulse 2.15s cubic-bezier(0.45, 0, 0.2, 1) infinite alternate;
}
.map-load-glow.is-slow span {
  animation-duration: 1.35s;
}
@keyframes mapLoadPulse {
  from {
    opacity: 0.48;
  }
  to {
    opacity: 1;
  }
}

body:not(.dev-tools-enabled) #colorLabPanel,
body:not(.dev-tools-enabled) .dev-config-actions {
  display: none !important;
}

.geo-float {
  position: static;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  max-width: 70vw;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.geo-float::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.geo-float .segpill button { font-size: 12px; }
.geo-float .segpill { min-width: max-content; }
.map-wrap > .geo-float {
  position: absolute;
  top: 12px;
  left: calc(var(--sidebar-width) + var(--side-panel-current-width) + var(--left-panel-map-gutter));
  z-index: 9;
  display: inline-flex;
  width: fit-content;
  max-width: calc(100vw - var(--detail-panel-current-width) - 24px - var(--left-panel-map-gutter));
  transition: left 0.28s ease, max-width 0.28s ease;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible;
}
.map-wrap > .geo-float .segpill {
  border-color: rgba(255,255,255,0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.hover-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(12,18,30,0.95);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
  z-index: 6;
}
.hover-tip-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}
.hover-tip-title {
  font-weight: 800;
  font-size: 13px;
}
.hover-tip-sub {
  color: var(--muted);
  font-size: 11px;
}
.hover-tip-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.hover-tip-line.primary {
  font-size: 14px;
  font-weight: 700;
}
.hover-tip-line.primary .label {
  color: var(--muted);
  font-weight: 600;
}
.hover-tip-line.muted {
  color: var(--muted);
  font-size: 11px;
}
.hover-tip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.hover-tip-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.hover-tip-bar-row {
  display: grid;
  grid-template-columns: 128px minmax(132px, 1fr) 52px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  min-width: 320px;
}
.hover-tip-bar-label {
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hover-tip-bar-wrap {
  position: relative;
  width: 100%;
  height: 16px;
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
}
.hover-tip-bar-fill {
  display: flex;
  align-items: center;
  min-width: 2px;
  height: 100%;
  border-radius: 6px;
  padding: 0 6px;
}
.hover-tip-bar-value {
  color: rgba(248, 250, 252, 0.92);
  font-size: 10px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hover-tip-bar-pct {
  color: #cbd5e1;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 44px;
}
.hover-tip-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.hover-tip-row .value {
  font-variant-numeric: tabular-nums;
}
.hover-tip .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.help-tip {
  position: fixed;
  z-index: 60;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.28);
  background: rgba(7,12,22,0.96);
  color: #dbe7f8;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 12px 26px rgba(2,6,23,0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.help-tip.show {
  opacity: 1;
  transform: translateY(0);
}

.legend-overlay {
  position: absolute;
  bottom: 16px;
  left: calc(var(--sidebar-width, 72px) + var(--side-panel-current-width, 360px) + 16px);
  background: rgba(12,18,30,0.92);
  backdrop-filter: blur(12px);
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.07);
  min-width: 180px;
  max-height: min(68vh, calc(100vh - var(--topbar-height) - 28px));
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 6;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
  transition: left 0.35s ease;
}
.legend-overlay .legend-shell {
  position: relative;
}
.legend-overlay .legend-content {
  padding-right: 20px;
}
.legend-overlay .legend-toggle-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.legend-overlay .legend-toggle-btn:hover,
.legend-overlay .legend-toggle-btn:focus-visible {
  background: rgba(255,255,255,0.08);
  color: #f8fafc;
  outline: none;
}
.legend-overlay.is-collapsed {
  min-width: 0;
  width: auto;
  max-height: none;
  overflow: hidden;
  padding: 8px;
}
.legend-overlay.is-collapsed .legend-content {
  display: none;
}
.legend-overlay.is-collapsed .legend-shell {
  width: 18px;
  height: 18px;
}
.legend-overlay.is-collapsed .legend-toggle-btn {
  position: static;
}
.legend-overlay .legend-title {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}
.legend-overlay .legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text);
}
.legend-overlay .legend-list {
  display: flex;
  flex-direction: column;
}
.legend-overlay .legend-list-scroll {
  max-height: min(42vh, 320px);
  overflow-y: auto;
  padding-right: 2px;
}
.legend-overlay .swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.2);
}
.legend-overlay .legend-ramp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.legend-overlay .legend-ramp-bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
}
.legend-overlay .legend-ramp-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.legend-overlay .legend-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.detail-panel {
  position: fixed;
  right: 0;
  top: var(--topbar-height);
  width: var(--detail-panel-current-width);
  max-width: var(--detail-panel-current-width);
  height: calc(100% - var(--topbar-height));
  background: linear-gradient(180deg, rgba(10,13,19,0.95) 0%, rgba(9,12,18,0.95) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 16px;
  overflow-y: auto;
  box-shadow: 0 14px 32px rgba(0,0,0,0.35);
  z-index: 8;
  transition: width 0.28s ease, max-width 0.28s ease, padding 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  container-type: inline-size;
}

.app-shell.left-panel-collapsed {
  --side-panel-current-width: 0px;
}

.app-shell.right-panel-collapsed {
  --detail-panel-current-width: 0px;
}

.app-shell.left-panel-collapsed .side-panel {
  min-width: 0;
  max-width: 0;
  padding: 0;
  border-right-color: transparent;
  box-shadow: none;
  overflow: hidden;
}

.app-shell.right-panel-collapsed .detail-panel {
  min-width: 0;
  max-width: 0;
  padding: 0;
  border-color: transparent;
  box-shadow: none;
  overflow: hidden;
}

.app-shell.left-panel-collapsed .side-panel > *,
.app-shell.right-panel-collapsed .detail-panel > * {
  opacity: 0;
  pointer-events: none;
}

.panel-edge-toggle {
  position: fixed;
  top: calc(
    var(--topbar-height)
    + ((100vh - var(--topbar-height)) / 2)
    + var(--panel-toggle-center-adjust)
  );
  transform: translateY(-50%);
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  margin: 0;
  min-width: 0;
  min-height: 0;
  width: var(--panel-toggle-width);
  height: 78px;
  border-radius: 999px;
  border: none;
  background: #2a3342;
  box-shadow: none;
  opacity: 0.9;
  cursor: pointer;
  z-index: 12;
  overflow: visible;
  transition: background 0.15s ease, opacity 0.15s ease, left 0.35s ease, right 0.28s ease;
}

.panel-edge-toggle:hover,
.panel-edge-toggle:focus-visible {
  background: #3a4558;
  opacity: 1;
  outline: none;
}

.panel-edge-toggle-left {
  left: calc(
    var(--sidebar-width)
    + var(--side-panel-current-width)
    - var(--panel-toggle-inset-left)
    - var(--panel-toggle-width)
  );
}

.panel-edge-toggle-right {
  right: calc(
    var(--detail-panel-current-width)
    - var(--panel-toggle-inset-right)
    - var(--panel-toggle-width)
  );
}

.app-shell.left-panel-collapsed .panel-edge-toggle-left {
  left: calc(
    var(--sidebar-width)
    + var(--panel-toggle-inset-left)
  );
}

.app-shell.left-panel-collapsed .panel-edge-toggle-left::before {
  content: "";
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: -16px;
  width: 16px;
  background: transparent;
}

.app-shell.right-panel-collapsed .panel-edge-toggle-right {
  right: var(--panel-toggle-inset-right);
}

.app-shell.right-panel-collapsed .panel-edge-toggle-right::before {
  content: "";
  position: absolute;
  top: -8px;
  bottom: -8px;
  right: -16px;
  width: 16px;
  background: transparent;
}

.corr-chart {
  position: relative;
  height: 180px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

.corr-chart canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#corrEmpty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.55);
  pointer-events: none;
}

.hover-insights-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}

.hover-insights-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hover-insights-title {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hover-insights-main-value {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f8fafc;
  line-height: 1.08;
}

.hover-insights-sub {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
}

.hover-insights-sub.muted {
  color: #7f8ea3;
}

.hover-insights-chart-wrap {
  height: 164px;
}

.hover-insights-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hover-insights-bench {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hover-insights-bench-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 88px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.hover-insights-bench-row .label {
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hover-insights-bench-row .track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.hover-insights-bench-row .track .fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.hover-insights-bench-row .value {
  text-align: right;
  color: #e2e8f0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hover-insights-bench-row.is-focus .label,
.hover-insights-bench-row.is-focus .value {
  color: #f8fafc;
}

.hover-insights-compare {
  display: grid;
  gap: 6px;
}

.hover-insights-compare-head {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hover-insights-compare-row,
.hover-insights-compare-delta-row {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) minmax(96px, 1.2fr) minmax(66px, auto);
  align-items: center;
  gap: 6px;
}

.hover-insights-compare-row .name,
.hover-insights-compare-delta-row .name {
  color: #e2e8f0;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hover-insights-compare-row .track {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.hover-insights-compare-row .track .fill {
  height: 100%;
  border-radius: inherit;
  display: block;
}

.hover-insights-compare-row .value {
  color: #f8fafc;
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hover-insights-compare-delta-row {
  grid-template-columns: minmax(84px, 1fr) minmax(112px, 1.2fr) minmax(66px, auto);
}

.hover-insights-compare-delta-row .delta-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.hover-insights-compare-delta-row .delta-midline {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(148, 163, 184, 0.7);
}

.hover-insights-compare-delta-row .delta-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  display: block;
}

.hover-insights-compare-delta-row .delta-fill.is-pos {
  background: rgba(34, 197, 94, 0.92);
}

.hover-insights-compare-delta-row .delta-fill.is-neg {
  background: rgba(248, 113, 113, 0.92);
}

.hover-insights-compare-delta-row .delta-fill.is-even {
  background: rgba(148, 163, 184, 0.75);
}

.hover-insights-compare-delta-row .delta-value {
  color: #cbd5e1;
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hover-insights-all-list,
.hover-insights-all-bench {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hover-insights-all-row {
  display: grid;
  grid-template-columns: minmax(96px, 1.2fr) minmax(0, 1.8fr) auto auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.hover-insights-all-row .name,
.hover-insights-all-bench-row .name {
  color: #d4deef;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hover-insights-all-row .track {
  height: 7px;
  border-radius: 999px;
  background: rgba(148,163,184,0.2);
  overflow: hidden;
}

.hover-insights-all-row .track .fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.hover-insights-all-row .value,
.hover-insights-all-bench-row .value {
  color: #e2e8f0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.hover-insights-all-row .meta,
.hover-insights-all-bench-row .meta {
  color: #93a7c1;
  font-size: 10px;
  white-space: nowrap;
}

.hover-insights-all-bench-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.hover-insights-all-hist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 10px;
  color: #cbd5e1;
}

.hover-insights-all-hist-legend-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hover-insights-all-hist-legend-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.hover-insights-donut {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hover-insights-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  color: #cbd5e1;
}

.hover-insights-donut-legend > div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hover-insights-donut-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.hover-insights-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 11px;
  color: #cbd5e1;
}

.hover-insights-trend-legend > div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hover-insights-trend-legend .line {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--line-color, #94a3b8);
  display: inline-block;
}

.hover-insights-trend-legend .line.hover {
  background: var(--line-color, #60a5fa);
}

.hover-insights-trend-legend .line.mean {
  background: var(--line-color, #22c55e);
}

.hover-insights-trend-legend .line.median {
  background: repeating-linear-gradient(
    to right,
    #f59e0b 0 4px,
    transparent 4px 7px
  );
}

.hover-insights-note {
  font-size: 10px;
  color: #768499;
  letter-spacing: 0.02em;
}

.geo-brief {
  display: grid;
  gap: 10px;
}

.geo-brief-sheet {
  display: grid;
  gap: 10px;
}

.geo-brief-main,
.geo-brief-support {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.geo-brief-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.62)),
    linear-gradient(90deg, color-mix(in srgb, var(--brief-color, #60a5fa) 20%, transparent), transparent 68%);
}

.geo-brief-hero-copy {
  min-width: 0;
}

.geo-brief-kicker {
  color: #93c5fd;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.geo-brief-title {
  margin-top: 2px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo-brief-metric {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.geo-brief-primary {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
  min-width: 0;
}

.geo-brief-primary strong {
  color: #f8fafc;
  font-size: 21px;
  font-weight: 850;
  line-height: 1.04;
  max-width: 132px;
  overflow-wrap: anywhere;
}

.geo-brief-primary span {
  color: #93a7c1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.geo-brief-position {
  display: grid;
  gap: 6px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.46)),
    linear-gradient(90deg, rgba(96, 165, 250, 0.08), transparent 72%);
}

.geo-brief-position-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.geo-brief-position-head div {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.geo-brief-position-head span {
  color: #93c5fd;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.geo-brief-position-head strong {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 850;
}

.geo-brief-position-head em {
  color: #7f8ea3;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.geo-percentile-svg {
  width: 100%;
  height: 112px;
  display: block;
}

.geo-percentile-band {
  transition: fill 0.14s ease, opacity 0.14s ease, filter 0.14s ease;
}

.geo-percentile-band:hover,
.geo-percentile-band.is-selected {
  filter: brightness(1.18) saturate(1.12);
}

.geo-percentile-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: #93a7c1;
  font-size: 10px;
  font-weight: 700;
}

.geo-percentile-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.geo-percentile-legend i {
  width: 14px;
  height: 3px;
  border-radius: 999px;
  display: inline-block;
}

.geo-percentile-legend i.median {
  background: repeating-linear-gradient(
    to right,
    #f59e0b 0 4px,
    transparent 4px 7px
  );
}

.geo-percentile-legend i.mean {
  background: #22c55e;
}

.geo-brief-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.geo-brief-stats > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.48);
}

.geo-brief-stats span {
  display: block;
  color: #7f8ea3;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.geo-brief-stats strong {
  display: block;
  margin-top: 2px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo-brief-section {
  display: grid;
  gap: 8px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: transparent;
}

.geo-brief-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.geo-brief-section-head div {
  color: #dbeafe;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.geo-brief-section-head span {
  color: #7f8ea3;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo-brief-section-chart .hover-insights-chart-wrap {
  height: 156px;
}

.geo-brief-section-chart .hover-insights-donut {
  align-items: flex-start;
}

.geo-brief-bench-compact {
  margin-top: 8px;
}

.geo-brief .hover-insights-bench-row {
  grid-template-columns: 52px minmax(0, 1fr) 78px;
}

.geo-brief .hover-insights-all-bench-row {
  grid-template-columns: minmax(90px, 1fr) auto auto;
}

.geo-brief .hover-insights-all-bench-row .meta:last-child {
  display: none;
}

.geo-brief .selection-brief-insights,
.geo-brief .selection-brief-source {
  border-radius: 10px;
  padding: 9px;
}

.geo-brief .selection-profile-row-list {
  gap: 2px;
}

.geo-brief-notes {
  display: grid;
  gap: 5px;
}

@container (min-width: 540px) {
  .geo-brief-sheet {
    grid-template-columns: minmax(0, 1.35fr) minmax(176px, 0.75fr);
    align-items: start;
  }

  .geo-brief-support {
    position: sticky;
    top: 0;
  }

  .geo-brief-support .geo-brief-stats {
    grid-template-columns: 1fr;
  }

  .geo-brief .selection-brief-source {
    grid-template-columns: 1fr;
  }

  .geo-brief .selection-brief-source p {
    grid-column: auto;
  }
}

.selection-profile-suite {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.selection-profile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  background:
    radial-gradient(circle at 16% 0%, rgba(96, 165, 250, 0.22), transparent 42%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.58));
}

.selection-profile-kicker {
  color: #93c5fd;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.selection-profile-title {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 850;
  margin-top: 2px;
}

.selection-profile-meta {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.selection-brief-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -1px 0 0;
}

.selection-brief-tabs span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.52);
  color: #8ea0b8;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.selection-brief-tabs span.active {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(37, 99, 235, 0.22);
  color: #dbeafe;
}

.selection-profile-scorecard,
.selection-profile-section,
.selection-brief-insights,
.selection-brief-source {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.58);
  padding: 10px;
}

.selection-profile-scorecard {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(104px, 0.8fr);
  gap: 10px;
  align-items: stretch;
}

.selection-profile-primary {
  min-width: 0;
}

.selection-profile-label,
.selection-profile-section-head {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.selection-profile-value {
  color: #f8fafc;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-profile-sub,
.selection-profile-note {
  color: #8ea0b8;
  font-size: 10px;
  font-weight: 650;
  margin-top: 5px;
}

.selection-profile-stats {
  display: grid;
  gap: 6px;
}

.selection-profile-stats > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.selection-profile-stats > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.selection-profile-stats span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.selection-profile-stats strong {
  color: #e2e8f0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.selection-profile-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.selection-profile-section-head div {
  color: #dbeafe;
}

.selection-profile-section-head span {
  color: #7f8ea3;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.selection-brief-insights {
  display: grid;
  gap: 8px;
  border-color: rgba(96, 165, 250, 0.2);
  background: rgba(15, 23, 42, 0.68);
}

.selection-brief-insights-title {
  color: #dbeafe;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selection-brief-insights ul {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.selection-brief-insights li {
  position: relative;
  padding-left: 14px;
  color: #d7e4f6;
  font-size: 11px;
  line-height: 1.38;
}

.selection-brief-insights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #60a5fa;
}

.selection-brief-source {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.selection-brief-source div {
  min-width: 0;
}

.selection-brief-source span {
  display: block;
  color: #7f8ea3;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.selection-brief-source strong {
  display: block;
  margin-top: 2px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-brief-source p {
  grid-column: 1 / -1;
  margin: 0;
  color: #8ea0b8;
  font-size: 10px;
  line-height: 1.35;
}

.selection-brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selection-profile-row-list {
  display: grid;
  gap: 1px;
}

.selection-profile-chart .hover-insights-chart-wrap {
  height: 150px;
}

.selection-profile-chart .hover-insights-donut {
  align-items: flex-start;
}

.hover-insights-toggle {
  display: none;
  width: fit-content;
  gap: 4px;
  margin-top: 10px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.45);
}

.hover-insights-toggle button {
  border: none;
  border-radius: 999px;
  padding: 5px 9px;
  background: transparent;
  color: #9fb0c8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.hover-insights-toggle button:hover {
  color: #d7e4f6;
  background: rgba(100, 116, 139, 0.22);
}

.hover-insights-toggle button.active {
  color: #f8fafc;
  background: rgba(59, 130, 246, 0.32);
  box-shadow: inset 0 0 0 1px rgba(191, 219, 254, 0.25);
}

.detail-body {
  margin-bottom: 12px;
}
.detail-panel .detail-section {
  margin-top: 12px;
}
#hoverInsightsPanel.detail-section {
  margin-top: 0;
}
#hoverInsightsPanel .section-head .section-title {
  display: none;
}
#hoverInsightsPanel .section-head {
  justify-content: flex-start;
}
.detail-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.detail-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(99,102,241,0.6);
}

.session-box {
  background: rgba(12,18,30,0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}
.session-box.small { font-size: 12px; }

.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bar-title { font-weight: 800; }
.bar-context { color: var(--muted); font-size: 12px; }
.stack-bar { display: flex; height: 24px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,0.08); }
.bar-stats { margin-top: 8px; color: var(--muted); font-size: 12px; display: grid; gap: 4px; }

.demogr-card {
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.demogr-card-title { font-weight: 800; color: var(--text); margin-bottom: 6px; }
.demogr-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; position: relative; }
.demogr-label { flex: 1; font-weight: 700; font-size: 13px; }
.demogr-bar-text {
  position: relative;
  font-weight: 700;
  font-size: 13px;
  color: #f8fafc;
  white-space: nowrap;
  padding-right: 4px;
  text-align: right;
}
.demogr-bar {
  position: absolute;
  right: 0;
  top: 10%;
  bottom: 10%;
  border-radius: 6px;
  opacity: 0.7;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.pill-muted { color: var(--muted); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Maplibre overrides */
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { margin: 10px; }
.maplibregl-ctrl-icon { filter: invert(85%); }


/* Demographics UI cleanup (temp) */
.demogr-card {
  position: relative;
  overflow: hidden;
  background: rgba(15,23,42,0.8);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  --demogr-card-pad: 12px;
  padding: var(--demogr-card-pad);
  margin-bottom: 10px;
  box-shadow: none;
  --demogr-rail-width: 4px;
  --demogr-label-width: 0px;
  --demogr-bar-width: clamp(132px, 46%, 176px);
  --demogr-pct-width: 54px;
}
.demogr-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--demogr-rail-width);
  border-radius: 999px;
  background: rgba(148,163,184,0.28);
  pointer-events: none;
}
.demogr-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: calc(-1 * var(--demogr-card-pad)) calc(-1 * var(--demogr-card-pad)) 8px;
  padding: 8px 10px 7px calc(var(--demogr-card-pad) + 2px);
  position: relative;
  background: linear-gradient(180deg, rgba(59,130,246,0.12) 0%, rgba(59,130,246,0.06) 100%);
  border-bottom: none;
}
.demogr-card-head::after {
  content: "";
  position: absolute;
  left: var(--demogr-rail-width);
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(255,255,255,0.1);
  pointer-events: none;
}
.demogr-card-title {
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demogr-card-title-with-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.demogr-card-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demogr-card-title-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.demogr-card-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.demogr-card-meta.dataset-meta-inline {
  margin: 0;
  flex-shrink: 0;
}
.dataset-flag-btn {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transform: translateY(-2px);
  transition: color 120ms ease, background-color 120ms ease;
}
.dataset-flag-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #94a3b8;
}
.dataset-flag-btn .tabler-icon {
  width: 14px;
  height: 14px;
}
.dataset-flag-btn.active {
  color: #e2e8f0;
}
.dataset-flag-btn.dataset-flag-star.active {
  color: #f59e0b;
}
.dataset-flag-btn.dataset-flag-bookmark.active {
  color: #60a5fa;
}
.dataset-card-expand-btn {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: color 120ms ease;
}
.dataset-card-expand-btn:hover {
  color: #cbd5e1;
}
.dataset-card-expand-btn .tabler-icon {
  width: 15px;
  height: 15px;
}
.demogr-card-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.demogr-source-tag {
  display: inline-flex;
  align-items: center;
}
.source-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  color: #3b82f6;
  opacity: 1;
}
.source-verified-badge svg {
  width: 100%;
  height: 100%;
}
.demogr-card-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin: 2px 0 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.demogr-card-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.demogr-filter-box input[type="search"]{
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15,23,42,0.5);
  color: var(--text);
  padding: 8px 10px;
}
.demogr-filter-grid{
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 900px){
  .demogr-filter-grid{
    grid-template-columns: 1fr;
  }
}
.dataset-year {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 10px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}
.demogr-card.active .dataset-year { display: flex; }
.dataset-year input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
}
.dataset-year .year-ticks {
  margin-top: 2px;
}
.demogr-row {
  --row-color: #94a3b8;
  display: block;
  margin: 0;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.demogr-row:hover { background: rgba(255,255,255,0.03); }
.demogr-row.active {
  background: rgba(37,99,235,0.08);
}
.demogr-row-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(var(--demogr-label-width), 1fr) minmax(112px, var(--demogr-bar-width)) var(--demogr-pct-width);
  align-items: center;
  gap: 4px;
  min-height: 24px;
}
.demogr-group-header {
  margin-top: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.demogr-row.group-row {
  background-image: linear-gradient(to right, rgba(148,163,184,0.2) 0 0);
  background-size: 1px 100%;
  background-repeat: no-repeat;
  background-position: calc(var(--demogr-rail-width) + 4px) 0;
}
.demogr-row.demogr-more {
  background: rgba(15,23,42,0.22);
}
.demogr-row.demogr-more .demogr-row-main {
  grid-template-columns: minmax(var(--demogr-label-width), 1fr) minmax(112px, var(--demogr-bar-width)) max-content;
}
.demogr-row.demogr-more .demogr-label {
  color: var(--muted);
  font-weight: 600;
}
.demogr-more-toggle-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 600;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  justify-self: start;
  white-space: nowrap;
}
.demogr-more-toggle-btn:hover {
  color: #cbd5e1;
}
.demogr-more-toggle-spacer {
  width: 100%;
  min-height: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demogr-dvg-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}
.demogr-dvg-toggle-btn.active {
  color: #e2e8f0;
}
.demogr-row.demogr-loading .demogr-row-main {
  grid-template-columns: 1fr;
}
.demogr-row.demogr-loading .demogr-label {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.demogr-card.unavailable {
  opacity: 0.85;
}
.demogr-card.unavailable .demogr-card-note {
  color: var(--muted);
}
.demogr-rail {
  position: absolute;
  left: calc(-1 * var(--demogr-card-pad));
  top: 0;
  bottom: 0;
  width: var(--demogr-rail-width);
  min-height: auto;
  border-radius: 0;
  background: transparent;
  opacity: 1;
  transform-origin: center;
  transition: transform 140ms ease, background-color 140ms ease, opacity 140ms ease;
}
.demogr-card.all-selected::before {
  background: rgba(241, 245, 249, 0.72);
}
.demogr-card.all-selected .demogr-row .demogr-rail {
  background: transparent;
  opacity: 1;
  transform: scaleX(1);
}
.demogr-card.all-selected .demogr-row.active .demogr-rail {
  background: rgba(255, 255, 255, 0.95);
  transform: scaleX(1.55);
}
.demogr-card.all-selected .demogr-row.active .demogr-label {
  color: #f8fafc;
}
.demogr-card.all-selected .demogr-row.active .demogr-pct {
  color: #e2e8f0;
}
.demogr-row.active .demogr-rail {
  background: var(--row-color);
  opacity: 1;
  transform: scaleX(1.55);
}
.demogr-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: var(--row-color);
}
.demogr-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demogr-label-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.demogr-label-wrap .demogr-label {
  flex: 0 1 auto;
  min-width: 0;
}
.demogr-expand-variable-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  color: rgba(248, 250, 252, 0.9);
  background: rgba(255, 255, 255, 0.06);
  opacity: 1;
  flex: 0 0 auto;
  cursor: pointer;
}
.demogr-row:hover .demogr-expand-variable-btn,
.demogr-expand-variable-btn:focus {
  opacity: 1;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}
.demogr-expand-variable-btn .tabler-icon {
  width: 13px;
  height: 13px;
}
.demogr-mute-variable-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  color: rgba(203, 213, 225, 0.75);
  background: rgba(148, 163, 184, 0.1);
  opacity: 0;
  flex: 0 0 auto;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.demogr-row:hover .demogr-mute-variable-btn,
.demogr-mute-variable-btn:focus,
.demogr-mute-variable-btn.active {
  opacity: 1;
}
.demogr-mute-variable-btn:hover,
.demogr-mute-variable-btn:focus {
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.2);
  outline: none;
}
.demogr-mute-variable-btn.active {
  color: #f97316;
  background: rgba(249, 115, 22, 0.16);
}
.demogr-row.muted-variable .demogr-label,
.demogr-row.muted-variable .demogr-bar-text,
.demogr-row.muted-variable .demogr-pct {
  color: rgba(148, 163, 184, 0.62);
}
.demogr-row.muted-variable .demogr-bar-fill {
  opacity: 0.38;
}
.demogr-breakdown-back-btn {
  color: #cbd5e1;
}
.demogr-bar-wrap {
  display: block;
  width: 100%;
  min-width: 0;
}
.demogr-bar-track {
  position: relative;
  width: 100%;
  height: 22px;
  border-radius: 3.5px;
  overflow: hidden;
  background: transparent;
}
.demogr-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: var(--row-color);
}
.demogr-bar-wrap.solo .demogr-bar-fill {
  opacity: 0;
}
.demogr-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  font-weight: 700;
  font-size: 12px;
  color: #f8fafc;
  text-shadow: 0 1px 1px rgba(0,0,0,0.38);
  white-space: nowrap;
  text-align: left;
}
.demogr-bar-text.solo {
  color: var(--muted);
  text-shadow: none;
}
.demogr-pct {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  width: var(--demogr-pct-width);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.demogr-row.demogr-row-italic .demogr-label,
.demogr-row.demogr-row-italic .demogr-bar-text,
.demogr-row.demogr-row-italic .demogr-pct {
  font-style: italic;
}
.demogr-saved-card .demogr-card-body {
  gap: 8px;
}
.saved-areas-body .ghost-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}
.saved-area-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px;
}
.saved-area-load {
  justify-content: flex-start;
  text-align: left;
}
.saved-area-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.saved-area-delete {
  min-width: 28px;
  padding: 4px 8px;
}
.saved-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.saved-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
}
.saved-item-load {
  justify-content: flex-start;
  text-align: left;
}
.saved-item-type {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.12);
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.saved-item-delete {
  min-width: 28px;
  padding: 4px 8px;
}
.saved-item-meta {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--muted);
}
.hover-hist-bar {
  cursor: pointer;
  transition: opacity 0.14s ease, filter 0.14s ease;
}
.hover-hist-bar:hover {
  opacity: 0.92;
  filter: brightness(1.08);
}
.hover-hist-bar.is-selected {
  opacity: 1;
  filter: brightness(1.22) saturate(1.18);
}
.hover-hist-bar:focus-visible {
  outline: none;
  filter: brightness(1.16) saturate(1.14) drop-shadow(0 0 4px rgba(226,232,240,0.45));
}


.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  justify-self: start;
  position: relative;
  z-index: 2;
}
.topbar .slate-row {
  margin: 0;
  gap: 8px;
  flex-wrap: nowrap;
}
.topbar .slate-row .chip-row {
  flex-wrap: nowrap;
}
.topbar-toggles {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-toggles .chip {
  height: var(--topbar-control-height);
  padding: 0 14px;
  font-size: 12px;
  border-radius: var(--radius-pill);
  background: var(--topbar-pill-bg);
  border: 1px solid var(--topbar-pill-border);
  box-shadow: var(--topbar-pill-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-toggles .chip.topbar-toggle-chip {
  border-color: rgba(255,255,255,0.18);
  color: var(--muted);
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.topbar-toggles .chip.topbar-toggle-chip.active {
  background: rgba(59,130,246,0.24);
  border-color: rgba(96,165,250,0.78);
  box-shadow: inset 0 1px 0 rgba(219,234,254,0.2), 0 1px 8px rgba(2,6,23,0.3), 0 0 12px rgba(96,165,250,0.3);
  color: #ffffff;
  font-weight: 700;
}
.topbar-toggles .chip.topbar-toggle-chip:not(.active):hover,
.topbar-toggles .chip.topbar-toggle-chip:not(.active):focus-visible {
  color: #cbd5e1;
  border-color: rgba(255,255,255,0.3);
}
.topbar-toggles .chip.isolate-chip:disabled {
  opacity: 1;
  cursor: default;
}
.topbar-toggles .chip.icon-chip {
  width: var(--topbar-control-height);
  min-width: var(--topbar-control-height);
  padding: 0;
  justify-content: center;
}
.topbar-toggles .chip.icon-chip svg {
  width: 18px;
  height: 18px;
  display: block;
}
.overlay-mode-pill {
  min-width: 118px;
  cursor: pointer;
}
.overlay-mode-pill.is-active {
  background: rgba(59,130,246,0.24);
  border-color: rgba(96,165,250,0.78);
  box-shadow: inset 0 1px 0 rgba(219,234,254,0.2), 0 1px 8px rgba(2,6,23,0.3), 0 0 12px rgba(96,165,250,0.3);
}
.overlay-mode-pill .mode-menu {
  min-width: 220px;
  max-height: min(56vh, 440px);
  overflow: auto;
}
.topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(12,18,30,0.9);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 14px rgba(0,0,0,0.25);
}
.topbar-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  min-width: 200px;
}
.topbar-search input::placeholder { color: var(--muted); }
.topbar-search .search-icon { color: var(--muted); font-size: 14px; }
.topbar-search .kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}
.topbar-search.geo-search {
  position: relative;
  width: 100%;
  min-width: 0;
  gap: 10px;
}
.topbar-search.geo-search input {
  min-width: 170px;
  flex: 1 1 auto;
}
.topbar-search.geo-search .ghost-btn {
  height: 24px;
  line-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
}
.topbar-search.geo-search.is-busy {
  opacity: 0.78;
}
.topbar-search.geo-search.is-error {
  border-color: rgba(248, 113, 113, 0.7);
}
.topbar-search.geo-search.is-ok {
  border-color: rgba(96, 165, 250, 0.65);
}
.geo-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 140;
  display: none;
  flex-direction: column;
  max-height: min(66vh, 600px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  border: 1px solid rgba(148,163,184,0.26);
  border-radius: 10px;
  background: rgba(8,12,20,0.98);
  box-shadow: 0 12px 26px rgba(2,6,23,0.5);
}
.geo-search-results::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.geo-search-results::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.45);
  border-radius: 999px;
}
.geo-search-results::-webkit-scrollbar-track {
  background: rgba(15,23,42,0.4);
  border-radius: 999px;
}
.geo-search-results.is-open {
  display: flex;
}
.geo-search-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(148,163,184,0.12);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}
.geo-search-result:last-child {
  border-bottom: 0;
}
.geo-search-result:hover,
.geo-search-result:focus-visible {
  background: rgba(59,130,246,0.18);
  outline: none;
}
.geo-search-result-title {
  font-size: 12px;
  line-height: 1.25;
  color: var(--text);
}
.geo-search-result-sub {
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
}

.topbar-geo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-modes {
  display: flex;
  gap: 8px;
  align-items: center;
}

.year-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 58px;
  width: min(520px, calc(100vw - var(--sidebar-width) - var(--side-panel-current-width) - var(--detail-panel-current-width) - 76px));
  padding: 9px 12px 7px;
  border-radius: 18px;
  background: var(--topbar-pill-bg);
  border: 1px solid var(--topbar-pill-border);
  box-shadow: var(--topbar-pill-shadow);
  color: #e2e8f0;
  font-size: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.year-pill .year-label {
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10px;
  flex: 0 0 auto;
}
.year-pill .year-current {
  min-width: 44px;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: right;
}
.year-pill .year-inline {
  display: grid;
  grid-template-columns: 48px 28px minmax(170px, 1fr) 28px 74px;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.year-map-float {
  position: absolute;
  right: calc(var(--detail-panel-current-width) + var(--right-panel-map-gutter) + 18px);
  bottom: 18px;
  z-index: 9;
  transition: right 0.28s ease;
}
.year-pill .year-select,
.year-pill .year-step-btn {
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.26);
  background: rgba(15,23,42,0.72);
  color: #e5e7eb;
  font-size: 12px;
}
.year-pill .year-select {
  padding: 0 8px;
  min-width: 72px;
}
.year-pill .year-step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.year-pill .year-step-btn:hover,
.year-pill .year-select:hover {
  border-color: rgba(226,232,240,0.44);
}
.year-pill .year-ticks {
  margin-top: 0;
}
.year-pill .year-slider {
  padding-bottom: 20px;
}

@media (max-width: 980px) {
  .year-pill {
    width: min(420px, calc(100vw - var(--sidebar-width) - 34px));
    right: 18px;
  }
  .year-pill .year-inline {
    grid-template-columns: 44px 28px minmax(120px, 1fr) 28px 70px;
  }
}

.mode-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--topbar-control-height);
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--topbar-pill-bg);
  border: 1px solid var(--topbar-pill-border);
  box-shadow: var(--topbar-pill-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12px;
  color: #e2e8f0;
}

.mode-pill::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

.mode-pill .mode-label {
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10px;
}

.mode-pill .mode-value {
  font-weight: 600;
}

.mode-pill .mode-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 6px;
  display: none;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.4);
}

.mode-pill:hover .mode-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-pill:focus-within .mode-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-pill .mode-menu button {
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.mode-pill .mode-menu button:hover {
  background: rgba(148, 163, 184, 0.18);
}

.mode-pill .mode-menu button.active {
  background: rgba(59, 130, 246, 0.25);
  color: #f8fafc;
}

.mode-pill .mode-menu button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.compare-mode-pill .mode-menu {
  min-width: 170px;
}

.compare-control-grid {
  align-items: end;
}

.compare-control-grid .compare-time-control.is-hidden,
.compare-control-grid .compare-dataset-control.is-hidden {
  display: none;
}

.mode-pill.is-disabled {
  opacity: 0.5;
}

.mode-pill.is-disabled .mode-menu {
  display: none !important;
}

.density3d-pill {
  padding: 0 4px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.density3d-pill .mode-menu {
  min-width: 88px;
  left: 50%;
  transform: translateX(-50%);
}

.density3d-pill::after {
  left: -10px;
  right: -10px;
  height: 14px;
}

.density3d-pill .density3d-chip {
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.density3d-pill .density3d-chip:hover,
.density3d-pill .density3d-chip:focus-visible {
  background: rgba(148, 163, 184, 0.16);
}

.detail-kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(99,102,241,0.6);
}

.content-row .map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.content-row .detail-panel {
  flex: 0 0 var(--detail-panel-current-width, 450px);
}


.section { position: relative; overflow: hidden; }
.section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.section-head .badge {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.control label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.control select, .control button.ghost-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.control select:focus, .control button.ghost-btn:focus { outline: 1px solid var(--accent); }
.session-box.small {
  background: rgba(8,10,15,0.85);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(0,0,0,0.28);
}
.colorlab-preview {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.colorlab-stops {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.colorlab-gradient {
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(90deg, #f8fafc 0%, #dbeafe 25%, #93c5fd 50%, #60a5fa 75%, #2563eb 100%);
  margin-top: 8px;
  position: relative;
  overflow: visible;
}
.colorlab-handle {
  position: absolute;
  top: -4px;
  width: 12px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transform: translateX(-50%);
  cursor: ew-resize;
  background: #f8fafc;
  z-index: 2;
}
.colorlab-handle.locked {
  cursor: default;
  opacity: 0.7;
}
.colorlab-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.colorlab-actions .ghost-btn {
  flex: 1 1 140px;
}
.colorlab-varlist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.colorlab-varitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  font-size: 12px;
}
.colorlab-varitem.active {
  border-color: rgba(99,102,241,0.6);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.3) inset;
}
.colorlab-varswatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
}
.colorlab-row {
  display: grid;
  gap: 6px;
}
.colorlab-row-title {
  font-size: 12px;
  color: var(--muted);
}
.colorlab-swatches {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(18px, 1fr);
  gap: 6px;
}
.colorlab-swatch {
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.colorlab-swatch span {
  position: absolute;
  right: 2px;
  bottom: 2px;
  font-size: 9px;
  color: rgba(15,23,42,0.8);
  background: rgba(255,255,255,0.65);
  padding: 0 3px;
  border-radius: 3px;
}
.bar-head .bar-title { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.bar-head .bar-context { color: var(--text); font-weight: 700; }
.layer-list .control label { text-transform: none; letter-spacing: normal; }


.summary-block {
  background: linear-gradient(145deg, rgba(17,24,39,0.92), rgba(8,10,15,0.9));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}
.summary-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.summary-title { text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; color: var(--muted); font-weight: 800; }
.summary-stat { color: var(--text); font-weight: 800; font-size: 14px; }
.summary-sub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.bar-stack { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.bar-row:last-child { border-bottom: none; }
.bar-label { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.bar-label .swatch { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.bar-meta { font-size: 12px; color: var(--muted); text-align: right; }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bar-fill { height: calc(100% - var(--topbar-height)); border-radius: inherit; }
.detail-body { display: flex; flex-direction: column; gap: 10px; }
.detail-panel { padding: 12px 18px 18px; }
.detail-title { font-size: 13px; }
.detail-kicker { margin-bottom: 4px; }


/* --- Top bar polish --- */
.topbar {
  gap: 14px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(12,17,26,0.94), rgba(8,10,15,0.9));
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
}
.topbar .crumbs { gap: 10px; letter-spacing: 0.12em; font-size: 12px; color: #9ca3af; text-transform: uppercase; }
.topbar-search {
  min-width: 320px;
  background: rgba(9,13,20,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 8px 14px;
}
.topbar-search input { padding: 4px 2px; }
.topbar-status { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.14); }
.geo-float {
  background: rgba(8,11,17,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.topbar-geo .geo-float {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* --- Left panel polish --- */
.side-panel {
  background: linear-gradient(180deg, rgba(10,13,19,0.95) 0%, rgba(9,12,18,0.95) 100%);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255,255,255,0.07);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.02), 8px 0 24px rgba(0,0,0,0.4);
}
.section {
  background: rgba(8,11,17,0.94);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 28px rgba(0,0,0,0.32);
}
.section-head { margin-bottom: 10px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: #e5e7eb; display: inline-flex; align-items: center; gap: 8px; }
.section-title::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(99,102,241,0.65);
}
.section-hint { color: #94a3b8; font-size: 12px; letter-spacing: 0.03em; }
.control label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; color: #9ca3af; }
.control select,
.control button.ghost-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.control select:focus,
.control button.ghost-btn:focus { outline: 1px solid var(--accent); }
.session-box.small {
  background: rgba(7,10,16,0.95);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}
.bar-head .bar-title { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; color: #9ca3af; }
.bar-head .bar-context { color: #e5e7eb; font-weight: 700; }
.segpill { box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 10px 20px rgba(0,0,0,0.3); }

/* Demographics side panel should only show dataset cards as containers. */
.side-panel .section[data-view="demographics"] {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.side-panel .section[data-view="demographics"] .section-head { display: none; }
.side-panel .section[data-view="demographics"]::after { display: none; }
.side-panel .section[data-view="demographics"] .session-box,
.side-panel .section[data-view="demographics"] .session-box.small {
  background: transparent;
  border: 0;
  box-shadow: none;
}


/* Layout adjustments for full-width topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(360px, 42vw, 680px) minmax(0, 1fr);
  grid-template-areas: "left search right";
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, rgba(12,17,26,0.94), rgba(8,10,15,0.9));
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 10;
}
.topbar-left {
  grid-area: left;
}
.topbar-search.geo-search {
  grid-area: search;
  position: relative;
  left: 22px;
  justify-self: stretch;
}
.topbar-right {
  grid-area: right;
}
.map-area {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: var(--topbar-height);
}
.content-row {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}
.content-row .map-wrap { flex: 1; }
.sidebar {
  top: var(--topbar-height);
  height: calc(100% - var(--topbar-height));
  overflow: hidden;
  overflow: hidden;
}
.side-panel {
  top: var(--topbar-height);
  height: calc(100% - var(--topbar-height));
  overflow-y: auto;
  overflow-x: hidden;
}

.map-area::before { content:""; position: fixed; top: var(--topbar-height); left: 0; width: var(--sidebar-width); height: calc(100% - var(--topbar-height)); background: rgba(9,12,18,0.96); pointer-events: none; transition: width 0.35s ease; z-index: 4; }

.sidebar-nav .sub { display: none !important; }





.sidebar.layout-open .sidebar-item { padding: 10px 10px 10px 6px; }

.sidebar:not(.layout-open) .sidebar-item { padding: 10px 10px 10px 6px; }


.sidebar:not(.is-open) .sidebar-item:not(.active) .icon { color: var(--muted-2); }

@media (prefers-reduced-motion: reduce) {
  .sidebar-item[data-type] .icon .ws-icon-sheen {
    opacity: 0 !important;
  }
}

.sidebar:not(.is-open) .sidebar-item.ghost { background: transparent; border-color: transparent; box-shadow: none; }

.topbar-brand.simple-brand { display: flex; align-items: baseline; gap: 8px; padding: 0; border: none; background: transparent; box-shadow: none; }

.topbar-brand .brand-title { font-weight: 800; font-size: 26px; color: #e5e7eb; letter-spacing: 0.01em; }
.topbar-brand .brand-subtle { font-size: 26px; color: #6b7280; font-weight: 400; }

.detail-panel { border-radius: 0 !important; }

/* --- Modals --- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7,10,16,0.72);
  backdrop-filter: blur(10px);
  z-index: 1200;
}
.modal-card {
  width: min(560px, 92vw);
  background: rgba(10,14,22,0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  box-shadow: 0 20px 48px rgba(0,0,0,0.5);
  padding: 16px 18px 18px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #e5e7eb;
  font-weight: 800;
}
.modal-actions { display: flex; align-items: center; gap: 6px; }
.modal-body { max-height: min(70vh, 520px); overflow: auto; }
.perf-diagnostics-box {
  border-color: rgba(148, 163, 184, 0.22);
}
.perf-diagnostics-box summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  color: #e5e7eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.perf-diagnostics-box summary::-webkit-details-marker {
  display: none;
}
.perf-metrics-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.perf-metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 7px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.perf-metric-name {
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.perf-metric-duration {
  color: #93c5fd;
  font-size: 12px;
}
.perf-metric-meta,
.perf-metric-empty {
  grid-column: 1 / -1;
  font-size: 10px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.export-presets { display: flex; flex-wrap: wrap; gap: 8px; }

.export-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,10,16,0.8);
  backdrop-filter: blur(6px);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5e7eb;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}
