/* ============================================================================
   Grillable — redesign (glass UI). Light = :root, dark = [data-theme="dark"].
   ========================================================================== */

:root {
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --radius-sm: .625rem;
  --radius-md: .875rem;
  --radius-lg: 1.125rem;
  --radius-full: 9999px;

  /* Light (warm oat glass) */
  --bg: #efe9dd;
  --glass: rgba(252, 250, 245, 0.82);
  --glass-2: rgba(255, 255, 255, 0.78);
  --card: rgba(255, 255, 255, 0.72);
  --line: rgba(60, 40, 20, 0.12);
  --line-soft: rgba(60, 40, 20, 0.07);
  --text: #2b2620;
  --muted: #6c6356;
  --faint: #8a8275;
  --accent: #c2541c;
  --accent-2: #a6451a;
  --on-accent: #fff6ee;
  --green: #3f8f5c;  --green-bg: rgba(63,143,92,.14);
  --sand: #a9781b;
  --red: #c0392b;    --red-soft: rgba(192,57,43,.10);  --red-line: rgba(192,57,43,.30);
  --gray: #8a8275;
  --blue: #2f6aa8;   --blue-soft: rgba(47,106,168,.12); --blue-line: rgba(47,106,168,.32);
  --shadow-sm: 0 2px 12px rgba(60,40,20,.10);
  --shadow-lg: 0 18px 50px rgba(60,40,20,.18);
  --cl-bg: rgba(255,252,247,.95); --cl-text: #9a4012; --cl-ring: var(--accent);
  --field: rgba(60,40,20,.05);
  --glow: rgba(194,84,28,.08);
}

[data-theme="dark"] {
  --bg: #11100e;
  --glass: rgba(28, 24, 20, 0.84);
  --glass-2: rgba(39, 34, 29, 0.92);
  --card: rgba(255, 255, 255, 0.025);
  --line: rgba(240, 224, 204, 0.10);
  --line-soft: rgba(240, 224, 204, 0.05);
  --text: #efe5d6;
  --muted: #b0a491;
  --faint: #7f7466;
  --accent: #d67831;
  --accent-2: #ffb26b;
  --on-accent: #1b1206;
  --green: #75b987;  --green-bg: rgba(117,185,135,.14);
  --sand: #d0ab63;
  --red: #c86a72;    --red-soft: rgba(200,106,114,.14); --red-line: rgba(200,106,114,.32);
  --gray: #97897b;
  --blue: #6fa7d8;   --blue-soft: rgba(111,167,216,.16); --blue-line: rgba(111,167,216,.34);
  --shadow-sm: 0 2px 12px rgba(0,0,0,.30);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.40);
  --cl-bg: rgba(34,29,24,.94); --cl-text: #f2d1af; --cl-ring: var(--accent);
  --field: rgba(255,255,255,.04);
  --glow: rgba(214,120,49,.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
.app { position: relative; height: 100vh; height: 100dvh; width: 100vw; }

/* ───────── Map ───────── */
.map-shell { position: absolute; inset: 0; z-index: 1; background: var(--bg); }
#map { position: absolute; inset: 0; }
.leaflet-container { background: var(--bg); font-family: var(--font-body); }
.leaflet-control-zoom a {
  background: var(--glass-2); color: var(--text);
  border-color: var(--line); backdrop-filter: blur(8px);
}
.leaflet-control-zoom a:hover { background: var(--accent); color: var(--on-accent); }
.leaflet-control-attribution {
  background: var(--glass-2) !important; color: var(--muted) !important;
  backdrop-filter: blur(8px); border-radius: 8px 0 0 0;
}
.leaflet-control-attribution a { color: var(--accent) !important; }

/* Markers: color fill + white glyph + ring (color AND icon, for colorblind users) */
.grill-marker .gm-pin {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid #fff; color: #fff;
  font: 700 11px/1 var(--font-body);
  box-shadow: 0 1px 5px rgba(0,0,0,.5);
  transition: transform .12s ease, box-shadow .12s ease;
}
.grill-marker.hover .gm-pin { transform: scale(1.25); }
.grill-marker.selected .gm-pin {
  transform: scale(1.5);
  box-shadow: 0 0 0 3px var(--accent), 0 4px 12px rgba(0,0,0,.5);
}
/* Cluster bubbles: neutral chip + accent ring (reads as a group, not a status) */
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: transparent; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: var(--cl-bg); color: var(--cl-text); font-weight: 700;
  border: 2px solid var(--cl-ring); box-shadow: 0 6px 18px rgba(0,0,0,.3);
  font-family: var(--font-body);
}

/* ───────── Sidebar (desktop glass panel) ───────── */
.sidebar {
  position: absolute; top: 16px; left: 16px; bottom: 16px; width: 340px; z-index: 5;
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border-radius: 24px; border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, var(--glow), transparent 26%),
    var(--glass);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(1.1);
}
.sidebar-header { padding: 18px 18px 14px; border-bottom: 1px solid var(--line-soft); }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.brand { display: flex; gap: 9px; align-items: center; }
.brand-mark { width: 22px; height: 22px; color: var(--accent); flex: none; }
.brand-name { font-family: var(--font-display); font-size: 2rem; line-height: .95; letter-spacing: -.02em; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 999px; flex: none;
  border: 1px solid var(--line); background: var(--field); color: var(--accent);
  display: grid; place-items: center; cursor: pointer; font-size: 15px;
  transition: border-color .15s, transform .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(-18deg); }
.intro { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; max-width: 30ch; }

.sidebar-scroll { overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.section-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--faint); font-weight: 600; margin-bottom: 10px;
}
.section-label.mt { margin-top: 16px; }

/* Inputs / buttons / selects */
.input, .select, .btn {
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--field); color: var(--text); outline: none;
}
.input { width: 100%; height: 42px; padding: 0 14px; }
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.select { width: 100%; height: 42px; padding: 0 12px; cursor: pointer; }
.select.compact { height: 38px; font-size: .84rem; }
.btn {
  height: 42px; padding: 0 13px; cursor: pointer; font-size: .86rem; font-weight: 600;
  white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { background: var(--accent-2); }
.btn-secondary { background: var(--field); }
.loc-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.inline-link {
  background: none; border: none; padding: 2px 0; color: var(--muted);
  font-size: .84rem; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; width: fit-content;
}
.inline-link:hover { color: var(--accent); }

.search-bar .row { display: flex; gap: 8px; }
.search-bar .input { flex: 1; border-radius: var(--radius-full); padding: 0 16px; }
/* Round icon button (matches mobile) */
.loc-btn { flex: none; width: 42px; padding: 0; border-radius: var(--radius-full); }
.loc-btn .i { width: 18px; height: 18px; }
.loc-glyph { vertical-align: -1px; }
.m-filter-btn { display: none; flex: none; width: 42px; padding: 0; }

.filters-wrap { display: flex; flex-direction: column; }
.filter-shell {
  display: grid; gap: 12px; padding: 12px; border-radius: 18px;
  background: var(--field); border: 1px solid var(--line-soft); margin-bottom: 12px;
}
.zip-row { display: flex; gap: 8px; }
.zip-row .input { flex: 1; border-radius: var(--radius-full); padding: 0 16px; }
.zip-row .btn { flex: none; width: 42px; padding: 0; border-radius: var(--radius-full); }
.slider-wrap { display: grid; gap: 8px; }
.slider-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .82rem; }
.value-pill {
  padding: 4px 10px; border-radius: var(--radius-full); background: var(--field);
  border: 1px solid var(--line); color: var(--text); font-size: .74rem; min-width: 56px; text-align: center;
}
input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
input[type="range"]:disabled { opacity: .5; cursor: not-allowed; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* Pill-style, compact region / access dropdowns */
.control-row .select { height: 32px; font-size: .8rem; padding: 0 14px; border-radius: var(--radius-full); }

/* Filter chips (checkbox toggles) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  padding: 8px 12px; border-radius: var(--radius-full); border: 1px solid var(--line);
  background: var(--field); color: var(--muted); font-size: .82rem; font-weight: 600;
  transition: background-color .12s, border-color .12s, color .12s;
}
.chip:hover { border-color: var(--accent); }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip-saved:has(input:checked) { background: var(--red); border-color: var(--red); color: #fff; }
.chip:has(input:focus-visible) { outline: 2px solid var(--glow); outline-offset: 2px; }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 9px 14px; color: var(--muted); font-size: .82rem; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.dot {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 9px; font-weight: 700; line-height: 1;
}
.dot.open { background: var(--green); }
.dot.discount { background: var(--sand); }
.dot.resident { background: var(--red); }
.dot.none { background: var(--gray); }

.m-appearance { display: none; align-items: center; justify-content: space-between; margin-top: 16px; }
.m-filter-done { display: none; width: 100%; margin-top: 14px; height: 46px; }

/* Results */
.results-wrap { display: flex; flex-direction: column; }
.m-sheet-handle { display: none; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.results-count { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text); font-weight: 700; }
.sort-mini { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.sort-mini .select { height: 34px; width: auto; padding: 0 12px; font-size: .82rem; border-radius: var(--radius-full); }

/* Scroll-to-top — floats at the bottom-center of the results scroll area.
   Containing block is .sidebar on desktop (so it floats, not scrolls) and the
   fixed .results-wrap sheet on mobile — both keep it pinned, not scrolling. */
.scroll-top {
  position: absolute; left: 50%; bottom: 14px; z-index: 15;
  transform: translateX(-50%) translateY(6px);
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); border: none;
  box-shadow: var(--shadow-lg); cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, background-color .15s ease;
}
.scroll-top.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.scroll-top:hover { background: var(--accent-2); }
.scroll-top:active { transform: translateX(-50%) scale(.94); }
/* Clearance so the floating button never covers the last card on desktop */
.sidebar-scroll { padding-bottom: 64px; }

.cards { display: grid; gap: 10px; }
.card {
  position: relative; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px; box-shadow: var(--shadow-sm);
  transition: border-color .12s, box-shadow .12s, transform .12s, background-color .25s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.card-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.card-title { font-size: 1.04rem; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.heart {
  width: 30px; height: 30px; border-radius: 999px; flex: none; cursor: pointer;
  display: grid; place-items: center; color: var(--faint);
  border: 1px solid transparent; background: var(--field); font-size: .95rem;
}
.heart:hover { color: var(--red); }
.heart.saved { color: #e8909a; background: var(--red-soft); border-color: var(--red-line); }
.card-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.card-meta .dist { font-weight: 700; color: var(--accent); }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge {
  padding: 5px 9px; border-radius: var(--radius-full); font-size: .73rem; font-weight: 600;
  border: 1px solid transparent; line-height: 1;
}
.badge.allow { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.badge.warn { background: rgba(208,171,99,.13); color: var(--sand); border-color: rgba(169,120,27,.4); }
.badge.no { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.badge.confirm { background: var(--field); color: var(--muted); border: 1px dashed var(--accent); }
.verify-pill {
  font-size: .68rem; font-weight: 600; padding: 4px 8px; border-radius: var(--radius-full);
  border: 1px solid var(--line); color: var(--muted);
}
.verify-pill.ok { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.verify-pill.confirm { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.footer-note { color: var(--faint); font-size: .8rem; line-height: 1.45; margin: 14px 0 4px; }
.empty { padding: 26px 6px; text-align: center; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.empty .empty-reset {
  display: inline-block; margin-top: 10px; background: var(--accent); color: var(--on-accent);
  border: none; border-radius: 8px; padding: 8px 14px; font-size: .82rem; font-weight: 700; cursor: pointer;
}

/* ───────── Detail panel (desktop fixed side panel) ───────── */
.detail {
  position: absolute; top: 16px; left: 372px; width: 366px; max-height: calc(100dvh - 32px); z-index: 6;
  border-radius: 24px; border: 1px solid var(--line); overflow: auto;
  background: radial-gradient(circle at top left, var(--glow), transparent 24%), var(--glass);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(18px) saturate(1.08);
}
.detail[hidden] { display: none; }
.detail-back { display: none; }
.detail-inner { padding: 18px; }
.detail-grab { display: none; }
.filter-grab { display: none; }

/* Floating "Reset view" pill — top-centered over the map, re-frames to all
   locations. Lives in .app (above map-shell's z-index:1 stacking context). */
.map-reset {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 22;
  height: 34px; padding: 0 16px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: .82rem; font-weight: 600; letter-spacing: -.01em;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(10px);
  cursor: pointer; opacity: .9;
  transition: opacity .15s ease, transform .12s ease, box-shadow .15s ease;
}
.map-reset:hover { opacity: 1; box-shadow: var(--shadow-lg); }
.map-reset:active { transform: translateX(-50%) scale(.95); }
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.title-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail h2 { margin: 0; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.05; letter-spacing: -.01em; }
.detail-top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-pill {
  width: 32px; height: 32px; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; border: 1px solid var(--line); background: var(--field);
  color: var(--muted); font-size: .95rem;
}
.icon-pill.saved { color: #e8909a; background: var(--red-soft); border-color: var(--red-line); }
.detail-close { background: none; border: none; color: var(--faint); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.verify-chip {
  width: 16px; height: 16px; flex: none; margin-left: auto;
  display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--blue-soft); border: 1px solid var(--blue-line); color: var(--blue);
  font-size: .58rem; cursor: default; position: relative;
}
.verify-chip[data-tip]:hover::after,
.verify-chip[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; top: 24px; right: 0; left: auto;
  width: 210px; white-space: normal; line-height: 1.35;
  background: var(--glass-2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 10px; border-radius: 10px; font-size: .72rem; box-shadow: var(--shadow-sm); z-index: 3;
}
.status-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; margin-bottom: 14px; }
.status-meta { min-width: 0; }
.status-line .dist { color: var(--accent); font-weight: 700; }
.summary { color: var(--text); font-size: .92rem; line-height: 1.5; margin: 0 0 16px; }
.summary-label { display: flex; align-items: center; gap: 7px; color: var(--accent); font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.fact-grid { display: grid; grid-template-columns: 86px 1fr; gap: 9px 10px; margin: 0 0 16px; font-size: .89rem; line-height: 1.35; }
.fact-grid dt { color: var(--muted); }
.fact-grid dd { margin: 0; color: var(--text); }
.fact-grid dd a { color: var(--accent); text-decoration: none; font-weight: 600; }
.fact-grid dd a:hover { text-decoration: underline; }
.fact-grid .prov { color: var(--faint); }
.popup-actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: center; }
.popup-actions .btn {
  height: 34px; border-radius: 999px; padding: 0 11px; font-size: .78rem;
  text-decoration: none; white-space: nowrap;
}

/* ───────── Mobile-only chrome (hidden on desktop) ───────── */
.m-peek, .scrim { display: none; }

/* ════════════ MOBILE ════════════ */
@media (max-width: 900px) {
  body { overflow: hidden; }

  /* Flatten the sidebar so its sections can be repositioned individually */
  .sidebar { display: contents; }
  .sidebar-header { display: none; }
  .sidebar-scroll { display: contents; }

  /* Search → floating top bar */
  .search-bar {
    position: fixed; top: 12px; left: 12px; right: 12px; z-index: 30; margin: 0;
  }
  .search-bar .row {
    background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-full);
    padding: 6px; box-shadow: var(--shadow-sm); backdrop-filter: blur(14px);
  }
  .search-bar .input { height: 40px; border: none; background: transparent; box-shadow: none; }
  .search-bar .input:focus { box-shadow: none; }
  .loc-btn { width: 42px; padding: 0; border-radius: 999px; }
  .loc-btn .t { display: none; }
  .m-filter-btn { display: inline-flex; border-radius: 999px; }

  /* Filters → slide-up sheet (hidden until opened) */
  .filters-wrap {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    max-height: 86vh; overflow: auto; padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    background: var(--glass); border-top: 1px solid var(--line);
    border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); backdrop-filter: blur(18px);
    transform: translateY(110%); transition: transform .28s ease; visibility: hidden;
  }
  .app.m-filters-open .filters-wrap { transform: translateY(0); visibility: visible; }
  /* Grab strip at the top of the filter sheet (swipe down to close) */
  .filter-grab {
    display: block; position: relative; width: calc(100% + 32px); margin: -18px -16px 6px;
    height: 30px; border: none; background: transparent; cursor: grab; touch-action: none; padding: 0;
  }
  .filter-grab::before {
    content: ""; position: absolute; left: 50%; top: 11px; transform: translateX(-50%);
    width: 60px; height: 6px; border-radius: 999px; background: var(--line);
  }
  .m-appearance { display: flex; }
  .m-filter-done { display: block; }

  /* Results → bottom sheet (peek / expanded) */
  .results-wrap {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--glass); border-top: 1px solid var(--line);
    border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); backdrop-filter: blur(18px);
    padding: 0 16px 12px;
    max-height: 78vh; height: 200px; overflow: hidden;
    transition: height .28s ease;
    display: flex; flex-direction: column;
  }
  .app.m-sheet-open .results-wrap { height: 82vh; overflow: hidden; }
  /* Full-width, tall, transparent grab strip; the visible bar is drawn via ::before */
  .m-sheet-handle {
    display: block; width: 100%; height: 30px; border: none; background: transparent;
    cursor: grab; flex: none; touch-action: none; position: relative; padding: 0; margin: 0;
  }
  .m-sheet-handle::before {
    content: ""; position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
    width: 60px; height: 6px; border-radius: 999px; background: var(--line);
  }
  .results-wrap .cards { overflow: auto; flex: 1; padding-bottom: 64px; }

  /* Grabber + back button replace the × on mobile */
  .detail-close { display: none; }

  /* Reset pill stays top-centered, just below the floating search bar; hide it
     when a full-screen sheet/panel is up (the map strip is too small to matter) */
  .map-reset { top: 88px; }
  .app.m-detail-open .map-reset,
  .app.m-filters-open .map-reset { display: none; }

  /* Detail → full-screen takeover (map shows in the top strip behind) */
  .detail {
    position: fixed; inset: 26vh 0 0 0; left: 0; width: auto; max-height: none;
    border-radius: 24px 24px 0 0; z-index: 50;
  }
  /* Full-width grab strip; the visible pill is drawn via ::before. Spans the
     .detail-inner padding so the whole top of the panel is the drag target. */
  .detail-grab {
    display: block; position: relative; width: calc(100% + 36px); margin: -18px -18px 8px;
    height: 30px; border: none; background: transparent; cursor: grab;
    touch-action: none; padding: 0;
  }
  .detail-grab::before {
    content: ""; position: absolute; left: 50%; top: 11px; transform: translateX(-50%);
    width: 60px; height: 6px; border-radius: 999px; background: var(--line);
  }
  .detail-back:not([hidden]) {
    display: grid; place-items: center; position: fixed; top: 14px; left: 14px; z-index: 55;
    width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--glass-2); color: var(--text); font-size: 1.2rem; cursor: pointer; backdrop-filter: blur(8px);
  }

  /* Compact peek card (marker tap) */
  .m-peek {
    display: block; position: fixed; left: 12px; right: 12px; bottom: 92px; z-index: 35;
    background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
    padding: 12px 14px; box-shadow: var(--shadow-lg); backdrop-filter: blur(14px); cursor: pointer;
  }
  .m-peek[hidden] { display: none; }
  .m-peek-title { font-weight: 700; font-size: 1rem; margin-bottom: 3px; padding-right: 26px; }
  .m-peek-meta { color: var(--muted); font-size: .84rem; display: flex; align-items: center; gap: 7px; }
  .m-peek-meta .dist { color: var(--accent); font-weight: 700; }
  .m-peek-close { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--faint); font-size: 1.2rem; cursor: pointer; }

  .scrim { display: block; position: fixed; inset: 0; z-index: 38; background: rgba(0,0,0,.35); }
  .scrim[hidden] { display: none; }

  /* When the detail is open, hide exploration chrome for a clean map strip */
  .app.m-detail-open .search-bar,
  .app.m-detail-open .results-wrap { display: none; }

  /* Pinch-to-zoom is natural on touch; the buttons would only collide with the
     full-width search bar, so hide them on mobile. */
  .leaflet-control-zoom { display: none; }

  /* When the bottom sheet is collapsed, nudge the peek above it */
  .m-peek { bottom: 212px; }
}
