/* ─────────────────────────────────────────────────────────────
   TOKENS  (liquid-glass dark mode on satellite)
───────────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --fill-primary: rgba(255, 255, 255, .10);
  --fill-secondary: rgba(255, 255, 255, .06);
  --fill-tertiary: rgba(255, 255, 255, .04);
  --label-primary: rgba(255, 255, 255, .96);
  --label-secondary: rgba(255, 255, 255, .72);
  --label-tertiary: rgba(255, 255, 255, .47);
  --label-quaternary: rgba(255, 255, 255, .29);
  --sep: rgba(255, 255, 255, .12);
  --accent: #FFFFFF;
  --accent-dim: rgba(255, 255, 255, .15);
  --accent-border: rgba(255, 255, 255, .40);
  --accent-active: #FFFFFF;

  /* Spacing — 4pt grid (Apple HIG–style: 4 / 8 / 12 / 16) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --sp: var(--space-3);
  --stack-gap: 6px;
  /* Panel inset — slightly tighter for space-efficient column */
  --panel-pad-x: 10px;
  --panel-pad-y: 10px;
  --stack-bubble-pad-y: var(--panel-pad-y);
  --stack-bubble-pad-x: var(--panel-pad-x);
  --inset: var(--sp);
  /* 1px border all sides → 2px vertical on .bubble (border-box min-height must include this) */
  --bubble-border-y: 2px;
  /* Pill / chip / slider track — inner row; matches KPI content band inside padded bubble */
  --module-min-h: 26px;
  /* Pills: one height + one type size (capsule controls) */
  --pill-font-size: 8.5px;
  --pill-font-weight: 600;
  /* Min cell width: 2 columns on ~272px inner panel; lone last row stretches (1fr) */
  --pill-cell-min: 108px;
  /* Motion — slower, more physical */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0.2, 1);
  --dur-fast: .30s;
  --dur-med: .60s;
  --dur-slow: .90s;
  /* KPI stat tiles: fixed row height */
  --tile-row-h: calc(var(--module-min-h) + 2 * var(--stack-bubble-pad-y) + var(--bubble-border-y));
  --pill-pad-x: var(--stack-gap);
  --panel-w: 296px;
  /* Large radius + equal inset ≈ Apple sheet / Control Center grouping (avoid “pinched” inner margins) */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  /* Inner corner when nesting content (radius − content inset) */
  --radius-inner: max(4px, calc(var(--radius-lg) - var(--panel-pad-x)));
  /* Range: thin track + thumb (not full pill height) */
  --slider-track-h: 5px;
  --slider-thumb-w: 15px;
  --slider-thumb-h: 17px;
  --slider-hit-h: 24px;
}

/* ─────────────────────────────────────────────────────────────
   BASE
───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1f2e;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
  color: var(--label-primary);
}

/* ─────────────────────────────────────────────────────────────
   MAP
───────────────────────────────────────────────────────────── */
#map {
  position: absolute;
  inset: 0;
}

/* MapLibre overrides */
.maplibregl-ctrl-bottom-right {
  right: var(--inset);
  bottom: var(--inset);
}

.maplibregl-ctrl-top-right {
  right: var(--sp);
  top: var(--sp);
}

.maplibregl-ctrl-attrib {
  background: rgba(0, 0, 0, .5) !important;
  color: rgba(255, 255, 255, .4) !important;
  font-size: 10px !important;
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm) !important;
}

.maplibregl-ctrl-attrib a {
  color: rgba(255, 255, 255, .5) !important;
}

.maplibregl-ctrl-group {
  background: rgba(28, 28, 30, .85) !important;
  backdrop-filter: blur(20px) !important;
  border-radius: var(--radius-md) !important;
  border: 0.5px solid rgba(255, 255, 255, .12) !important;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .4) !important;
}

.maplibregl-ctrl-group button {
  background: transparent !important;
  border-bottom: 0.5px solid rgba(255, 255, 255, .1) !important;
}

.maplibregl-ctrl-group button:last-child {
  border-bottom: none !important;
}

.maplibregl-ctrl-icon {
  filter: invert(1) opacity(.7);
}

.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
  filter: none;
}

/* ─────────────────────────────────────────────────────────────
   LIQUID GLASS BUBBLE — true see-through with specular highlights
───────────────────────────────────────────────────────────── */
.bubble {
  position: relative;
  width: 100%;
  overflow: visible;
  /* Ultra-thin tinted glass — satellite visible below */
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, .13) 0%,
      rgba(255, 255, 255, .04) 40%,
      rgba(120, 160, 255, .03) 70%,
      rgba(255, 255, 255, .07) 100%);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, .20);
  box-shadow:
    0 14px 80px rgba(0, 0, 0, .26),
    0 2px 30px rgba(0, 0, 0, .12),
    inset 0 1.5px 0 rgba(255, 255, 255, .45),
    inset 1.5px 0 0 rgba(255, 255, 255, .18),
    inset 0 -1px 0 rgba(0, 0, 0, .08),
    inset -1px 0 0 rgba(0, 0, 0, .035);
  z-index: 10;
  padding: var(--panel-pad-y) var(--panel-pad-x);
  /* Avoid animating box-shadow (expensive repaint); keep motion on transform/opacity elsewhere. */
  transition: border-color var(--dur-med) ease;
  contain: paint;
}
.bubble:hover {
  border-color: rgba(255, 255, 255, .24);
  box-shadow:
    0 14px 80px rgba(0, 0, 0, .26),
    0 2px 30px rgba(0, 0, 0, .12),
    inset 0 1.5px 0 rgba(255, 255, 255, .48),
    inset 1.5px 0 0 rgba(255, 255, 255, .2),
    inset 0 -1px 0 rgba(0, 0, 0, .08),
    inset -1px 0 0 rgba(0, 0, 0, .035),
    inset 0 0 80px rgba(255, 255, 255, .06);
}

/* Definitive map control removal */
.maplibregl-ctrl {
  display: none !important;
}

/* Soft diffuse glaze on the whole glass (no streak / spotlight) */
.bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse 125% 110% at 50% 38%,
      rgba(255, 255, 255, .14) 0%,
      rgba(255, 255, 255, .05) 45%,
      transparent 72%);
  pointer-events: none;
  z-index: 0;
  transition: background var(--dur-med) ease, opacity var(--dur-med) ease;
}
.bubble:hover::before {
  background: radial-gradient(ellipse 135% 118% at 50% 42%,
      rgba(255, 255, 255, .17) 0%,
      rgba(255, 255, 255, .06) 48%,
      transparent 74%);
}

.bubble>* {
  position: relative;
  z-index: 1;
}

/* ─────────────────────────────────────────────────────────────
   LEFT STACK — absolute column holding results + panel
───────────────────────────────────────────────────────────── */
#left-stack {
  position: absolute;
  top: var(--sp);
  left: var(--sp);
  bottom: var(--sp);
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
  pointer-events: none; /* Let clicks pass through gaps */
  z-index: 10;
}

/* ─────────────────────────────────────────────────────────────
   BLOCK DOCK (bottom-center carousel)
───────────────────────────────────────────────────────────── */
.block-dock {
  position: absolute;
  left: 50%;
  bottom: var(--sp);
  transform: translateX(-50%);
  z-index: 1002;
  width: min(560px, calc(100vw - 2 * var(--sp)));
  max-width: calc(100vw - 2 * var(--sp));
  /* Frosted tray */
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, .11) 0%,
      rgba(255, 255, 255, .03) 44%,
      rgba(120, 160, 255, .025) 70%,
      rgba(255, 255, 255, .055) 100%);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  box-shadow:
    0 22px 120px rgba(0,0,0,.26),
    0 2px 40px rgba(0,0,0,.12),
    inset 0 1.2px 0 rgba(255,255,255,.42),
    inset 0 -1px 0 rgba(0,0,0,.06);
  pointer-events: none;
  opacity: 0;
  filter: blur(8px);
  transition: opacity var(--dur-med) ease, filter var(--dur-med) ease, transform var(--dur-med) var(--ease-spring);
}

.block-dock[data-visible="true"] {
  opacity: 1;
  filter: blur(0);
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.block-dock-track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Own the scroll: soft edge fade like iOS carousels */
  -webkit-mask-image: linear-gradient(to right,
    transparent 0px,
    rgba(0,0,0,1) 14px,
    rgba(0,0,0,1) calc(100% - 14px),
    transparent 100%);
  mask-image: linear-gradient(to right,
    transparent 0px,
    rgba(0,0,0,1) 14px,
    rgba(0,0,0,1) calc(100% - 14px),
    transparent 100%);
}
.block-dock-track::-webkit-scrollbar { width: 0; height: 0; }

.block-card {
  flex: 0 0 auto;
  scroll-snap-align: center;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  gap: 2px;
  /* Override `.bubble { width:100% }` so multiple cards can show */
  width: auto;
  min-width: 78px;
  height: 42px;
  border-radius: 16px;
  padding: 6px 7px;
  position: relative;
}

.block-card .thumb {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
  border: 0.5px solid rgba(255, 255, 255, .14);
  display: grid;
  place-items: center;
  overflow: visible;
  flex-shrink: 0;
}

.block-card .thumb svg {
  width: 22px;
  height: 22px;
  opacity: 0.9;
  transform: translateY(-6px);
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.22));
}

.block-card .meta {
  display: flex;
  flex-direction: column;
  line-height: 1.02;
  min-width: 0;
  align-items: center;
  text-align: center;
}

.block-card .ratio {
  font-size: 8.2px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--label-primary);
}

.block-card .sub {
  font-size: 7.2px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--label-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 82px;
}

.block-card.is-active {
  border-color: rgba(255, 255, 255, .26) !important;
}

.dl-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  opacity: 0.55;
  transform: translateY(0.5px);
}

.block-card:hover .dl-hint { opacity: 0.75; }

.dl-hint svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─────────────────────────────────────────────────────────────
   RESULTS BUBBLE — top of left stack
───────────────────────────────────────────────────────────── */
#kpi-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--stack-gap);
  flex-shrink: 0;
  align-items: stretch;
}

.stat-bubble {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tile-row-h);
  box-sizing: border-box;
}
.stat-bubble > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}
.stat-bubble .stat-lbl { margin-top: 2px; text-align: center; }

.stat-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -.02em;
  text-shadow:            0 0 18px rgba(255, 255, 255, .28);
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  font-size: 8px;
  font-weight: 700;
  color: var(--accent);
  opacity: .8;
  margin-left: 2px;
}

.stat-lbl {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--label-quaternary);
  margin-top: 0;
}

/* ─────────────────────────────────────────────────────────────
   CONTROLS PANEL — fills remaining height in left stack
───────────────────────────────────────────────────────────── */
#control-stack {
  flex: 1;
  height: 0;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--stack-gap);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  /* Needs to accept wheel/touch scroll when accordions grow. */
  pointer-events: auto;
}

#control-stack::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.control-tile { 
  flex-shrink: 0; 
  width: var(--panel-w);
  max-width: 100%;
  pointer-events: auto;
}

#kpi-strip {
  width: var(--panel-w);
  max-width: 100%;
  pointer-events: auto;
}

/* ─────────────────────────────────────────────────────────────
   BASEMAP TOGGLE (top-right) — liquid glass style
───────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────
   SECTION LABELS & SEPARATORS
───────────────────────────────────────────────────────────── */
.sec-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--label-quaternary);
  margin-bottom: var(--stack-gap);
  flex-shrink: 0;
}

.sec-sep {
  height: 0.5px;
  background: var(--sep);
  margin: var(--stack-gap) 0;
  flex-shrink: 0;
}

.flex-align {
  display: flex;
  align-items: center;
  gap: var(--stack-gap);
}

.vis-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--label-quaternary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: color var(--dur-fast) ease;
  width: var(--module-min-h);
  height: var(--module-min-h);
  box-sizing: border-box;
}
.vis-toggle svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.vis-toggle:hover {
  color: var(--label-quaternary);
  background: rgba(255, 255, 255, .05);
  border-radius: 100px;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
}
.vis-toggle.active { color: var(--accent); }
.vis-toggle .slash { display: none; }
.vis-toggle.off .slash { display: block; }
.vis-toggle.off .eye-ball { opacity: 0.3; }

/* ─────────────────────────────────────────────────────────────
   TOP MENU + AUTH OVERLAY (v1)
───────────────────────────────────────────────────────────── */
#app-menu.app-menu {
  pointer-events: auto; /* left-stack itself has pointer-events: none */
  align-self: flex-start;
  /* override `.control-tile` width + bubble padding so we can morph into a pill */
  width: 52px;
  min-width: 52px;
  max-width: none;
  padding: 0 !important;
  border-radius: 999px;
  overflow: hidden;
  /* Remove sharp bubble border/shadow wrapper during morph */
  border: none !important;
  box-shadow: none !important;
  background: rgba(255, 255, 255, .04) !important;
  transition: width .38s cubic-bezier(0.34, 1.56, 0.64, 1), border-radius .38s ease, box-shadow .25s ease, border-color .25s ease;
}

#app-menu.app-menu #menu-trigger {
  display: none; /* row mode: no collapse/expand trigger */
}

#app-menu.app-menu:hover {
  border-color: transparent !important;
  box-shadow: none !important;
}

#app-menu.app-menu.collapsed {
  height: 52px;
}

#app-menu.app-menu.open {
  width: var(--panel-w);
  height: 52px;
}

#app-menu.app-menu.open #menu-trigger {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .26);
  box-shadow: 0 22px 90px rgba(0,0,0,.32);
}

#app-menu.app-menu.open #menu-trigger::before {
  transform: translate(-50%, -50%) rotate(90deg);
}

#menu-trigger {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  flex-shrink: 0;
  z-index: 2;
  transition: transform var(--dur-fast) ease, background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

#menu-trigger:hover {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .26);
  box-shadow: 0 14px 60px rgba(0,0,0,.25);
  transform: translateY(-1px);
}

#menu-trigger::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .78);
  transform: translate(-50%, -50%);
  box-shadow:
    0 -6px 0 rgba(255, 255, 255, .58),
    0 6px 0 rgba(255, 255, 255, .58);
}

#menu-panel {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--stack-gap);
  padding: 0 var(--stack-gap) 0 0;
  margin-left: calc(-1 * var(--stack-gap));
  opacity: 0;
  transform: translateX(-10px) scale(0.985);
  pointer-events: none;
  transition: opacity var(--dur-fast) ease, transform var(--dur-slow) var(--ease-spring);
  position: relative;
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
}

#app-menu.app-menu.open #menu-panel {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

#menu-panel .menu-item {
  opacity: 0;
  transform: translateX(-10px) scale(0.98);
  filter: blur(5px);
  transition:
    opacity .26s ease,
    transform .36s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter .36s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#app-menu.app-menu.open #menu-panel .menu-item {
  opacity: 1;
  transform: translateX(0) scale(1);
  filter: blur(0);
}

#app-menu.app-menu.open #menu-panel [data-menu-action="territory"] { transition-delay: .02s; }
#app-menu.app-menu.open #menu-panel [data-menu-action="login"]     { transition-delay: .06s; }
#app-menu.app-menu.open #menu-panel [data-menu-action="export"]    { transition-delay: .10s; }
#app-menu.app-menu.open #menu-panel [data-menu-action="logout"]    { transition-delay: .14s; }

.menu-item {
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: var(--label-secondary);
  border-radius: 999px;
  /* Match existing capsule/pill padding language */
  padding: 5px var(--stack-gap);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) ease;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  user-select: none;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Territory dropdown inside the menu panel
   (Use control-chip styling when present; keep legacy styles only for non-control-chip cases.) */
.territory-dropdown {
  position: absolute;
  top: 60px;
  left: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Use same inset rhythm as bubbles */
  padding: var(--panel-pad-y) var(--panel-pad-x);
  border-radius: var(--radius-inner);
  background: rgba(20, 20, 24, .88);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 22px 90px rgba(0,0,0,.35);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  filter: blur(6px);
  pointer-events: none;
  transition: opacity var(--dur-fast) ease, transform var(--dur-slow) var(--ease-spring), filter var(--dur-med) ease;
}

.territory-dropdown[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.territory-option:not(.control-chip) {
  text-align: left;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: var(--label-secondary);
  padding: 5px var(--stack-gap);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.territory-option:not(.control-chip):hover {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .22);
  transform: translateY(-1px);
}

.territory-option:not(.control-chip)[disabled] {
  cursor: not-allowed;
  opacity: .55;
}

.menu-item:hover {
  color: var(--accent);
  border-color: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .10);
  box-shadow: 0 14px 60px rgba(0,0,0,.25), inset 0 0 32px rgba(255, 255, 255, .06);
  transform: translateY(-1px);
}

@keyframes liquid-pop-in {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.995);
    filter: blur(6px);
  }
  65% {
    opacity: 1;
    transform: translateY(-0.5px) scale(1.02);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Accordion reveal must preserve borders (no blur). */
@keyframes liquid-acc-pop-in {
  0% {
    opacity: 0;
    transform: translateY(4px) scale(0.995);
  }
  65% {
    opacity: 1;
    transform: translateY(-0.5px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─────────────────────────────────────────────────────────────
   UTILITY ROW (v4) — same `control-chip` language
───────────────────────────────────────────────────────────── */
#menu-grid.menu-grid {
  display: grid;
  grid-template-columns: 1fr max-content max-content max-content;
  gap: var(--stack-gap);
  width: var(--panel-w);
  max-width: 100%;
  pointer-events: auto;
}

.menu-tile {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.menu-tile.bubble {
  /* Make `.bubble` behave like a compact pill (same height rhythm as chips). */
  min-height: var(--module-min-h);
  height: var(--module-min-h);
  padding: 0 var(--stack-gap);
  border-radius: 100px;
  color: var(--label-secondary);
}

.menu-tile.bubble::before {
  border-radius: 100px;
}

/* Utility bubbles: boost frosting (same recipe, denser in small area). */
#menu-grid .menu-tile.bubble {
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, .18) 0%,
      rgba(255, 255, 255, .06) 40%,
      rgba(120, 160, 255, .04) 70%,
      rgba(255, 255, 255, .10) 100%);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border-color: rgba(255, 255, 255, .24);
  box-shadow:
    0 14px 80px rgba(0, 0, 0, .26),
    0 2px 30px rgba(0, 0, 0, .12),
    inset 0 1.5px 0 rgba(255, 255, 255, .52),
    inset 1.5px 0 0 rgba(255, 255, 255, .22),
    inset 0 -1px 0 rgba(0, 0, 0, .08),
    inset -1px 0 0 rgba(0, 0, 0, .035);
}

#menu-grid .menu-tile.bubble:hover {
  border-color: rgba(255, 255, 255, .28);
  box-shadow:
    0 14px 80px rgba(0, 0, 0, .26),
    0 2px 30px rgba(0, 0, 0, .12),
    inset 0 1.5px 0 rgba(255, 255, 255, .55),
    inset 1.5px 0 0 rgba(255, 255, 255, .24),
    inset 0 -1px 0 rgba(0, 0, 0, .08),
    inset -1px 0 0 rgba(0, 0, 0, .035),
    inset 0 0 80px rgba(255, 255, 255, .07);
}

.menu-tile--wide {
  justify-content: flex-start;
}

.menu-tile--mini {
  width: auto;
  min-width: var(--module-min-h);
  padding-left: 0;
  padding-right: 0;
}

.menu-tile:focus,
.menu-tile:focus-visible {
  outline: none;
}

.menu-tile:active {
  transform: translateY(-0.5px);
}

.menu-tile[disabled],
.menu-tile[aria-disabled="true"] {
  opacity: 0.62;
  cursor: not-allowed;
}

/* Territory is static, but should retain full frosting/opacity. */
.menu-territory.menu-tile[aria-disabled="true"] {
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

.menu-tile .menu-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.menu-tile .menu-label {
  font-size: var(--pill-font-size);
  font-weight: var(--pill-font-weight);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: inherit;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Icon-only mini actions (download/out) */
.menu-tile--mini .menu-icon { margin: 0 auto; }

/* Muni boundary icon semantics: show slash only when OFF. */
/* Muni boundary icon uses the same `vis-toggle` semantics (active/off). */

/* Full screen blocker */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 50000;
  opacity: 0;
  transform: translateY(10px) scale(0.99);
  pointer-events: none;
  transition: opacity var(--dur-fast) ease, transform var(--dur-slow) var(--ease-spring);
  background:
    radial-gradient(circle at 18% 16%, rgba(120, 160, 255, .20) 0%, transparent 46%),
    radial-gradient(circle at 78% 28%, rgba(255, 255, 255, .10) 0%, transparent 50%),
    rgba(0, 0, 0, .38);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp);
  pointer-events: none;
}

.auth-overlay[data-visible="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.auth-modal {
  width: min(390px, calc(100vw - 2 * var(--sp)));
}

.auth-head {
  margin-bottom: var(--stack-gap);
}

.auth-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.auth-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
  margin-bottom: 8px;
}

.auth-note {
  margin-top: var(--stack-gap);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--label-quaternary);
}

.auth-subtitle {
  margin-top: 6px;
  font-size: 9px;
  color: var(--label-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}

.auth-form {
  /* Keep the form compact and aligned with the existing bubble rhythm */
  width: min(var(--panel-w), calc(100vw - 2 * var(--sp)));
}

/* Auth orb — “magical” 3D glass object */
.auth-orb-wrap {
  width: 100%;
  display: grid;
  place-items: center;
  margin-bottom: calc(var(--stack-gap) * 2.5);
  pointer-events: none;
}

/* (No WebGL orb; lens-only CSS) */

.auth-orb {
  width: 124px;
  height: 124px;
  position: relative;
  perspective: 900px;
  transform-style: preserve-3d;
  animation: auth-orb-float 4.2s ease-in-out infinite;
  filter: drop-shadow(0 24px 70px rgba(0, 0, 0, .38));
}

.auth-orb-rot {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  /* True micro 3D wobble (very low limits) */
  transform:
    translateZ(0)
    rotateX(var(--wx, 0deg))
    rotateY(var(--wy, 0deg))
    rotateZ(calc(var(--wy, 0deg) * 0.06));
}

.auth-orb-core {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  /* Convex lens: specular hotspot follows cursor; no lines, no globe cues. */
  background:
    radial-gradient(circle at var(--lx, 50%) var(--ly, 35%),
      rgba(255,255,255,.26) 0%,
      rgba(255,255,255,.12) 18%,
      rgba(255,255,255,.05) 34%,
      transparent 62%),
    radial-gradient(circle at calc(100% - var(--lx, 50%)) calc(100% - var(--ly, 35%)),
      rgba(120,160,255,.08) 0%,
      rgba(120,160,255,.035) 30%,
      transparent 66%),
    radial-gradient(circle at 50% 60%,
      rgba(255,255,255,.10) 0%,
      rgba(255,255,255,.04) 44%,
      transparent 70%),
    linear-gradient(135deg,
      rgba(255,255,255,.13) 0%,
      rgba(255,255,255,.04) 42%,
      rgba(120,160,255,.03) 72%,
      rgba(255,255,255,.075) 100%);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow:
    0 18px 92px rgba(0,0,0,.32),
    inset 0 1.5px 0 rgba(255,255,255,.55),
    inset 0 0 70px rgba(255,255,255,.08);
  transform: translateZ(18px);
  backface-visibility: hidden;
}

.auth-orb-core {
  /* Thick-glass edge response: rim brightens when light is off-center */
  border-color: rgba(255, 255, 255, calc(0.18 + var(--ld, 0) * 0.14));
  box-shadow:
    0 18px 92px rgba(0,0,0,.32),
    inset 0 1.5px 0 rgba(255,255,255,.50),
    inset 0 0 70px rgba(255,255,255,.07),
    inset 0 0 0 1px rgba(255,255,255, calc(0.04 + var(--ld, 0) * 0.06)),
    inset 0 0 34px rgba(255,255,255, calc(0.04 + var(--ld, 0) * 0.06));
}

/* (Removed back/rim layers for lens-only look) */

.auth-orb-vignette {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  transform: translateZ(22px);
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 55%,
      transparent 52%,
      rgba(0, 0, 0, .10) 76%,
      rgba(0, 0, 0, .20) 100%),
    radial-gradient(circle at var(--lx, 50%) var(--ly, 35%),
      rgba(255,255,255,.10) 0%,
      transparent 44%);
  mix-blend-mode: multiply;
  opacity: .9;
}

.auth-orb-vignette {
  /* Rim glint follows light direction (thick glass) */
  background:
    radial-gradient(circle at 50% 55%,
      transparent 52%,
      rgba(0, 0, 0, .10) 76%,
      rgba(0, 0, 0, .20) 100%),
    radial-gradient(circle at var(--lx, 50%) var(--ly, 35%),
      rgba(255,255,255, calc(0.08 + var(--ld, 0) * 0.10)) 0%,
      transparent 44%);
}

.auth-orb-core::marker { content: ''; }

/* Cursor-driven specular highlight + reflection band (liquid-glass feel) */
.auth-orb-core .auth-orb-light,
.auth-orb-core::before,
.auth-orb-core::after {
  /* keep existing pseudo elements; additional layers below */
}

.auth-orb-core::before {
  background: radial-gradient(ellipse 120% 90% at 35% 20%,
      rgba(255,255,255,.22) 0%,
      rgba(255,255,255,.06) 42%,
      transparent 70%);
}

.auth-orb-core::after {
  background: radial-gradient(circle at 50% 60%,
      rgba(255,255,255,.10) 0%,
      rgba(255,255,255,.04) 38%,
      transparent 62%);
}

.auth-orb-core::before,
.auth-orb-core::after {
  /* add a subtle cursor-driven shift via a nested overlay using background-position vars */
}

.auth-orb-core::after {
  opacity: .75;
}

.auth-orb-core::before {
  opacity: .9;
}

.auth-orb-core::before {
  /* specular hotspot follows cursor */
  background:
    radial-gradient(circle at var(--lx, 50%) var(--ly, 35%),
      rgba(255,255,255,.22) 0%,
      rgba(255,255,255,.10) 18%,
      rgba(255,255,255,.04) 34%,
      transparent 58%),
    radial-gradient(ellipse 120% 90% at 35% 20%,
      rgba(255,255,255,.18) 0%,
      rgba(255,255,255,.05) 42%,
      transparent 70%);
}

.auth-orb-core::after {
  /* reflection band slides horizontally with cursor */
  background:
    linear-gradient(120deg,
      transparent 0%,
      rgba(255,255,255,.00) 34%,
      rgba(255,255,255,.10) 46%,
      rgba(255,255,255,.015) 58%,
      transparent 66%),
    radial-gradient(circle at 50% 60%,
      rgba(255,255,255,.08) 0%,
      rgba(255,255,255,.03) 40%,
      transparent 64%);
  background-size: 220% 220%, 100% 100%;
  background-position: calc(var(--lx, 50%) * 1) 50%, 50% 50%;
}

/* No mesh lines for lens. */

.auth-orb-core::before {
  content: '';
  position: absolute;
  inset: 10px 12px 18px 12px;
  border-radius: 999px;
  background: radial-gradient(ellipse 120% 90% at 35% 20%, rgba(255,255,255,.22) 0%, rgba(255,255,255,.06) 42%, transparent 70%);
  filter: blur(0.3px);
  opacity: .95;
}

.auth-orb-core::after {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 60%, rgba(255,255,255,.10) 0%, rgba(255,255,255,.04) 38%, transparent 62%);
  filter: blur(0.6px);
  opacity: .8;
}

/* No rings for lens. */

.auth-orb-spark {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(circle at var(--lx, 65%) var(--ly, 22%), rgba(255,255,255,.42) 0%, rgba(255,255,255,.12) 14%, transparent 34%);
  transform: translateZ(24px);
  opacity: .78;
  animation: auth-orb-spark 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes auth-orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes auth-lens-wobble {
  0%, 100% { transform: translateZ(0) rotateX(0deg) rotateY(0deg); }
  30% { transform: translateZ(0) rotateX(-0.35deg) rotateY(0.55deg); }
  70% { transform: translateZ(0) rotateX(0.4deg) rotateY(-0.5deg); }
}

.auth-orb-rot {
  /* Keep a very subtle idle wobble; mouse movement adds the real "physical" wobble */
  animation: auth-lens-wobble 7.2s ease-in-out infinite;
}

/* (No ring spin keyframes) */

@keyframes auth-orb-spark {
  0%, 100% { opacity: .72; filter: blur(0px); }
  55% { opacity: .95; filter: blur(0.4px); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-orb,
  .auth-orb-spark,
  .auth-orb-rot {
    animation: none !important;
  }
}

.auth-field-bubble {
  /* Each input is a frosted capsule bubble (same language as panel pills). */
  width: 100%;
  min-height: 40px;
  height: 40px;
  border-radius: 100px;
  padding: 0 12px;
  display: flex;
  align-items: center;
}

.auth-row {
  display: flex;
  align-items: stretch;
  gap: 0; /* gap would steal width even when proceed pill is hidden */
  width: 100%;
}

.auth-field-bubble--pass {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--label-quaternary);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--label-primary);
  padding: 0;
  outline: none;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.auth-field-bubble {
  width: 100%;
}

.auth-signin-bubble {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.985);
  filter: blur(8px);
  pointer-events: none;
  /* Proceed bubble: hidden = takes no space; visible = round 40×40 */
  height: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;

  /* Hidden state geometry (password stays full width) */
  width: 0;
  min-width: 0;
  padding: 0 !important;
  margin-left: 0;
  overflow: hidden;
  border-radius: 999px;

  transition:
    width var(--dur-slow) var(--ease-spring),
    margin-left var(--dur-slow) var(--ease-spring),
    opacity var(--dur-fast) ease,
    transform var(--dur-slow) var(--ease-spring),
    filter var(--dur-slow) var(--ease-spring),
    border-color var(--dur-fast) ease,
    background-color var(--dur-fast) ease;
}

.auth-signin-bubble[data-visible="false"] {
  /* Important: even at width:0, `.bubble` border would still reserve ~2px */
  border-width: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.auth-input::placeholder {
  color: var(--label-quaternary);
  opacity: 1;
}

/* Unified coming-forth for auth UI */
#auth-overlay .auth-field-bubble.is-moving,
#auth-overlay .auth-signin-bubble.is-moving {
  transform: translateY(-0.5px);
  border-color: rgba(255, 255, 255, .24) !important;
  box-shadow:
    inset 0 0 38px rgba(255, 255, 255, .12),
    0 18px 80px rgba(0, 0, 0, .25) !important;
}

#auth-overlay .auth-input.is-moving { transform: none; }

/* Prevent `.bubble:hover` from creating a sharp halo in the auth overlay.
   Auth uses the diffused `bubble::before` spotlight only. */
#auth-overlay .bubble:hover {
  border-color: rgba(255, 255, 255, .20);
  box-shadow:
    0 14px 80px rgba(0, 0, 0, .26),
    0 2px 30px rgba(0, 0, 0, .12),
    inset 0 1.5px 0 rgba(255, 255, 255, .45),
    inset 1.5px 0 0 rgba(255, 255, 255, .18),
    inset 0 -1px 0 rgba(0, 0, 0, .08),
    inset -1px 0 0 rgba(0, 0, 0, .035);
}

.auth-primary {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .10);
  color: var(--accent);
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: transform var(--dur-fast) ease, background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.auth-primary:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .34);
  box-shadow: 0 18px 70px rgba(0,0,0,.30), inset 0 0 32px rgba(255, 255, 255, .08);
  transform: translateY(-1px);
}

.auth-error {
  min-height: 14px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 220, 220, .92);
}

.auth-signin-bubble[data-visible="true"] {
  width: 40px;
  min-width: 40px;
  padding: 0 !important;
  margin-left: var(--stack-gap);
  border-width: 1px !important;
  /* Ensure it reads as the same frosted glass as other bubbles */
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, .13) 0%,
      rgba(255, 255, 255, .04) 40%,
      rgba(120, 160, 255, .03) 70%,
      rgba(255, 255, 255, .07) 100%);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);

  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
  animation:
    liquid-pop-in .62s var(--ease-spring) both,
    auth-proceed-breathe 2.8s ease-in-out infinite;
  animation-delay: 40ms;
}

/* The proceed pill is rounder than default bubbles; keep frosting geometry consistent. */
.auth-signin-bubble::before {
  border-radius: inherit;
}

.auth-signin-bubble svg {
  display: block;
  margin: 0 auto;
  stroke: var(--label-primary);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .22));
}

.auth-signin-bubble[data-visible="true"] {
  border-style: solid;
  border-color: rgba(255, 255, 255, .22);
  box-shadow:
    0 20px 90px rgba(0,0,0,.30),
    0 2px 30px rgba(0, 0, 0, .12),
    inset 0 1.5px 0 rgba(255, 255, 255, .45),
    inset 1.5px 0 0 rgba(255, 255, 255, .18),
    inset 0 -1px 0 rgba(0, 0, 0, .08),
    inset -1px 0 0 rgba(0, 0, 0, .035),
    inset 0 0 56px rgba(255, 255, 255, .10);
}

@keyframes auth-proceed-breathe {
  0%, 100% {
    transform: translateY(0);
  }
  55% {
    transform: translateY(-0.5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-signin-bubble[data-visible="true"] {
    animation: none;
  }
}

.auth-modal {
  position: relative;
  overflow: hidden;
}

.auth-modal::before {
  content: '';
  position: absolute;
  inset: -2px;
  pointer-events: none;
  background: radial-gradient(ellipse 110% 70% at 30% 20%,
      rgba(255, 255, 255, .18) 0%,
      rgba(255, 255, 255, .06) 35%,
      transparent 70%);
  opacity: 0;
  animation: auth-glimmer 3.4s ease-in-out infinite;
  z-index: 0;
}

.auth-modal > * {
  position: relative;
  z-index: 1;
}

@keyframes auth-glimmer {
  0% { opacity: 0; transform: translateY(2px); }
  12% { opacity: 1; transform: translateY(0); }
  55% { opacity: 0.55; transform: translateY(-2px); }
  100% { opacity: 0; transform: translateY(2px); }
}

/* Regulatory tri-state — same capsule height as pills / sliders (visionOS segmented control) */
.glass-seg {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 78px;
  min-width: 78px;
  height: var(--module-min-h);
  min-height: var(--module-min-h);
  box-sizing: border-box;
  --slider-scale: 1;
  background-color: rgba(255, 255, 255, .05);
  border: 0.5px solid rgba(255, 255, 255, .1);
  border-radius: 100px;
  padding: 1px;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  flex-shrink: 0;
  transition:
    background-color var(--dur-fast) var(--ease-standard),
    border-color var(--dur-fast) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
}
.glass-seg:hover {
  background-color: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 32px rgba(255, 255, 255, .08);
}

/* “Glass coming forth” while interacting */
.glass-seg.is-moving {
  --slider-scale: 1.02;
  transform: translateY(-0.5px);
  background-color: rgba(255, 255, 255, .085);
  border-color: rgba(255, 255, 255, .16);
  box-shadow:
    inset 0 0 28px rgba(255, 255, 255, .10),
    0 12px 60px rgba(0, 0, 0, .20);
}

/* Unified "coming forth" physical language for other pills/toggles/buttons */
.control-chip.is-moving,
.muni-chip.is-moving,
.soil-pill.is-moving,
.status-pill.is-moving,
.vis-toggle.is-moving,
.reg-row .info-btn.is-moving,
#menu-grid .menu-tile.is-moving {
  transform: translateY(-0.5px) !important;
  border-color: rgba(255, 255, 255, .16) !important;
  box-shadow:
    inset 0 0 28px rgba(255, 255, 255, .10),
    0 12px 60px rgba(0, 0, 0, .20) !important;
}

.glass-seg.is-moving .glass-slider {
  border-color: rgba(255, 255, 255, .34);
  box-shadow: 0 14px 60px rgba(0,0,0,.22), inset 0 0 28px rgba(255, 255, 255, .09);
}

.glass-opt {
  flex: 1;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
  color: var(--label-tertiary);
  letter-spacing: 0.02em;
}
.glass-opt.active { color: var(--accent); }
.glass-slider {
  position: absolute;
  top: 1px;
  left: 1px;
  width: calc(33.33% - 1.67px);
  height: calc(100% - 2px);
  background: var(--accent-dim);
  border: 0.5px solid var(--accent-border);
  border-radius: 100px;
  z-index: 1;
  transition:
    transform .2s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color .22s ease,
    box-shadow .22s ease,
    background-color .22s ease;
}
[data-mode="neutral"] .glass-slider { transform: translateX(0) scale(var(--slider-scale)); }
[data-mode="exclude"] .glass-slider { transform: translateX(100%) scale(var(--slider-scale)); }
[data-mode="only"]    .glass-slider { transform: translateX(200%) scale(var(--slider-scale)); }

/* ─────────────────────────────────────────────────────────────
   SLIDERS
───────────────────────────────────────────────────────────── */
.slider-group {
  margin-bottom: var(--stack-gap);
  flex-shrink: 0;
}

.slider-group:last-child {
  margin-bottom: 0;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
  gap: var(--space-1);
  min-width: 0;
}

.slider-label {
  font-size: 10px;
  color: var(--label-secondary);
  line-height: 1.2;
}

.slider-value-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* Thin track + pill thumb — wrapper keeps tall hit band; input height = track so WebKit thumb math matches rail */
.slider-range-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--slider-hit-h);
  flex-shrink: 0;
  overflow: visible;
}

.slider-range-wrap input[type=range] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--slider-track-h);
  min-height: var(--slider-track-h);
  margin: 0;
  padding: 0;
  background: transparent;
  outline: none;
  cursor: pointer;
  display: block;
  vertical-align: middle;
  box-sizing: border-box;
}

.slider-range-wrap input[type=range]::-webkit-slider-runnable-track {
  height: var(--slider-track-h);
  border-radius: 100px;
  background: rgba(255, 255, 255, .08);
  border: 0.5px solid rgba(255, 255, 255, .12);
  box-sizing: border-box;
}

/* Center thumb on the track (input box height === track height) */
.slider-range-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--slider-thumb-w);
  height: var(--slider-thumb-h);
  border-radius: 100px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .1));
  border: 0.5px solid var(--accent-border);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .38);
  cursor: pointer;
  margin-top: calc((var(--slider-track-h) - var(--slider-thumb-h)) / 2);
  box-sizing: border-box;
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background var(--dur-fast) ease;
}

/* Thumb-only “coming forth” while dragging (best-effort). */
.slider-range-wrap input[type=range].is-moving::-webkit-slider-thumb {
  transform: scale(1.05);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, .30),
    inset 0 1px 0 rgba(255, 255, 255, .40);
}

.slider-range-wrap input[type=range]:active::-webkit-slider-thumb {
  transform: scale(1.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .14));
  border-color: var(--accent-active);
}

.slider-range-wrap input[type=range]::-moz-range-track {
  height: var(--slider-track-h);
  border-radius: 100px;
  background: rgba(255, 255, 255, .08);
  border: 0.5px solid rgba(255, 255, 255, .12);
  box-sizing: border-box;
}

.slider-range-wrap input[type=range]::-moz-range-thumb {
  width: var(--slider-thumb-w);
  height: var(--slider-thumb-h);
  border-radius: 100px;
  border: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .1));
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .38),
    0 0 0 0.5px var(--accent-border);
  cursor: pointer;
  box-sizing: border-box;
}

.slider-range-wrap input[type=range].is-moving::-moz-range-thumb {
  transform: scale(1.05);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, .30),
    inset 0 1px 0 rgba(255, 255, 255, .40),
    0 0 0 0.5px var(--accent-border);
}

.slider-num {
  width: 44px;
  height: var(--module-min-h);
  box-sizing: border-box;
  background: rgba(255, 255, 255, .08);
  border: 0.5px solid rgba(255, 255, 255, .18);
  border-radius: 100px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: 0 8px;
  line-height: calc(var(--module-min-h) - 2px);
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.slider-num::-webkit-inner-spin-button,
.slider-num::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.slider-num:focus {
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.slider-unit {
  font-size: 9px;
  font-weight: 500;
  color: var(--label-quaternary);
  width: 15px; /* Fixed width for alignment */
  text-align: left;
}

/* ─────────────────────────────────────────────────────────────
   SOIL PILLS — equal-width grid (same cell size per row)
───────────────────────────────────────────────────────────── */
.soil-pills {
  display: grid;
  /* One column so long soil names wrap instead of clipping in narrow tiles */
  grid-template-columns: 1fr;
  gap: var(--stack-gap);
  align-items: stretch;
  flex-shrink: 0;
}

.soil-pill.all-btn {
  grid-column: 1 / -1;
}

.soil-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: var(--module-min-h);
  box-sizing: border-box;
  border-radius: 100px;
  font-size: var(--pill-font-size);
  font-weight: var(--pill-font-weight);
  background-color: rgba(255, 255, 255, .07);
  border: 0.5px solid rgba(255, 255, 255, .12);
  color: var(--label-secondary);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.25;
  text-align: center;
  padding: 5px var(--stack-gap);
}

.soil-pill.on {
  background-color: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Accordion — one gap between title and body (no stacked pad + pad) */
.acc-section {
  overflow: visible;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}
.acc-section.expanded {
  gap: var(--stack-gap);
}
.acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-gap);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border-bottom: 0.5px solid transparent;
}

.acc-head-actions {
  display: flex;
  align-items: center;
  gap: calc(var(--stack-gap) * 0.65);
  flex-shrink: 0;
}

.acc-reset {
  width: var(--module-min-h);
  height: var(--module-min-h);
  min-width: var(--module-min-h);
  padding: 0;
  border: none;
  background: transparent;
  margin: 0;
  display: none; /* critical: don't steal header width when collapsed */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  color: var(--label-secondary);
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease;
}

.acc-section.expanded .acc-reset {
  display: flex;
  opacity: 0.28;
  visibility: visible;
  pointer-events: auto;
}

.acc-reset:hover {
  opacity: 0.55;
  color: var(--label-primary);
}

.acc-reset:focus,
.acc-reset:focus-visible {
  outline: none;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
  border-radius: 999px;
}

.acc-reset svg {
  width: 13px;
  height: 13px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* No accordion container deformation: motion belongs to the control being moved. */
.acc-section.expanded .acc-head {
  border-bottom-color: rgba(255, 255, 255, .1);
  padding-bottom: 0;
  margin-bottom: 0;
}
.acc-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--label-quaternary);
  flex: 1;
  min-width: 0;
}
.acc-chev {
  font-size: 10px;
  color: var(--label-tertiary);
  transition: transform var(--dur-med) ease;
  flex-shrink: 0;
}
.acc-section.expanded .acc-chev { transform: rotate(180deg); }
.acc-body {
  /* Collapsible tray animation: keep element in flow but clamp height. */
  display: block;
  flex: 0 1 auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-spring);
  contain: layout paint;
}

.acc-section.acc-animating .acc-body {
  will-change: max-height;
}
.acc-section.expanded .acc-body {
  padding-top: 0;
  padding-bottom: var(--space-1);
  /* Clamp to viewport-available space when JS sets --acc-max-h (never overflow). */
  /* Expand to content height until hitting the viewport-derived clamp. */
  max-height: var(--acc-max-h, 9999px);
  /* Inset “tray” corners: radius − panel inset, matches curved glass (Apple grouped style) */
  border-radius: var(--radius-inner);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.acc-section.expanded .acc-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.acc-section:not(.expanded) .acc-head {
  padding-bottom: var(--stack-gap);
}

.reg-hint {
  font-size: 8.5px;
  line-height: 1.35;
  color: var(--label-quaternary);
  margin: 0 0 var(--stack-gap);
  flex-shrink: 0;
}

/* (Block stats UI removed: on-click only) */

/* Modular pill — same capsule height + weight as data pills; equal share in muni row */
.control-chip {
  position: relative;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--module-min-h);
  height: var(--module-min-h);
  box-sizing: border-box;
  padding: 0 var(--stack-gap);
  border: 0.5px solid rgba(255, 255, 255, .14);
  border-radius: 100px;
  background-color: rgba(255, 255, 255, .06);
  color: var(--label-tertiary);
  font-size: var(--pill-font-size);
  font-weight: var(--pill-font-weight);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.control-chip.on {
  background-color: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}
.control-chip:not(.on):hover {
  background-color: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .17);
  box-shadow: inset 0 0 32px rgba(255, 255, 255, .08);
}
.control-chip.on:hover {
  background-color: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .45);
  box-shadow: inset 0 0 28px rgba(255, 255, 255, .1);
}

/* Remove default "sharp white" focus ring; keep only diffused inset glow */
.control-chip:focus,
.control-chip:focus-visible {
  outline: none;
  box-shadow: inset 0 0 32px rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .17);
}

.control-chip.on:focus-visible {
  box-shadow: inset 0 0 28px rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .45);
}

/* Soil / status pills: uniform diffuse lift on hover — no text color change */
.soil-pill:hover,
.status-pill:hover {
  box-shadow: inset 0 0 32px rgba(255, 255, 255, .09);
}
.soil-pill:not(.on):hover,
.status-pill:not(.on):hover {
  background-color: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .16);
}
.soil-pill.on:hover,
.status-pill.on:hover {
  box-shadow: inset 0 0 28px rgba(255, 255, 255, .12);
}

.reg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--stack-gap);
  min-width: 0;
  margin-bottom: var(--stack-gap);
  min-height: var(--module-min-h);
}
.reg-row:last-child { margin-bottom: 0; }
.reg-row-label-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.reg-row .reg-label {
  flex: 1;
  min-width: 0;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--label-secondary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reg-actions {
  display: flex;
  align-items: center;
  gap: var(--stack-gap);
  flex-shrink: 0;
}

.reg-row .info-btn {
  width: var(--module-min-h);
  height: var(--module-min-h);
  min-width: var(--module-min-h);
  padding: 0;
  border: none;
  background: transparent;
  margin: 0;
  opacity: 0.45;
  cursor: help;
  color: var(--label-secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
  border-radius: 6px;
}
.reg-row .info-btn:hover {
  opacity: 1;
  color: var(--label-secondary);
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
}
.reg-row .info-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
}

/* Muni chips + optional full-width boundary toggle */
/* Municipality accordion list: uses the same `reg-row` spacing rhythm. */
.muni-list {
  display: flex;
  flex-direction: column;
  gap: 0; /* reg-row already owns vertical rhythm */
}
.muni-chip {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────────────────────
   STATUS CHECKS
───────────────────────────────────────────────────────────── */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 0px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   STATUS PILLS — same grid as soils (identical cell geometry)
───────────────────────────────────────────────────────────── */
.status-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--pill-cell-min)), 1fr));
  gap: var(--stack-gap);
  align-items: stretch;
  margin-bottom: 0;
}

.status-pill.all-btn {
  grid-column: 1 / -1;
}

.status-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: var(--module-min-h);
  box-sizing: border-box;
  border-radius: 100px;
  font-size: var(--pill-font-size);
  font-weight: var(--pill-font-weight);
  background-color: rgba(255, 255, 255, .06);
  border: 0.5px solid rgba(255, 255, 255, .12);
  color: var(--label-tertiary);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  hyphens: auto;
  padding: 5px var(--stack-gap);
}

.status-pill.on {
  background-color: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Status-specific overrides for coloring — SEMANTIC, LIGHT & DISTINCT palette */
.status-pill.on[data-status="Abandoned"] { color: #EF9A9A; background-color: rgba(239, 154, 154, .15); border-color: rgba(239, 154, 154, .5); }
.status-pill.on[data-status="Arable"] { color: #FFF59D; background-color: rgba(255, 245, 157, .15); border-color: rgba(255, 245, 157, .5); }
.status-pill.on[data-status="Forest"] { color: #C5E1A5; background-color: rgba(197, 225, 165, .15); border-color: rgba(197, 225, 165, .5); }
.status-pill.on[data-status="Encroached"] { color: #FFCC80; background-color: rgba(255, 204, 128, .15); border-color: rgba(255, 204, 128, .5); }
.status-pill.on[data-status="Managed"] { color: #80CBC4; background-color: rgba(128, 203, 196, .15); border-color: rgba(128, 203, 196, .5); }
.status-pill.on[data-status="Water"] { color: #90CAF9; background-color: rgba(144, 202, 249, .15); border-color: rgba(144, 202, 249, .5); }
.status-pill.on[data-status="Planted Groves & Net Semi Natural"] { color: #CE93D8; background-color: rgba(206, 147, 216, .15); border-color: rgba(206, 147, 216, .5); }
.status-pill.on[data-status="Uncertain"] { color: #CFD8DC; background-color: rgba(207, 216, 220, .15); border-color: rgba(207, 216, 220, .5); }

/* Neutral style for "All Parcels" button when active — now matching map accent */
.status-pill.on.all-btn {
  color: var(--accent);
  background-color: var(--accent-dim);
  border-color: var(--accent-border);
}

/* Standard transparent style used for all-btn */

/* Reset Button Removed */

/* ─────────────────────────────────────────────────────────────
   KPI
───────────────────────────────────────────────────────────── */
/* KPI grid & card removed in favor of top-level stat-bubbles */

/* ─────────────────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────────────────── */
.empty {
  background: rgba(255, 255, 255, .06);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  text-align: center;
  color: var(--label-quaternary);
  font-size: 11px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────
   LOADING
───────────────────────────────────────────────────────────── */
#loading {
  position: absolute;
  inset: 0;
  background: #101520;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: opacity .4s;
}

#loading.gone {
  opacity: 0;
  pointer-events: none;
}

.ld-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
}

.ld-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .2;
  animation: pulse 1.4s ease-in-out infinite;
}

.ld-dot:nth-child(2) {
  animation-delay: .2s;
}

.ld-dot:nth-child(3) {
  animation-delay: .4s;
}

@keyframes pulse {

  0%,
  80%,
  100% {
    opacity: .15;
    transform: scale(.9);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.ld-text {
  font-size: 12px;
  color: rgba(255, 255, 255, .4);
  letter-spacing: .04em;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────
   MAP POPUP — same liquid-glass module as .bubble
───────────────────────────────────────────────────────────── */
.maplibregl-popup {
  max-width: 268px !important;
}

.maplibregl-popup-content {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  color: var(--label-primary) !important;
}

.maplibregl-popup-tip {
  display: none !important;
}

.map-popup-glass {
  position: relative;
  overflow: visible;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, .13) 0%,
      rgba(255, 255, 255, .04) 40%,
      rgba(120, 160, 255, .03) 70%,
      rgba(255, 255, 255, .07) 100%);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  /* Softer edge + more diffuse shadow on the map popup */
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow:
    0 26px 140px rgba(0, 0, 0, .22),
    0 3px 55px rgba(0, 0, 0, .09),
    inset 0 1.2px 0 rgba(255, 255, 255, .36),
    inset 1.1px 0 0 rgba(255, 255, 255, .14),
    inset 0 -1px 0 rgba(0, 0, 0, .06),
    inset -1px 0 0 rgba(0, 0, 0, .02);
  padding: var(--panel-pad-y) var(--panel-pad-x);
  /* Keep popups responsive: avoid animating box-shadow (paint heavy). */
  transition: border-color var(--dur-fast) var(--ease-standard);
}
.map-popup-glass:hover {
  border-color: rgba(255, 255, 255, .20);
  box-shadow:
    0 26px 140px rgba(0, 0, 0, .22),
    0 3px 55px rgba(0, 0, 0, .09),
    inset 0 1.2px 0 rgba(255, 255, 255, .42),
    inset 1.1px 0 0 rgba(255, 255, 255, .16),
    inset 0 -1px 0 rgba(0, 0, 0, .07),
    inset -1px 0 0 rgba(0, 0, 0, .02),
    inset 0 0 100px rgba(255, 255, 255, .05);
}

.map-popup-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse 140% 125% at 50% 38%,
      rgba(255, 255, 255, .11) 0%,
      rgba(255, 255, 255, .035) 45%,
      transparent 72%);
  pointer-events: none;
  z-index: 0;
  transition: background var(--dur-fast) var(--ease-standard);
}
.map-popup-glass:hover::before {
  background: radial-gradient(ellipse 150% 135% at 50% 42%,
      rgba(255, 255, 255, .14) 0%,
      rgba(255, 255, 255, .045) 48%,
      transparent 74%);
}

.map-popup-glass > * {
  position: relative;
  z-index: 1;
}

/* Regulatory (i) hover — same skin as .map-popup-glass; rules after base so position:fixed wins */
#reg-info-tip.map-popup-glass {
  position: fixed;
  z-index: 50000;
  width: min(288px, calc(100vw - 24px));
  max-height: min(320px, calc(100vh - 2 * var(--sp)));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
  font-size: 10.5px;
  line-height: 1.42;
  color: var(--label-secondary);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s;
}
#reg-info-tip.map-popup-glass.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
#reg-info-tip.map-popup-glass .info-title {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.05em;
  margin-bottom: var(--stack-gap);
  color: var(--accent);
}

.reg-tip-desc {
  white-space: pre-line;
  margin: 0;
}
.reg-tip-sources {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.14);
}
.reg-tip-sources-title {
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--label-secondary);
  margin-bottom: 6px;
  opacity: 0.92;
}
.reg-tip-sources-list {
  margin: 0;
  padding-left: 1.15em;
  list-style: disc;
}
.reg-tip-sources-list li {
  margin-bottom: 5px;
}
.reg-tip-sources-list li:last-child {
  margin-bottom: 0;
}
.reg-tip-sources-list a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-word;
}
.reg-tip-sources-list a:hover {
  text-decoration: underline;
}
.reg-tip-sources-list a:focus-visible {
  outline: 1px solid var(--accent-border);
  outline-offset: 2px;
  border-radius: 3px;
}

.tt-status {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: var(--stack-gap);
  letter-spacing: -.01em;
  line-height: 1.25;
}

.tt-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
}

.tt-lbl {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--label-quaternary);
  line-height: 1.55;
  font-weight: 600;
}

.tt-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--label-secondary);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.tt-val--muted {
  font-size: 10px;
  font-weight: 500;
  opacity: .85;
}

.tt-soil {
  font-size: 9px;
  color: var(--label-tertiary);
  margin-top: var(--stack-gap);
  border-top: 0.5px solid rgba(255, 255, 255, .12);
  padding-top: var(--stack-gap);
  line-height: 1.45;
}

.tt-actions {
  display: flex;
  gap: 8px;
  margin-top: var(--stack-gap);
}

.tt-action {
  border: 0.5px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: var(--label-secondary);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}

.tt-action:hover {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .20);
  transform: translateY(-0.5px);
}

.tt-refs {
  margin-top: var(--stack-gap);
  padding-top: var(--stack-gap);
  border-top: 0.5px solid rgba(255, 255, 255, .12);
}

.tt-refs-title {
  display: block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--label-quaternary);
  margin-bottom: calc(var(--stack-gap) * 0.75);
}

.tt-refs-list {
  margin: 0;
  padding: 0 0 0 var(--sp);
  font-size: 8.5px;
  line-height: 1.45;
  color: var(--label-tertiary);
}

.tt-refs-list li {
  margin-bottom: calc(var(--stack-gap) * 0.5);
}

.tt-refs-list a {
  color: var(--label-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.tt-refs-list a:hover {
  color: var(--label-secondary);
}

/* ─────────────────────────────────────────────────────────────
EXPORT PILL (Top right — aligned with left stack / map insets)
───────────────────────────────────────────────────────────── */
#export-pill {
  position: absolute;
  top: var(--sp);
  right: var(--sp);
  width: auto;
  border-radius: 100px;
  padding: var(--panel-pad-y) var(--panel-pad-x);
  gap: var(--stack-gap);
  display: flex;
  align-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: all var(--dur-fast) var(--ease-standard);
  z-index: 1001; /* Ensure it's on top */
}

#export-pill:hover {
  transform: none;
  border-color: rgba(255, 255, 255, .26) !important;
  box-shadow:
    0 6px 32px rgba(0, 0, 0, .30),
    0 1px 8px rgba(0, 0, 0, .15),
    inset 0 1.5px 0 rgba(255, 255, 255, .48),
    inset 1.5px 0 0 rgba(255, 255, 255, .2),
    inset 0 -1px 0 rgba(0, 0, 0, .12),
    inset -1px 0 0 rgba(0, 0, 0, .06),
    inset 0 0 72px rgba(255, 255, 255, .07) !important;
}

#export-pill:active {
  transform: translateY(0) scale(0.96);
  background: rgba(255, 255, 255, .10) !important;
}

#export-pill span {
  font-size: 11px;
  font-weight: 700;
  color: var(--label-primary);
  letter-spacing: 0.02em;
}

#export-pill svg {
  width: 14px;
  height: 14px;
  stroke: var(--label-primary);
  stroke-width: 2.5;
  fill: none;
}

/* ─────────────────────────────────────────────────────────────
/*  VISION-OS SWITCH
/* ───────────────────────────────────────────────────────────── */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
  flex-shrink: 0;
}
.ios-switch input { opacity: 0; width: 0; height: 0; }
.ios-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  transition: var(--dur-fast) var(--ease-standard);
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
}
.ios-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 1.5px;
  bottom: 1.5px;
  background-color: #FFF;
  transition: var(--dur-fast) var(--ease-standard);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
input:checked + .ios-slider { background-color: #FFF; }
input:checked + .ios-slider:before {
  transform: translateX(12px);
  background-color: #000;
}

/* Landscape Panel specific */
#landscape-panel { 
  padding: 0; 
  max-height: 480px;
  display: flex;
  flex-direction: column;
}
.panel-header {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.panel-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
.panel-header .sec-lbl { margin: 0; }
#landscape-chevron {
  font-size: 14px;
  transition: transform 0.3s;
  color: var(--label-tertiary);
}
.panel-collapsed #landscape-chevron { transform: rotate(-90deg); }
.panel-collapsed { max-height: 52px !important; }

.landscape-list {
  overflow-y: auto;
  padding: 0 18px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: none;
}
.landscape-list::-webkit-scrollbar { display: none; }

.panel-collapsed .landscape-list { display: none; }

.layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
}
.layer-row:last-child { border: none; }
.layer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin-right: 12px;
}
.layer-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--label-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer-meta {
  font-size: 8px;
  color: var(--label-quaternary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
