:root {
  --bg: #f4f1e6;
  --surface: #fbfaf7;
  --ink: #122117;
  --muted: #536157;
  --accent: #2f6f53;
  --line: #d9d3c2;
  --good: #2c9b63;
  --mid: #e2a33a;
  --low: #d46544;
  --overlay-z: 100;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Sora", sans-serif;
  background:
    radial-gradient(circle at 16% 8%, rgba(47,111,83,.18), transparent 34%),
    radial-gradient(circle at 80% 0%, rgba(226,163,58,.2), transparent 42%),
    linear-gradient(160deg, #f9f6ef 0%, var(--bg) 48%, #ece6d4 100%);
}

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100vh;
  gap: 14px;
  padding: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, white);
  box-shadow: 0 10px 24px rgba(18,33,23,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

/* ---- Search bar ---- */
.search-bar {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.6));
  display: grid;
  gap: 8px;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 4px;
}

.location-wrap { position: relative; }

.location-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 56px 10px 14px;
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color 140ms;
}
.location-input:focus { border-color: var(--accent); }
.location-input::placeholder { font-weight: 400; color: var(--muted); }

.location-clear {
  position: absolute;
  right: 32px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  display: none;
}
.location-clear:hover { color: var(--ink); }
.location-clear.visible { display: block; }

.location-icon {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 16px;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(18,33,23,.12);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.autocomplete-dropdown.open { display: block; }

.ac-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 100ms;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.focused { background: color-mix(in srgb, var(--accent) 8%, white); }

.ac-name { font-weight: 600; font-size: 13px; }
.ac-sub { font-size: 11px; color: var(--muted); margin-top: 1px; display: flex; gap: 8px; align-items: center; }
.ac-badge {
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: "IBM Plex Mono", monospace;
}
.ac-loading { font-size: 10px; color: var(--muted); font-style: italic; }

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.date-field { display: grid; gap: 3px; }
.date-field label { font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.date-field input[type="date"] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 140ms;
}
.date-field input[type="date"]:focus { border-color: var(--accent); }

.guests-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.guests-wrap { position: relative; }
.guests-btn {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms;
}
.guests-btn:hover, .guests-btn.open { border-color: var(--accent); }

.guests-popup {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(18,33,23,.12);
  z-index: 200;
  padding: 12px;
  display: none;
  gap: 10px;
}
.guests-popup.open { display: grid; }

.guest-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
.guest-label { font-size: 12px; color: var(--ink); }
.guest-sub { font-size: 11px; color: var(--muted); }
.counter {
  display: flex;
  align-items: center;
  gap: 6px;
}
.counter-btn {
  width: 28px; height: 28px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: border-color 120ms, background 120ms;
}
.counter-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, white); }
.counter-btn:disabled { opacity: .35; cursor: default; }
.counter-val { min-width: 20px; text-align: center; font-size: 14px; font-weight: 600; }

.pets-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.pets-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

.search-btn {
  padding: 8px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms, transform 100ms;
  align-self: end;
}
.search-btn:hover { background: color-mix(in srgb, var(--accent) 80%, black); }
.search-btn:active { transform: scale(.97); }
.search-btn:disabled { opacity: .55; cursor: default; }

/* ---- Results bar ---- */
.results-bar {
  padding: 9px 14px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255,255,255,.45);
  flex-shrink: 0;
}

.results-count {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0;
}

.filter-btn {
  display: none;
  padding: 5px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: white;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms;
  gap: 5px;
  align-items: center;
}
.filter-btn.visible { display: flex; }
.filter-btn:hover { border-color: var(--accent); }
.filter-btn .filter-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: none;
}
.filter-btn.active .filter-dot { display: block; }

/* ---- Demo banner ---- */
.demo-banner {
  padding: 8px 14px;
  background: color-mix(in srgb, var(--mid) 18%, white);
  border-bottom: 1px solid color-mix(in srgb, var(--mid) 30%, var(--line));
  color: #6b4a0a;
  font-size: 12px;
  text-align: center;
  flex-shrink: 0;
}

/* ---- Accommodation list ---- */
.list {
  margin: 0;
  padding: 8px 10px 12px;
  list-style: none;
  overflow: auto;
  display: grid;
  gap: 6px;
  flex: 1;
  min-height: 80px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
  animation: reveal 220ms ease both;
}
.item:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.item.active { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, white); }

.item-row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.item-title { font-size: 13px; font-weight: 600; margin: 0; line-height: 1.3; flex: 1; }
.item-price { font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--ink); }
.item-row2 { margin-top: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.badge {
  border-radius: 999px;
  padding: 2px 7px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-booking { background: #003580; color: white; }
.badge-amadeus { background: #1a1a6e; color: white; }
.badge-camptocamp { background: #4a4a2a; color: #e8e070; }
.badge-camping_info { background: #1e6a2e; color: white; }
.badge-demo { background: var(--line); color: var(--muted); }

.stars { color: #d4a017; font-size: 11px; letter-spacing: -.5px; }
.review { font-size: 11px; color: var(--muted); font-family: "IBM Plex Mono", monospace; }
.score { border-radius: 999px; padding: 3px 7px; font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 500; margin-left: auto; }
.score.good { background: color-mix(in srgb, var(--good) 18%, white); color: var(--good); }
.score.mid  { background: color-mix(in srgb, var(--mid) 20%, white);  color: #8d5e0f; }
.score.low  { background: color-mix(in srgb, var(--low) 20%, white);  color: #9a3a1d; }
.empty { color: var(--muted); font-size: 13px; padding: 12px; }

/* ---- Filter overlay ---- */
.filter-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(18,33,23,.38);
  z-index: calc(var(--overlay-z) - 1);
  border-radius: 18px;
}
.filter-backdrop.open { display: block; }

.filter-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-radius: 18px 18px 0 0;
  z-index: var(--overlay-z);
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(100%);
  transition: transform 240ms cubic-bezier(.32,1,.5,1);
  max-height: 82%;
  overflow-y: auto;
}
.filter-overlay.open { transform: translateY(0); }

.filter-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.filter-overlay-title { font-size: 15px; font-weight: 700; margin: 0; }
.filter-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 2px;
}

.filter-section { display: grid; gap: 8px; }
.filter-section-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 0;
}

/* Budget range */
.budget-range-label {
  font-size: 13px;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
  margin: 0;
}

.histogram {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 32px;
}
.histo-bar {
  flex: 1;
  background: color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: background 120ms;
}
.histo-bar.active { background: var(--accent); }

/* Dual range slider — both inputs fill the same track */
.range-wrap {
  position: relative;
  height: 18px;
}
.range-track {
  position: absolute;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  top: 7px; left: 0; right: 0;
}
.range-fill {
  position: absolute;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  top: 0;
}
.range-wrap input[type="range"] {
  position: absolute;
  width: 100%;
  height: 18px;
  top: 0; left: 0;
  margin: 0;
  pointer-events: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
}
.range-wrap input[type="range"]::-webkit-slider-thumb {
  pointer-events: all;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  cursor: pointer;
}
.range-wrap input[type="range"]::-moz-range-thumb {
  pointer-events: all;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  cursor: pointer;
}
#price-min { z-index: 3; }
#price-max { z-index: 4; }

/* Popular filter chips */
.popular-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.pop-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 120ms, background 120ms;
  user-select: none;
}
.pop-chip .chip-check {
  width: 14px; height: 14px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  transition: background 120ms, border-color 120ms;
}
.pop-chip.checked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, white); }
.pop-chip.checked .chip-check { background: var(--accent); border-color: var(--accent); color: white; }
.pop-chip-count { margin-left: auto; font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--muted); }

/* Number inputs (bedrooms/bathrooms) */
.number-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.number-field { display: grid; gap: 5px; }
.number-field > label { font-size: 12px; color: var(--muted); }
.number-field .counter {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 5px 8px;
  background: white;
  justify-content: space-between;
}

/* Slider fields (bike filters) */
.slider-field { display: grid; gap: 4px; }
.slider-field .slider-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.slider-field input[type="range"] { width: 100%; accent-color: var(--accent); height: 4px; }

/* Apply button */
.apply-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms;
  margin-top: 4px;
}
.apply-btn:hover { background: color-mix(in srgb, var(--accent) 80%, black); }

/* ---- Map ---- */
.map-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(18,33,23,.08);
  position: relative;
  min-height: 0;
}
#map { width: 100%; height: 100%; }

.map-note {
  position: absolute;
  right: 14px; top: 14px;
  z-index: 2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #f5f3ed;
  background: rgba(18,33,23,.72);
  border-radius: 999px;
  padding: 7px 10px;
  backdrop-filter: blur(4px);
}

.legend {
  position: absolute;
  left: 14px; bottom: 14px;
  z-index: 2;
  width: 200px;
  border: 1px solid rgba(255,255,255,.32);
  background: rgba(18,33,23,.78);
  border-radius: 12px;
  padding: 9px 11px;
  color: #f7f6f1;
  backdrop-filter: blur(4px);
}
.legend-title { margin: 0 0 7px; font-family: "IBM Plex Mono", monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .95; }
.legend-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 11px; }
.legend-item { display: grid; grid-template-columns: 16px 1fr; align-items: center; gap: 8px; line-height: 1.2; }
.legend-line { width: 16px; height: 0; border-top: 3px solid white; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   MOBILE — bottom-sheet over full-screen map
   ================================================================ */
/* Hide mobile-only elements on desktop */
.mob-sheet-handle,
.mob-search-trigger,
.mob-legend-btn,
.mob-search-overlay,
.mob-peek-bar,
.mob-card { display: none; }

@media (max-width: 900px) {
  /* ---- Layout: full-screen map ---- */
  .layout {
    display: block;
    height: 100dvh;
    padding: 0;
    position: relative;
    overflow: hidden;
  }
  .map-wrap {
    position: absolute;
    inset: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 0;
  }
  #map { min-height: 100%; }
  .map-note { display: none; }

  /* ---- Hide desktop legend, show (i) button ---- */
  .legend { display: none; }
  .mob-legend-btn {
    display: flex;
    position: absolute;
    bottom: 10px; left: 10px;
    z-index: 4;
    width: 29px; height: 29px;
    border-radius: 4px;
    border: none;
    background: white;
    color: var(--ink);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(0,0,0,.1);
  }
  .mob-legend-btn svg { width: 16px; height: 16px; }
  /* When legend is visible on mobile, show it above the button */
  .legend.mob-open {
    display: block;
    bottom: 45px; left: 10px;
    right: auto;
    width: 180px;
    z-index: 5;
  }
  /* Compact attribution so it doesn't span full width */
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib {
    max-width: calc(100vw - 70px);
  }

  /* ---- Mobile floating search trigger ---- */
  .mob-search-trigger {
    display: flex;
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 12px));
    left: 12px; right: 12px;
    z-index: 6;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(0,0,0,.1);
    font-family: inherit;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    align-items: center;
    gap: 8px;
  }
  .mob-search-trigger .mob-search-icon {
    font-size: 18px;
    color: var(--accent);
  }
  .mob-search-trigger.has-location {
    color: var(--ink);
    font-weight: 600;
  }

  /* ---- Mobile search overlay (full-screen) ---- */
  .mob-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: white;
    display: none;
    flex-direction: column;
  }
  .mob-search-overlay.open { display: flex; }
  .mob-search-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    padding-top: max(12px, env(safe-area-inset-top, 12px));
  }
  .mob-search-back {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--ink);
    padding: 4px;
    line-height: 1;
  }
  .mob-location-input {
    flex: 1;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    background: white;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    outline: none;
  }
  .mob-location-input:focus { border-color: var(--accent); }
  .mob-location-input::placeholder { font-weight: 400; color: var(--muted); }
  .mob-ac-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
  }
  .mob-ac-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .mob-ac-item:active { background: color-mix(in srgb, var(--accent) 8%, white); }
  .mob-ac-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 12%, white);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
  }
  .mob-ac-text { flex: 1; }
  .mob-ac-name { font-weight: 600; font-size: 14px; }
  .mob-ac-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

  /* ---- Panel becomes bottom sheet ---- */
  .panel {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 10;
    border: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(18,33,23,.12);
    max-height: 85dvh;
    transition: transform 300ms cubic-bezier(.32,1,.5,1);
    overflow: hidden;
  }
  /* Sheet states */
  .panel[data-mob="hidden"] {
    transform: translateY(100%);
    pointer-events: none;
  }
  .panel[data-mob="form"] {
    transform: translateY(0);
  }
  /* Peek state: collapsed form hint */
  .mob-peek-bar { display: none; }
  .panel[data-mob="peek"] .search-bar,
  .panel[data-mob="peek"] .demo-banner,
  .panel[data-mob="peek"] .results-bar,
  .panel[data-mob="peek"] .list {
    display: none;
  }
  .panel[data-mob="peek"] .mob-peek-bar {
    display: block;
    padding: 4px 16px 14px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
  }

  .panel[data-mob="collapsed"] .search-bar,
  .panel[data-mob="collapsed"] .demo-banner {
    display: none;
  }
  .panel[data-mob="collapsed"] .results-bar {
    display: flex;
  }
  .panel[data-mob="collapsed"] .list {
    display: none;
  }
  /* During drag: panel is full-size but positioned off-screen via transform.
     The drag JS controls how much is visible. */
  .panel.sheet-dragging .search-bar {
    display: none;
  }
  .panel.sheet-dragging .list {
    display: grid !important;
  }
  .panel.sheet-dragging .results-bar {
    display: flex;
  }
  .panel[data-mob="half"],
  .panel[data-mob="full"] {
    transform: translateY(0);
  }
  .panel[data-mob="half"] .search-bar {
    display: none;
  }
  .panel[data-mob="half"] .list {
    max-height: 35dvh;
  }
  .panel[data-mob="full"] .search-bar {
    display: none;
  }
  .panel[data-mob="full"] {
    max-height: 85dvh;
  }

  /* Sheet drag handle */
  .mob-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
    cursor: grab;
  }
  .mob-sheet-handle span {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
  }

  /* Eyebrow hidden on mobile */
  .eyebrow { display: none; }

  /* Search bar compact on mobile */
  .search-bar {
    padding: 8px 14px 12px;
  }

  /* Filter overlay goes full-screen on mobile */
  .filter-backdrop {
    position: fixed;
    inset: 0;
    border-radius: 0;
    z-index: 200;
  }
  .filter-overlay {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-height: 100dvh;
    border-radius: 0;
    z-index: 201;
    padding-bottom: 80px; /* space for sticky apply btn */
  }
  .filter-overlay .apply-btn {
    position: sticky;
    bottom: 0;
    margin: 0 -16px;
    width: calc(100% + 32px);
    border-radius: 0;
    padding: 16px;
  }

  /* ---- Mobile bottom card (marker detail) ---- */
  .mob-card {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9;
    background: white;
    border-radius: 18px;
    box-shadow: 0 -4px 24px rgba(18,33,23,.12);
    padding: 14px 16px 16px;
    max-height: 50dvh;
    overflow-y: auto;
  }
  .mob-card.open { display: block; }
  .mob-card .ib-inner {
    box-shadow: none;
    border-radius: 0;
  }
  .mob-card .ib-img { height: 160px; border-radius: 12px; }
  .mob-card .ib-close {
    position: absolute;
    top: 10px; right: 12px;
  }
  .mob-card .ib-body { padding: 12px 0 0; }
  .mob-card .ib-name { font-size: 16px; }
  .mob-card .ib-price { font-size: 18px; }

  /* Hide desktop infobox on mobile */
  .map-infobox { display: none !important; }

  /* No hover effect on mobile card */
  .mob-card .ib-inner:hover {
    box-shadow: 0 8px 28px rgba(18,33,23,.18), 0 1px 4px rgba(18,33,23,.08);
  }

  /* Hide location input inside sheet on mobile (we have the top search trigger) */
  .panel .location-wrap { display: none; }

  /* Move nav controls below the search trigger */
  .maplibregl-ctrl-top-left { top: 64px; }
}

/* ---- Custom map markers ---- */
/* Wrapper sized to include pill + arrow so anchor: "bottom" works */
.map-marker-wrap {
  --mc: #2c9b63;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
}
.map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 44px;
  height: 28px;
  padding: 0 9px;
  background: white;
  border: 2.5px solid var(--mc);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  cursor: pointer;
  transition: box-shadow 120ms;
  white-space: nowrap;
}
/* Downward arrow tip — in flow so it contributes to wrapper height */
.map-marker-wrap::after {
  content: "";
  width: 0; height: 0;
  border: 5px solid transparent;
  border-top-color: var(--mc, #2c9b63);
  margin-top: -2.5px;
}
.map-marker:hover {
  transform: scale(1.12) translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
  z-index: 10;
}
/* Selected marker — inverted pill */
.map-marker-wrap.selected { z-index: 20; }
.map-marker-wrap.selected .map-marker {
  background: var(--mc);
  box-shadow: 0 4px 14px rgba(0,0,0,.32);
}
.map-marker-wrap.selected .mm-price { color: white; }
.mm-price {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--mc);
  line-height: 1;
}

/* ---- Map infobox ---- */
.map-infobox {
  position: absolute;
  z-index: 50;
  width: 260px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.map-infobox.visible {
  opacity: 1;
  transform: translateY(0);
}

.ib-inner {
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(18,33,23,.18), 0 1px 4px rgba(18,33,23,.08);
  overflow: hidden;
  cursor: pointer;
}
.ib-inner:hover { box-shadow: 0 10px 34px rgba(18,33,23,.22), 0 1px 4px rgba(18,33,23,.1); }

.ib-close {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 2;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(18,33,23,.45);
  color: white;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  transition: background 120ms;
}
.ib-close:hover { background: rgba(18,33,23,.7); }

.ib-img {
  width: 100%;
  height: 130px;
  background-size: cover;
  background-position: center;
}
.ib-img-placeholder {
  background: linear-gradient(135deg, #e8e4db, #d5cfc2);
}

.ib-body {
  padding: 11px 13px 13px;
  display: grid;
  gap: 7px;
}

.ib-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.ib-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ib-stars { color: #d4a017; font-size: 11px; letter-spacing: -.5px; }
.ib-review-badge {
  background: #003580;
  color: white;
  border-radius: 6px;
  padding: 2px 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}
.ib-review-count { font-size: 10px; color: var(--muted); }

.ib-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ib-price {
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.ib-price-unit { font-size: 11px; font-weight: 400; color: var(--muted); }
.ib-tag {
  font-size: 10px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, white);
  border-radius: 999px;
  padding: 2px 7px;
}

.ib-address {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.3;
}

.ib-score-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ib-score-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  white-space: nowrap;
}
.ib-score-bar {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.ib-score-fill { height: 100%; border-radius: 2px; transition: width 400ms ease; }
.ib-score-val {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  min-width: 22px;
  text-align: right;
}

.ib-cta {
  display: block;
  text-align: center;
  padding: 8px;
  background: #003580;
  color: white;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 120ms;
  margin-top: 2px;
}
.ib-cta:hover { background: #00205c; }
