@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800&family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Poppins:wght@300;400;500;600;700;800&family=Montserrat:wght@400;500;600;700;800;900&family=DM+Mono:wght@400;500;600&display=swap');

/* ── RESET ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

/* ══ LOADING SCREEN ══════════════════════════════════════════════════════════ */
.map-loader {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: #0b1326;
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(183,109,255,0.13) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 80%, rgba(68,226,205,0.07) 0%, transparent 60%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.map-loader.map-loader--out { opacity: 0; visibility: hidden; pointer-events: none; }
.map-loader__inner { display:flex; flex-direction:column; align-items:center; width:min(340px,88vw); text-align:center; }
.map-loader__pin-wrap { position:relative; width:88px; height:88px; display:flex; align-items:center; justify-content:center; margin-bottom:0.5rem; }
.map-loader__pin-pulse { position:absolute; inset:0; border-radius:50%; border:1.5px solid rgba(221,183,255,0.35); animation:loaderPulse 2s ease-out infinite; }
.map-loader__pin-pulse--delay { animation-delay:0.75s; border-color:rgba(68,226,205,0.25); }
@keyframes loaderPulse { 0%{transform:scale(0.55);opacity:0.9} 100%{transform:scale(1.4);opacity:0} }
.map-loader__pin { width:64px; height:64px; border-radius:50%; background:rgba(221,183,255,0.08); border:1px solid rgba(221,183,255,0.2); display:flex; align-items:center; justify-content:center; animation:loaderPinBob 2.4s ease-in-out infinite; box-shadow:0 0 24px rgba(183,109,255,0.25); }
@keyframes loaderPinBob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.map-loader__brand { font-family:'Bricolage Grotesque','Poppins',sans-serif; font-size:1.5rem; font-weight:700; color:#ddb7ff; margin-bottom:0.5rem; }
.map-loader__msg { font-family:'Inter',sans-serif; font-size:0.825rem; color:rgba(218,226,253,0.55); line-height:1.55; max-width:260px; margin-bottom:1.75rem; }
.map-loader__bar-track { width:100%; height:3px; background:rgba(255,255,255,0.07); border-radius:9999px; overflow:hidden; margin-bottom:0.75rem; }
.map-loader__bar-fill { height:100%; width:0%; border-radius:9999px; background:linear-gradient(90deg,#b76dff 0%,#ddb7ff 50%,#44e2cd 100%); background-size:200% 100%; transition:width 0.4s ease; animation:loaderShimmer 2s linear infinite; }
@keyframes loaderShimmer { 0%{background-position:100% 0} 100%{background-position:-100% 0} }
.map-loader__status { font-family:'DM Mono',monospace; font-size:0.7rem; color:rgba(218,226,253,0.38); letter-spacing:0.04em; text-transform:uppercase; }
/* ══ END LOADING SCREEN ══════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ──────────────────────────────── */

:root {
  /* Surface */
  --surface:          #0b1326;
  --surface-dim:      #0b1326;
  --surface-bright:   #31394d;
  --surface-low:      #131b2e;
  --surface-container:#171f33;
  --surface-high:     #222a3d;
  --surface-highest:  #2d3449;

  /* On-surface */
  --text:             #dae2fd;
  --text-variant:     #cfc2d6;
  --muted:            rgba(218, 226, 253, 0.45);

  /* Outline */
  --outline:          #988d9f;
  --outline-dim:      #4d4354;
  --border:           rgba(77, 67, 84, 0.6);

  /* Primary — Electric Violet */
  --primary:          #ddb7ff;
  --primary-container:#b76dff;
  --on-primary:       #490080;
  --primary-glow:     rgba(221, 183, 255, 0.22);
  --primary-glow-strong: rgba(183, 109, 255, 0.35);

  /* Secondary — Cyan/Teal */
  --secondary:        #44e2cd;
  --secondary-container: #03c6b2;
  --on-secondary:     #003731;

  /* Tertiary — Amber */
  --tertiary:         #ffb95f;
  --tertiary-container: #ca8100;

  /* Status */
  --error:            #ffb4ab;
  --error-container:  #93000a;

  /* Legacy aliases used in JS-injected content */
  --green:            #44e2cd;
  --yellow:           #ffb95f;
  --red:              #ffb4ab;
  --blue:             #ddb7ff;
  --dark:             #0b1326;
  --panel:            rgba(11, 19, 38, 0.92);
  --input-bg:         rgba(255, 255, 255, 0.04);

  /* Radii */
  --r-sm:   0.25rem;
  --r-md:   0.5rem;
  --r-lg:   0.75rem;
  --r-xl:   1rem;
  --r-2xl:  1.5rem;
  --r-full: 9999px;

  /* Spacing */
  --gap:    0.75rem;
  --pad:    1rem;
  --pad-lg: 1.5rem;
  --header-h: 72px;
  --sidebar-rail-w: 64px;
  --sidebar-panel-w: 240px;
  --sidebar-total-w: 304px;
}


/* ── BASE ────────────────────────────────────────── */
/* ── BASE ────────────────────────────────────────── */
html, body {
  width: 100%; height: 100%;
  font-family: 'Geist', 'Outfit', sans-serif;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  position: fixed;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

/* ── Nav panel open: push map right on desktop ─── */
body.nav-panel-open #map {
  left: calc(var(--sidebar-total-w) + 320px);
}
body.nav-panel-open.sidebar-collapsed #map {
  left: calc(var(--sidebar-rail-w) + 320px);
}
@media (max-width: 768px) {
  body.nav-panel-open #map { left: 0 !important; }
}

#map {
  position: absolute;
  top: 0; left: var(--sidebar-total-w); right: 0; bottom: 0;
  transition: left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  /* ── Mobile perf fix 1: removed will-change:transform — it promoted #map
     to a permanent GPU compositing layer even when idle, eating ~40 MB of
     GPU memory on mobile.  translateZ(0) is enough for the Leaflet canvas. */
  contain: strict;
}

body.sidebar-collapsed #map {
  left: var(--sidebar-rail-w);
}

/* ── GLASS MIXIN ─────────────────────────────────── */
.glass {
  background: rgba(11, 19, 38, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-total-w);
  z-index: 1000;
  display: flex;
  flex-direction: row;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-transform: translateZ(0); transform: translateZ(0);
  will-change: transform; isolation: isolate;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-rail-w);
}

/* ── RAIL (icon strip) ───────────────────────────── */
.sidebar-rail {
  width: var(--sidebar-rail-w);
  flex-shrink: 0;
  background: rgba(8, 14, 28, 0.97);
  border-right: 1px solid rgba(77, 67, 84, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 12px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Logo at top of rail */
.sidebar-logo {
  width: var(--sidebar-rail-w);
  flex-shrink: 0;
  background: rgba(8, 14, 28, 0.97);
  border-right: 1px solid rgba(77, 67, 84, 0.4);
  border-bottom: 1px solid rgba(77, 67, 84, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 6px 12px;
  position: absolute;
  top: 0; left: 0;
  height: 76px;
  z-index: 2;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: rgba(183, 109, 255, 0.15);
  border: 1px solid rgba(183, 109, 255, 0.3);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-logo-text { display: none; }

/* Icon rail nav - pushed below the logo */
.sidebar-rail {
  position: absolute;
  top: 76px; left: 0; bottom: 60px;
  width: var(--sidebar-rail-w);
}

/* Rail buttons */
.rail-btn {
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: none;
  border: none;
  border-radius: var(--r-lg);
  color: rgba(218, 226, 253, 0.4);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.rail-btn span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rail-btn:hover {
  color: var(--text);
  background: rgba(221, 183, 255, 0.06);
}
.rail-btn.active {
  color: var(--primary);
  background: rgba(183, 109, 255, 0.14);
}
.rail-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 24px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.brand-text {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  color: var(--muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding-bottom: 24px;
  letter-spacing: 0.05em;
  font-weight: 600;
  text-transform: uppercase;
}

/* ── SIDEBAR PANEL ───────────────────────────────── */
.sidebar-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 0; left: var(--sidebar-rail-w); bottom: 0;
  width: var(--sidebar-panel-w);
  background: rgba(10, 17, 32, 0.96);
  border-right: 1px solid rgba(77, 67, 84, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
  animation: panelIn 0.18s ease;
}
.sidebar-panel.active { display: flex; }
@keyframes panelIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px 14px;
  border-bottom: 1px solid rgba(77, 67, 84, 0.35);
  flex-shrink: 0;
  margin-top: 76px;
}
.panel-title {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.panel-header-right {
  display: flex; align-items: center; gap: 8px;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(77, 67, 84, 0.5) transparent;
  -webkit-overflow-scrolling: touch;
}

/* ── SIDEBAR FOOTER ──────────────────────────────── */
.sidebar-footer {
  position: absolute;
  bottom: 0; left: 0;
  width: var(--sidebar-rail-w);
  height: 60px;
  background: rgba(8, 14, 28, 0.97);
  border-right: 1px solid rgba(77, 67, 84, 0.4);
  border-top: 1px solid rgba(77, 67, 84, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}


.bi{
  font-size: 18px;
}


/* ── LAYER ICON WRAP (replaces dot) ──────────────── */
.layer-icon-wrap {
  width: 26px; height: 26px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--layer-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--layer-color) 30%, transparent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.layer-row:hover .layer-icon-wrap {
  background: color-mix(in srgb, var(--layer-color) 20%, transparent);
}
.layer-row.layer-off .layer-icon-wrap { opacity: 0.25; filter: grayscale(1); }

/* ── SIDEBAR SEARCH ──────────────────────────────── */
.sidebar-search-wrap {
  padding: 10px 12px 0;
}
.sidebar-search-wrap .search-field-wrap {
  border-radius: var(--r-lg);
  flex-direction: column;
  align-items: stretch;
  height: auto;
  padding: 0;
  overflow: hidden;
}
.sidebar-search-wrap .search-field-wrap input {
  padding: 10px 12px 10px 36px;
  font-size: 12px;
  width: 100%;
}
.sidebar-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 0;
  z-index: 1;
}
.sidebar-search-wrap .search-dropdown {
  position: static;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  max-height: 260px;
}
.sidebar-search-wrap #searchBtn {
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  width: 100%;
  padding: 8px;
  border-left: none;
  border-top: 1px solid var(--outline-dim);
}

/* ── SIDEBAR NAV BUTTON ──────────────────────────── */
.sidebar-nav-btn {
  width: calc(100% - 24px);
  margin: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 11px;
  border-radius: var(--r-lg);
}
.nav-panel-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  line-height: 1.6;
  padding: 14px 14px 0;
  letter-spacing: 0.03em;
}

/* Admin toggle in sidebar footer */
.sidebar-footer .admin-toggle {
  width: 40px; height: 40px;
  border-radius: var(--r-lg);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 7px;
  letter-spacing: 0.06em;
  border: 1px solid rgba(183, 109, 255, 0.25);
  background: rgba(183, 109, 255, 0.08);
}
.sidebar-footer .admin-toggle svg { flex-shrink: 0; }

/* ── OLD HEADER (kept for nav-dest-panel which references it) ── */
.logo-block {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
  animation: logopulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes logopulse {
  0%, 100% { box-shadow: 0 0 8px var(--primary); opacity: 1; }
  50%       { box-shadow: 0 0 22px var(--primary), 0 0 40px var(--primary-glow); opacity: 0.85; }
}
.app-title {
  font-family: 'Geist', sans-serif;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.app-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── SEARCH ──────────────────────────────────────── */
.search-wrap { display: flex; flex: 1; gap: 0; min-width: 0; }

.search-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--outline-dim);
  border-radius: var(--r-full);
  overflow: visible;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-field-wrap:focus-within {
  border-color: var(--primary-container);
  box-shadow: 0 0 0 2px rgba(183, 109, 255, 0.18);
}

.search-icon {
  padding: 0 8px 0 14px;
  font-size: 13px;
  opacity: 0.4;
  pointer-events: none;
  flex-shrink: 0;
  color: var(--primary);
}

.search-field-wrap input {
  flex: 1; min-width: 0;
  background: transparent;
  border: none; outline: none;
  color: var(--text);
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 400;
  padding: 10px 4px;
}
.search-field-wrap input::placeholder { color: var(--muted); }

.search-clear {
  background: none; border: none;
  color: var(--muted);
  font-size: 12px; cursor: pointer;
  padding: 0 8px; line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.search-clear:hover { color: var(--text); }
.search-clear.hidden { display: none; }

.search-field-wrap #searchBtn {
  border-radius: 0 var(--r-full) var(--r-full) 0;
  margin: 0; border: none;
  border-left: 1px solid var(--outline-dim);
  background: var(--primary-container);
  color: var(--on-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 10px 16px;
  cursor: pointer;
  transition: opacity 0.15s, background 0.2s;
  flex-shrink: 0;
  text-transform: uppercase;
}
.search-field-wrap #searchBtn:hover { background: var(--primary); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid var(--outline-dim);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(221, 183, 255, 0.06);
  z-index: 9999;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--outline-dim) transparent;
}
.search-dropdown.hidden { display: none; }

.sd-section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 8px 14px 4px;
  text-transform: uppercase;
  border-top: 1px solid rgba(77, 67, 84, 0.4);
}
.sd-section-label:first-child { border-top: none; }

.sd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.sd-item:last-child { border-bottom: none; }
.sd-item:hover, .sd-item.active { background: rgba(183, 109, 255, 0.1); }

.sd-icon { font-size: 14px; flex-shrink: 0; width: 22px; text-align: center; }
.sd-body { flex: 1; min-width: 0; }
.sd-name {
  font-family: 'Geist', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sd-name mark { background: transparent; color: var(--primary); font-weight: 800; }
.sd-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--muted);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sd-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; font-weight: 700;
  padding: 2px 6px; border-radius: 20px;
  background: rgba(183, 109, 255, 0.15);
  color: var(--primary);
  border: 1px solid rgba(183, 109, 255, 0.25);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sd-badge.osm  { background: rgba(68, 226, 205, 0.12); color: var(--secondary); border-color: rgba(68, 226, 205, 0.25); }
.sd-badge.seg  { background: rgba(221, 183, 255, 0.12); color: var(--primary); border-color: rgba(221, 183, 255, 0.25); }
.sd-spinner, .sd-empty {
  text-align: center; padding: 14px 12px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}

/* ── HEADER BUTTONS ──────────────────────────────── */
.nav-launch-btn {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-container) 100%);
  color: var(--on-secondary);
  border: none;
  border-radius: var(--r-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
  text-transform: uppercase;
}
.nav-launch-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(68, 226, 205, 0.3);
}
.nav-launch-btn.nav-active {
  background: linear-gradient(135deg, var(--error) 0%, #c93030 100%);
  color: #fff;
}

.admin-toggle {
  background: linear-gradient(135deg, var(--primary-container) 0%, var(--on-primary) 100%);
  color: var(--primary);
  border: 1px solid rgba(221, 183, 255, 0.25);
  border-radius: var(--r-md);
  padding: 9px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
}
.admin-toggle:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(183, 109, 255, 0.3);
}

/* ── VIEW TOGGLE BTN ─────────────────────────────── */
.view-toggle-btn {
  position: absolute;
  bottom: 32px;
  left: calc(var(--sidebar-total-w) + 16px);
  z-index: 999;
  background: rgba(11, 19, 38, 0.88);
  border: 1px solid var(--outline-dim);
  border-radius: var(--r-full);
  color: var(--text-variant);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
body.sidebar-collapsed .view-toggle-btn {
  left: calc(var(--sidebar-rail-w) + 16px);
}
.view-toggle-btn:hover {
  border-color: var(--primary-container);
  color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.view-toggle-btn.raw-mode {
  border-color: var(--tertiary);
  color: var(--tertiary);
  background: rgba(255, 185, 95, 0.1);
}
.vt-icon { font-size: 11px; }

/* ── ROUTE PLANNER BAR ───────────────────────────── */
.route-planner-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(11, 19, 38, 0.95);
  border-radius: var(--r-lg);
  margin: 8px 12px 0;
  padding: 8px;
  animation: none;
}
.route-planner-bar.hidden { display: none; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.route-input-wrap {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--outline-dim);
  border-radius: var(--r-md);
  padding: 0 10px;
  transition: border-color 0.2s;
}
.route-input-wrap:focus-within { border-color: var(--primary-container); }
.route-input-wrap input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text);
  font-family: 'Geist', sans-serif; font-size: 12px;
  padding: 9px 0;
}
.route-input-wrap input::placeholder { color: var(--muted); }

.route-dot {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; font-weight: 700; flex-shrink: 0;
}
.start-dot { background: var(--secondary); color: var(--on-secondary); }
.end-dot   { background: var(--error); color: #fff; }

.route-go-btn {
  background: var(--secondary);
  color: var(--on-secondary);
  border: none; border-radius: var(--r-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  padding: 9px 16px; cursor: pointer;
  transition: opacity 0.15s; text-transform: uppercase;
}
.route-go-btn:hover { opacity: 0.8; }
.route-close-btn {
  background: rgba(255, 180, 171, 0.12);
  color: var(--error);
  border: 1px solid rgba(255, 180, 171, 0.25);
  border-radius: var(--r-md);
  font-size: 12px; padding: 9px 13px; cursor: pointer;
  transition: background 0.15s;
}
.route-close-btn:hover { background: rgba(255, 180, 171, 0.22); }
.route-btn-row { display: flex; gap: 8px; }

/* ── PLACE TOAST ─────────────────────────────────── */
.place-toast {
  position: absolute;
  bottom: 130px; left: 50%; transform: translateX(-50%);
  z-index: 1000;
  background: rgba(11, 19, 38, 0.94);
  border: 1px solid rgba(183, 109, 255, 0.4);
  border-radius: var(--r-lg);
  padding: 12px 20px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  min-width: 240px; max-width: 340px;
  text-align: center;
  box-shadow: 0 4px 28px rgba(183, 109, 255, 0.2);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.place-toast.hidden { display: none; }
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}
.toast-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; letter-spacing: 0.15em;
  color: var(--primary); text-transform: uppercase; margin-bottom: 5px;
}
.toast-name {
  font-family: 'Geist', sans-serif; font-weight: 700; font-size: 14px;
  color: var(--text); line-height: 1.3;
}
.toast-coords {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--muted); margin-top: 4px;
}

/* ── GPS PANEL ───────────────────────────────────── */
.gps-panel {
  position: absolute;
  bottom: 32px; right: 16px;
  z-index: 1000;
  background: rgba(11, 19, 38, 0.92);
  border: 1px solid var(--outline-dim);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  width: 220px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  transition: border-color 0.4s, box-shadow 0.4s;
  -webkit-transform: translateZ(0); transform: translateZ(0);
  will-change: transform; isolation: isolate;
}
.gps-panel.sig-good {
  border-color: rgba(68, 226, 205, 0.5);
  box-shadow: 0 8px 32px rgba(68, 226, 205, 0.15);
}
.gps-panel.sig-fair {
  border-color: rgba(255, 185, 95, 0.5);
  box-shadow: 0 8px 32px rgba(255, 185, 95, 0.15);
}
.gps-panel.sig-poor {
  border-color: rgba(255, 180, 171, 0.5);
  box-shadow: 0 8px 32px rgba(255, 180, 171, 0.15);
}
.gps-panel.sig-tracking {
  border-color: rgba(68, 226, 205, 0.5);
  animation: trackGlow 2s ease-in-out infinite;
}
@keyframes trackGlow {
  0%, 100% { box-shadow: 0 8px 32px rgba(68, 226, 205, 0.15); }
  50%       { box-shadow: 0 8px 48px rgba(68, 226, 205, 0.38); }
}

.gps-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.gps-panel-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; letter-spacing: 0.18em;
  color: var(--muted); text-transform: uppercase;
}
.gps-signal-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.06); color: var(--muted);
  transition: all 0.3s;
}
.gps-signal-badge.good     { background: rgba(68, 226, 205, 0.18);  color: var(--secondary); }
.gps-signal-badge.fair     { background: rgba(255, 185, 95, 0.18);  color: var(--tertiary); }
.gps-signal-badge.poor     { background: rgba(255, 180, 171, 0.18); color: var(--error); }
.gps-signal-badge.tracking { background: rgba(68, 226, 205, 0.28);  color: var(--secondary); }

.signal-bars {
  display: flex; align-items: flex-end; gap: 4px;
  height: 26px; margin-bottom: 10px;
}
.bar {
  flex: 1; border-radius: 3px 3px 0 0;
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.4s;
}
.b1{height:20%;} .b2{height:40%;} .b3{height:60%;} .b4{height:80%;} .b5{height:100%;}
.bar.active-good { background: var(--secondary); }
.bar.active-fair { background: var(--tertiary); }
.bar.active-poor { background: var(--error); }

.stat-row { display: flex; gap: 4px; margin-bottom: 10px; }
.stat-cell {
  flex: 1; background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(77, 67, 84, 0.5);
  border-radius: var(--r-sm);
  padding: 5px 4px; text-align: center;
}
.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7px; letter-spacing: 0.12em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 2px;
}
.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-value.good { color: var(--secondary); }
.stat-value.fair { color: var(--tertiary); }
.stat-value.poor { color: var(--error); }

.gps-btn {
  width: 100%;
  background: rgba(183, 109, 255, 0.1);
  border: 1px solid rgba(183, 109, 255, 0.4);
  border-radius: var(--r-md);
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  padding: 9px 0; cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}
.gps-btn:hover:not(:disabled) {
  background: rgba(183, 109, 255, 0.2);
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.gps-btn.tracking {
  background: rgba(255, 180, 171, 0.1);
  border-color: rgba(255, 180, 171, 0.5);
  color: var(--error);
  animation: btnPulse 1.5s ease-in-out infinite;
}
@keyframes btnPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
.gps-btn:disabled {
  opacity: 0.4; cursor: not-allowed;
  border-color: rgba(255, 180, 171, 0.35);
  color: var(--error);
  background: rgba(255, 180, 171, 0.06);
  animation: none;
}

.gps-warning {
  margin-top: 8px; font-size: 9px; line-height: 1.5;
  color: var(--tertiary);
  border-top: 1px solid rgba(255, 185, 95, 0.2);
  padding-top: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.gps-warning.hidden { display: none; }
.gps-warning.poor-warn { color: var(--error); border-color: rgba(255, 180, 171, 0.2); }

/* ══════════════════════════════════════════════════════════════
   LAYERS PANEL  —  Premium Redesign v2
   Font system: Bricolage Grotesque (headings), Inter (UI),
   Poppins (labels), Montserrat (mono-like caps), DM Mono (values)
   ══════════════════════════════════════════════════════════════ */

/* ── Font system variables ─────────────────────────── */
:root {
  --font-display:  'Bricolage Grotesque', 'Poppins', sans-serif;
  --font-ui:       'Inter', system-ui, -apple-system, sans-serif;
  --font-label:    'Montserrat', 'Poppins', sans-serif;
  --font-body:     'Poppins', 'Inter', sans-serif;
  --font-mono:     'DM Mono', 'Courier New', monospace;
}

/* ── Panel header ──────────────────────────────────── */
#panelLayers .panel-header {
  background: var(--surface-low);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 16px 16px 13px;
  position: relative;
  overflow: hidden;
}
#panelLayers .panel-header::before {
  display: none;
}
#panelLayers .panel-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
.panel-header-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.panel-subtitle {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 400;
  color: rgba(218,226,253,0.42);
  letter-spacing: 0;
}

/* ALL toggle */
.legend-all-btn {
  font-family: var(--font-label);
  font-size: 8px; letter-spacing: 0.1em;
  color: var(--primary);
  background: rgba(183, 109, 255, 0.14);
  border: 1px solid rgba(183, 109, 255, 0.3);
  border-radius: 20px;
  padding: 4px 10px; cursor: pointer;
  transition: all 0.18s; font-weight: 700;
  text-transform: uppercase;
}
.legend-all-btn:hover {
  background: rgba(183, 109, 255, 0.3);
  box-shadow: 0 0 14px rgba(183,109,255,0.35);
  transform: translateY(-1px);
}

/* Live status dot */
.legend-active-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 10px var(--secondary);
  animation: dotpulse 2.4s infinite;
  flex-shrink: 0;
}
.legend-active-dot.partial { background: var(--tertiary); box-shadow: 0 0 10px var(--tertiary); }
.legend-active-dot.all-off { background: var(--error); box-shadow: 0 0 10px var(--error); animation: none; }
@keyframes dotpulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ── Layer stats strip ───────────────────────────── */
.layer-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 10px 16px;
}
.layer-stat-cell {
  background: var(--surface-bright);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  border: 1px solid var(--outline-dim);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.layer-stat-cell:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.layer-stat-val {
  font-family: 'Inter', var(--font-body);
  font-size: 18px; font-weight: 700;
  color: var(--primary);
  line-height: 1.1; margin-bottom: 4px;
}
.layer-stat-label {
  font-family: 'Inter', var(--font-label);
  font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
  color: var(--muted); text-transform: uppercase;
}
.layer-stat-divider {
  display: none;
}

/* ── Section divider label ───────────────────────── */
.layer-section-label {
  font-family: var(--font-label);
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(218,226,253,0.42);
  padding: 10px 14px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.layer-section-label::before {
  display: none;
}

/* ── Layer card rows ─────────────────────────────── */
.layer-row {
  margin: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: transparent;
  transition: background 0.15s, opacity 0.2s;
  cursor: default;
  overflow: hidden;
  position: relative;
}
.layer-row:last-of-type {
  border-bottom: none;
}
.layer-row::before {
  display: none;
}
.layer-row:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
  box-shadow: none;
  transform: none;
}
.layer-row:hover::before { opacity: 0; }
.layer-row.layer-off {
  opacity: 0.45;
  background: transparent;
  border-color: transparent;
  transform: none;
}
.layer-row.layer-off .layer-name { opacity: 0.5; text-decoration: line-through; }
.layer-row.layer-off .layer-dot,
.layer-row.layer-off .layer-icon-wrap  { opacity: 0.3; filter: grayscale(1); }
.layer-row.layer-off .layer-badge-live { opacity: 0.2; animation: none; }
.layer-row.layer-off::before { opacity: 0 !important; }

.layer-row-main {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 10px 16px;
}

/* ── Layer icon ──────────────────────────────────── */
.layer-icon-wrap {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.layer-row:hover .layer-icon-wrap {
  background: rgba(255,255,255,0.09);
  box-shadow: none;
}
.layer-row.layer-off .layer-icon-wrap { opacity: 0.22; filter: grayscale(1); }

/* ── Layer name ──────────────────────────────────── */
.layer-name {
  font-family: var(--font-ui);
  flex: 1; font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.2s, color 0.2s;
  letter-spacing: -0.01em;
}

/* ── Count badge ─────────────────────────────────── */
.layer-count {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  color: rgba(218,226,253,0.75);
  background: rgba(255,255,255,0.08);
  border: none;
  padding: 2px 7px; border-radius: 20px;
  flex-shrink: 0; min-width: 26px; text-align: center;
  transition: background 0.15s;
  letter-spacing: 0;
}
.layer-row:hover .layer-count {
  background: rgba(255,255,255,0.11);
}

/* ── Live blink badge ────────────────────────────── */
.layer-badge-live {
  font-size: 9px; color: var(--secondary);
  animation: liveblink 1.6s infinite; flex-shrink: 0; line-height: 1;
  filter: none;
}
@keyframes liveblink { 0%,100%{opacity:1} 50%{opacity:.25} }

/* ── Toggle switch ───────────────────────────────── */
.lswitch { position: relative; flex-shrink: 0; cursor: pointer; }
.lswitch input { position: absolute; opacity: 0; width: 0; height: 0; }
.lswitch-track {
  display: block; width: 32px; height: 18px;
  background: rgba(255,255,255,0.1);
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.12);
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.lswitch-knob {
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(218,226,253,0.5);
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), background 0.2s;
}
.lswitch input:checked ~ .lswitch-track {
  background: rgba(68,226,205,0.25);
  border-color: rgba(68,226,205,0.5);
}
.lswitch input:checked ~ .lswitch-track .lswitch-knob {
  transform: translateX(14px);
  background: var(--secondary);
}

/* ── Layer sub-row (hover reveals) ──────────────── */
.layer-sub {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1),
              opacity 0.22s ease,
              padding 0.3s ease;
  background: rgba(255,255,255,0.012);
  border-top: 1px solid transparent;
}
.layer-row:hover .layer-sub,
.layer-row:focus-within .layer-sub {
  max-height: 44px; opacity: 1;
  padding: 6px 12px 8px;
  border-top-color: rgba(255,255,255,0.05);
}
.layer-row.layer-off .layer-sub { opacity: 0.35; }

.layer-action {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-label);
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em;
  color: rgba(218,226,253,0.5);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px; padding: 3px 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  white-space: nowrap;
  text-transform: uppercase;
}
.layer-action:hover {
  background: rgba(183,109,255,0.18);
  color: var(--primary);
  border-color: rgba(183,109,255,0.38);
  transform: translateY(-1px);
}

.layer-status-pill {
  font-family: var(--font-label);
  font-size: 7px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--secondary);
  background: rgba(68,226,205,0.12);
  border: 1px solid rgba(68,226,205,0.25);
  padding: 2px 8px; border-radius: 20px;
  margin-left: auto; text-transform: uppercase;
}
.layer-status-pill.layer-status-gps {
  color: var(--primary);
  background: rgba(183,109,255,0.12);
  border-color: rgba(183,109,255,0.28);
}
.layer-status-pill.layer-status-static {
  color: rgba(218,226,253,0.4);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

/* ── Layer sub-description text ──────────────────── */
.layer-sub-desc {
  font-family: var(--font-ui);
  font-size: 9.5px; color: rgba(218,226,253,0.5);
  letter-spacing: 0.01em;
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Base map style grid ─────────────────────────── */
.basemap-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; margin: 4px 10px 10px;
}
.basemap-thumb {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: var(--surface-low);
  border: 1px solid var(--outline-dim);
  border-radius: 12px; padding: 10px 8px 9px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  font-family: var(--font-label);
  font-size: 10px; font-weight: 700;
  color: var(--muted); letter-spacing: 0.05em;
  text-transform: uppercase;
}
.basemap-thumb:hover {
  background: var(--surface-container);
  border-color: var(--primary-container);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.basemap-thumb.active {
  background: var(--surface-bright);
  border-color: var(--primary);
  border-width: 2px;
  padding: 9px 7px 8px; /* account for border width */
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.basemap-preview {
  width: 100%; height: 40px;
  border-radius: 8px; overflow: hidden;
  flex-shrink: 0;
}
.basemap-preview--dark {
  background: linear-gradient(135deg, #0d1b2e 0%, #1a2744 50%, #0f1a2e 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
}
.basemap-preview--dark::after {
  content: ''; display: block; width: 100%; height: 100%;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 10px);
}
.basemap-preview--light {
  background: linear-gradient(135deg, #e8ecf0 0%, #f4f7fa 50%, #dde3ea 100%);
}
.basemap-preview--light::after {
  content: ''; display: block; width: 100%; height: 100%;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.07) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.07) 0 1px, transparent 1px 10px);
}


/* ── Map opacity section ─────────────────────────── */
.layer-opacity-section {
  margin: 8px 10px 8px;
  padding: 14px;
  background: var(--surface-low);
  border-radius: 12px;
  border: 1px solid var(--outline-dim);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.opacity-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.opacity-label {
  font-family: var(--font-label);
  font-size: 8.5px; letter-spacing: 0.14em; font-weight: 700;
  color: rgba(218,226,253,0.55); text-transform: uppercase;
}
.opacity-val {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; color: var(--primary);
  letter-spacing: -0.02em;
}
.opacity-slider {
  -webkit-appearance: none; width: 100%;
  height: 5px;
  background: linear-gradient(to right,
    var(--primary-container) 0%,
    var(--primary-container) var(--pct, 100%),
    rgba(255,255,255,0.08) var(--pct, 100%));
  border-radius: 4px; outline: none; cursor: pointer;
}
.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--primary);
  border: 2.5px solid rgba(255,255,255,0.3);
  box-shadow: 0 0 12px rgba(221,183,255,0.6);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.opacity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.28);
  box-shadow: 0 0 20px rgba(221,183,255,0.85);
}

/* ── Legacy expand-map btn (kept for compat) ─────── */
.legend-expand-btn,
#layersPanel + * .legend-expand-btn {
  width: 100%; background: none;
  border: none; border-top: 1px solid var(--outline-dim);
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 0.12em;
  padding: 9px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: color 0.15s, background 0.15s;
  text-transform: uppercase;
}
.legend-expand-btn:hover { color: var(--primary); background: rgba(183,109,255,0.06); }

/* ── Legacy .legend shell (kept for JS compat) ───── */
.legend {
  position: absolute;
  bottom: 32px; left: 16px;
  z-index: 999;
  background: rgba(11,19,38,0.92);
  border: 1px solid var(--outline-dim);
  border-radius: var(--r-xl);
  padding: 0;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  transition: bottom 0.3s ease, box-shadow 0.3s;
  min-width: 210px; max-width: 235px;
  overflow: hidden;
  font-family: 'Geist', sans-serif;
  -webkit-transform: translateZ(0); transform: translateZ(0);
  will-change: transform; isolation: isolate;
}
.legend:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(221,183,255,0.1); }
.legend-header { display:flex;align-items:center;justify-content:space-between;padding:11px 13px;cursor:pointer;user-select:none;transition:background 0.15s;border-bottom:1px solid transparent;gap:6px; }
.legend-header:hover { background:rgba(221,183,255,0.04); }
.legend.expanded .legend-header { border-bottom-color:var(--outline-dim); }
.legend-header-left  { display:flex;align-items:center;gap:7px; }
.legend-header-right { display:flex;align-items:center;gap:6px; }
.legend-icon { display:flex;align-items:center;opacity:0.85; }
.legend-title { font-family:'JetBrains Mono',monospace;font-size:9px;letter-spacing:0.2em;color:var(--muted);text-transform:uppercase;font-weight:600; }
.legend-chevron { font-size:11px;color:var(--muted);transition:transform 0.25s ease;line-height:1; }
.legend.expanded .legend-chevron { transform:rotate(180deg); }
.legend-body { max-height:0;overflow:hidden;transition:max-height 0.35s cubic-bezier(0.4,0,0.2,1);padding:0; }
.legend.expanded .legend-body { max-height:500px;padding:6px 0 6px; }
.layer-dot { width:10px;height:10px;border-radius:50%;flex-shrink:0;transition:opacity 0.2s,filter 0.2s; }
.layer-dot-multi { background:conic-gradient(var(--secondary) 0deg 90deg,var(--error) 90deg 180deg,var(--tertiary) 180deg 270deg,var(--primary) 270deg 360deg);border-radius:50%; }
.layer-dot-trail { background:transparent;border:none;position:relative;width:16px;height:10px;flex-shrink:0; }
.layer-dot-trail::before { content:'';position:absolute;top:50%;left:0;right:0;border-top:2px dashed var(--primary);transform:translateY(-50%);opacity:0.8; }
.layer-dot-boundary { background:transparent;border:1.5px dashed var(--primary);opacity:0.6;width:10px;height:10px;border-radius:2px; }
.layer-expand-row { display:flex;align-items:center;justify-content:center;padding:8px 12px;gap:7px;border-top:1px solid rgba(255,255,255,0.05);margin-top:2px;cursor:pointer;color:var(--muted);font-family:'JetBrains Mono',monospace;font-size:9px;font-weight:600;letter-spacing:0.1em;text-transform:uppercase;transition:color 0.15s,background 0.15s;border-radius:0 0 var(--r-xl) var(--r-xl); }
.layer-expand-row:hover { color:var(--primary);background:rgba(183,109,255,0.06); }

/* ── MODALS ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #0e1628;
  border: 1px solid var(--outline-dim);
  border-radius: var(--r-xl);
  width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(221, 183, 255, 0.08);
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--outline-dim);
  position: sticky; top: 0;
  background: #0e1628; z-index: 1;
}
.modal-title {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 12px; letter-spacing: 0.12em;
  color: var(--primary); text-transform: uppercase;
}
.modal-close {
  background: rgba(255, 255, 255, 0.06); border: none;
  border-radius: var(--r-sm);
  color: var(--muted); font-size: 14px;
  width: 28px; height: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: rgba(255, 180, 171, 0.2); color: var(--error); }

.modal-body {
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
}

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; letter-spacing: 0.14em;
  color: var(--muted); text-transform: uppercase;
}
.field-group input,
.field-group textarea,
.field-group select {
  background: var(--input-bg);
  border: 1px solid var(--outline-dim);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: 'Geist', sans-serif; font-size: 13px;
  padding: 9px 12px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}
.field-group input::placeholder,
.field-group textarea::placeholder { color: var(--muted); }
.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: var(--primary-container);
  box-shadow: 0 0 0 2px rgba(183, 109, 255, 0.15);
}
.field-group select option { background: #0e1628; }

.waypoint-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.waypoint-item {
  background: rgba(255, 185, 95, 0.06);
  border: 1px solid rgba(255, 185, 95, 0.2);
  border-radius: var(--r-md); padding: 8px 10px;
  display: flex; gap: 8px; align-items: flex-start;
}
.waypoint-icon { color: var(--tertiary); font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.waypoint-fields { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.waypoint-fields input {
  background: transparent; border: none;
  border-bottom: 1px solid var(--outline-dim);
  border-radius: 0; padding: 3px 0; font-size: 11px;
}
.waypoint-coords { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--muted); }

.image-upload-zone {
  border: 1px dashed var(--outline-dim); border-radius: var(--r-md);
  padding: 12px; cursor: pointer; transition: border-color 0.2s;
}
.image-upload-zone:hover { border-color: var(--primary-container); }
.upload-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); font-size: 11px; padding: 8px 0;
}
.upload-placeholder span:first-child { font-size: 22px; }
.image-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.preview-wrap { position: relative; }
.preview-wrap img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--outline-dim);
}
.preview-remove {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: var(--error-container); border: none; border-radius: 50%;
  color: #fff; font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.export-toggle { display: flex; gap: 6px; }
.export-opt {
  flex: 1; background: var(--input-bg);
  border: 1px solid var(--outline-dim);
  border-radius: var(--r-md); color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  padding: 7px 0; cursor: pointer; transition: all 0.2s;
  text-transform: uppercase;
}
.export-opt.active {
  background: rgba(183, 109, 255, 0.15);
  border-color: rgba(183, 109, 255, 0.5);
  color: var(--primary);
}

.modal-footer {
  display: flex; gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(183, 109, 255, 0.1);
  background: rgba(183, 109, 255, 0.02);
}
.modal-btn {
  flex: 1;
  border-radius: var(--r-lg);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 9px; letter-spacing: 0.12em;
  padding: 11px 10px; cursor: pointer; transition: all 0.18s;
  text-transform: uppercase; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  position: relative; overflow: hidden;
}
.modal-btn::after {
  content: ''; position: absolute; inset: 0;
  background: white; opacity: 0; transition: opacity 0.15s;
}
.modal-btn:active::after { opacity: 0.06; }

.modal-btn.primary {
  background: linear-gradient(135deg, var(--primary-container) 0%, #9040e0 100%);
  color: #fff;
  border: 1px solid rgba(221, 183, 255, 0.2);
  box-shadow: 0 4px 16px rgba(183, 109, 255, 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}
.modal-btn.primary:hover {
  box-shadow: 0 6px 24px rgba(183, 109, 255, 0.45), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.modal-btn.secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}
.modal-btn.secondary:hover {
  border-color: rgba(183, 109, 255, 0.35);
  color: var(--primary);
  background: rgba(183, 109, 255, 0.07);
}
.modal-btn.danger {
  background: rgba(255, 80, 60, 0.08);
  border: 1px solid rgba(255, 180, 171, 0.2);
  color: var(--error);
}
.modal-btn.danger:hover {
  background: rgba(255, 80, 60, 0.18);
  border-color: rgba(255,180,171,0.45);
  box-shadow: 0 2px 12px rgba(255,60,40,0.2);
  transform: translateY(-1px);
}

.save-status {
  margin: 0 20px 16px; padding: 10px 12px; border-radius: var(--r-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; text-align: center; letter-spacing: 0.08em;
}
.save-status.hidden { display: none; }
.save-status.success {
  background: rgba(68, 226, 205, 0.1); border: 1px solid rgba(68, 226, 205, 0.4);
  color: var(--secondary);
}
.save-status.error {
  background: rgba(255, 180, 171, 0.1); border: 1px solid rgba(255, 180, 171, 0.4);
  color: var(--error);
}

/* Detail Modal */
#detailBody { display: flex; flex-direction: column; gap: 14px; }
.detail-section { display: flex; flex-direction: column; gap: 6px; }
.detail-section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase;
}
.detail-text { font-size: 12px; color: var(--text); line-height: 1.6; }
.detail-badge {
  display: inline-block;
  background: rgba(183, 109, 255, 0.12); border: 1px solid rgba(183, 109, 255, 0.3);
  border-radius: 5px; color: var(--primary); font-family: 'JetBrains Mono', monospace;
  font-size: 9px; padding: 3px 8px; letter-spacing: 0.08em;
}
.detail-waypoints { display: flex; flex-direction: column; gap: 6px; }
.detail-waypoint {
  background: rgba(255, 185, 95, 0.06);
  border: 1px solid rgba(255, 185, 95, 0.2);
  border-radius: var(--r-md); padding: 8px 10px;
}
.detail-wp-name  { font-size: 11px; color: var(--tertiary); margin-bottom: 2px; font-weight: 600; }
.detail-wp-desc  { font-size: 10px; color: var(--muted); }
.detail-wp-coord { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--muted); margin-top: 3px; }
.detail-images { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-images img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: var(--r-md); border: 1px solid var(--outline-dim); cursor: pointer;
  transition: border-color 0.2s; 
}
.detail-images img:hover { border-color: var(--primary-container); }

/* ── WAYPOINT MODAL ──────────────────────────────── */
#waypointModal .modal { border-color: rgba(255, 185, 95, 0.4); }
#waypointModal .modal-title { color: var(--tertiary); }

/* ── ADMIN PANEL ─────────────────────────────────── */
/* ════════════════════════════════════════════════════════
   ADMIN PANEL — redesigned clean layout
   ════════════════════════════════════════════════════════ */

.admin-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: stretch; justify-content: flex-end;
  -webkit-transform: translateZ(0); transform: translateZ(0);
  will-change: transform; isolation: isolate;
}
.admin-overlay.hidden { display: none; }

.admin-panel {
  width: 400px; max-width: 100vw;
  background: #080d1a;
  border-left: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  position: relative;
}

/* ─ Header ─────────────────────────────────────────────── */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.admin-header-left {
  display: flex; align-items: center; gap: 8px;
}
.admin-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: 0.01em;
}
.admin-header-right { display: flex; gap: 6px; }

.admin-icon-btn {
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all 0.15s;
}
.admin-icon-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.admin-icon-btn--close:hover {
  background: rgba(255,100,80,0.12);
  border-color: rgba(255,100,80,0.3);
  color: var(--error);
}

/* ─ Tab bar ─────────────────────────────────────────────── */
.admin-tabbar {
  display: flex; gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  background: rgba(255,255,255,0.01);
}
.atab {
  flex: 1; background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  padding: 7px 8px; cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.atab:hover:not(.active) {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.atab.active {
  background: rgba(183,109,255,0.12);
  border-color: rgba(183,109,255,0.3);
  color: var(--primary);
}

/* ─ Tab content ─────────────────────────────────────────── */
.admin-tab-content { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.admin-tab-content.active { display: flex; }

/* ─ Toolbar row ─────────────────────────────────────────── */
.admin-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.admin-count-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px; padding: 3px 8px;
  white-space: nowrap; flex-shrink: 0;
}
.admin-search-input {
  flex: 1; min-width: 80px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; color: var(--text);
  font-size: 12px; padding: 6px 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-search-input:focus {
  border-color: rgba(183,109,255,0.45);
  box-shadow: 0 0 0 3px rgba(183,109,255,0.07);
}
.admin-search-input::placeholder { color: rgba(218,226,253,0.2); }

.admin-add-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(183,109,255,0.1);
  border: 1px solid rgba(183,109,255,0.28);
  border-radius: 8px; color: var(--primary);
  font-size: 11px; font-weight: 600;
  padding: 6px 11px; cursor: pointer;
  white-space: nowrap; transition: all 0.15s; flex-shrink: 0;
}
.admin-add-btn:hover {
  background: rgba(183,109,255,0.2);
  border-color: rgba(183,109,255,0.5);
  box-shadow: 0 2px 10px rgba(183,109,255,0.2);
}

/* ─ Inline "Add Point" Form ─────────────────────────────── */
.admin-inline-form {
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(183,109,255,0.03);
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}
.admin-inline-form.hidden { display: none; }
.admin-form-title {
  font-size: 11px; font-weight: 700;
  color: var(--primary); letter-spacing: 0.04em;
}
.admin-field-group { display: flex; flex-direction: column; gap: 4px; }
.admin-field-group label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; letter-spacing: 0.14em;
  color: var(--muted); text-transform: uppercase;
}
.admin-field-group input,
.admin-field-group select,
.admin-field-group textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: var(--text);
  font-family: 'Geist', sans-serif; font-size: 12px;
  padding: 7px 10px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-field-group input:focus,
.admin-field-group select:focus,
.admin-field-group textarea:focus {
  border-color: rgba(183,109,255,0.45);
  box-shadow: 0 0 0 3px rgba(183,109,255,0.08);
}
.admin-field-group select option { background: #080d1a; }
.admin-field-group textarea { resize: vertical; min-height: 60px; }
.admin-field-row { display: flex; gap: 8px; }

.admin-pick-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(68,226,205,0.07);
  border: 1px solid rgba(68,226,205,0.2);
  border-radius: 7px; color: var(--secondary);
  font-size: 11px; font-weight: 600;
  padding: 6px 11px; cursor: pointer;
  transition: all 0.15s; width: fit-content;
}
.admin-pick-btn:hover { background: rgba(68,226,205,0.15); }
.admin-pick-btn.active {
  background: rgba(68,226,205,0.2);
  border-color: rgba(68,226,205,0.5);
  animation: pick-pulse 1.2s ease-in-out infinite;
}
@keyframes pick-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(68,226,205,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(68,226,205,0); }
}
.admin-pick-hint {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: var(--secondary); padding: 4px 8px;
  background: rgba(68,226,205,0.06); border-radius: 5px;
  border: 1px solid rgba(68,226,205,0.15);
}
.admin-pick-hint.hidden { display: none; }

.admin-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.admin-form-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px; color: var(--muted);
  font-size: 11px; font-weight: 600;
  padding: 7px 14px; cursor: pointer;
  transition: all 0.15s;
}
.admin-form-cancel:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.admin-form-save {
  background: var(--primary);
  border: none; border-radius: 7px; color: #000;
  font-size: 11px; font-weight: 700;
  padding: 7px 16px; cursor: pointer;
  transition: all 0.15s;
}
.admin-form-save:hover { opacity: 0.88; }
.admin-form-save:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─ List ─────────────────────────────────────────────────── */
.admin-list {
  flex: 1; overflow-y: auto;
  padding: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.07) transparent;
  display: flex; flex-direction: column; gap: 3px;
}
.admin-loading {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--muted);
  text-align: center; padding: 24px 12px;
}
.admin-empty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--muted);
  text-align: center; padding: 20px; opacity: 0.6;
}

/* ─ List items ───────────────────────────────────────────── */
.admin-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: flex; align-items: center; gap: 10px;
}
.admin-item:hover {
  background: rgba(183,109,255,0.07);
  border-color: rgba(183,109,255,0.18);
  transform: translateX(2px);
}
.admin-item:active { transform: translateX(1px); }

.admin-item-icon {
  font-size: 15px; flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.06);
}
.admin-item-body { flex: 1; min-width: 0; }
.admin-item-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-item-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-item-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; letter-spacing: 0.06em;
  background: rgba(183,109,255,0.1); color: var(--primary);
  border: 1px solid rgba(183,109,255,0.2);
  text-transform: uppercase; flex-shrink: 0;
}
.admin-item-badge.seg,
.admin-item-badge.road { background: rgba(68,226,205,0.1); color: var(--secondary); border-color: rgba(68,226,205,0.22); }
.admin-item-badge.kml { background: rgba(255,185,95,0.1); color: var(--tertiary); border-color: rgba(255,185,95,0.22); }

/* Academic */
.admin-item-badge.lecture_hall { background: rgba(55,138,221,0.12); color: #378ADD; border-color: rgba(55,138,221,0.28); }
.admin-item-badge.faculty      { background: rgba(24,95,165,0.12);  color: #85B7EB; border-color: rgba(24,95,165,0.28); }
.admin-item-badge.laboratory   { background: rgba(93,202,165,0.12); color: #5DCAA5; border-color: rgba(93,202,165,0.28); }
.admin-item-badge.workshop     { background: rgba(29,158,117,0.12); color: #1D9E75; border-color: rgba(29,158,117,0.28); }
.admin-item-badge.library      { background: rgba(159,225,203,0.12);color: #9FE1CB; border-color: rgba(159,225,203,0.28); }
/* Administration */
.admin-item-badge.senate         { background: rgba(127,119,221,0.12); color: #7F77DD; border-color: rgba(127,119,221,0.28); }
.admin-item-badge.admin          { background: rgba(175,169,236,0.12); color: #AFA9EC; border-color: rgba(175,169,236,0.28); }
.admin-item-badge.bursary        { background: rgba(206,203,246,0.12); color: #AFA9EC; border-color: rgba(206,203,246,0.28); }
.admin-item-badge.student_affairs{ background: rgba(83,74,183,0.12);  color: #AFA9EC; border-color: rgba(83,74,183,0.28); }
/* Residential */
.admin-item-badge.hostel        { background: rgba(239,159,39,0.12); color: #EF9F27; border-color: rgba(239,159,39,0.28); }
.admin-item-badge.staff_quarters{ background: rgba(186,117,23,0.12); color: #FAC775; border-color: rgba(186,117,23,0.28); }
/* Commercial */
.admin-item-badge.shopping { background: rgba(216,90,48,0.12);  color: #F0997B; border-color: rgba(216,90,48,0.28); }
.admin-item-badge.kiosk    { background: rgba(240,153,123,0.12); color: #F0997B; border-color: rgba(240,153,123,0.28); }
.admin-item-badge.bank     { background: rgba(153,60,29,0.12);   color: #F0997B; border-color: rgba(153,60,29,0.28); }
/* Recreational */
.admin-item-badge.sports    { background: rgba(212,83,126,0.12); color: #D4537E; border-color: rgba(212,83,126,0.28); }
.admin-item-badge.hall      { background: rgba(237,147,177,0.12);color: #ED93B1; border-color: rgba(237,147,177,0.28); }
.admin-item-badge.clinic    { background: rgba(244,192,209,0.12);color: #ED93B1; border-color: rgba(244,192,209,0.28); }
.admin-item-badge.auditorium{ background: rgba(153,53,86,0.12);  color: #ED93B1; border-color: rgba(153,53,86,0.28); }
/* Operational */
.admin-item-badge.garage   { background: rgba(136,135,128,0.12); color: #B4B2A9; border-color: rgba(136,135,128,0.28); }
.admin-item-badge.bus_stop { background: rgba(95,94,90,0.12);    color: #B4B2A9; border-color: rgba(95,94,90,0.28); }
.admin-item-badge.utility  { background: rgba(180,178,169,0.12); color: #B4B2A9; border-color: rgba(180,178,169,0.28); }
/* Religious */
.admin-item-badge.mosque { background: rgba(250,199,117,0.12); color: #FAC775; border-color: rgba(250,199,117,0.28); }
.admin-item-badge.chapel { background: rgba(239,159,39,0.12);  color: #FAC775; border-color: rgba(239,159,39,0.28); }
/* Gates */
.admin-item-badge.gate    { background: rgba(226,75,74,0.12); color: #E24B4A; border-color: rgba(226,75,74,0.28); }
.admin-item-badge.entrance{ background: rgba(226,75,74,0.12); color: #E24B4A; border-color: rgba(226,75,74,0.28); }
.admin-item-badge.hazard  { background: rgba(226,75,74,0.12); color: #E24B4A; border-color: rgba(226,75,74,0.28); }
/* Legacy */
.admin-item-badge.landmark{ background: rgba(175,169,236,0.12); color: #AFA9EC; border-color: rgba(175,169,236,0.28); }
.admin-item-badge.poi     { background: rgba(93,202,165,0.12);  color: #5DCAA5; border-color: rgba(93,202,165,0.28); }
.admin-item-badge.junction{ background: rgba(136,135,128,0.12); color: #B4B2A9; border-color: rgba(136,135,128,0.28); }

.admin-item-chevron {
  color: rgba(183,109,255,0.35); font-size: 16px; flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}
.admin-item:hover .admin-item-chevron { color: var(--primary); transform: translateX(2px); }

.admin-item-photo-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 8px;
  background: rgba(255,185,95,0.08); color: var(--tertiary);
  padding: 2px 6px; border-radius: 20px;
  border: 1px solid rgba(255,185,95,0.2); margin-right: 2px;
  flex-shrink: 0; display: flex; align-items: center; gap: 2px;
}

/* ─ KML Upload Tab ───────────────────────────────────────── */
.admin-kml-upload-area {
  margin: 14px 14px 0;
  padding: 24px 16px;
  border: 1.5px dashed rgba(183,109,255,0.25);
  border-radius: 12px;
  background: rgba(183,109,255,0.03);
  display: flex; flex-direction: column;
  align-items: center; gap: 10px; text-align: center;
}
.admin-kml-upload-label {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.admin-kml-upload-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--muted);
}
.admin-kml-file-btn {
  background: rgba(183,109,255,0.12);
  border: 1px solid rgba(183,109,255,0.3);
  border-radius: 8px; color: var(--primary);
  font-size: 11px; font-weight: 700;
  padding: 8px 18px; cursor: pointer;
  transition: all 0.15s; margin-top: 4px;
  display: inline-block;
}
.admin-kml-file-btn:hover { background: rgba(183,109,255,0.22); }
.admin-kml-color-row {
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
}
.admin-color-pick {
  width: 36px; height: 28px; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; background: transparent; cursor: pointer; padding: 2px;
}

.admin-kml-divider {
  text-align: center; margin: 12px 14px 0;
  font-family: 'JetBrains Mono', monospace; font-size: 9px; color: rgba(218,226,253,0.2);
}
.admin-kml-path-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
}

.admin-section-label {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em;
  padding: 8px 14px 4px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 4px;
}

/* ─ Edit Modal ───────────────────────────────────────────── */
.admin-edit-modal { max-width: 520px; }
.admin-edit-modal .modal-title { color: var(--primary); }

.admin-coord-display {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: rgba(218,226,253,0.4);
  background: rgba(255,255,255,0.03);
  border-radius: 7px; padding: 8px 12px; margin-top: 2px;
}
.admin-save-status {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  padding: 8px 12px; border-radius: 7px; margin-top: 8px; display: none;
}
.admin-save-status.success {
  background: rgba(68,226,205,0.08); color: var(--secondary); display: block;
  border: 1px solid rgba(68,226,205,0.18);
}
.admin-save-status.error {
  background: rgba(255,180,171,0.08); color: var(--error); display: block;
  border: 1px solid rgba(255,180,171,0.18);
}

.kml-source-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: rgba(218,226,253,0.35);
  background: rgba(255,255,255,0.04);
  border-radius: 4px; padding: 1px 6px;
}

/* ─ Photo upload zone (edit modal) ──────────────────────── */
.admin-img-zone {
  border: 1.5px dashed var(--outline-dim);
  border-radius: 10px; padding: 14px; text-align: center;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.admin-img-zone:hover { border-color: var(--primary-container); background: rgba(183,109,255,0.04); }
.admin-img-zone-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); margin-bottom: 10px;
}
.admin-img-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; justify-content: flex-start; }
.admin-img-thumb-wrap { position: relative; width: 72px; height: 72px; }
.admin-img-thumb {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 6px; border: 1.5px solid var(--outline-dim); cursor: pointer;
  transition: border-color 0.15s;
}
.admin-img-thumb:hover { border-color: var(--primary-container); }
.admin-img-remove {
  position: absolute; top: -5px; right: -5px;
  background: var(--error-container); color: white; border: none;
  border-radius: 50%; width: 18px; height: 18px; font-size: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1;
  transition: background 0.15s;
}
.admin-img-remove:hover { background: #c00; }

/* ══════════════════════════════════════════════════════════
   NAV DEST PANEL  —  Redesigned
   Desktop: Google Maps-style sidebar card (left panel)
   Mobile:  Apple Maps-style bottom sheet
   ══════════════════════════════════════════════════════════ */

/* ── DESKTOP: sidebar-anchored directions card ──────────── */
.nav-dest-panel {
  position: fixed;
  top: 0;
  left: var(--sidebar-total-w);
  bottom: 0;
  width: 320px;
  z-index: 2100;
  background: #0c1425;
  border-right: 1px solid rgba(77, 67, 84, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: navSlideInLeft 0.30s cubic-bezier(0.34, 1.04, 0.64, 1);
  box-shadow: 4px 0 32px rgba(0,0,0,0.55);
  -webkit-transform: translateZ(0); transform: translateZ(0);
  will-change: transform; isolation: isolate;
}
body.sidebar-collapsed .nav-dest-panel {
  left: var(--sidebar-rail-w);
}
.nav-dest-panel.hidden { display: none; }

@keyframes navSlideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes navSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Header ─────────────────────────────────────────────── */
.nav-dest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.nav-dest-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}
.nav-dest-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: rgba(218,226,253,0.55);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
  line-height: 1;
}
.nav-dest-close:hover {
  background: rgba(255,180,171,0.12);
  color: var(--error);
  transform: scale(1.08);
}

/* ── Transport mode selector ─────────────────────────────── */
.nav-mode-row {
  display: flex;
  gap: 0;
  padding: 14px 18px 0;
  flex-shrink: 0;
}
.nav-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(218,226,253,0.38);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.nav-mode-btn .bi,
.nav-mode-btn .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
}
.nav-mode-btn .material-symbols-outlined { font-size: 20px; }
.nav-mode-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary-container);
}
.nav-mode-btn:hover:not(.active) {
  color: rgba(218,226,253,0.70);
}

/* ── Body ────────────────────────────────────────────────── */
.nav-dest-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}

/* ── Location rows ───────────────────────────────────────── */
.nav-route-inputs {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Vertical connector line between dots */
.nav-route-inputs::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: 38px;
  width: 2px;
  background: linear-gradient(180deg,
    var(--secondary) 0%,
    rgba(68,226,205,0.3) 50%,
    rgba(147,0,10,0.6) 100%);
  border-radius: 1px;
  z-index: 0;
}

.nav-from-row,
.nav-to-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  position: relative;
  z-index: 1;
}

.nav-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  position: relative;
  z-index: 2;
}
.nav-dot-a {
  background: var(--secondary);
  color: var(--on-secondary);
  box-shadow: 0 0 0 3px rgba(68,226,205,0.18);
}
.nav-dot-b {
  background: var(--error-container);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(147,0,10,0.25);
}

.nav-from-label {
  flex: 1;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(218,226,253,0.45);
  font-style: italic;
  padding: 10px 12px;
  background: rgba(255,255,255,0.028);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 10px;
}

/* Divider between rows */
.nav-inputs-divider {
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: 4px 0 4px 34px;
}

/* ── Destination input ───────────────────────────────────── */
.nav-to-input-wrap {
  flex: 1;
  position: relative;
}
.nav-to-input-wrap input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.nav-to-input-wrap input:focus {
  border-color: rgba(183,109,255,0.55);
  background: rgba(183,109,255,0.05);
  box-shadow: 0 0 0 3px rgba(183,109,255,0.12);
}
.nav-to-input-wrap input::placeholder {
  color: rgba(218,226,253,0.28);
  font-style: italic;
}

/* ── Search dropdown ─────────────────────────────────────── */
.nav-dest-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #0e1628;
  border: 1px solid rgba(77,67,84,0.55);
  border-radius: 12px;
  z-index: 9999;
  box-shadow: 0 12px 40px rgba(0,0,0,0.75), 0 2px 0 rgba(255,255,255,0.04) inset;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(77,67,84,0.5) transparent;
}
.nav-dest-dropdown.hidden { display: none; }
.nav-dd-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}
.nav-dd-item:first-child { border-radius: 12px 12px 0 0; }
.nav-dd-item:last-child  { border-bottom: none; border-radius: 0 0 12px 12px; }
.nav-dd-item:hover { background: rgba(183,109,255,0.10); }
.nav-dd-icon { font-size: 15px; flex-shrink: 0; }
.nav-dd-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--text); line-height: 1.3;
}
.nav-dd-sub {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  color: rgba(218,226,253,0.40);
  margin-top: 2px;
}
.nav-dd-item mark {
  background: rgba(183,109,255,0.22);
  color: var(--primary);
  border-radius: 3px;
  padding: 0 1px;
}

/* ── Hint text ───────────────────────────────────────────── */
.nav-dest-hint {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  color: rgba(218,226,253,0.30);
  text-align: center;
  letter-spacing: 0.01em;
  padding: 6px 0 0;
  min-height: 20px;
  transition: color 0.2s;
}
.nav-dest-hint:not(:empty) { color: rgba(68,226,205,0.65); }

/* ── CTA button ──────────────────────────────────────────── */
.nav-go-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--primary-container);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 14px 20px;
  cursor: pointer;
  margin-top: 14px;
  transition: opacity 0.15s, transform 0.14s cubic-bezier(0.34,1.3,0.64,1), box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(183,109,255,0.35), 0 1px 0 rgba(255,255,255,0.15) inset;
}
.nav-go-btn:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 8px 28px rgba(183,109,255,0.50), 0 1px 0 rgba(255,255,255,0.15) inset;
}
.nav-go-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(183,109,255,0.30);
}
.nav-go-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ══════════════════════════════════════════════════════════
   MOBILE OVERRIDES  ≤ 768px
   Apple Maps-style bottom sheet
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-dest-panel {
    /* override desktop panel → become a bottom sheet */
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-height: 88vh;
    border-right: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px 22px 0 0;
    animation: navSlideUp 0.38s cubic-bezier(0.34, 1.08, 0.64, 1);
    box-shadow:
      0 -1px 0 rgba(255,255,255,0.06),
      0 -8px 48px rgba(0,0,0,0.72),
      0 -20px 80px rgba(0,0,0,0.42);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Drag handle pill (Apple-style) */
  .nav-dest-header::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
  }
  .nav-dest-header {
    position: relative;
    padding: 28px 18px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .nav-dest-title {
    font-size: 20px;
  }

  /* Mode tabs become pill buttons on mobile */
  .nav-mode-row {
    padding: 12px 18px 0;
    gap: 8px;
    border: none;
  }
  .nav-mode-btn {
    flex-direction: row;
    gap: 6px;
    padding: 9px 14px;
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.04);
    border-bottom: 1.5px solid rgba(255,255,255,0.08);
    color: rgba(218,226,253,0.50);
  }
  .nav-mode-btn .bi,
  .nav-mode-btn .material-symbols-outlined {
    font-size: 16px;
  }
  .nav-mode-btn.active {
    background: rgba(183,109,255,0.18);
    border-color: rgba(183,109,255,0.45);
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(183,109,255,0.22);
  }

  /* Body padding for mobile */
  .nav-dest-body {
    padding: 14px 18px 20px;
  }

  /* Bigger input for mobile (iOS anti-zoom) */
  .nav-to-input-wrap input {
    font-size: 16px !important;
    padding: 13px 16px;
    border-radius: 12px;
  }

  .nav-from-label {
    font-size: 14px;
    padding: 12px 14px;
    border-radius: 12px;
  }

  /* CTA */
  .nav-go-btn {
    font-size: 15px;
    padding: 17px 20px;
    border-radius: 16px;
    letter-spacing: 0.00em;
    margin-top: 16px;
  }

  .nav-dest-hint {
    font-size: 12px;
    padding: 8px 0 4px;
  }
}

/* ── NAV HUD ─────────────────────────────────────── */
.nav-hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2200;
  background: #080f1f;
  border-bottom: 3px solid var(--primary-container);
  box-shadow: 0 4px 30px rgba(183, 109, 255, 0.2);
  animation: navSlideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-transform: translateZ(0); transform: translateZ(0);
  will-change: transform; isolation: isolate;
}
.nav-hud.hidden { display: none; }
.nav-hud.nav-arriving { border-bottom-color: var(--tertiary); }
.nav-hud.nav-arrived  { border-bottom-color: var(--secondary); }

.nav-hud-top {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-turn-icon {
  width: 44px; height: 44px;
  background: rgba(183, 109, 255, 0.12);
  border: 2px solid var(--primary-container);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  transition: all 0.3s;
  box-shadow: 0 0 16px rgba(183, 109, 255, 0.2);
}
.nav-turn-info { flex: 1; min-width: 0; }
.nav-turn-instruction {
  font-family: 'Geist', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-turn-dist {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--primary); margin-top: 2px;
}
.nav-hud-close {
  background: rgba(255, 180, 171, 0.1);
  border: 1px solid rgba(255, 180, 171, 0.3);
  color: var(--error); border-radius: var(--r-sm);
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  padding: 6px 10px; cursor: pointer; transition: background 0.15s; flex-shrink: 0;
  letter-spacing: 0.08em;
}
.nav-hud-close:hover { background: rgba(255, 180, 171, 0.22); }

.nav-hud-stats { display: flex; padding: 8px 16px; gap: 0; }
.nav-stat {
  flex: 1; text-align: center; padding: 4px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-stat:last-child { border-right: none; }
.nav-stat--single { border-right: none; padding: 4px 0 6px; }
.nav-stat--single .nav-stat-val { font-size: 18px; color: var(--primary); }
.nav-stat-label {
  font-family: 'JetBrains Mono', monospace; font-size: 8px;
  color: rgba(218, 226, 253, 0.35); letter-spacing: 0.12em; margin-bottom: 2px;
}
.nav-stat-val {
  font-family: 'Geist', sans-serif; font-size: 14px; font-weight: 700; color: var(--text);
}
.nav-dest-name {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: rgba(218, 226, 253, 0.3); text-align: center;
  padding: 4px 16px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Nav arrived banner */
.nav-arrived-banner {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3000;
  background: #080f1f;
  border: 2px solid var(--primary-container);
  border-radius: var(--r-xl); padding: 28px 36px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--primary-glow);
  animation: arrivedPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes arrivedPop {
  from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}
.nav-arrived-banner h2 {
  font-family: 'Geist', sans-serif; font-size: 22px; font-weight: 800;
  color: var(--primary); margin: 0 0 6px; letter-spacing: -0.02em;
}
.nav-arrived-banner p {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--muted); margin: 0 0 18px;
}
.nav-arrived-banner button {
  background: var(--primary-container); color: var(--on-primary);
  border: none; border-radius: var(--r-md);
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; padding: 11px 22px; cursor: pointer; text-transform: uppercase;
}

/* ── POI Review Modal ──────────────────────────────────────────── */
.review-place-name {
  font-family: 'Geist', sans-serif; font-size: 16px; font-weight: 800;
  color: var(--text); margin-bottom: 14px; text-align: center;
}
.review-stars {
  display: flex; justify-content: center; gap: 8px;
  font-size: 36px; line-height: 1; margin-bottom: 18px;
  user-select: none;
}
.review-star {
  color: rgba(255,255,255,.15);
  cursor: pointer;
  transition: color 0.12s, transform 0.12s;
}
.review-star:hover { transform: scale(1.12); }
.review-star.active { color: #FFC857; }
.review-modal-actions {
  display: flex; gap: 10px; margin-top: 16px;
}
.review-modal-actions .modal-btn { flex: 1; }
.review-status {
  margin-top: 10px; text-align: center;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--muted); letter-spacing: 0.05em;
}
.review-status.success { color: var(--primary); }
.review-status.error   { color: var(--error); }

/* Nav dest pin */
.nav-dest-pin {
  background: var(--error-container);
  border: 3px solid #fff; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.5);
}

/* ── LEAFLET OVERRIDES ───────────────────────────── */
.leaflet-popup-content-wrapper {
  background: rgba(11, 19, 38, 0.96) !important;
  border: 1px solid var(--outline-dim) !important;
  border-radius: var(--r-lg) !important;
  color: var(--text) !important;
  font-family: 'Geist', sans-serif !important;
  font-size: 12px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6) !important;
}
.leaflet-popup-tip { background: rgba(11, 19, 38, 0.96) !important; }
.leaflet-popup-close-button { color: var(--muted) !important; }
.leaflet-control-attribution {
  background: rgba(11, 19, 38, 0.85) !important;
  color: rgba(218, 226, 253, 0.35) !important; font-size: 9px !important;
  border-radius: var(--r-sm) !important;
}
.leaflet-marker-pane .leaflet-marker-icon {
  transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── POPUP COMPONENTS ────────────────────────────── */
.seg-popup { font-family: 'Geist', sans-serif; min-width: 160px; }
.seg-popup-name {
  font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 4px;
}
.seg-popup-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--muted); margin-bottom: 8px;
}
.seg-popup-btn {
  width: 100%; background: rgba(183, 109, 255, 0.12);
  border: 1px solid rgba(183, 109, 255, 0.35);
  border-radius: var(--r-sm); color: var(--primary);
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  padding: 7px; cursor: pointer; letter-spacing: 0.08em; text-transform: uppercase;
  transition: background 0.2s;
}
.seg-popup-btn:hover { background: rgba(183, 109, 255, 0.25); }

.futa-popup .leaflet-popup-content-wrapper {
  background: rgba(11, 19, 38, 0.97) !important;
  border: 1px solid var(--outline-dim) !important;
  border-radius: var(--r-lg) !important; padding: 0 !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65) !important;
}
.futa-popup .leaflet-popup-tip-container { display: none; }
.futa-popup .leaflet-popup-content { margin: 0; }

.wp-popup { padding: 14px 16px; min-width: 190px; }
.wp-popup-title {
  font-family: 'Geist', sans-serif; font-weight: 700; font-size: 14px;
  color: var(--tertiary); margin-bottom: 4px; line-height: 1.25;
}
.wp-popup-type {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: var(--primary); letter-spacing: 0.08em; margin-bottom: 6px;
}
.wp-popup-note { font-size: 11px; color: var(--text); line-height: 1.4; margin-bottom: 6px; }
.wp-popup-coords {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: rgba(218, 226, 253, 0.35); letter-spacing: 0.04em; margin-top: 6px;
}
.wp-popup-seg {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: rgba(68, 226, 205, 0.6); margin-top: 4px;
}
.wp-popup-photos {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.wp-popup-photos-label {
  font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.14em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 8px;
}
.wp-popup-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.wp-popup-thumb {
  width: 68px; height: 68px; object-fit: cover;
  border-radius: var(--r-md); cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.18s, transform 0.18s;
}
.wp-popup-thumb:hover { border-color: var(--tertiary); transform: scale(1.06); }
.wp-popup-pending {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  color: rgba(218, 226, 253, 0.3); font-style: italic;
}

/* ── WAYPOINT MARKER — Google Maps style ─────────── */
/*
  Layout: [●  Name]
  One inline-flex pill. The dot is a ::before pseudo-element.
  No backdrop-filter — no blur — cheap to paint.
*/
/* ═══════════════════════════════════════════════════════════
   GOOGLE MAPS–STYLE TEARDROP PIN + PLAIN LABEL
   ═══════════════════════════════════════════════════════════
   zoom-far  (z≤14) → 5 px solid dot only
   zoom-mid  (z=15) → 7 px dot only
   zoom-near (z≥16) → teardrop SVG pin + plain text beside it
   No backdrop-filter anywhere — zero GPU composite cost.
*/

/* Outer wrapper — Leaflet anchors this div at the pin tip */
.gm-pin-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  pointer-events: auto;
  isolation: isolate;
}



/* ── Plain text label ────────────────────────────────── */
.gm-pin-label {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  color: #1a1a2e;
  max-width: 120px;
  line-height: 1.2;
  text-shadow:
    0 0 3px rgba(255,255,255,1),
    0 0 6px rgba(255,255,255,0.9),
    0  1px 0  rgba(255,255,255,0.95),
    0 -1px 0  rgba(255,255,255,0.95);
  transition: opacity 0.18s ease;
}

/* ── Zoom-out dot ────────────────────────────────────── */
.gm-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pin-color, #00c896);
  border: 1.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 1px 3px rgba(0,0,0,0.55);
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* ── Hover ─────────────────────────────────────────────── */
.gm-pin-wrap:hover .gm-pin-dot {
  transform: scale(1.15);
}

/* ══════════════════════════════════════════════════════
   ZOOM OVERRIDES
   ══════════════════════════════════════════════════════ */

#map.zoom-far .gm-pin-label { opacity: 0; pointer-events: none; }
#map.zoom-far .gm-pin-dot   { transform: scale(0.6); opacity: 0.7; }
#map.zoom-far .gm-pin-wrap  { opacity: 0.65; }

#map.zoom-mid .gm-pin-label { opacity: 0; pointer-events: none; }
#map.zoom-mid .gm-pin-dot   { transform: scale(0.8); opacity: 0.88; }
#map.zoom-mid .gm-pin-wrap  { opacity: 0.88; }

#map.zoom-near .gm-pin-label { opacity: 0; pointer-events: none; }   /* pin only — no label clutter */
#map.zoom-near .gm-pin-dot   { transform: scale(1); opacity: 1; }
#map.zoom-near .gm-pin-wrap  { opacity: 1; }

#map.zoom-close .gm-pin-label { opacity: 1; }      /* labels bloom in at z≥18 */
#map.zoom-close .gm-pin-dot   { transform: scale(1); opacity: 1; }
#map.zoom-close .gm-pin-wrap  { opacity: 1; }

/* ── RAW MODE ─────────────────────────────────────────── */
body.raw-mode .gm-pin-wrap { display: none !important; }

/* ── Silence stale chip class refs ───────────────────── */
.wp-chip-wrap   { display: none !important; }
.wp-gm-pin      { display: none !important; }
.saved-pin-icon { display: none !important; }

/* ── GPS ANIMATION ───────────────────────────────── */
@keyframes gps-pulse {
  0%   { transform: scale(1);   opacity: 0.22; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1);   opacity: 0; }
}

/* ── PERFORMANCE ─────────────────────────────────── */
/* ── Mobile perf fix 3: removed will-change:transform from every overlay.
   Blanket-promoting panels, modals, and nav HUD to GPU layers consumed
   ~60 MB extra GPU memory on mobile and caused compositor stalls.
   translateZ(0) is kept for Safari paint-order correctness. */
.header-panel,
.gps-panel,
#layersPanel,
#navHud,
#navDestPanel,
#adminOverlay,
#saveModal,
#detailModal {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  isolation: isolate;
}

/* ── SAFARI FIXES ────────────────────────────────── */
@keyframes logopulse-safari { 0%,100%{opacity:1} 50%{opacity:.7} }
@keyframes trackGlow-safari { 0%,100%{opacity:1} 50%{opacity:.75} }

/* ── EXPAND MAP BTN (inside layers) ─────────────── */
.layer-expand-row {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 12px; gap: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 2px; cursor: pointer;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.15s, background 0.15s; border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.layer-expand-row:hover { color: var(--primary); background: rgba(183, 109, 255, 0.06); }

/* ── RESPONSIVE — MOBILE ─────────────────────────── */
@media (max-width: 768px) {
  :root {
    --header-h: auto;
  }

  /* Header becomes top-fixed strip */
  .header-panel {
    top: 10px; left: 10px; right: 10px;
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
    border-radius: var(--r-lg);
  }

  .logo-block { flex: 0 0 auto; }
  .app-title { font-size: 15px; }
  .app-sub { display: none; }

  .search-wrap { flex: 1 1 100%; order: 3; }

  .nav-launch-btn,
  .admin-toggle {
    font-size: 9px;
    padding: 7px 10px;
  }

  /* Layers panel becomes bottom-sheet */
  .legend {
    left: 10px; right: 10px; bottom: 80px;
    min-width: unset; max-width: unset;
    width: auto;
    border-radius: var(--r-xl);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(11, 19, 38, 0.97) !important;
  }

  /* GPS panel bottom-right, smaller */
  .gps-panel {
    right: 10px; bottom: 10px;
    width: calc(100% - 20px);
    max-width: 280px;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(11, 19, 38, 0.97) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  }

  .place-toast {
    bottom: 200px; min-width: 200px; max-width: calc(100vw - 32px);
  }

  .admin-panel {
    width: 100vw;
    border-left: none;
    border-top: 1px solid var(--outline-dim);
  }

  .modal { max-width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  .view-toggle-btn { left: 10px; bottom: 10px; }

  /* Nav panel: sidebar card shrinks slightly on mid screens */
  .nav-dest-panel { width: 280px; }
  .nav-dest-title { font-size: 18px; }

  /* ── Mobile perf fix 4: kill ALL backdrop-filter blur on mobile ────────
     backdrop-filter:blur() requires the GPU to composite every blurred
     element on every repaint. On mid-range Android this causes visible
     frame drops during map pan/zoom and when popups open. All surfaces
     switch to fully opaque solid backgrounds — visually identical at
     the dark theme we use, zero GPU cost. ──────────────────────────── */
  .glass,
  .header-panel,
  .gps-panel,
  .place-card,
  #placeToast,
  .search-bar,
  .nav-hud,
  #navHud,
  .nav-dest-panel,
  #navDestPanel,
  .mob-sheet,
  #mobSheet,
  .admin-panel,
  #adminOverlay,
  .modal,
  .modal-overlay,
  .desk-search-bar,
  .search-dropdown,
  .nav-dd-list,
  .place-card-photo-count,
  .place-card-photo-nav,
  .leaflet-popup-content-wrapper,
  .leaflet-control-attribution,
  .leaflet-control-zoom a {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* Ensure surfaces stay readable without blur by forcing full opacity */
  .glass {
    background: rgba(11, 19, 38, 0.97) !important;
  }
  .leaflet-popup-content-wrapper {
    background: rgba(10, 16, 32, 0.98) !important;
  }
  .leaflet-control-attribution {
    background: rgba(8, 12, 26, 0.92) !important;
  }
  .place-card-photo-count,
  .place-card-photo-nav {
    background: rgba(0, 0, 0, 0.72) !important;
  }
}

@media (max-width: 480px) {
  .header-panel { top: 8px; left: 8px; right: 8px; padding: 8px 10px; }
  .gps-panel { right: 8px; bottom: 8px; width: calc(100% - 16px); max-width: unset; }
  .legend { left: 8px; right: 8px; bottom: 72px; }

  .nav-launch-btn, .admin-toggle { font-size: 8px; padding: 6px 8px; }
  .app-title { font-size: 14px; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--outline-dim); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }
/* ══════════════════════════════════════════════════════════════
   MOBILE-FIRST LAYOUT  —  Google Maps-style
   ► Map = 100vw × 100vh, full bleed, always
   ► Floating search bar top
   ► FAB cluster bottom-right
   ► Draggable bottom sheet for all panels
   ══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --mob-search-h:    56px;
  --mob-sheet-peek:  76px;   /* collapsed: handle + tab strip + slight breathing room */
  --mob-sheet-half:  50vh;   /* exactly half the screen — sits below browser chrome */
  --mob-sheet-full:  92vh;
  --mob-sheet-radius: 20px;
  --mob-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mob-safe-top:    env(safe-area-inset-top, 0px);
}

/* ════════════════════════════════════════════════════════════════
   DESKTOP FLOATING SEARCH BAR  —  Google Maps-style top-center
   ════════════════════════════════════════════════════════════════ */

/* Hidden on mobile — shown only via media query below */
.desk-search-bar { display: none; }

@media (min-width: 769px) {

  /* ── Pill container ──────────────────────────────────────────── */
  .desk-search-bar {
    display: flex;
    align-items: center;
    position: fixed;
    top: 14px;
    /* sit in the map area, centred between sidebar and right edge */
    left: calc(var(--sidebar-total-w) + 16px);
    right: 16px;
    max-width: 580px;
    /* horizontally centre it within the available space */
    margin-left: auto;
    margin-right: auto;
    height: 52px;
    background: rgba(11, 19, 38, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(77, 67, 84, 0.55);
    border-radius: 28px;
    box-shadow:
      0 2px 6px rgba(0,0,0,0.20),
      0 6px 22px rgba(0,0,0,0.32),
      0 14px 48px rgba(0,0,0,0.26),
      0 0 0 1px rgba(255,255,255,0.06);
    z-index: 1100;
    gap: 0;
    /* animate left when sidebar collapses */
    transition:
      left   0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
      max-width 0.25s ease,
      box-shadow 0.25s ease,
      border-color 0.25s ease;
    overflow: visible;
  }

  /* Shift bar with sidebar collapse */
  body.sidebar-collapsed .desk-search-bar {
    left: calc(var(--sidebar-rail-w) + 16px);
  }

  /* Glow + expand on focus */
  .desk-search-bar:focus-within {
    border-color: rgba(183, 109, 255, 0.45);
    box-shadow:
      0 2px 6px rgba(0,0,0,0.20),
      0 6px 22px rgba(0,0,0,0.32),
      0 14px 48px rgba(0,0,0,0.26),
      0 0 0 2.5px rgba(183, 109, 255, 0.28),
      0 0 0 1px rgba(255,255,255,0.06);
    max-width: 640px;
  }

  /* ── Logo button ─────────────────────────────────────────────── */
  .desk-search-logo {
    flex-shrink: 0;
    width: 52px; height: 100%;
    background: none; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
    border-radius: 28px 0 0 28px;
    transition: background 0.15s;
  }
  .desk-search-logo:hover { background: rgba(183, 109, 255, 0.08); }

  /* ── Divider ─────────────────────────────────────────────────── */
  .desk-search-divider {
    width: 1px; height: 24px; flex-shrink: 0;
    background: rgba(77, 67, 84, 0.55);
  }

  /* ── Input area ──────────────────────────────────────────────── */
  .desk-search-input-wrap {
    flex: 1; position: relative;
    display: flex; align-items: center;
    height: 100%; min-width: 0;
  }

  .desk-search-icon {
    position: absolute; left: 14px;
    font-size: 13px;
    color: rgba(218, 226, 253, 0.38);
    pointer-events: none;
    transition: color 0.2s;
    z-index: 1;
  }
  .desk-search-bar:focus-within .desk-search-icon { color: var(--primary); }

  .desk-search-input {
    width: 100%; height: 100%;
    background: transparent; border: none; outline: none;
    color: var(--text);
    font-family: 'Geist', 'Inter', sans-serif;
    font-size: 14px; font-weight: 400;
    padding: 0 8px 0 40px;
    caret-color: var(--primary);
  }
  .desk-search-input::placeholder { color: rgba(218, 226, 253, 0.38); }

  /* ── Clear button ────────────────────────────────────────────── */
  .desk-search-clear {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: none; color: rgba(218, 226, 253, 0.45);
    font-size: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; margin-right: 4px;
    transition: background 0.15s, color 0.15s;
  }
  .desk-search-clear:hover { background: rgba(255,255,255,0.14); color: var(--text); }
  .desk-search-clear.hidden { display: none; }

  /* ── Navigate button ─────────────────────────────────────────── */
  .desk-search-action {
    flex-shrink: 0;
    width: 42px; height: 38px;
    margin: 0 7px;
    background: var(--primary-container);
    border: none; border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; cursor: pointer;
    box-shadow: 0 2px 10px rgba(183, 109, 255, 0.45);
    transition: opacity 0.15s, transform 0.12s, box-shadow 0.2s;
  }
  .desk-search-action:hover {
    opacity: 0.9;
    transform: scale(1.07);
    box-shadow: 0 4px 18px rgba(183, 109, 255, 0.6);
  }
  .desk-search-action:active { transform: scale(0.95); opacity: 0.8; }

  /* ── Suggestions dropdown ────────────────────────────────────── */
  .desk-search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    /* extend full width of the pill, including logo + action areas */
    left: -53px;
    right: -57px;
    background: rgba(11, 19, 38, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(77, 67, 84, 0.55);
    border-radius: 18px;
    box-shadow:
      0 8px 32px rgba(0,0,0,0.60),
      0 24px 64px rgba(0,0,0,0.45),
      0 0 0 1px rgba(183, 109, 255, 0.07);
    z-index: 9999;
    overflow: hidden;
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(77,67,84,0.6) transparent;
    transform-origin: top center;
    animation: deskDropIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .desk-search-dropdown.hidden { display: none; }

  @keyframes deskDropIn {
    from { opacity: 0; transform: scaleY(0.91) translateY(-6px); }
    to   { opacity: 1; transform: scaleY(1)    translateY(0); }
  }

  /* ── Dropdown items (inherit sd-* styles with slight sizing bump) ── */
  .desk-search-dropdown .sd-section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px; letter-spacing: 0.12em;
    color: var(--muted);
    padding: 10px 18px 5px;
    text-transform: uppercase;
    border-top: 1px solid rgba(77, 67, 84, 0.4);
  }
  .desk-search-dropdown .sd-section-label:first-child { border-top: none; }

  .desk-search-dropdown .sd-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
  }
  .desk-search-dropdown .sd-item:last-child { border-bottom: none; }
  .desk-search-dropdown .sd-item:hover,
  .desk-search-dropdown .sd-item.active { background: rgba(183, 109, 255, 0.10); }

  .desk-search-dropdown .sd-icon { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
  .desk-search-dropdown .sd-body { flex: 1; min-width: 0; }
  .desk-search-dropdown .sd-name {
    font-family: 'Geist', 'Inter', sans-serif;
    font-size: 13px; font-weight: 600;
    color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .desk-search-dropdown .sd-name mark {
    background: transparent; color: var(--primary); font-weight: 800;
  }
  .desk-search-dropdown .sd-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; color: var(--muted);
    margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .desk-search-dropdown .sd-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px; font-weight: 700;
    padding: 3px 8px; border-radius: 20px;
    background: rgba(183, 109, 255, 0.15);
    color: var(--primary);
    border: 1px solid rgba(183, 109, 255, 0.25);
    flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.08em;
  }
  .desk-search-dropdown .sd-badge.osm {
    background: rgba(68, 226, 205, 0.12); color: var(--secondary);
    border-color: rgba(68, 226, 205, 0.25);
  }
  .desk-search-dropdown .sd-badge.seg {
    background: rgba(221, 183, 255, 0.12); color: var(--primary);
    border-color: rgba(221, 183, 255, 0.25);
  }
  .desk-search-dropdown .sd-spinner,
  .desk-search-dropdown .sd-empty {
    text-align: center; padding: 16px 14px;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
  }

} /* end @media (min-width: 769px) */

/* ── All mobile-only elements: hidden on desktop ───────────── */
.mob-search-bar,
.mob-fab-cluster,
.mob-sheet,
.mob-sheet-backdrop {
  display: none;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE BREAKPOINT  ≤ 768px
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Kill the sidebar entirely on mobile ─────────────────── */
  .sidebar           { display: none !important; }
  .view-toggle-btn   { display: none !important; }

  /* ── Map = full screen ───────────────────────────────────── */
  #map {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transition: none !important;
  }

  /* ── Floating search bar ─────────────────────────────────── */
  .mob-search-bar {
    display: flex;
    align-items: center;
    position: fixed;
    top: calc(14px + var(--mob-safe-top));
    left: 12px;
    right: 12px;
    height: var(--mob-search-h);
    background: var(--surface-bright);
    border-radius: 28px;
    box-shadow:
      0 1px 4px rgba(0,0,0,0.12),
      0 4px 16px rgba(0,0,0,0.20),
      0 8px 32px rgba(0,0,0,0.18),
      0 0 0 1px rgba(255,255,255,0.07);
    z-index: 1100;
    overflow: hidden;
    gap: 0;
  }

  .mob-search-logo {
    flex-shrink: 0;
    width: 52px; height: 100%;
    background: none; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    padding: 0;
  }

  .mob-search-input-btn {
    flex: 1;
    height: 100%;
    background: none; border: none;
    display: flex; align-items: center; gap: 8px;
    padding: 0 4px;
    cursor: pointer;
    text-align: left;
  }

  .mob-search-icon {
    color: var(--muted);
    font-size: 14px;
    flex-shrink: 0;
  }

  .mob-search-placeholder {
    font-family: 'Geist', sans-serif;
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mob-search-action {
    flex-shrink: 0;
    width: 48px; height: 42px;
    margin: 0 5px;
    background: var(--primary);
    border: none; border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(183,109,255,0.4);
    transition: opacity 0.15s, transform 0.1s;
  }
  .mob-search-action:active { transform: scale(0.94); opacity: 0.85; }

  /* ── FAB cluster ─────────────────────────────────────────── */
  .mob-fab-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: fixed;
    right: 14px;
    bottom: calc(var(--mob-sheet-peek) + 20px + var(--mob-safe-bottom));
    z-index: 1050;
    transition: bottom 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Shift FABs up when sheet is half/full */
  body.mob-sheet-half  .mob-fab-cluster { bottom: calc(var(--mob-sheet-half)  + 16px + var(--mob-safe-bottom)); }
  body.mob-sheet-full  .mob-fab-cluster { bottom: calc(var(--mob-sheet-full)   + 16px + var(--mob-safe-bottom)); }

  .mob-fab {
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25), 0 4px 16px rgba(0,0,0,0.15);
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-fab:active { transform: scale(0.9); }

  .mob-fab--sm {
    width: 40px; height: 40px;
    background: var(--surface-bright);
    color: var(--text-variant);
    font-size: 15px;
  }
  .mob-fab--sm:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.3); }

  .mob-fab--locate {
    width: 52px; height: 52px;
    background: var(--surface-bright);
    color: var(--primary);
    font-size: 22px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.28), 0 6px 24px rgba(183,109,255,0.18);
  }
  .mob-fab--locate.tracking {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 3px 12px rgba(183,109,255,0.45);
  }

  /* ── Bottom sheet backdrop ───────────────────────────────── */
  .mob-sheet-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1199;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
  }
  body.mob-sheet-full .mob-sheet-backdrop {
    opacity: 1; pointer-events: auto;
  }

  /* ── Bottom sheet ────────────────────────────────────────── */
  .mob-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    height: var(--mob-sheet-full);
    background: var(--surface-bright);
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    z-index: 1200;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.4), 0 -1px 0 rgba(255,255,255,0.06);
    /* Default: peeking — translate so only peek height shows */
    transform: translateY(calc(100% - var(--mob-sheet-peek) - var(--mob-safe-bottom)));
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Prevent the sheet itself from triggering browser swipe navigation */
    touch-action: pan-y;
  }

  /* Sheet states */
  body.mob-sheet-peek .mob-sheet {
    transform: translateY(calc(100% - var(--mob-sheet-peek) - var(--mob-safe-bottom)));
  }
  body.mob-sheet-half .mob-sheet {
    transform: translateY(calc(100% - var(--mob-sheet-half) - var(--mob-safe-bottom)));
  }
  body.mob-sheet-full .mob-sheet {
    transform: translateY(calc(100% - var(--mob-sheet-full) - var(--mob-safe-bottom)));
  }

  /* Dragging: no transition */
  .mob-sheet.dragging { transition: none; }

  /* Handle — enlarged tap/drag zone */
  .mob-sheet-handle-wrap {
    flex-shrink: 0;
    height: 36px;           /* taller for easier grab */
    display: flex; align-items: center; justify-content: center;
    cursor: grab;
    touch-action: none;     /* this element owns touch events */
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    /* Subtle gradient hint that this is draggable */
    background: linear-gradient(
      to bottom,
      rgba(255,255,255,0.03) 0%,
      transparent 100%
    );
  }
  .mob-sheet-handle-wrap:active { cursor: grabbing; }
  .mob-sheet-handle-bar {
    width: 40px; height: 4px;
    background: var(--outline);
    border-radius: 2px;
    opacity: 0.45;
    transition: opacity 0.2s, width 0.2s;
  }
  /* Expand handle bar on press */
  .mob-sheet-handle-wrap:active .mob-sheet-handle-bar {
    opacity: 0.8;
    width: 52px;
  }

  /* Tab strip — also a drag zone so touch-action: none */
  .mob-sheet-header {
    flex-shrink: 0;
    padding: 0 8px 8px;
    border-bottom: 1px solid var(--border);
    touch-action: none;   /* owned by our drag handler when dragging */
    cursor: grab;
  }
  .mob-sheet-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
  }
  .mob-sheet-tabs::-webkit-scrollbar { display: none; }

  .mob-tab {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 6px;
    padding: 9px 14px;    /* bigger tap target */
    background: none; border: none;
    border-radius: 20px;
    font-family: 'Geist', sans-serif;
    font-size: 12px; font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    min-height: 44px;     /* WCAG minimum touch target */
    -webkit-tap-highlight-color: transparent;
  }
  .mob-tab i { font-size: 14px; }
  .mob-tab.active {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
  }
  .mob-tab--admin { color: var(--muted); }
  .mob-tab--admin.active { background: rgba(183,109,255,0.1); color: var(--primary); }

  /* Sheet body: scrollable content */
  .mob-sheet-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(16px + var(--mob-safe-bottom));
  }

  /* Panel content inside mob-sheet-body: reset sidebar-specific positioning */
  .mob-sheet-body .sidebar-panel {
    position: static !important;
    display: none;
    flex-direction: column;
    width: 100% !important;
    height: auto !important;
    border: none !important;
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
    overflow: visible !important;
  }
  .mob-sheet-body .sidebar-panel.active { display: flex; }

  .mob-sheet-body .panel-header {
    margin-top: 0 !important;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border);
  }
  .mob-sheet-body .panel-body {
    padding: 8px 0 8px;
  }

  /* Search panel: full-width inputs */
  .mob-sheet-body .sidebar-search-wrap { padding: 10px 12px 0; }
  .mob-sheet-body .search-field-wrap input { font-size: 14px; }

  /* Route planner full-width */
  .mob-sheet-body .route-planner-bar { margin: 8px 12px 0; }

  /* GPS panel stats */
  .mob-sheet-body .stat-row { padding: 0 12px; }
  .mob-sheet-body .gps-btn {
    margin: 12px 12px 0;
    width: calc(100% - 24px);
  }

  /* Nav panel */
  .mob-sheet-body .sidebar-nav-btn {
    width: calc(100% - 24px);
    margin: 8px 12px 0;
    padding: 14px;
    font-size: 13px;
  }
  .mob-sheet-body .nav-panel-hint {
    padding: 10px 14px 0;
    font-size: 10px;
  }

  /* Admin button in tabs */
  .mob-sheet-body .sidebar-footer { display: none; }

  /* ── Nav dest panel: handled inside the nav panel section above ─── */
  .nav-dest-panel.hidden { display: none !important; }

  /* ── Nav HUD: full-width sticky top ──────────────────────── */
  .nav-hud {
    left: 0 !important; right: 0 !important;
    top: 0 !important;
    border-radius: 0 0 16px 16px;
    padding-top: var(--mob-safe-top);
  }
  .nav-hud-top { padding: 10px 14px 8px; gap: 10px; }
  .nav-turn-icon { width: 40px; height: 40px; font-size: 20px; }
  .nav-turn-instruction { font-size: 15px; }
  .nav-turn-dist { font-size: 11px; }
  .nav-hud-close { font-size: 10px; padding: 6px 10px; }
  .nav-hud-stats { padding: 6px 14px; }
  .nav-dest-name { font-size: 10px; padding: 3px 14px 8px; }

  /* ── Place toast: above bottom sheet ────────────────────────*/
  .place-toast {
    bottom: calc(var(--mob-sheet-peek) + 12px + var(--mob-safe-bottom));
    left: 50%; transform: translateX(-50%);
    min-width: 200px; max-width: calc(100vw - 100px);
    right: auto;
    z-index: 1060;
    transition: bottom 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.mob-sheet-half .place-toast {
    bottom: calc(var(--mob-sheet-half) + 12px + var(--mob-safe-bottom));
  }

  /* ── Admin overlay: slide up as sheet ───────────────────── */
  .admin-overlay {
    align-items: flex-end;
    padding: 0;
    background: rgba(0,0,0,0.6);
  }
  .admin-panel {
    width: 100vw;
    max-height: 88vh;
    border-left: none;
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    overflow-y: auto;
  }
  .admin-header {
    padding: 14px 14px 10px;
    padding-top: calc(14px + var(--mob-safe-top));
  }
  .admin-tabbar { padding: 6px 10px; }

  /* ── Modals: bottom sheet style ──────────────────────────── */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100vw;
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    max-height: 88vh;
  }
  .modal-body { max-height: 60vh; overflow-y: auto; }

  /* ── Mobile search overlay (full-screen) ─────────────────── */
  .mob-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: var(--surface);
    flex-direction: column;
  }
  .mob-search-overlay.active { display: flex; }

  .mob-search-ov-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    padding-top: calc(10px + var(--mob-safe-top));
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .mob-search-ov-back {
    flex-shrink: 0;
    width: 40px; height: 40px;
    background: none; border: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-search-ov-back:active { background: rgba(255,255,255,0.07); }

  .mob-search-ov-input {
    flex: 1;
    background: var(--surface-bright);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
  }
  .mob-search-ov-input:focus { border-color: var(--primary); }

  .mob-search-ov-clear {
    flex-shrink: 0;
    width: 36px; height: 36px;
    background: none; border: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mob-search-ov-results {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0 var(--mob-safe-bottom);
  }
  .mob-ov-section {
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .mob-ov-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
  }
  .mob-ov-item:active { background: rgba(183,109,255,0.09); }
  .mob-ov-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
  }
  .mob-ov-body { flex: 1; min-width: 0; }
  .mob-ov-name {
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mob-ov-sub {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
  }
  .mob-ov-empty,
  .mob-ov-spinner {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
  }

} /* end @media ≤768px */

/* ── State-aware sheet shadow (depth cue for current position) ──── */
body.mob-sheet-half  .mob-sheet { box-shadow: 0 -6px 40px rgba(0,0,0,0.5), 0 -1px 0 rgba(255,255,255,0.07); }
body.mob-sheet-full  .mob-sheet { box-shadow: 0 -8px 48px rgba(0,0,0,0.6), 0 -1px 0 rgba(255,255,255,0.08); }

/* ── Sheet peek state: subtle upward arrow hint ─────────────────── */
body.mob-sheet-peek .mob-sheet-handle-bar {
  opacity: 0.6;
  /* Subtle pulse to invite interaction */
  animation: handlePulse 2.4s ease-in-out 1.2s 2;
}
@keyframes handlePulse {
  0%,100% { opacity: 0.45; transform: scaleX(1); }
  50%     { opacity: 0.9;  transform: scaleX(1.15); }
}

/* ── Fine-tune for very small phones ≤390px ─────────────────── */
@media (max-width: 390px) {
  .mob-search-placeholder { font-size: 13px; }
  .mob-tab span { display: none; }
  .mob-tab { padding: 8px 12px; min-height: 44px; }
  .mob-tab i { font-size: 16px; }
}

/* ── Admin PIN Auth Modal ──────────────────────────────────────────────── */
.admin-pin-modal {
  max-width: 320px;
  padding: 0;
  border-radius: var(--r-xl);
  background: #0e1628;
  border: 1px solid rgba(183, 109, 255, 0.2);
  box-shadow: 0 24px 64px rgba(0,0,0,0.8), 0 0 0 1px rgba(221,183,255,0.06);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.admin-pin-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 24px 24px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
}
.admin-pin-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 20px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}
.admin-pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-bottom: 10px;
}
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(183, 109, 255, 0.4);
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
}
.pin-dot.error {
  border-color: #ff4d6d;
  background: #ff4d6d;
  animation: pinShake 0.35s ease;
}
@keyframes pinShake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.admin-pin-error {
  text-align: center;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: #ff4d6d;
  padding: 6px 0 4px;
  letter-spacing: 0.04em;
  min-height: 22px;
}
.admin-pin-error.hidden { visibility: hidden; }
.admin-pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(183, 109, 255, 0.08);
  border-top: 1px solid rgba(183, 109, 255, 0.1);
  margin-top: 12px;
}
.pin-key {
  background: #0e1628;
  border: none;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  padding: 18px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pin-key:hover, .pin-key:active {
  background: rgba(183, 109, 255, 0.15);
  color: var(--primary);
}
.pin-key--cancel, .pin-key--back {
  font-size: 16px;
  color: var(--muted);
}
.pin-key--cancel:hover, .pin-key--cancel:active {
  background: rgba(255, 77, 109, 0.12);
  color: #ff4d6d;
}
#adminPinOverlay {
  z-index: 10001;
}

/* Hide Admin tab on phones (≤480px) — keeps it on iPad/tablet & desktop */
@media (max-width: 480px) {
  .mob-tab--admin { display: none !important; }
}
/* ═══════════════════════════════════════════════════════════════
   PLACE CARD  —  Google-Maps-style half-screen location panel
   ═══════════════════════════════════════════════════════════════ */

/* Scrim (tap to dismiss on mobile) */
.place-card-scrim {
  position: fixed; inset: 0;
  background: transparent;
  z-index: 1299;
  pointer-events: auto;
}
.place-card-scrim.hidden { display: none; }

/* ── Card shell ──────────────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════════
   FONT SYSTEM + TILE POLISH
   ══════════════════════════════════════════════════════════════ */
.place-card {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1300;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 40px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  overflow: hidden;
  /* On desktop: constrain width and anchor right (sidebar-aware) */
}
.place-card.visible {
  transform: translateY(0);
}
.place-card.expanded {
  max-height: 92vh;
}
.place-card.hidden {
  /* hidden via transform, not display:none — so transition works */
  pointer-events: none;
}

/* Desktop: float as a sidebar-style card on the left edge of the map */
@media (min-width: 769px) {
  .place-card {
    left: var(--sidebar-total-w);  /* respects sidebar */
    right: auto;
    bottom: 32px;
    width: 380px;
    max-height: 78vh;
    border-radius: var(--r-xl);
    box-shadow: 0 8px 40px rgba(0,0,0,.65);
    transform: translateX(-420px);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .place-card.visible {
    transform: translateX(12px);
  }
  .place-card-scrim { display: none !important; }
  .place-card-handle { display: none; }
}

/* ── Drag handle ─────────────────────────────────────────────── */
.place-card-handle {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0 4px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.place-card-handle:active { cursor: grabbing; }
.place-card-handle-bar {
  width: 40px; height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 2px;
}

/* ── Hero image ──────────────────────────────────────────────── */
.place-card-hero {
  position: relative;
  width: 100%;
  height: 220px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface-low);
}
.place-card-hero.hidden { display: none; }
.place-card-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s;
}
.place-card-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    transparent 55%,
    rgba(8,15,31,.7) 100%);
  pointer-events: none;
}

/* Photo counter */
.place-card-photo-count {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: 20px;
  padding: 3px 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; gap: 5px;
  backdrop-filter: blur(6px);
}
.place-card-photo-count.hidden { display: none; }

/* Prev / next photo buttons */
.place-card-photo-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.5);
  border: none; color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.15s, transform 0.15s;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.place-card-photo-nav:active { background: rgba(0,0,0,.75); transform: translateY(-50%) scale(.92); }
.place-card-photo-nav.prev { left: 10px; }
.place-card-photo-nav.next { right: 10px; }
.place-card-photo-nav.hidden { display: none; }

/* ── Scrollable body ─────────────────────────────────────────── */
.place-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 4px;
  flex-shrink: 0;
}
.place-card-title-wrap { flex: 1; min-width: 0; }
.place-card-name {
  font-family: 'Geist', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  word-break: break-word;
}
.place-card-badge {
  margin-top: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  display: flex; align-items: center; gap: 5px;
}
.place-card-badge:empty { display: none; }

.place-card-rating { margin-top: 5px; }
.place-card-rating:empty { display: none; }
.poi-rating {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  color: #FFC857;
  display: inline-flex; align-items: center; gap: 5px;
}
.poi-rating-count {
  color: var(--muted); font-weight: 600; font-size: 9px;
}
.poi-rating--empty {
  color: var(--muted); font-weight: 600; font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.08em;
}

.place-card-close {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--muted);
  border-radius: 50%;
  width: 34px; height: 34px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.place-card-close:hover { background: rgba(255,77,109,.12); color: #ff4d6d; }

.place-card-coords {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: rgba(218,226,253,.3);
  letter-spacing: 0.05em;
  padding: 0 18px 10px;
  flex-shrink: 0;
}

.place-card-desc {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-variant);
  padding: 0 18px 12px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.05);
  padding-top: 12px;
}
.place-card-desc.hidden { display: none; }

/* ── Photo strip ─────────────────────────────────────────────── */
.place-card-strip {
  padding: 0 18px 14px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.05);
  padding-top: 12px;
}
.place-card-strip.hidden { display: none; }
.place-card-strip-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.place-card-strip-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.place-card-strip-inner::-webkit-scrollbar { display: none; }
.place-card-strip-inner img {
  width: 88px; height: 72px;
  object-fit: cover;
  border-radius: var(--r-md);
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}
.place-card-strip-inner img.active,
.place-card-strip-inner img:hover { border-color: var(--primary); transform: scale(1.04); }

/* ── Action buttons ──────────────────────────────────────────── */
.place-card-actions {
  display: flex;
  gap: 10px;
  padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.05);
}
.place-card-action-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 10px;
  border: none; border-radius: 14px;
  font-family: 'Geist', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}
.place-card-action-btn:active { opacity: .82; transform: scale(.97); }
.place-card-action-btn.primary {
  background: var(--primary-container);
  color: var(--primary);
  box-shadow: 0 4px 18px rgba(183,109,255,.25);
}
.place-card-action-btn.secondary {
  background: rgba(255,255,255,.06);
  color: var(--text-variant);
  border: 1px solid rgba(255,255,255,.1);
}

/* ══════════════════════════════════════════════════════════════════
   DM SANS FONT SYSTEM + TILE POLISH
   ══════════════════════════════════════════════════════════════════ */
:root {
  --font-ui:   'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
}
html, body { font-family: var(--font-ui); }

.panel-title, .layer-name, .layer-stat-label, .layer-section-label,
.mob-search-placeholder, .mob-tab span, input, button, select, textarea {
  font-family: var(--font-ui);
}
.place-card-coords, .layer-status-pill, .brand-text,
.layer-count, .gps-value, .dist-val, .eta-val {
  font-family: var(--font-mono);
}
.place-card-name {
  font-family: var(--font-ui) !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
}

/* ── Tile sharpness ───────────────────────────────────────────────── */
.leaflet-tile {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* ── Mobile perf fix 2: removed will-change:transform — it created a
     separate GPU compositing layer per visible tile (~20–30 layers) causing
     GPU memory pressure and periodic 1-2 s freezes while panning on mobile.
     translateZ(0) is sufficient to prevent subpixel painting artifacts. */
  transform: translateZ(0);
}
.leaflet-container { font-family: var(--font-ui) !important; }

/* Tile filter adapts to the active basemap via body class set by JS */
body.map-light .leaflet-tile-pane { filter: saturate(0.88) brightness(1.01); }
body.map-dark  .leaflet-tile-pane { filter: contrast(1.05) brightness(0.96); }

/* On dark basemap: flip pin labels to white with subtle dark halo */
body.map-dark .gm-pin-label {
  color: #ffffff;
  text-shadow:
    0 0 3px rgba(0,0,0,1),
    0 0 6px rgba(0,0,0,0.85),
    0  1px 0 rgba(0,0,0,0.95),
    0 -1px 0 rgba(0,0,0,0.95);
}

/* ── Flat popup ───────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: rgba(10,16,32,0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5) !important;
  padding: 0 !important;
}
.leaflet-popup-tip-container { display: none !important; }
.leaflet-popup-content {
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  margin: 0 !important; padding: 12px 14px !important;
  line-height: 1.5 !important; color: var(--text) !important;
}

/* ── Zoom controls ────────────────────────────────────────────────── */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4) !important;
  border-radius: 10px !important; overflow: hidden;
}
.leaflet-control-zoom a {
  background: rgba(12,18,36,0.95) !important;
  color: rgba(218,226,253,0.7) !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  font-family: var(--font-ui) !important;
  width: 34px !important; height: 34px !important; line-height: 34px !important;
  transition: background 0.15s, color 0.15s !important;
}
.leaflet-control-zoom a:hover {
  background: rgba(183,109,255,.15) !important; color: var(--primary) !important;
}
.leaflet-control-zoom-out { border-bottom: none !important; }
.leaflet-control-attribution {
  background: rgba(8,12,26,0.75) !important;
  color: rgba(218,226,253,0.3) !important;
  font-family: var(--font-ui) !important; font-size: 9px !important;
  backdrop-filter: blur(8px) !important; border-radius: 6px 0 0 0 !important;
  padding: 2px 6px !important;
}
.leaflet-fade-anim .leaflet-tile { transition: opacity 0.18s linear !important; }
.leaflet-zoom-anim .leaflet-zoom-animated {
  transition: transform 0.22s cubic-bezier(0.25,0.46,0.45,0.94) !important;
}
/* ══════════════════════════════════════════════════════════════
   PLACE TYPE FILTER  —  Reference UI Redesign v3
   ══════════════════════════════════════════════════════════════ */

/* ── Section label + reset ────────────────────────────────── */
.layer-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ptf-reset-btn {
  display: none;
}

/* ── Group wrapper ────────────────────────────────────────── */
.ptf-group {
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background-color: #7851A9 !important;
  transition: opacity 0.22s;
}
.ptf-group:last-child {
  border-bottom: none;
}
.ptf-group:hover {
  border-color: rgba(255,255,255,0.07);
}
.ptf-group.ptf-group-off {
  opacity: 0.45;
}

/* ── Group header row ─────────────────────────────────────── */
.ptf-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 14px;
  cursor: pointer;
  background: transparent;
  border-bottom: 1px solid transparent;
  user-select: none;
  transition: background 0.15s;
  position: relative;
}
.ptf-group-header:hover {
  background: rgba(255,255,255,0.03);
}

/* Swatch — plain color dot, no shadow/glow */
.ptf-group-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  border: none;
  box-shadow: none;
}

.ptf-group-name {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: rgba(218,226,253,0.9);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Count badge — matches reference: rounded pill, colored text on dark bg */
.ptf-group-count {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: rgba(218,226,253,0.7);
  background: rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 1px 6px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
  border: none;
}

.ptf-group-chevron {
  font-size: 9px;
  color: var(--dark) !important;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
  line-height: 1;
}
.ptf-group-header.collapsed .ptf-group-chevron {
  transform: rotate(-90deg);
}

.ptf-group-toggle {
  flex-shrink: 0;
  margin-left: 2px;
}

/* ── Group body (collapsible) ─────────────────────────────── */
.ptf-group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1);
  background: rgba(0,0,0,0.12);
}
.ptf-group-body.open {
  max-height: 700px;
}

/* ── Per-type rows ────────────────────────────────────────── */
.ptf-type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 26px;
  cursor: pointer;
  transition: background 0.13s, opacity 0.2s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  position: relative;
}
.ptf-type-row:last-child {
  border-bottom: none;
}
.ptf-type-row:hover {
  background: rgba(255,255,255,0.04);
}
.ptf-type-row.ptf-type-off {
  opacity: 0.38;
}
.ptf-type-row.ptf-type-off .ptf-type-name {
  text-decoration: line-through;
}
.ptf-type-row:active {
  background: rgba(255,255,255,0.06);
}

/* ── Pin dot — small color circle, no shadow ────── */
.ptf-pin {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: none;
  flex-shrink: 0;
  box-shadow: none;
}

/* ── Type name ─────────────────────────────────── */
.ptf-type-name {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 400;
  color: rgba(218,226,253,0.72);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
  line-height: 1.3;
}

/* Type count badge — subdued, right-aligned */
.ptf-type-count {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: rgba(218,226,253,0.42);
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 20px;
  padding: 1px 5px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Custom checkbox — styled as a green indicator dot ─── */
.ptf-type-cb {
  appearance: none;
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(68,226,205,0.5);
  background: var (--dark) !important;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.ptf-type-cb:checked {
  background: var(--secondary);
  border-color: var(--secondary);
  box-shadow: none;
}
.ptf-type-cb:checked::after {
  content: none;
}
.ptf-type-row { cursor: pointer; }

/* ── Place-type layout overrides to keep legend visible ───────────────────── */
.layer-section-label {
  gap: 12px;
  margin-bottom: 12px;
}

.ptf-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 6px 12px;
  background: rgba(183,109,255,0.12);
  border: 1px solid rgba(183,109,255,0.24);
  border-radius: 999px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}
.ptf-reset-btn:hover {
  background: rgba(183,109,255,0.22);
  transform: translateY(-1px);
}

.ptf-group {
  margin: 0 0 14px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background:  var(--dark) !important;
}
.ptf-group:last-child {
  margin-bottom: 0;
}
.ptf-group:hover {
  border-color: #000000  !important;
}
.ptf-group.ptf-group-off {
  opacity: 0.45;
}

.ptf-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: default;
  background: #fff !important;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ptf-group-header:hover {
  background: rgba(255,255,255,0.06);
}

.ptf-group-chevron,
.ptf-group-toggle {
  display: none;
}

.ptf-group-body {
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 10px;
  padding: 14px;
  background: #fff !important;
}

.ptf-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  transition: background 0.18s, border-color 0.18s, opacity 0.2s, transform 0.18s;
}
.ptf-type-row:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(183,109,255,0.16);
  transform: translateY(-1px);
}
.ptf-type-row.ptf-type-off {
  opacity: 0.5;
}

.ptf-pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.ptf-type-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.ptf-type-count {
  font-size: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 3px 8px;
}

.ptf-type-cb {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
}
.ptf-type-cb:checked {
  box-shadow: 0 0 0 3px rgba(0,200,150,0.12);
}
.ptf-type-cb:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(183,109,255,0.22);
}

/* Hide collapsible group behavior in current UI */
.ptf-group-body,
.ptf-group-header,
.ptf-group-chevron,
.ptf-group-toggle {
  max-height: none !important;
  display: block !important;
}

/* ── Font system global rules ─────────────────── */
.panel-title, .layer-section-label {
  font-family: var(--font-display);
}
.layer-name, .layer-sub-desc, input, button, select, textarea {
  font-family: var(--font-ui);
}
.mob-search-placeholder, .mob-tab span {
  font-family: var(--font-ui);
}
.layer-count, .gps-value, .dist-val, .eta-val, .layer-status-pill {
  font-family: var(--font-mono);
}
.layer-stat-label, .layer-stat-val {
  font-family: var(--font-mono);
}
html, body { font-family: var(--font-ui); }
.leaflet-container { font-family: var(--font-ui) !important; }

/* ── Tile sharpness ───────────────────────────── */
.leaflet-tile {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* will-change removed — see first instance comment above */
  transform: translateZ(0);
}

body.map-light .leaflet-tile-pane { filter: saturate(0.88) brightness(1.01); }
body.map-dark  .leaflet-tile-pane { filter: contrast(1.05) brightness(0.96); }

body.map-dark .gm-pin-label {
  color: #ffffff;
  text-shadow:
    0 0 3px rgba(0,0,0,1),
    0 0 6px rgba(0,0,0,0.85),
    0  1px 0 rgba(0,0,0,0.95),
    0 -1px 0 rgba(0,0,0,0.95);
}

/* ── Flat popup ─────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: rgba(10,16,32,0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5) !important;
  padding: 0 !important;
}
.leaflet-popup-tip-container { display: none !important; }
.leaflet-popup-content {
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  margin: 0 !important; padding: 12px 14px !important;
  line-height: 1.5 !important; color: var(--text) !important;
}

/* ── Zoom controls ─────────────────────────────── */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4) !important;
  border-radius: 10px !important; overflow: hidden;
}
.leaflet-control-zoom a {
  background: rgba(12,18,36,0.95) !important;
  color: rgba(218,226,253,0.7) !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  font-family: var(--font-ui) !important;
  width: 34px !important; height: 34px !important; line-height: 34px !important;
  transition: background 0.15s, color 0.15s !important;
}
.leaflet-control-zoom a:hover {
  background: rgba(183,109,255,.15) !important; color: var(--primary) !important;
}
.leaflet-control-zoom-out { border-bottom: none !important; }
.leaflet-control-attribution {
  background: rgba(8,12,26,0.75) !important;
  color: rgba(218,226,253,0.3) !important;
  font-family: var(--font-ui) !important; font-size: 9px !important;
  backdrop-filter: blur(8px) !important; border-radius: 6px 0 0 0 !important;
  padding: 2px 6px !important;
}
.leaflet-fade-anim .leaflet-tile { transition: opacity 0.18s linear !important; }
.leaflet-zoom-anim .leaflet-zoom-animated {
  transition: transform 0.22s cubic-bezier(0.25,0.46,0.45,0.94) !important;
}

/* ── Light basemap overrides (PLACE TYPE) ────────── */
body.map-light .ptf-group-header {
  background: rgba(0,0,0,0.03);
}
body.map-light .ptf-group-header:hover {
  background: rgba(0,0,0,0.06);
}
body.map-light .ptf-type-row:hover {
  background: rgba(0,0,0,0.04);
}
body.map-light .ptf-group {
  border-color: rgba(0,0,0,0.09);
  background: rgba(255,255,255,0.6);
}
body.map-light .ptf-type-name {
  color: rgba(10,18,40,0.88);
}
body.map-light .ptf-group-name {
  color: rgba(10,18,40,0.92);
}
body.map-light .ptf-group-count,
body.map-light .ptf-type-count {
  color: rgba(10,18,40,0.5);
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.1);
}
body.map-light .ptf-group-body {
  background: rgba(0,0,0,0.02);
}
/* ══════════════════════════════════════════════════════════════
   QUICK SUGGESTION CHIP BAR
   ══════════════════════════════════════════════════════════════ */

/* Shared wrapper — hidden by default, shown by breakpoint */
.qc-bar {
  display: none;
  position: fixed;
  z-index: 1090;
  pointer-events: none;
}

/* ── Desktop ── */
@media (min-width: 769px) {
  .qc-bar {
    display: block;
    /* desk-search-bar: top 14px + height 52px + 14px gap = 80px */
    top: 80px;
    left: calc(var(--sidebar-total-w) + 16px);
    right: 16px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    transition: left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  body.sidebar-collapsed .qc-bar {
    left: calc(var(--sidebar-rail-w) + 16px);
  }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .qc-bar {
    display: block;
    /* mob-search-bar sits at top ~14px + height ~48px + 6px gap = ~68px */
    top: 68px;
    left: 0;
    right: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  /* Hide outer chip bar when results are in the sheet */
  body.mob-chip-active .qc-bar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
  }
}

/* ── Horizontal scroll strip ── */
.qc-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 16px 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  pointer-events: all;
}
.qc-scroll::-webkit-scrollbar { display: none; }

/* ── Chip pill ── */
.qc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  height: 30px;
  padding: 0 12px 0 9px;
  background: rgba(11, 19, 38, 0.93);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(77, 67, 84, 0.55);
  border-radius: 999px;
  box-shadow:
    0 1px 4px rgba(0,0,0,0.28),
    0 4px 14px rgba(0,0,0,0.28),
    0 0 0 1px rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.16s ease,
    transform 0.10s ease;
}
.qc-chip:hover {
  background: rgba(183, 109, 255, 0.13);
  border-color: rgba(183, 109, 255, 0.44);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.28),
    0 4px 18px rgba(183, 109, 255, 0.20),
    0 0 0 1px rgba(183, 109, 255, 0.14);
  transform: translateY(-1px);
}
.qc-chip:active {
  transform: translateY(0) scale(0.96);
}
.qc-chip.qc-active {
  background: rgba(183, 109, 255, 0.18);
  border-color: rgba(183, 109, 255, 0.55);
  color: var(--primary);
  box-shadow:
    0 2px 12px rgba(183, 109, 255, 0.28),
    0 0 0 1.5px rgba(183, 109, 255, 0.35);
}
.qc-icon {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}
.qc-label {
  font-family: 'Inter', 'Geist', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: inherit;
}

/* Staggered entrance */
@keyframes qcChipIn {
  from { opacity: 0; transform: translateY(5px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}
.qc-chip { animation: qcChipIn 0.24s cubic-bezier(0.2,0.8,0.2,1) both; }
.qc-chip:nth-child(1)  { animation-delay: 0.05s; }
.qc-chip:nth-child(2)  { animation-delay: 0.08s; }
.qc-chip:nth-child(3)  { animation-delay: 0.11s; }
.qc-chip:nth-child(4)  { animation-delay: 0.14s; }
.qc-chip:nth-child(5)  { animation-delay: 0.17s; }
.qc-chip:nth-child(6)  { animation-delay: 0.20s; }
.qc-chip:nth-child(7)  { animation-delay: 0.23s; }
.qc-chip:nth-child(8)  { animation-delay: 0.26s; }
.qc-chip:nth-child(9)  { animation-delay: 0.29s; }
.qc-chip:nth-child(10) { animation-delay: 0.32s; }
.qc-chip:nth-child(11) { animation-delay: 0.35s; }
.qc-chip:nth-child(12) { animation-delay: 0.38s; }

/* ══════════════════════════════════════════════════════════════
   SEARCH–CHIPS DIVIDER
   A gossamer separator that visually bridges the floating search
   bar and the quick-suggestion chip strip below it.
   ══════════════════════════════════════════════════════════════ */

.sq-divider {
  display: none; /* mobile: hidden by default */
  pointer-events: none;
}

@media (min-width: 769px) {
  .sq-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 1095; /* between search bar (1100) and chips (1090) */

    /* Vertically centred in the 14px gap between bar bottom (66px) and chip bar top (80px) */
    top: 72px;     /* 14px bar-top + 52px bar-height + 6px → optical midpoint of gap */
    left: calc(var(--sidebar-total-w) + 16px);
    right: 16px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;

    gap: 0;
    height: 10px;

    transition: left 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  body.sidebar-collapsed .sq-divider {
    left: calc(var(--sidebar-rail-w) + 16px);
  }

  /* ── The two flanking lines ──────────────────────────────── */
  .sq-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(183, 109, 255, 0.18) 30%,
      rgba(221, 183, 255, 0.35) 70%,
      transparent 100%
    );
    /* subtle shimmer pulse */
    animation: sqLinePulse 3.6s ease-in-out infinite;
  }

  /* Reverse gradient for the right line */
  .sq-divider-line:last-child {
    background: linear-gradient(
      270deg,
      transparent 0%,
      rgba(183, 109, 255, 0.18) 30%,
      rgba(221, 183, 255, 0.35) 70%,
      transparent 100%
    );
    animation-delay: 0.4s;
  }

  /* ── The centre orb ──────────────────────────────────────── */
  .sq-divider-orb {
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(221, 183, 255, 0.55);
    box-shadow:
      0 0 0 2px rgba(183, 109, 255, 0.15),
      0 0 8px  rgba(183, 109, 255, 0.40),
      0 0 18px rgba(183, 109, 255, 0.20);
    margin: 0 8px;
    animation: sqOrbPulse 3.6s ease-in-out infinite;
  }

  /* ── Animations ──────────────────────────────────────────── */
  @keyframes sqLinePulse {
    0%, 100% { opacity: 0.55; }
    50%       { opacity: 1;    }
  }

  @keyframes sqOrbPulse {
    0%, 100% {
      transform: scale(1);
      box-shadow:
        0 0 0 2px rgba(183, 109, 255, 0.15),
        0 0 8px  rgba(183, 109, 255, 0.40),
        0 0 18px rgba(183, 109, 255, 0.20);
    }
    50% {
      transform: scale(1.35);
      box-shadow:
        0 0 0 3px rgba(183, 109, 255, 0.22),
        0 0 14px rgba(183, 109, 255, 0.55),
        0 0 28px rgba(183, 109, 255, 0.28);
    }
  }

  /* Entrance fade-in synced with the bar */
  .sq-divider {
    animation: sqDividerIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both;
  }
  @keyframes sqDividerIn {
    from { opacity: 0; transform: scaleX(0.6); }
    to   { opacity: 1; transform: scaleX(1);   }
  }
}

/* ══════════════════════════════════════════════════════════════
   CATEGORY RESULTS CARD
   ══════════════════════════════════════════════════════════════ */

/* Background scrim */
.cat-card-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.30);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1140;
}
.cat-card-scrim.hidden { display: none !important; }

/* Card shell */
.cat-card {
  position: fixed;
  z-index: 1160;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(10, 17, 34, 0.97);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(183, 109, 255, 0.22);
  border-radius: 18px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.65),
    0 24px 64px rgba(0,0,0,0.40),
    0 0 0 1px rgba(183, 109, 255, 0.06) inset;
}
.cat-card.hidden { display: none !important; }

@keyframes catCardIn {
  from { opacity: 0; transform: scale(0.94) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
.cat-card { animation: catCardIn 0.22s cubic-bezier(0.2,0.8,0.2,1) both; }

/* Desktop position: just below chip bar */
@media (min-width: 769px) {
  .cat-card {
    top: 118px;
    left: calc(var(--sidebar-total-w) + 16px);
    width: min(400px, calc(100vw - var(--sidebar-total-w) - 32px));
    max-height: calc(100vh - 150px);
    transition: left 0.3s cubic-bezier(0.2,0.8,0.2,1);
  }
  body.sidebar-collapsed .cat-card {
    left: calc(var(--sidebar-rail-w) + 16px);
    width: min(400px, calc(100vw - var(--sidebar-rail-w) - 32px));
  }
}

/* Mobile position: above bottom sheet */
@media (max-width: 768px) {
  .cat-card {
    top: calc(12px + var(--mob-safe-top));
    bottom: calc(96px + var(--mob-safe-bottom));
    left: 12px;
    right: 12px;
    max-height: calc(100vh - 128px);
    border-radius: 16px;
  }
}

/* ── Card header ── */
.cat-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.cat-card-hd-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}
.cat-card-emoji {
  font-size: 17px;
  flex-shrink: 0;
  line-height: 1;
}
.cat-card-title {
  font-family: 'Inter', 'Geist', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-card-badge {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(183, 109, 255, 0.12);
  border: 1px solid rgba(183, 109, 255, 0.22);
  border-radius: 999px;
  padding: 1px 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.cat-card-close {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.cat-card-close:hover {
  background: rgba(255,255,255,0.13);
  color: var(--text);
}

/* ── Scrollable list ── */
.cat-card-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(77,67,84,0.45) transparent;
}
.cat-card-list::-webkit-scrollbar { width: 4px; }
.cat-card-list::-webkit-scrollbar-thumb {
  background: rgba(77,67,84,0.5);
  border-radius: 2px;
}

/* ── Empty state ── */
.cat-empty {
  text-align: center;
  padding: 28px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
}

/* ── Result row ── */
.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.10s;
}
.cat-row:hover {
  background: rgba(183, 109, 255, 0.09);
  border-color: rgba(183, 109, 255, 0.18);
  transform: translateX(2px);
}
.cat-row:active { transform: translateX(1px); }

@keyframes catRowIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0);    }
}
.cat-row { animation: catRowIn 0.18s cubic-bezier(0.2,0.8,0.2,1) both; }

.cat-row-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 5px currentColor;
}
.cat-row-body { flex: 1; min-width: 0; }
.cat-row-name {
  font-family: 'Inter', 'Geist', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-row-sub {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-row-nav {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(183, 109, 255, 0.10);
  border: 1px solid rgba(183, 109, 255, 0.22);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.14s, transform 0.12s, box-shadow 0.14s;
}
.cat-row-nav:hover {
  background: rgba(183, 109, 255, 0.22);
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(183, 109, 255, 0.30);
}
/* ══════════════════════════════════════════════════════════════
   CATEGORY RESULTS PANEL  (#panelCatResults)
   ══════════════════════════════════════════════════════════════ */

/* ── Panel header ── */
.cat-rp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--outline-dim);
  flex-shrink: 0;
}
.cat-rp-back {
  flex-shrink: 0;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--outline-dim);
  border-radius: 50%;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  touch-action: manipulation;
}
.cat-rp-back:hover { background: rgba(183,109,255,0.12); color: var(--primary); }
.cat-rp-icon { font-size: 18px; flex-shrink: 0; line-height: 1; }
.cat-rp-badge {
  flex-shrink: 0;
  font-family: var(--font-label);
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(183,109,255,0.14);
  border: 1px solid rgba(183,109,255,0.28);
  color: var(--primary);
  border-radius: 20px;
  padding: 3px 8px;
  white-space: nowrap;
}

/* ── Scrollable body ── */
.cat-rp-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(183,109,255,0.22) transparent;
}
.cat-rp-body::-webkit-scrollbar { width: 4px; }
.cat-rp-body::-webkit-scrollbar-thumb { background: rgba(183,109,255,0.22); border-radius: 2px; }

/* ── Individual place card ── */
.cat-rp-card {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  min-height: 84px;
  background: var(--surface-bright);
  border: 1px solid var(--outline-dim);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  animation: catRpSlideIn 0.28s ease both;
}
.cat-rp-card:hover {
  border-color: rgba(183,109,255,0.38);
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  transform: translateY(-1px);
}
@keyframes catRpSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Left: photo thumbnail ── */
.cat-rp-thumb {
  flex-shrink: 0;
  width: 86px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.cat-rp-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
/* Placeholder shown when no photo */
.cat-rp-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(183,109,255,0.08), rgba(68,226,205,0.06));
}

/* ── Middle: info ── */
.cat-rp-info {
  flex: 1;
  min-width: 0;
  padding: 12px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.cat-rp-name {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-rp-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-rp-type {
  font-family: var(--font-label);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(183,109,255,0.18);
  white-space: nowrap;
}
.cat-rp-dist {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.cat-rp-dist.far { color: var(--muted); }
.cat-rp-photo-count {
  font-family: var(--font-label);
  font-size: 9px;
  color: var(--primary);
  display: flex; align-items: center; gap: 4px;
}

.cat-rp-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Right: nav button ── */
.cat-rp-nav {
  flex-shrink: 0;
  width: 48px;
  background: rgba(183,109,255,0.07);
  border: none;
  border-left: 1px solid var(--outline-dim);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  touch-action: manipulation;
}
.cat-rp-nav:hover { background: rgba(183,109,255,0.18); }
.cat-rp-nav svg { flex-shrink: 0; }

/* ── Empty / loading state ── */
.cat-rp-empty {
  text-align: center;
  padding: 36px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.cat-rp-empty strong { color: var(--text); font-weight: 600; }
.cat-rp-loading-dots {
  display: flex; justify-content: center;
  gap: 5px; margin-bottom: 12px;
}
.cat-rp-loading-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  animation: catDotBounce 1.1s ease-in-out infinite;
}
.cat-rp-loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.cat-rp-loading-dots span:nth-child(3) { animation-delay: 0.36s; }

/* ── User location header (distance legend) ── */
.cat-rp-loc-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  margin-bottom: 2px;
  background: rgba(68,226,205,0.06);
  border: 1px solid rgba(68,226,205,0.14);
  border-radius: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--secondary);
}

.cat-rp-loc-bar svg { flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   DESKTOP FLOATING CHIP RESULTS PANEL  (#deskChipResults)
   Appears below the search bar / chip bar — Google Maps style
   ══════════════════════════════════════════════════════════════ */

.desk-chip-results {
  display: none; /* hidden by default; shown only on desktop */
}

@media (min-width: 769px) {
  .desk-chip-results {
    display: flex;
    flex-direction: column;
    position: fixed;
    /* align with search bar: same left/right calculation */
    left: calc(var(--sidebar-total-w) + 16px);
    right: 16px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    /* sit just below chip bar: search bar top(14) + height(52) + chip(34+gap) = ~110px */
    top: 118px;
    max-height: calc(100vh - 148px);
    z-index: 1095;
    background: rgba(9, 15, 30, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(77, 67, 84, 0.55);
    border-radius: 20px;
    box-shadow:
      0 4px 12px rgba(0,0,0,0.30),
      0 12px 40px rgba(0,0,0,0.45),
      0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
    transition: left 0.3s cubic-bezier(0.2,0.8,0.2,1);
    /* entrance animation */
    animation: dcrSlideDown 0.22s cubic-bezier(0.2,0.8,0.2,1) both;
  }

  body.sidebar-collapsed .desk-chip-results {
    left: calc(var(--sidebar-rail-w) + 16px);
  }

  .desk-chip-results.hidden {
    display: none !important;
  }
}

@keyframes dcrSlideDown {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ── Header ── */
.dcr-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(77,67,84,0.40);
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
}

.dcr-back {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(77,67,84,0.45);
  border-radius: 50%;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
  touch-action: manipulation;
}
.dcr-back:hover {
  background: rgba(183,109,255,0.14);
  border-color: rgba(183,109,255,0.40);
  color: var(--primary);
}

.dcr-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.dcr-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dcr-title {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dcr-subtitle {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.dcr-badge {
  flex-shrink: 0;
  font-family: var(--font-label);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(183,109,255,0.15);
  border: 1px solid rgba(183,109,255,0.32);
  color: var(--primary);
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* ── Scrollable list ── */
.dcr-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(183,109,255,0.22) transparent;
}
.dcr-list::-webkit-scrollbar { width: 4px; }
.dcr-list::-webkit-scrollbar-thumb { background: rgba(183,109,255,0.22); border-radius: 2px; }

/* ── Result row — Google Maps style ── */
.dcr-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 86px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(77,67,84,0.35);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.12s;
  animation: dcrRowIn 0.26s ease both;
}
.dcr-row:hover {
  background: rgba(183,109,255,0.08);
  border-color: rgba(183,109,255,0.35);
  box-shadow: 0 4px 18px rgba(0,0,0,0.28);
  transform: translateX(2px);
}
@keyframes dcrRowIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* thumbnail */
.dcr-thumb {
  flex-shrink: 0;
  width: 80px;
  min-height: 72px;
  background: rgba(183,109,255,0.06);
  position: relative;
  overflow: hidden;
}
.dcr-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.dcr-thumb-ph {
  width: 100%; height: 100%;
  min-height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, rgba(183,109,255,0.10), rgba(68,226,205,0.06));
}

/* info */
.dcr-info {
  flex: 1;
  min-width: 0;
  padding: 10px 10px 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.dcr-name {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dcr-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dcr-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.dcr-type {
  font-family: var(--font-label);
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(183,109,255,0.18);
  white-space: nowrap;
}
.dcr-dist {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.dcr-photos {
  font-family: var(--font-label);
  font-size: 9px;
  color: var(--secondary);
  display: flex; align-items: center; gap: 3px;
}

/* nav button */
.dcr-nav {
  flex-shrink: 0;
  width: 46px;
  background: rgba(183,109,255,0.06);
  border: none;
  border-left: 1px solid rgba(77,67,84,0.35);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.14s;
  touch-action: manipulation;
}
.dcr-nav:hover { background: rgba(183,109,255,0.20); }

/* empty / loading */
.dcr-empty {
  text-align: center;
  padding: 40px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.dcr-empty strong { color: var(--text); font-weight: 600; }

.dcr-loc-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  margin-bottom: 2px;
  background: rgba(68,226,205,0.06);
  border: 1px solid rgba(68,226,205,0.14);
  border-radius: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--secondary);
}
.dcr-loc-bar svg { flex-shrink: 0; }

.dcr-loading-dots {
  display: flex; justify-content: center;
  gap: 5px; margin-bottom: 12px;
}
.dcr-loading-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  animation: catDotBounce 1.1s ease-in-out infinite;
}
.dcr-loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.dcr-loading-dots span:nth-child(3) { animation-delay: 0.36s; }

/* ══════════════════════════════════════════════════════════════
   MOBILE CHIP RESULTS  — inside bottom sheet
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Mini horizontal chip strip shown at top of sheet body when results active */
  .mob-chip-results-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  /* Re-rendered chip strip inside the sheet */
  .mob-chip-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 14px 6px;
    border-bottom: 1px solid rgba(77,67,84,0.30);
    flex-shrink: 0;
    scrollbar-width: none;
  }
  .mob-chip-strip::-webkit-scrollbar { display: none; }

  .mob-chip-strip .qc-chip {
    height: 28px;
    font-size: 11px;
    padding: 0 10px 0 8px;
  }

  /* Results list section inside the sheet */
  .mob-chip-results-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 8px;
    flex-shrink: 0;
  }
  .mob-chip-results-label {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
  }
  .mob-chip-results-badge {
    font-family: var(--font-label);
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.06em;
    background: rgba(183,109,255,0.15);
    border: 1px solid rgba(183,109,255,0.30);
    color: var(--primary);
    border-radius: 20px;
    padding: 3px 8px;
  }

  .mob-chip-results-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 10px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: none;
  }
  .mob-chip-results-list::-webkit-scrollbar { display: none; }

  /* Reuse .dcr-row styles for mobile rows */
  .mob-chip-results-list .dcr-row { border-radius: 12px; }
}

/* ══════════════════════════════════════════════════════════════
   APPLE-GRADE MOBILE POLISH  ─  MapsByFuta
   One focused overrides block. All rules scoped to ≤768px.
   Design system: generous breathing room · tight radii ·
   layered micro-shadow system · 44px minimum touch targets ·
   SF-style optical balance.
   ══════════════════════════════════════════════════════════════ */

/* ── Token adjustments for mobile ──────────────────────────── */
@media (max-width: 768px) {
  :root {
    --mob-sheet-peek:    80px;   /* slightly taller peek = handle + tabs + 4px air */
    --mob-sheet-radius:  24px;   /* more pronounced corner = premium feel */
    --mob-card-gap:      14px;   /* consistent card inner gutter */
    --mob-section-pad:   18px;   /* horizontal breathing room throughout */
  }
}

/* ══ 1. FLOATING SEARCH BAR ══════════════════════════════════ */
@media (max-width: 768px) {
  .mob-search-bar {
    height: 54px;
    left: 14px;
    right: 14px;
    border-radius: 17px;   /* squircle-ish, not capsule — Apple Maps style */
    background: rgba(28, 34, 52, 0.97);
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow:
      0 1px 0   rgba(255,255,255,0.07) inset,   /* top highlight */
      0 2px 6px  rgba(0,0,0,0.18),
      0 6px 20px rgba(0,0,0,0.26),
      0 14px 40px rgba(0,0,0,0.22);
    gap: 0;
  }

  /* Tighter logo zone */
  .mob-search-logo {
    width: 48px;
    border-radius: 17px 0 0 17px;
  }

  /* Divider between logo and input */
  .mob-search-bar .desk-search-divider,
  .mob-search-bar-divider {
    width: 1px; height: 20px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
  }

  .mob-search-input-btn {
    padding: 0 6px 0 12px;
    gap: 10px;
  }

  .mob-search-icon {
    font-size: 13px;
    color: rgba(218,226,253,0.4);
  }

  .mob-search-placeholder {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: rgba(218,226,253,0.4);
  }

  /* Navigate pill button — feels like the blue pill in iOS Maps */
  .mob-search-action {
    width: 44px;
    height: 36px;
    margin: 0 7px;
    border-radius: 11px;
    font-size: 13px;
    background: var(--primary-container);
    box-shadow:
      0 2px 8px rgba(183,109,255,0.45),
      0 1px 0 rgba(255,255,255,0.12) inset;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s;
  }
  .mob-search-action:active {
    transform: scale(0.93);
    box-shadow: 0 1px 4px rgba(183,109,255,0.35);
    opacity: 0.9;
  }
}

/* ══ 2. QUICK CHIP STRIP ══════════════════════════════════════ */
@media (max-width: 768px) {
  .qc-bar {
    top: calc(14px + var(--mob-safe-top) + 54px + 8px); /* search bar + gap */
  }

  .qc-scroll {
    padding: 4px 14px 8px;
    gap: 7px;
  }

  .qc-chip {
    height: 32px;
    padding: 0 13px 0 10px;
    gap: 6px;
    border-radius: 10px;   /* squircle pill on mobile */
    background: rgba(22, 28, 46, 0.96);
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.06) inset,
      0 2px 6px rgba(0,0,0,0.22),
      0 4px 12px rgba(0,0,0,0.18);
  }

  .qc-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }

  .qc-chip.qc-active {
    background: rgba(183, 109, 255, 0.20);
    border-color: rgba(183, 109, 255, 0.45);
    box-shadow:
      0 2px 10px rgba(183,109,255,0.28),
      0 0 0 1.5px rgba(183,109,255,0.30);
  }
}

/* ══ 3. FAB CLUSTER ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .mob-fab-cluster {
    right: 16px;
    gap: 11px;
  }

  /* Small utility FABs */
  .mob-fab--sm {
    width: 42px; height: 42px;
    background: rgba(22, 28, 46, 0.97);
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.07) inset,
      0 2px 8px rgba(0,0,0,0.28),
      0 6px 18px rgba(0,0,0,0.22);
    border-radius: 13px;   /* squircle to match search bar language */
    color: rgba(218,226,253,0.75);
    font-size: 16px;
  }
  .mob-fab--sm:active {
    transform: scale(0.91);
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  }

  /* Locate FAB — prominent primary CTA */
  .mob-fab--locate {
    width: 54px; height: 54px;
    border-radius: 16px;
    background: rgba(22, 28, 46, 0.97);
    border: 1px solid rgba(183,109,255,0.22);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.08) inset,
      0 3px 12px rgba(0,0,0,0.32),
      0 8px 28px rgba(183,109,255,0.18);
    font-size: 22px;
  }
  .mob-fab--locate.tracking {
    background: var(--primary-container);
    border-color: transparent;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.15) inset,
      0 4px 18px rgba(183,109,255,0.50),
      0 8px 32px rgba(183,109,255,0.30);
  }
  .mob-fab--locate:active {
    transform: scale(0.90);
    box-shadow: 0 2px 8px rgba(183,109,255,0.35);
  }
}

/* ══ 4. BOTTOM SHEET ══════════════════════════════════════════ */
@media (max-width: 768px) {

  .mob-sheet {
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    background: rgba(16, 21, 38, 0.99);
    box-shadow:
      0 -1px 0 rgba(255,255,255,0.07),   /* top rim highlight */
      0 -4px 28px rgba(0,0,0,0.45);
  }

  /* ── Handle ── */
  .mob-sheet-handle-wrap {
    height: 32px;
    padding-top: 2px;
    background: none;
  }
  .mob-sheet-handle-bar {
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.16);
    border-radius: 2px;
    opacity: 1;  /* always visible — Apple doesn't fade handle */
    transition: width 0.2s ease, background 0.2s ease;
  }
  .mob-sheet-handle-wrap:active .mob-sheet-handle-bar {
    width: 48px;
    background: rgba(183,109,255,0.55);
    opacity: 1;
  }

  /* ── Tab strip ── */
  .mob-sheet-header {
    padding: 0 10px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .mob-sheet-tabs {
    gap: 4px;
    padding: 0;
  }
  .mob-tab {
    padding: 8px 14px;
    min-height: 44px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    gap: 7px;
    color: rgba(218,226,253,0.55);
    transition: background 0.18s ease, color 0.18s ease;
  }
  .mob-tab i {
    font-size: 15px;
  }
  .mob-tab.active {
    background: rgba(183,109,255,0.14);
    color: var(--primary);
    box-shadow: none;
  }
  .mob-tab.active i {
    filter: drop-shadow(0 0 4px rgba(183,109,255,0.55));
  }

  /* ── Sheet body ── */
  .mob-sheet-body {
    padding-bottom: calc(20px + var(--mob-safe-bottom));
  }
}

/* ══ 5. PANEL HEADERS inside the sheet ════════════════════════ */
@media (max-width: 768px) {
  .mob-sheet-body .panel-header {
    padding: 14px var(--mob-section-pad, 18px) 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .mob-sheet-body .panel-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .mob-sheet-body .panel-body {
    padding: 10px 0 10px;
  }

  /* Search inputs inside sheet */
  .mob-sheet-body .sidebar-search-wrap {
    padding: 12px var(--mob-section-pad, 18px) 0;
  }
  .mob-sheet-body .search-field-wrap {
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
  }
  .mob-sheet-body .search-field-wrap input {
    font-size: 15px;
    padding: 12px 14px 12px 40px;
  }
}

/* ══ 6. LAYER ROWS in sheet ═══════════════════════════════════ */
@media (max-width: 768px) {
  .mob-sheet-body .layer-row {
    padding: 11px var(--mob-section-pad, 18px);
    min-height: 56px;          /* Apple HIG: 44px touch + 6px v-padding × 2 */
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 13px;
    transition: background 0.15s ease;
  }
  .mob-sheet-body .layer-row:last-of-type {
    border-bottom: none;
  }
  .mob-sheet-body .layer-row:active {
    background: rgba(255,255,255,0.04);
  }
  .mob-sheet-body .layer-icon-wrap {
    width: 38px; height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .mob-sheet-body .layer-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .mob-sheet-body .layer-stat-label {
    font-size: 12px;
    margin-top: 1px;
  }
  .mob-sheet-body .layer-count {
    font-size: 13px;
    font-weight: 600;
  }
}

/* ══ 7. PTF TYPE FILTER ROWS ══════════════════════════════════ */
@media (max-width: 768px) {
  .mob-sheet-body .ptf-type-row {
    padding: 12px var(--mob-section-pad, 18px);
    min-height: 52px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 12px;
  }
  .mob-sheet-body .ptf-type-row:last-child {
    border-bottom: none;
  }
  .mob-sheet-body .ptf-type-row:active {
    background: rgba(255,255,255,0.04);
  }
  .mob-sheet-body .ptf-type-name {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
  }
}

/* ══ 8. GPS / NAV PANELS ═════════════════════════════════════ */
@media (max-width: 768px) {
  .mob-sheet-body .stat-row {
    padding: 6px var(--mob-section-pad, 18px);
    min-height: 44px;
  }
  .mob-sheet-body .gps-btn {
    margin: 14px var(--mob-section-pad, 18px) 0;
    width: calc(100% - 36px);
    padding: 15px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .mob-sheet-body .sidebar-nav-btn {
    width: calc(100% - 36px);
    margin: 10px var(--mob-section-pad, 18px) 0;
    padding: 15px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .mob-sheet-body .nav-panel-hint {
    padding: 10px var(--mob-section-pad, 18px) 0;
    font-size: 11px;
    line-height: 1.6;
    color: rgba(218,226,253,0.45);
  }
  .mob-sheet-body .route-planner-bar {
    margin: 10px var(--mob-section-pad, 18px) 0;
  }
}

/* ══ 9. MOBILE SEARCH OVERLAY ═════════════════════════════════ */
@media (max-width: 768px) {
  .mob-search-overlay {
    background: rgba(12, 16, 30, 0.99);
  }

  .mob-search-ov-bar {
    padding: calc(12px + var(--mob-safe-top)) 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    gap: 10px;
  }

  .mob-search-ov-back {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 17px;
    color: var(--text);
    transition: background 0.12s;
  }
  .mob-search-ov-back:active {
    background: rgba(255,255,255,0.10);
    transform: scale(0.93);
  }

  .mob-search-ov-input {
    border-radius: 13px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    padding: 12px 14px;
    font-size: 16px;   /* ≥16px prevents iOS auto-zoom */
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text);
    transition: border-color 0.18s ease, background 0.18s ease;
  }
  .mob-search-ov-input:focus {
    border-color: rgba(183,109,255,0.55);
    background: rgba(183,109,255,0.05);
    outline: none;
  }

  /* Section labels */
  .mob-ov-section {
    padding: 14px var(--mob-section-pad, 18px) 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(218,226,253,0.4);
  }

  /* Result rows */
  .mob-ov-item {
    padding: 12px var(--mob-section-pad, 18px);
    min-height: 56px;
    gap: 14px;
    transition: background 0.1s;
  }
  .mob-ov-item:active {
    background: rgba(183,109,255,0.08);
  }

  /* Icon container */
  .mob-ov-icon {
    width: 36px; height: 36px;
    border-radius: 11px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.07);
    font-size: 16px;
  }

  .mob-ov-name {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
  }
  .mob-ov-sub {
    font-size: 12px;
    margin-top: 2px;
    color: rgba(218,226,253,0.45);
  }

  .mob-ov-empty,
  .mob-ov-spinner {
    padding: 40px var(--mob-section-pad, 18px);
    font-size: 14px;
    color: rgba(218,226,253,0.35);
  }
}

/* ══ 10. PLACE CARD ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .place-card {
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    background: rgba(14, 19, 35, 0.99);
    box-shadow:
      0 -1px 0 rgba(255,255,255,0.07),
      0 -4px 32px rgba(0,0,0,0.60),
      0 -12px 48px rgba(0,0,0,0.40);
  }

  .place-card-handle {
    padding: 14px 0 6px;
  }
  .place-card-handle-bar {
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.16);
    border-radius: 2px;
  }

  .place-card-hero {
    height: 210px;
  }

  .place-card-header {
    padding: 16px var(--mob-section-pad, 18px) 6px;
    gap: 10px;
  }
  .place-card-name {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
  }
  .place-card-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    margin-top: 2px;
  }

  .place-card-badge {
    margin-top: 6px;
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .place-card-coords {
    padding: 2px var(--mob-section-pad, 18px) 10px;
    font-size: 9.5px;
  }

  .place-card-desc {
    padding: 12px var(--mob-section-pad, 18px);
    font-size: 14px;
    line-height: 1.65;
    border-top: 1px solid rgba(255,255,255,0.06);
  }

  /* Photo strip */
  .place-card-strip {
    padding: 12px var(--mob-section-pad, 18px) 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .place-card-strip-label {
    font-size: 9px;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
    color: rgba(218,226,253,0.35);
  }
  .place-card-strip-inner {
    gap: 8px;
  }
  .place-card-strip-inner img {
    width: 90px; height: 70px;
    border-radius: 11px;
  }

  /* Action buttons */
  .place-card-actions {
    padding: 14px var(--mob-section-pad, 18px) calc(env(safe-area-inset-bottom, 0px) + 18px);
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .place-card-action-btn {
    padding: 15px 10px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    gap: 8px;
  }
  .place-card-action-btn.primary {
    background: rgba(183,109,255,0.22);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.10) inset,
      0 4px 18px rgba(183,109,255,0.30);
  }
  .place-card-action-btn.secondary {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
  }
  .place-card-action-btn:active {
    opacity: 0.80;
    transform: scale(0.96);
  }
}

/* ══ 11. CAT CARD (chip results on mobile) ════════════════════ */
@media (max-width: 768px) {
  .cat-card {
    top: calc(14px + var(--mob-safe-top));
    bottom: calc(88px + var(--mob-safe-bottom));
    left: 14px;
    right: 14px;
    border-radius: 20px;
    background: rgba(14, 19, 36, 0.98);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.06) inset,
      0 8px 32px rgba(0,0,0,0.70),
      0 24px 64px rgba(0,0,0,0.45);
  }

  .cat-card-hd {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .cat-card-emoji {
    font-size: 18px;
  }
  .cat-card-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .cat-card-badge {
    font-size: 10px;
    padding: 2px 9px;
    border-radius: 999px;
  }
  .cat-card-close {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.09);
  }

  .cat-card-list {
    padding: 10px 12px 14px;
    gap: 8px;
  }

  .cat-row {
    padding: 11px 13px;
    border-radius: 13px;
    gap: 11px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    min-height: 52px;
    align-items: center;
  }
  .cat-row:active {
    background: rgba(183,109,255,0.10);
    border-color: rgba(183,109,255,0.22);
    transform: scale(0.98);
  }
  .cat-row-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .cat-row-sub {
    font-size: 11.5px;
    margin-top: 2px;
  }
}

/* ══ 12. MOBILE CHIP RESULTS (in-sheet) ══════════════════════ */
@media (max-width: 768px) {
  .mob-chip-results-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .mob-chip-results-list {
    padding: 8px 12px 24px;
    gap: 8px;
  }

  .mob-chip-results-list .dcr-row {
    border-radius: 13px;
    padding: 12px 13px;
    min-height: 60px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
  }
  .mob-chip-results-list .dcr-row:active {
    background: rgba(183,109,255,0.09);
    border-color: rgba(183,109,255,0.20);
    transform: scale(0.98);
  }
}

/* ══ 13. ADMIN PANEL on mobile ════════════════════════════════ */
@media (max-width: 768px) {
  .admin-panel {
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    background: rgba(12, 16, 30, 0.99);
    border-top: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 -4px 40px rgba(0,0,0,0.60);
  }
  .admin-header {
    padding: 18px var(--mob-section-pad, 18px) 12px;
    padding-top: calc(18px + var(--mob-safe-top));
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .admin-tabbar {
    padding: 8px 12px;
    gap: 4px;
  }

  /* Admin inputs */
  .admin-search-input {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.09);
    color: var(--text);
    transition: border-color 0.18s, background 0.18s;
  }
  .admin-search-input:focus {
    border-color: rgba(183,109,255,0.50);
    background: rgba(183,109,255,0.05);
    outline: none;
  }
}

/* ══ 14. MODAL SHEETS on mobile ══════════════════════════════ */
@media (max-width: 768px) {
  .modal {
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    background: rgba(14, 19, 35, 0.99);
    border-top: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 -4px 40px rgba(0,0,0,0.60);
    padding: 0;
  }
  .modal-body {
    padding: 16px var(--mob-section-pad, 18px);
    font-size: 14px;
    line-height: 1.65;
  }
}

/* ══ 15. BODY-STATE SHEET SHADOWS ════════════════════════════ */
@media (max-width: 768px) {
  body.mob-sheet-half .mob-sheet {
    box-shadow:
      0 -1px 0 rgba(255,255,255,0.08),
      0 -8px 40px rgba(0,0,0,0.55),
      0 -16px 60px rgba(0,0,0,0.35);
  }
  body.mob-sheet-full .mob-sheet {
    box-shadow:
      0 -1px 0 rgba(255,255,255,0.09),
      0 -10px 48px rgba(0,0,0,0.65),
      0 -20px 72px rgba(0,0,0,0.40);
  }
}

/* ══ 16. GENERAL MOBILE MICRO-POLISH ══════════════════════════ */
@media (max-width: 768px) {
  /* Ensure all interactive targets meet 44px minimum */
  button, [role="button"], .mob-tab, .qc-chip, .cat-row, .mob-ov-item, .dcr-row {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }

  /* Smoother scroll momentum everywhere */
  .mob-sheet-body,
  .cat-card-list,
  .mob-search-ov-results,
  .mob-chip-results-list,
  .qc-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  /* Subtle pressed state for any tappable row not otherwise covered */
  .mob-sheet-body [class*="-row"]:not(.layer-row):active {
    background: rgba(255,255,255,0.04) !important;
  }

  /* iOS font smoothing */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ══ 17. VERY SMALL PHONES ≤390px ════════════════════════════ */
@media (max-width: 390px) {
  .mob-search-placeholder {
    font-size: 14px;
  }
  .mob-tab span {
    display: none;
  }
  .mob-tab {
    padding: 8px 13px;
    min-height: 44px;
  }
  .mob-tab i {
    font-size: 17px;
  }
  .place-card-name {
    font-size: 19px;
  }
  .cat-card-title {
    font-size: 14px;
  }
}


/* ══════════════════════════════════════════════════════════════
   ██  APPLE-GRADE MOBILE POLISH  —  MapsByFuta  v2
   ══════════════════════════════════════════════════════════════
   Design principles:
   · Every touch target ≥ 44px (Apple HIG)
   · One canonical spacing scale: 8 / 12 / 16 / 20 / 24px
   · Layered glass surfaces — each layer 8–10% lighter than below
   · Consistent corner radius vocabulary: 12 / 16 / 20 / 24px
   · SF-style optical balance: negative space is not wasted space
   · Micro-shadows that communicate lift, not decoration
   · Typography: -0.02em tracking on titles, 400/500/600/700 only
   ══════════════════════════════════════════════════════════════ */

/* ── Design tokens (mobile override) ──────────────────────── */
@media (max-width: 768px) {
  :root {
    --mob-search-h:      58px;
    --mob-sheet-peek:    82px;    /* handle 32px + tabs 44px + 6px air */
    --mob-sheet-radius:  24px;
    --mob-section-pad:   20px;
    --mob-card-gap:      12px;
    --mob-row-pad-v:     14px;
    --mob-row-pad-h:     20px;
    --mob-touch-min:     44px;
    /* Glass surface stack */
    --mob-glass-0: rgba(11, 16, 30, 0.99);    /* deepest — sheet bg */
    --mob-glass-1: rgba(20, 26, 44, 0.98);    /* search bar, modals */
    --mob-glass-2: rgba(30, 37, 58, 0.97);    /* chips, FABs */
    --mob-glass-3: rgba(42, 50, 72, 0.96);    /* rows hover / active */
    --mob-rim:     rgba(255,255,255,0.07);     /* top-edge highlight */
    --mob-border:  rgba(255,255,255,0.07);     /* separators */
    --mob-purple:  rgba(183,109,255,1);
    --mob-purple-glow: rgba(183,109,255,0.38);
  }
}

/* ══ 1. FLOATING SEARCH BAR ══════════════════════════════════ */
@media (max-width: 768px) {
  .mob-search-bar {
    top: calc(14px + var(--mob-safe-top));
    left: 14px;
    right: 14px;
    height: var(--mob-search-h);       /* 58px */
    background: var(--mob-glass-1);
    border: 1px solid var(--mob-border);
    border-radius: 18px;
    overflow: visible;                  /* allow action btn shadow to escape */
    box-shadow:
      0 1px 0 var(--mob-rim) inset,
      0 1px 3px  rgba(0,0,0,0.15),
      0 4px 16px rgba(0,0,0,0.28),
      0 12px 36px rgba(0,0,0,0.20);
    gap: 0;
    z-index: 1100;
  }

  /* Logo zone */
  .mob-search-logo {
    flex-shrink: 0;
    width: 52px;
    height: 100%;
    border-radius: 18px 0 0 18px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.14s;
  }
  .mob-search-logo:active {
    background: rgba(255,255,255,0.04);
  }

  /* Vertical separator after logo */
  .mob-search-logo + .mob-search-input-btn::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.09);
    margin-right: 12px;
    align-self: center;
  }

  /* Input button */
  .mob-search-input-btn {
    flex: 1;
    height: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0;                 /* gap handled by ::before pseudo-divider */
    padding: 0 4px 0 0;
    cursor: pointer;
    min-width: 0;
  }

  .mob-search-icon {
    font-size: 13px;
    color: rgba(218,226,253,0.38);
    flex-shrink: 0;
    margin-right: 9px;
  }

  .mob-search-placeholder {
    font-family: 'Geist', 'SF Pro Text', sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: rgba(218,226,253,0.38);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }

  /* Directions pill */
  .mob-search-action {
    flex-shrink: 0;
    width: 46px;
    height: 40px;
    margin: 0 8px;
    background: var(--mob-purple);
    border: none;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.16) inset,
      0 2px 8px  rgba(183,109,255,0.42),
      0 6px 20px rgba(183,109,255,0.28);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
  }
  .mob-search-action:active {
    transform: scale(0.92);
    box-shadow: 0 1px 4px rgba(183,109,255,0.30);
  }
}

/* ══ 2. QUICK CHIP STRIP ══════════════════════════════════════ */
@media (max-width: 768px) {
  .qc-bar {
    top: calc(14px + var(--mob-safe-top) + 58px + 10px);  /* search + gap */
  }

  .qc-scroll {
    padding: 3px 14px 8px;
    gap: 8px;
  }

  .qc-chip {
    height: 34px;
    padding: 0 14px 0 11px;
    gap: 6px;
    border-radius: 11px;
    background: var(--mob-glass-1);
    border: 1px solid var(--mob-border);
    box-shadow:
      0 1px 0 var(--mob-rim) inset,
      0 2px 6px  rgba(0,0,0,0.20),
      0 4px 12px rgba(0,0,0,0.16);
    color: rgba(218,226,253,0.80);
    transition: background 0.12s, border-color 0.12s, transform 0.10s;
  }
  .qc-chip:active {
    transform: scale(0.95);
    background: var(--mob-glass-3);
  }
  .qc-chip.qc-active {
    background: rgba(183,109,255,0.18);
    border-color: rgba(183,109,255,0.42);
    color: var(--primary);
    box-shadow:
      0 2px 10px rgba(183,109,255,0.25),
      0 0 0 1.5px rgba(183,109,255,0.28);
  }

  .qc-label {
    font-family: 'Geist', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: inherit;
  }

  .qc-icon, .qc-chip > i {
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
  }
}

/* ══ 3. FAB CLUSTER ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .mob-fab-cluster {
    right: 16px;
    gap: 12px;
    bottom: calc(var(--mob-sheet-peek) + 20px + var(--mob-safe-bottom));
    transition: bottom 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.mob-sheet-half .mob-fab-cluster { bottom: calc(var(--mob-sheet-half) + 18px + var(--mob-safe-bottom)); }
  body.mob-sheet-full .mob-fab-cluster { bottom: calc(var(--mob-sheet-full) + 18px + var(--mob-safe-bottom)); }

  /* Secondary FABs */
  .mob-fab--sm {
    width: 44px;
    height: 44px;
    background: var(--mob-glass-1);
    border: 1px solid var(--mob-border);
    color: rgba(218,226,253,0.75);
    font-size: 16px;
    box-shadow:
      0 1px 0 var(--mob-rim) inset,
      0 2px 8px  rgba(0,0,0,0.24),
      0 6px 20px rgba(0,0,0,0.20);
    transition: transform 0.12s ease, background 0.12s ease;
  }
  .mob-fab--sm:active {
    transform: scale(0.90);
    background: var(--mob-glass-2);
  }

  /* Primary locate FAB */
  .mob-fab--locate {
    width: 54px;
    height: 54px;
    background: var(--mob-glass-1);
    border: 1px solid var(--mob-border);
    color: var(--primary);
    font-size: 22px;
    box-shadow:
      0 1px 0 var(--mob-rim) inset,
      0 3px 10px rgba(0,0,0,0.28),
      0 8px 28px rgba(0,0,0,0.22),
      0 0 0 0 rgba(183,109,255,0);
    transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.14s ease;
  }
  .mob-fab--locate:active {
    transform: scale(0.90);
  }
  .mob-fab--locate.tracking {
    background: var(--mob-purple);
    border-color: transparent;
    color: #fff;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.14) inset,
      0 4px 14px rgba(183,109,255,0.50),
      0 10px 30px rgba(183,109,255,0.30);
  }
}

/* ══ 4. BOTTOM SHEET ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .mob-sheet {
    background: var(--mob-glass-0);
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    box-shadow:
      0 -1px 0 var(--mob-rim),
      0 -4px 24px rgba(0,0,0,0.40),
      0 -12px 48px rgba(0,0,0,0.32);
  }

  /* Handle */
  .mob-sheet-handle-wrap {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
  }
  .mob-sheet-handle-wrap:active { cursor: grabbing; }

  .mob-sheet-handle-bar {
    width: 38px;
    height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    opacity: 1;
    transition: width 0.18s ease, background 0.18s ease;
  }
  .mob-sheet-handle-wrap:active .mob-sheet-handle-bar {
    width: 50px;
    background: rgba(183,109,255,0.60);
  }

  /* Tab strip header */
  .mob-sheet-header {
    flex-shrink: 0;
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--mob-border);
    touch-action: none;
    cursor: grab;
  }

  .mob-sheet-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0;
  }
  .mob-sheet-tabs::-webkit-scrollbar { display: none; }

  .mob-tab {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    min-height: var(--mob-touch-min);
    background: none;
    border: none;
    border-radius: 13px;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: rgba(218,226,253,0.48);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-tab i { font-size: 15px; }
  .mob-tab.active {
    background: rgba(183,109,255,0.14);
    color: var(--primary);
  }
  .mob-tab.active i {
    filter: drop-shadow(0 0 5px rgba(183,109,255,0.50));
  }
  .mob-tab--admin { color: rgba(218,226,253,0.38); }
  .mob-tab--admin.active {
    background: rgba(183,109,255,0.12);
    color: var(--primary);
  }

  /* Scrollable content */
  .mob-sheet-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(24px + var(--mob-safe-bottom));
  }
}

/* ══ 5. PANEL HEADERS ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .mob-sheet-body .panel-header {
    padding: 16px var(--mob-row-pad-h) 14px;
    border-bottom: 1px solid var(--mob-border);
    margin: 0;
  }
  .mob-sheet-body .panel-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
  }
  .mob-sheet-body .panel-body {
    padding: 10px 0;
  }

  /* Search inside sheet */
  .mob-sheet-body .sidebar-search-wrap {
    padding: 14px var(--mob-row-pad-h) 0;
  }
  .mob-sheet-body .search-field-wrap {
    border-radius: 13px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
  }
  .mob-sheet-body .search-field-wrap input {
    font-size: 16px;    /* ≥16px prevents iOS zoom */
    padding: 13px 14px 13px 42px;
    font-weight: 400;
    letter-spacing: -0.01em;
  }
}

/* ══ 6. LAYER ROWS ════════════════════════════════════════════ */
@media (max-width: 768px) {
  .mob-sheet-body .layer-row {
    padding: var(--mob-row-pad-v) var(--mob-row-pad-h);
    min-height: 58px;
    border-radius: 0;
    border-bottom: 1px solid var(--mob-border);
    gap: 14px;
    transition: background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-sheet-body .layer-row:last-of-type {
    border-bottom: none;
  }
  .mob-sheet-body .layer-row:active {
    background: rgba(255,255,255,0.04);
  }
  .mob-sheet-body .layer-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    flex-shrink: 0;
  }
  .mob-sheet-body .layer-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
  }
  .mob-sheet-body .layer-stat-label {
    font-size: 12px;
    margin-top: 2px;
    color: rgba(218,226,253,0.45);
  }
  .mob-sheet-body .layer-count {
    font-size: 13px;
    font-weight: 600;
    color: rgba(218,226,253,0.60);
  }
}

/* ══ 7. PTF TYPE FILTER ROWS ══════════════════════════════════ */
@media (max-width: 768px) {
  .mob-sheet-body .ptf-type-row {
    padding: var(--mob-row-pad-v) var(--mob-row-pad-h);
    min-height: 54px;
    border-radius: 0;
    border-bottom: 1px solid var(--mob-border);
    gap: 14px;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-sheet-body .ptf-type-row:last-child {
    border-bottom: none;
  }
  .mob-sheet-body .ptf-type-row:active {
    background: rgba(255,255,255,0.04);
  }
  .mob-sheet-body .ptf-type-name {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.015em;
  }
}

/* ══ 8. GPS / NAV PANELS ═════════════════════════════════════ */
@media (max-width: 768px) {
  .mob-sheet-body .stat-row {
    padding: 8px var(--mob-row-pad-h);
    min-height: 44px;
  }

  /* Full-bleed CTA buttons */
  .mob-sheet-body .gps-btn,
  .mob-sheet-body .sidebar-nav-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 16px var(--mob-row-pad-h) 0;
    padding: 16px;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    transition: transform 0.12s ease, opacity 0.12s ease;
  }
  .mob-sheet-body .gps-btn:active,
  .mob-sheet-body .sidebar-nav-btn:active {
    transform: scale(0.97);
    opacity: 0.88;
  }

  .mob-sheet-body .nav-panel-hint {
    padding: 12px var(--mob-row-pad-h) 0;
    font-size: 12px;
    line-height: 1.65;
    color: rgba(218,226,253,0.42);
  }

  .mob-sheet-body .route-planner-bar {
    margin: 12px var(--mob-row-pad-h) 0;
  }
}

/* ══ 9. MOBILE SEARCH OVERLAY ═════════════════════════════════ */
@media (max-width: 768px) {
  .mob-search-overlay {
    background: var(--mob-glass-0);
  }

  .mob-search-ov-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(14px + var(--mob-safe-top)) 16px 14px;
    border-bottom: 1px solid var(--mob-border);
  }

  .mob-search-ov-back {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--mob-glass-2);
    border: 1px solid var(--mob-border);
    color: var(--text);
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s, transform 0.10s;
  }
  .mob-search-ov-back:active {
    transform: scale(0.92);
    background: var(--mob-glass-3);
  }

  .mob-search-ov-input {
    flex: 1;
    border-radius: 13px;
    background: var(--mob-glass-2);
    border: 1px solid var(--mob-border);
    padding: 13px 16px;
    font-size: 16px;       /* ≥16px prevents iOS zoom */
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text);
    transition: border-color 0.16s ease, background 0.16s ease;
  }
  .mob-search-ov-input:focus {
    border-color: rgba(183,109,255,0.52);
    background: rgba(183,109,255,0.05);
    outline: none;
  }

  .mob-ov-section {
    padding: 16px var(--mob-row-pad-h) 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(218,226,253,0.38);
  }

  .mob-ov-item {
    display: flex;
    align-items: center;
    padding: var(--mob-row-pad-v) var(--mob-row-pad-h);
    min-height: 58px;
    gap: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.10s;
  }
  .mob-ov-item:active {
    background: rgba(183,109,255,0.07);
  }

  .mob-ov-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--mob-glass-2);
    border: 1px solid var(--mob-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
  }

  .mob-ov-name {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.3;
  }
  .mob-ov-sub {
    font-size: 12px;
    margin-top: 3px;
    color: rgba(218,226,253,0.42);
    letter-spacing: -0.005em;
  }

  .mob-ov-empty,
  .mob-ov-spinner {
    padding: 48px var(--mob-row-pad-h);
    font-size: 14px;
    text-align: center;
    color: rgba(218,226,253,0.32);
  }
}

/* ══ 10. PLACE CARD ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .place-card {
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    background: var(--mob-glass-0);
    box-shadow:
      0 -1px 0 var(--mob-rim),
      0 -4px 28px rgba(0,0,0,0.50),
      0 -14px 56px rgba(0,0,0,0.36);
  }

  .place-card-handle {
    padding: 14px 0 8px;
    display: flex;
    justify-content: center;
  }
  .place-card-handle-bar {
    width: 38px;
    height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
  }

  .place-card-hero {
    height: 220px;
  }

  .place-card-header {
    padding: 18px var(--mob-row-pad-h) 8px;
    gap: 12px;
  }
  .place-card-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.12;
    flex: 1;
  }
  .place-card-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mob-glass-2);
    border: 1px solid var(--mob-border);
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s, transform 0.10s;
  }
  .place-card-close:active {
    transform: scale(0.90);
    background: var(--mob-glass-3);
  }

  .place-card-badge {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .place-card-coords {
    padding: 4px var(--mob-row-pad-h) 12px;
    font-size: 11px;
    color: rgba(218,226,253,0.38);
    letter-spacing: 0.01em;
  }

  .place-card-desc {
    padding: 14px var(--mob-row-pad-h);
    font-size: 14.5px;
    line-height: 1.68;
    color: rgba(218,226,253,0.75);
    border-top: 1px solid var(--mob-border);
  }

  .place-card-strip {
    padding: 14px var(--mob-row-pad-h) 16px;
    border-top: 1px solid var(--mob-border);
  }
  .place-card-strip-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: rgba(218,226,253,0.35);
  }
  .place-card-strip-inner {
    gap: 10px;
  }
  .place-card-strip-inner img {
    width: 96px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
  }

  /* Action buttons */
  .place-card-actions {
    padding: 16px var(--mob-row-pad-h) calc(env(safe-area-inset-bottom, 0px) + 20px);
    gap: 10px;
    border-top: 1px solid var(--mob-border);
  }
  .place-card-action-btn {
    flex: 1;
    padding: 16px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.015em;
    gap: 8px;
    transition: transform 0.12s ease, opacity 0.12s ease;
  }
  .place-card-action-btn:active {
    transform: scale(0.96);
    opacity: 0.82;
  }
  .place-card-action-btn.primary {
    background: rgba(183,109,255,0.22);
    border: 1px solid rgba(183,109,255,0.30);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.10) inset,
      0 4px 18px rgba(183,109,255,0.28);
  }
  .place-card-action-btn.secondary {
    background: var(--mob-glass-2);
    border: 1px solid var(--mob-border);
  }
}

/* ══ 11. CAT CARD (chip results floating card) ════════════════ */
@media (max-width: 768px) {
  .cat-card {
    top: calc(14px + var(--mob-safe-top));
    bottom: calc(96px + var(--mob-safe-bottom));
    left: 14px;
    right: 14px;
    border-radius: 20px;
    background: rgba(16, 21, 38, 0.99);
    border: 1px solid var(--mob-border);
    box-shadow:
      0 1px 0 var(--mob-rim) inset,
      0 8px 32px rgba(0,0,0,0.65),
      0 24px 64px rgba(0,0,0,0.42);
  }

  .cat-card-hd {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--mob-border);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .cat-card-emoji { font-size: 20px; }
  .cat-card-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.025em;
    flex: 1;
  }
  .cat-card-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
  }
  .cat-card-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mob-glass-2);
    border: 1px solid var(--mob-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s, transform 0.10s;
  }
  .cat-card-close:active {
    transform: scale(0.90);
  }

  .cat-card-list {
    padding: 12px var(--mob-card-gap) 16px;
    gap: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cat-row {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    gap: 12px;
    min-height: 54px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s, border-color 0.12s, transform 0.10s;
  }
  .cat-row:active {
    background: rgba(183,109,255,0.10);
    border-color: rgba(183,109,255,0.22);
    transform: scale(0.98);
  }
  .cat-row-name {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
  }
  .cat-row-sub {
    font-size: 12px;
    margin-top: 3px;
    color: rgba(218,226,253,0.42);
  }
}

/* ══ 12. IN-SHEET CHIP RESULTS ════════════════════════════════ */
@media (max-width: 768px) {
  .mob-chip-results-header {
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--mob-border);
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mob-chip-results-list {
    padding: 10px 14px 28px;
    gap: 10px;
    display: flex;
    flex-direction: column;
  }

  .mob-chip-results-list .dcr-row {
    border-radius: 14px;
    padding: 13px 14px;
    min-height: 62px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s, border-color 0.12s, transform 0.10s;
  }
  .mob-chip-results-list .dcr-row:active {
    background: rgba(183,109,255,0.09);
    border-color: rgba(183,109,255,0.20);
    transform: scale(0.98);
  }
}

/* ══ 13. ADMIN PANEL ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .admin-panel {
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    background: var(--mob-glass-0);
    border-top: 1px solid var(--mob-rim);
    box-shadow: 0 -4px 40px rgba(0,0,0,0.55);
  }
  .admin-header {
    padding: calc(18px + var(--mob-safe-top)) var(--mob-row-pad-h) 14px;
    border-bottom: 1px solid var(--mob-border);
  }
  .admin-tabbar {
    padding: 10px 14px;
    gap: 6px;
  }

  .admin-search-input {
    border-radius: 13px;
    padding: 13px 16px;
    font-size: 16px;       /* ≥16 prevents iOS zoom */
    background: var(--mob-glass-2);
    border: 1px solid var(--mob-border);
    color: var(--text);
    transition: border-color 0.16s, background 0.16s;
  }
  .admin-search-input:focus {
    border-color: rgba(183,109,255,0.48);
    background: rgba(183,109,255,0.05);
    outline: none;
  }
}

/* ══ 14. MODALS ════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .modal {
    border-radius: var(--mob-sheet-radius) var(--mob-sheet-radius) 0 0;
    background: var(--mob-glass-0);
    border-top: 1px solid var(--mob-rim);
    box-shadow: 0 -4px 40px rgba(0,0,0,0.55);
    padding: 0;
  }
  .modal-body {
    padding: 20px var(--mob-row-pad-h);
    font-size: 15px;
    line-height: 1.68;
    color: rgba(218,226,253,0.80);
  }
}

/* ══ 15. SHEET BODY SHEET-STATE SHADOWS ════════════════════════ */
@media (max-width: 768px) {
  body.mob-sheet-half .mob-sheet {
    box-shadow:
      0 -1px 0 var(--mob-rim),
      0 -6px 32px rgba(0,0,0,0.50),
      0 -16px 56px rgba(0,0,0,0.32);
  }
  body.mob-sheet-full .mob-sheet {
    box-shadow:
      0 -1px 0 rgba(255,255,255,0.09),
      0 -8px 40px rgba(0,0,0,0.60),
      0 -20px 72px rgba(0,0,0,0.38);
  }
}

/* ══ 16. MICRO-POLISH & GLOBAL MOBILE FIXES ════════════════════ */
@media (max-width: 768px) {
  /* All interactive elements: no blue flash on iOS */
  button, [role="button"],
  .mob-tab, .qc-chip, .cat-row,
  .mob-ov-item, .dcr-row, .layer-row, .ptf-type-row {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }

  /* Smooth momentum scroll on all scrollable containers */
  .mob-sheet-body,
  .cat-card-list,
  .mob-search-ov-results,
  .mob-chip-results-list,
  .qc-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  /* Consistent generic press state for any row not covered above */
  .mob-sheet-body [class*="-row"]:not(.layer-row):not(.ptf-type-row):active {
    background: rgba(255,255,255,0.04);
  }

  /* Font rendering */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Disable input zoom on iOS — font-size must be ≥16px on all inputs */
  input[type="text"],
  input[type="search"],
  input[type="email"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ══ 17. VERY SMALL PHONES ≤ 390px ════════════════════════════ */
@media (max-width: 390px) {
  .mob-search-placeholder {
    font-size: 14px;
  }
  .mob-tab span {
    display: none;
  }
  .mob-tab {
    padding: 8px 14px;
    min-height: 44px;
  }
  .mob-tab i {
    font-size: 18px;
  }
  .place-card-name {
    font-size: 20px;
  }
  .cat-card-title {
    font-size: 15px;
  }
  .mob-search-action {
    width: 42px;
    height: 36px;
    margin: 0 6px;
  }
  .mob-row-pad-h {
    --mob-row-pad-h: 16px;
  }
}