/* ============================================================
   S3 Alumni — Global Network Atlas
   Dark, map-first location-intelligence console.
   ============================================================ */

:root {
  --bg: #0a0f16;
  --bg-raise: #0d141d;
  --surface: #121a26;
  --surface-2: #182231;
  --glass: rgba(13, 19, 28, 0.82);
  --glass-strong: rgba(16, 23, 33, 0.94);
  --line: rgba(151, 168, 192, 0.14);
  --line-strong: rgba(151, 168, 192, 0.28);
  --ink: #e9eff7;
  --ink-2: #a9b6c6;
  --ink-3: #7d8ca1;
  --teal: #2ec4b0;
  --teal-strong: #63ddca;
  --teal-deep: #12433f;
  --teal-dim: rgba(46, 196, 176, 0.14);
  --amber: #f2a650;
  --amber-strong: #ffce93;
  --amber-dim: rgba(242, 166, 80, 0.16);
  --danger: #f27e6b;
  --focus: #86c7ff;
  --shadow-1: 0 1px 2px rgba(2, 6, 12, 0.55), 0 8px 24px rgba(2, 6, 12, 0.38);
  --shadow-2: 0 2px 6px rgba(1, 4, 9, 0.5), 0 18px 48px rgba(1, 4, 9, 0.55);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --panel-width: 404px;
  --blur: saturate(1.35) blur(14px);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, "SF Pro Text", Inter, "Segoe UI Variable Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior: none;
}

::selection {
  background: rgba(46, 196, 176, 0.32);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button,
summary {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Thin dark scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(151, 168, 192, 0.28) transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: rgba(151, 168, 192, 0.26) padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(151, 168, 192, 0.4) padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* ============================================================
   App frame
   ============================================================ */

.app-frame {
  display: flex;
  height: 100dvh;
  min-height: 540px;
  flex-direction: column;
}

.is-theme-transitioning .app-frame {
  animation: theme-crossfade 180ms ease-out;
}

@keyframes theme-crossfade {
  from {
    opacity: 0.94;
  }

  to {
    opacity: 1;
  }
}

.workspace {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

/* ============================================================
   Top bar — brand, KPI strip, coverage, access
   ============================================================ */

.topbar {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  flex: none;
  gap: 20px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #101724 0%, var(--bg-raise) 100%);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: none;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(99, 221, 202, 0.38);
  border-radius: 9px;
  background: linear-gradient(160deg, rgba(46, 196, 176, 0.2), rgba(46, 196, 176, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #9ff0e2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.product-name {
  margin: 0;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 660;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2,
h3,
p {
  margin-top: 0;
}

.topbar__stats {
  display: flex;
  align-items: stretch;
  margin-left: auto;
  gap: 0;
  min-width: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 18px;
  border-left: 1px solid var(--line);
  gap: 0;
}

.stat:first-child {
  border-left: 0;
}

.stat__value {
  font-size: 17px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat__label {
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.coverage-track {
  width: 52px;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(151, 168, 192, 0.2);
}

.coverage-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--teal-strong));
  transition: width 420ms ease-out;
}

.theme-toggle {
  display: inline-flex;
  flex: none;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(151, 168, 192, 0.07);
  gap: 2px;
}

.theme-controls {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 8px;
}

.theme-toggle button {
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 620;
  transition: background 140ms ease, color 140ms ease;
}

.theme-toggle button:hover {
  color: var(--ink);
}

.theme-toggle button.is-active {
  background: var(--teal-dim);
  box-shadow: inset 0 0 0 1px rgba(46, 196, 176, 0.38);
  color: var(--teal-strong);
}

/* ============================================================
   Toolbar — search, filters, chips
   ============================================================ */

.toolbar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  flex: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raise);
}

.field {
  position: relative;
  min-width: 0;
}

.field--search {
  flex: 0 1 264px;
  min-width: 190px;
}

.search-control,
.combo-picker summary {
  display: flex;
  align-items: center;
  width: 100%;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  transition: border-color 140ms ease, background 140ms ease;
}

.search-control:hover,
.combo-picker summary:hover {
  border-color: rgba(151, 168, 192, 0.45);
  background: var(--surface-2);
}

.search-control {
  gap: 8px;
  padding: 0 10px;
}

.search-control:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(46, 196, 176, 0.18);
}

.search-glyph {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

.search-control input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

input::placeholder {
  color: var(--ink-3);
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Picker triggers */

.combo-picker {
  position: relative;
}

.combo-picker summary {
  justify-content: space-between;
  gap: 10px;
  padding: 0 11px;
  list-style: none;
  user-select: none;
  white-space: nowrap;
}

.combo-picker summary > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-picker summary::-webkit-details-marker {
  display: none;
}

.chev {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.combo-picker[open] summary .chev {
  margin-top: 3px;
  transform: rotate(225deg);
}

.combo-picker[open] summary {
  border-color: var(--teal);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(46, 196, 176, 0.18);
}

.field .combo-picker {
  width: 148px;
}

/* Picker popovers */

.combo-picker__popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 70;
  width: min(320px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-2);
}

.combo-picker__search {
  display: block;
  margin-bottom: 8px;
}

.combo-picker__search input,
.panel-search input,
.map-list-tools input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}

.combo-picker__search input:focus,
.panel-search input:focus,
.map-list-tools input:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 196, 176, 0.18);
}

.combo-picker__options {
  display: flex;
  max-height: 264px;
  flex-direction: column;
  overflow: auto;
  gap: 1px;
  margin: 0 -4px;
  padding: 0 4px;
}

.combo-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  text-align: left;
}

.combo-option:hover {
  background: rgba(151, 168, 192, 0.1);
  color: var(--ink);
}

.combo-option__check {
  width: 12px;
  flex: none;
  color: var(--teal-strong);
  font-size: 11px;
  opacity: 0;
}

.combo-option.is-selected {
  background: var(--teal-dim);
  color: var(--ink);
}

.combo-option.is-selected .combo-option__check {
  opacity: 1;
}

.combo-option__label {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-option__count {
  flex: none;
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.picker-empty {
  padding: 14px 8px;
  color: var(--ink-3);
  font-size: 11.5px;
  text-align: center;
}

.combo-picker__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: #04231f;
  font-size: 12px;
  font-weight: 640;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover:not(:disabled) {
  background: var(--teal-strong);
}

.button--small {
  height: 28px;
  padding: 0 12px;
  font-size: 11.5px;
}

.button--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink-2);
}

.button--ghost:hover:not(:disabled) {
  border-color: rgba(151, 168, 192, 0.5);
  background: rgba(151, 168, 192, 0.08);
  color: var(--ink);
}

.reset-button {
  height: 34px;
}

.text-button {
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--teal-strong);
  font-size: 11.5px;
  font-weight: 600;
}

.text-button:hover:not(:disabled) {
  background: var(--teal-dim);
}

.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(151, 168, 192, 0.1);
  color: var(--ink);
}

/* Toolbar meta — chips + result count */

.toolbar__meta {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  margin-left: 4px;
}

.filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 220px;
  height: 24px;
  padding: 0 3px 0 10px;
  border: 1px solid rgba(46, 196, 176, 0.32);
  border-radius: 99px;
  background: var(--teal-dim);
  color: #a5ecdf;
  font-size: 11px;
  white-space: nowrap;
}

.filter-chip > button {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 12px;
  line-height: 1;
}

.filter-chip > button:hover {
  background: rgba(46, 196, 176, 0.28);
  color: #d7fff6;
}

.filter-results {
  flex: none;
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.filter-chips .filter-results {
  font-size: 11px;
}

/* Location autocomplete */

.location-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: min(400px, calc(100vw - 28px));
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-2);
}

.location-results__count {
  padding: 5px 9px 7px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 640;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.location-result {
  display: grid;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  gap: 1px;
  text-align: left;
}

.location-result strong {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 620;
}

.location-result span {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-result:hover,
.location-result.is-active {
  background: rgba(151, 168, 192, 0.12);
}

.location-result.is-active strong {
  color: var(--teal-strong);
}

mark {
  background: transparent;
  color: var(--amber-strong);
  font-weight: 700;
}

.location-results__more {
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 10.5px;
}

/* ============================================================
   Map stage
   ============================================================ */

.map-workspace {
  position: relative;
  min-height: 0;
  flex: 1;
}

.map-card {
  position: absolute;
  overflow: hidden;
  inset: 0;
  background: var(--bg);
}

.map {
  position: absolute;
  inset: 0;
}

/* Soft inner vignette for depth */
.map-card::after {
  position: absolute;
  z-index: 5;
  content: "";
  box-shadow: inset 0 0 90px rgba(1, 4, 9, 0.55);
  inset: 0;
  pointer-events: none;
}

.maplibregl-canvas {
  outline: none;
}

/* Floating map navigation cluster */

.map-nav {
  position: absolute;
  z-index: 20;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 80px);
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-1);
  gap: 2px;
}

.view-toggle button {
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 620;
  transition: background 140ms ease, color 140ms ease;
}

.view-toggle button:hover {
  color: var(--ink);
}

.view-toggle button.is-active {
  background: var(--teal-dim);
  box-shadow: inset 0 0 0 1px rgba(46, 196, 176, 0.38);
  color: var(--teal-strong);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 620;
}

.back-button:hover {
  border-color: rgba(151, 168, 192, 0.5);
  background: var(--glass-strong);
}

.map-breadcrumb {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(10, 15, 22, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-2);
  font-size: 11px;
  white-space: nowrap;
}

.live-status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(151, 168, 192, 0.045);
  color: var(--ink-3);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.live-status[hidden] {
  display: none;
}

/* MapLibre control restyle */

.maplibregl-ctrl-top-right {
  top: 12px;
  right: 12px;
  transition: right 200ms ease;
}

.maplibregl-ctrl-top-right .maplibregl-ctrl {
  margin: 0;
}

.maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-1);
}

.maplibregl-ctrl-group button {
  width: 30px;
  height: 30px;
  border-radius: 0;
  background: transparent;
}

.maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--line);
}

.maplibregl-ctrl-group button:hover {
  background: rgba(151, 168, 192, 0.12);
}

.maplibregl-ctrl button .maplibregl-ctrl-icon {
  filter: invert(0.82) brightness(1.15);
}

.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {
  opacity: 0.4;
}

/* ============================================================
   Legend — compact nested-circle scale
   ============================================================ */

.map-legend {
  position: absolute;
  z-index: 20;
  bottom: 14px;
  left: 12px;
  width: 212px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-1);
}

.map-legend__toggle {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
}

.map-legend__title {
  flex: none;
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-legend__hint {
  overflow: hidden;
  flex: 1;
  color: var(--ink-3);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-legend__toggle .chev {
  margin-top: -2px;
  transform: rotate(45deg);
}

.map-legend.is-collapsed .map-legend__toggle .chev {
  margin-top: 2px;
  transform: rotate(225deg);
}

.map-legend__body {
  padding: 2px 12px 10px;
}

.map-legend.is-collapsed {
  width: auto;
}

.map-legend.is-collapsed .map-legend__body {
  display: none;
}

.map-legend.is-collapsed .map-legend__hint {
  display: none;
}

/* Nested circle scale (JS positions children absolutely) */

.legend-scale {
  position: relative;
  margin: 4px 0 10px;
}

.lg-circle {
  position: absolute;
  bottom: 0;
  border: 1px solid rgba(99, 221, 202, 0.72);
  border-radius: 50%;
  background: rgba(46, 196, 176, 0.08);
}

.lg-tick {
  position: absolute;
  height: 0;
  border-top: 1px dashed rgba(151, 168, 192, 0.4);
}

.lg-label {
  position: absolute;
  color: var(--ink-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.legend-key {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 4px;
  list-style: none;
}

.legend-key li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 10.5px;
}

.key-swatch {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
}

.key-swatch--exact {
  border: 1px solid var(--teal-strong);
  background: var(--teal);
}

.key-swatch--metro {
  border: 1px solid rgba(99, 221, 202, 0.6);
  background: rgba(46, 196, 176, 0.42);
}

.key-swatch--region {
  border: 1.5px solid #93a7bd;
  background: transparent;
}

.map-legend__foot {
  margin: 7px 0 0;
  color: var(--ink-3);
  font-size: 9.5px;
  line-height: 1.4;
}

/* ============================================================
   Map footer — ranked list, coverage, attribution
   ============================================================ */

.map-footer {
  position: absolute;
  z-index: 20;
  right: 12px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
  max-width: 46%;
  text-align: right;
  transition: right 200ms ease;
}

.map-list-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 620;
}

.map-list-button svg {
  width: 13px;
  height: 13px;
  color: var(--teal-strong);
}

.map-list-button:hover {
  border-color: rgba(151, 168, 192, 0.5);
  background: var(--glass-strong);
}

.map-coverage {
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(10, 15, 22, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.map-attribution {
  max-width: 340px;
  color: rgba(125, 140, 161, 0.75);
  font-size: 9px;
  line-height: 1.5;
}

/* Gesture hint */

.gesture-hint {
  position: absolute;
  z-index: 22;
  bottom: 16px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-1);
  color: var(--ink-2);
  font-size: 11px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.gesture-hint button {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(151, 168, 192, 0.12);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1;
}

.gesture-hint button:hover {
  background: rgba(151, 168, 192, 0.24);
  color: var(--ink);
}

/* ============================================================
   Map states — loading, empty, error
   ============================================================ */

.map-state {
  position: absolute;
  z-index: 30;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  inset: 0;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

.map-state strong {
  font-size: 13.5px;
  font-weight: 650;
}

.map-state > span {
  max-width: 360px;
  color: var(--ink-2);
  font-size: 11.5px;
}

.map-state .button {
  margin-top: 10px;
  pointer-events: auto;
}

.map-state--loading {
  background: rgba(10, 15, 22, 0.86);
  pointer-events: auto;
}

.map-state:not(.map-state--loading) strong,
.map-state:not(.map-state--loading) > span,
.map-state:not(.map-state--loading) .map-state__icon {
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(10, 15, 22, 0.78);
}

.map-state__icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  margin-bottom: 6px;
  color: var(--teal-strong);
  font-size: 17px;
}

.map-state--notice .map-state__icon {
  border-color: rgba(242, 166, 80, 0.45);
  color: var(--amber-strong);
}

.loader {
  width: 26px;
  height: 26px;
  border: 2.5px solid rgba(99, 221, 202, 0.2);
  border-top-color: var(--teal-strong);
  border-radius: 50%;
  margin-bottom: 8px;
  animation: spin 720ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   Map tooltip
   ============================================================ */

.map-tooltip {
  position: absolute;
  z-index: 40;
  width: max-content;
  max-width: 272px;
  padding: 11px 13px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-2);
  pointer-events: none;
}

.tooltip-kicker {
  color: var(--teal-strong);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.tooltip-title {
  margin-top: 1px;
  font-size: 13.5px;
  font-weight: 660;
  line-height: 1.25;
}

.tooltip-meta {
  color: var(--ink-2);
  font-size: 10.5px;
}

.tooltip-total {
  margin: 5px 0 1px;
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.tooltip-total span {
  margin-left: 2px;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.granularity-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(46, 196, 176, 0.4);
  border-radius: 99px;
  background: var(--teal-dim);
  color: #a5ecdf;
  font-size: 9.5px;
  font-weight: 620;
}

.granularity-badge--coarse {
  border-color: var(--line-strong);
  background: rgba(151, 168, 192, 0.12);
  color: var(--ink-2);
}

.tooltip-columns {
  display: grid;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.tooltip-column {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tooltip-column strong {
  color: var(--ink-3);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tooltip-column span {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-action {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

/* Selected-location marker */

/* NOTE: no `position` here — MapLibre's .maplibregl-marker rule must keep
   `position: absolute` or the marker stretches into a full-width band. */
.selected-location-marker {
  display: grid;
  max-width: 168px;
  padding: 6px 11px 7px;
  border: 1px solid rgba(242, 166, 80, 0.55);
  border-radius: 9px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 6px 20px rgba(1, 4, 9, 0.55);
  gap: 0;
  pointer-events: none;
  text-align: center;
}

.selected-location-marker::after {
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(242, 166, 80, 0.55);
  border-bottom: 1px solid rgba(242, 166, 80, 0.55);
  background: var(--glass-strong);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.selected-location-marker strong {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-location-marker span {
  overflow: hidden;
  color: var(--amber-strong);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   Detail panel — floating overlay drawer
   ============================================================ */

.detail-panel {
  position: absolute;
  z-index: 60;
  top: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  width: min(var(--panel-width), calc(100vw - 28px));
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(14, 20, 29, 0.9);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateX(14px);
  transition: opacity 190ms ease, transform 190ms ease, visibility 190ms;
  visibility: hidden;
}

.map-workspace.has-panel .detail-panel {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
}

.detail-panel__header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  flex: none;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--glass-strong);
}

.detail-panel__heading {
  min-width: 0;
}

.detail-panel__header .eyebrow {
  color: var(--teal-strong);
}

.detail-panel.is-selected-location .detail-panel__header .eyebrow {
  color: var(--amber-strong);
}

.detail-panel h2 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.detail-panel__subtitle {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 11px;
}

.detail-panel__body {
  flex: 1;
  padding: 14px 16px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.panel-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-kpi {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(151, 168, 192, 0.05);
}

.panel-kpi__label {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.panel-kpi__value {
  overflow: hidden;
  margin-top: 2px;
  font-size: 14.5px;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-kpi__note {
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-section {
  margin-top: 18px;
}

.panel-section__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-section__heading h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.01em;
}

.panel-section__heading > span,
.panel-section__heading span {
  color: var(--ink-3);
  font-size: 10px;
}

.panel-section__heading--stack {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.panel-section__heading--stack > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.panel-search {
  display: block;
  width: 100%;
}

.chart-wrap {
  position: relative;
  height: 158px;
}

.chart-wrap canvas {
  width: 100% !important;
}

.chart-empty {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-3);
  font-size: 11px;
  inset: 0;
}

.aggregate-summary {
  display: grid;
  margin: 0;
  gap: 8px;
}

.aggregate-summary__item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(151, 168, 192, 0.05);
}

.aggregate-summary__item dt {
  color: var(--ink-3);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.aggregate-summary__item dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.45;
}

.aggregate-summary__item--locations {
  padding-bottom: 10px;
}

.aggregate-location-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.aggregate-location-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(151, 168, 192, 0.08);
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.aggregate-location-link:hover,
.aggregate-location-link:focus-visible {
  border-color: rgba(88, 214, 197, 0.55);
  background: rgba(88, 214, 197, 0.12);
  color: var(--ink);
  outline: none;
}

.aggregate-location-link span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.aggregate-location-link strong {
  color: var(--teal-strong);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-empty {
  padding: 22px 14px;
  color: var(--ink-3);
  font-size: 11.5px;
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
}

.pagination span {
  color: var(--ink-3);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

/* Backdrop (mobile only — desktop drawer floats over a live map) */

.panel-backdrop {
  position: fixed;
  z-index: 55;
  display: none;
  border: 0;
  background: rgba(3, 6, 10, 0.6);
  inset: 0;
}

/* ============================================================
   Ranked locations dialog
   ============================================================ */

.map-list-dialog {
  width: min(600px, calc(100vw - 28px));
  max-height: min(78dvh, 720px);
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #101724;
  box-shadow: var(--shadow-2);
  color: var(--ink);
}

.map-list-dialog[open] {
  display: flex;
}

.map-list-dialog::backdrop {
  background: rgba(3, 6, 11, 0.68);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  flex: none;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}

.dialog-header .eyebrow {
  color: var(--teal-strong);
}

.dialog-header h2 {
  margin: 2px 0 1px;
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.dialog-header p {
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
}

.map-list-tools {
  display: grid;
  flex: none;
  gap: 8px;
  padding: 0 18px 10px;
}

.map-list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.map-list-context-chip {
  padding: 2.5px 9px;
  border: 1px solid rgba(46, 196, 176, 0.32);
  border-radius: 99px;
  background: var(--teal-dim);
  color: #a5ecdf;
  font-size: 10px;
}

.map-list-context-chip--muted {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-3);
}

.map-list-results {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 4px 10px 14px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.map-list-item {
  position: relative;
  display: grid;
  align-items: center;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background:
    linear-gradient(to right, rgba(46, 196, 176, 0.1) var(--share, 0%), transparent var(--share, 0%));
  color: var(--ink);
  gap: 12px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  text-align: left;
}

.map-list-item:hover {
  background:
    linear-gradient(to right, rgba(46, 196, 176, 0.14) var(--share, 0%), transparent var(--share, 0%)),
    rgba(151, 168, 192, 0.08);
}

.map-list-rank {
  color: var(--ink-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.map-list-copy {
  display: grid;
  min-width: 0;
}

.map-list-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-list-copy span {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-list-count {
  color: var(--teal-strong);
  font-size: 13px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Loading skeleton
   ============================================================ */

.is-loading .skeleton-text {
  position: relative;
  display: inline-block;
  overflow: hidden;
  min-width: 36px;
  border-radius: 6px;
  background: rgba(151, 168, 192, 0.14);
  color: transparent !important;
}

.is-loading .skeleton-text::after {
  position: absolute;
  animation: shimmer 1.3s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(151, 168, 192, 0.14), transparent);
  content: "";
  inset: 0;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (min-width: 1200px) {
  .map-workspace.has-panel .maplibregl-ctrl-top-right {
    right: calc(var(--panel-width) + 26px);
  }

  .map-workspace.has-panel .map-footer {
    right: calc(var(--panel-width) + 26px);
  }
}

@media (max-width: 1280px) {
  .stat {
    padding: 0 13px;
  }

  .stat__value {
    font-size: 15.5px;
  }

  .topbar {
    gap: 14px;
  }
}

@media (max-width: 1120px) {
  .toolbar__meta {
    order: 10;
    flex-basis: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .filter-chips {
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  .topbar {
    flex-wrap: wrap;
    padding: 10px 14px;
    row-gap: 8px;
  }

  .topbar__brand {
    order: 1;
  }

  .theme-controls {
    order: 2;
    margin-left: auto;
  }

  .topbar__stats {
    order: 3;
    overflow-x: auto;
    flex-basis: 100%;
    margin-left: 0;
    padding-bottom: 2px;
  }

  .stat {
    flex: none;
  }

  .stat:first-child {
    padding-left: 0;
  }
}

@media (max-width: 900px) {
  .app-frame {
    height: auto;
    min-height: 100dvh;
  }

  .map-workspace {
    min-height: 0;
    flex: none;
    height: max(430px, calc(100dvh - 245px));
  }

  .field--search {
    flex-basis: 100%;
  }

  .field .combo-picker {
    width: auto;
    min-width: 124px;
  }

  .detail-panel {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 82dvh;
    border-radius: 16px 16px 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    transform: translateY(24px);
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
  }

  .map-workspace.has-panel .detail-panel {
    transform: translateY(0);
  }

  .map-workspace.has-panel .panel-backdrop {
    display: block;
  }

  .map-attribution {
    display: none;
  }

  .map-legend {
    bottom: 12px;
  }

  .map-footer {
    bottom: 12px;
  }

  .gesture-hint {
    bottom: 54px;
  }
}

@media (max-width: 640px) {
  .toolbar {
    padding: 8px 12px;
  }

  .topbar {
    padding: 9px 12px;
  }

  .theme-controls {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 3px;
  }

  .live-status {
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 8.75px;
    line-height: 1.2;
  }

  .field:not(.field--search) {
    flex: 1 1 calc(33% - 8px);
  }

  .field .combo-picker {
    width: 100%;
    min-width: 0;
  }

  .reset-button {
    flex: none;
  }

  .stat {
    padding: 0 11px;
  }

  .stat__value {
    font-size: 14.5px;
  }

  .product-name {
    font-size: 13px;
  }

  .map-coverage {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand-copy {
    display: none;
  }
}

/* ============================================================
   Motion preferences
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Light theme — soft neutral daylight palette
   ============================================================ */

:root[data-theme="light"] {
  --bg: #dce4e5;
  --bg-raise: #e7ebea;
  --surface: #f1efe9;
  --surface-2: #e3e9e8;
  --glass: rgba(238, 239, 234, 0.88);
  --glass-strong: rgba(243, 241, 235, 0.96);
  --line: rgba(31, 51, 61, 0.16);
  --line-strong: rgba(31, 51, 61, 0.31);
  --ink: #182a34;
  --ink-2: #3f5661;
  --ink-3: #5d737c;
  --teal: #126f78;
  --teal-strong: #0b5c64;
  --teal-deep: #d4e7e4;
  --teal-dim: rgba(18, 111, 120, 0.11);
  --amber: #bd6c20;
  --amber-strong: #8f4f13;
  --amber-dim: rgba(189, 108, 32, 0.14);
  --focus: #1f66bd;
  --shadow-1: 0 1px 2px rgba(21, 39, 49, 0.08), 0 8px 24px rgba(21, 39, 49, 0.11);
  --shadow-2: 0 2px 6px rgba(21, 39, 49, 0.09), 0 18px 48px rgba(21, 39, 49, 0.2);
}

[data-theme="light"] ::selection {
  background: rgba(15, 119, 130, 0.16);
}

[data-theme="light"] * {
  scrollbar-color: rgba(20, 36, 54, 0.22) transparent;
}

[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: rgba(20, 36, 54, 0.2) padding-box;
}

[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 36, 54, 0.34) padding-box;
}

[data-theme="light"] .topbar {
  background: linear-gradient(180deg, #eceeea 0%, #e5e9e8 100%);
}

[data-theme="light"] .brand-mark {
  border-color: rgba(15, 119, 130, 0.4);
  background: linear-gradient(160deg, #10828d, #0b5e68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #eafaf6;
}

[data-theme="light"] .theme-toggle {
  background: rgba(20, 36, 54, 0.04);
}

[data-theme="light"] .theme-toggle button.is-active,
[data-theme="light"] .view-toggle button.is-active {
  box-shadow: inset 0 0 0 1px rgba(15, 119, 130, 0.32);
}

[data-theme="light"] .button {
  color: #ffffff;
}

[data-theme="light"] .button--ghost {
  color: var(--ink-2);
}

[data-theme="light"] .button--ghost:hover:not(:disabled) {
  color: var(--ink);
}

[data-theme="light"] .search-control:focus-within,
[data-theme="light"] .combo-picker[open] summary,
[data-theme="light"] .combo-picker__search input:focus,
[data-theme="light"] .panel-search input:focus,
[data-theme="light"] .map-list-tools input:focus {
  box-shadow: 0 0 0 3px rgba(15, 119, 130, 0.14);
}

[data-theme="light"] .filter-chip {
  border-color: rgba(15, 119, 130, 0.32);
  color: #0a5f57;
}

[data-theme="light"] .filter-chip > button:hover {
  background: rgba(15, 119, 130, 0.18);
  color: #06403a;
}

[data-theme="light"] .granularity-badge {
  color: #0a5f57;
}

[data-theme="light"] .granularity-badge--coarse {
  background: rgba(20, 36, 54, 0.07);
  color: var(--ink-2);
}

[data-theme="light"] .map-breadcrumb {
  background: rgba(240, 239, 233, 0.84);
}

[data-theme="light"] .map-coverage {
  background: rgba(235, 237, 232, 0.82);
}

[data-theme="light"] .map-attribution {
  color: rgba(107, 125, 143, 0.95);
}

[data-theme="light"] .map-card::after {
  box-shadow: inset 0 0 90px rgba(20, 36, 54, 0.1);
}

[data-theme="light"] .maplibregl-ctrl button .maplibregl-ctrl-icon {
  filter: none;
}

[data-theme="light"] .map-state--loading {
  background: rgba(220, 228, 229, 0.92);
}

[data-theme="light"] .map-state:not(.map-state--loading) strong,
[data-theme="light"] .map-state:not(.map-state--loading) > span,
[data-theme="light"] .map-state:not(.map-state--loading) .map-state__icon {
  background: rgba(241, 239, 233, 0.88);
}

[data-theme="light"] .lg-circle {
  border-color: rgba(15, 119, 130, 0.6);
  background: rgba(15, 119, 130, 0.06);
}

[data-theme="light"] .lg-tick {
  border-top-color: rgba(20, 36, 54, 0.3);
}

[data-theme="light"] .key-swatch--exact {
  border-color: #0a5f68;
  background: #0f7782;
}

[data-theme="light"] .key-swatch--metro {
  border-color: rgba(15, 119, 130, 0.55);
  background: rgba(15, 119, 130, 0.4);
}

[data-theme="light"] .key-swatch--region {
  border-color: #6c8296;
}

[data-theme="light"] .map-list-dialog {
  background: var(--surface);
}

[data-theme="light"] .map-list-dialog::backdrop {
  background: rgba(18, 28, 38, 0.42);
}

[data-theme="light"] .map-list-context-chip {
  border-color: rgba(15, 119, 130, 0.32);
  color: #0a5f57;
}

[data-theme="light"] .map-list-item {
  background:
    linear-gradient(to right, rgba(15, 119, 130, 0.1) var(--share, 0%), transparent var(--share, 0%));
}

[data-theme="light"] .map-list-item:hover {
  background:
    linear-gradient(to right, rgba(15, 119, 130, 0.13) var(--share, 0%), transparent var(--share, 0%)),
    rgba(20, 36, 54, 0.04);
}

[data-theme="light"] .detail-panel {
  background: rgba(241, 239, 233, 0.95);
}

[data-theme="light"] .panel-kpi {
  background: rgba(20, 36, 54, 0.03);
}

[data-theme="light"] .aggregate-summary__item {
  background: rgba(20, 36, 54, 0.04);
}

[data-theme="light"] .aggregate-location-link {
  background: rgba(20, 36, 54, 0.04);
}

[data-theme="light"] .aggregate-location-link:hover,
[data-theme="light"] .aggregate-location-link:focus-visible {
  background: rgba(31, 143, 126, 0.12);
}

[data-theme="light"] .panel-backdrop {
  background: rgba(18, 28, 38, 0.38);
}

[data-theme="light"] .is-loading .skeleton-text {
  background: rgba(20, 36, 54, 0.09);
}

[data-theme="light"] .is-loading .skeleton-text::after {
  background: linear-gradient(90deg, transparent, rgba(20, 36, 54, 0.07), transparent);
}

/* ============================================================
   Live theme — stable interface chrome around the real-time solar map
   ============================================================ */

:root[data-theme="live"] {
  --bg: #08111b;
  --bg-raise: #0b1520;
  --surface: #111d29;
  --surface-2: #172534;
  --glass: rgba(10, 20, 30, 0.82);
  --glass-strong: rgba(14, 25, 36, 0.95);
  --line: rgba(135, 166, 187, 0.15);
  --line-strong: rgba(135, 166, 187, 0.29);
  --ink: #e7eff5;
  --ink-2: #a9bac8;
  --ink-3: #7f93a4;
  --teal: #2ec4b0;
  --teal-strong: #72e0cf;
  --teal-deep: #123f3c;
  --teal-dim: rgba(46, 196, 176, 0.14);
  --amber: #e8923e;
  --amber-strong: #ffc989;
  --amber-dim: rgba(232, 146, 62, 0.16);
}

[data-theme="live"] .lg-circle {
  border-color: rgba(114, 224, 207, 0.66);
  background: rgba(46, 196, 176, 0.1);
}

[data-theme="live"] .key-swatch--exact {
  border-color: #72e0cf;
  background: #2ec4b0;
}

[data-theme="live"] .key-swatch--metro {
  border-color: rgba(114, 224, 207, 0.6);
  background: rgba(46, 196, 176, 0.58);
}
