/* ============================================================
   Wallapop Mapper — paneles flotantes sobre el mapa.
   Color: rampa secuencial de un solo tono (azul) para densidad;
   en oscuro se recorre al revés para que "más" siga siendo "más visible".
   ============================================================ */
:root {
  color-scheme: light;
  --bg:        #e8eeed;
  --surface-1: #ffffff;
  --surface-2: #f1f5f4;
  --surface-3: #e3ebe9;
  --border:    #d6e0de;
  --border-soft: rgba(10, 32, 30, .08);

  --text-primary:   #10201e;
  --text-secondary: #48575a;
  --text-muted:     #718286;

  /* Menta de marca. Sobre ella sólo funciona tinta oscura: blanco sobre #3dd2ba
     se queda en 1,89:1, mientras que #04302a da 7,61:1. Para texto teal sobre
     fondo claro va --accent-text, que sí llega a 5,0:1. */
  --accent:      #3dd2ba;
  --accent-hover:#2ec8af;
  --accent-ink:  #04302a;
  --accent-text: #0d7d6d;
  --accent-soft: rgba(61, 210, 186, .15);

  --d1: #2ec8af;
  --d2: #17ab95;
  --d3: #12907e;
  --d4: #0d6f61;
  --d5: #094f46;
  --d-sparse: #94a3a5;
  --zone-ink: #05403a;

  --glass:  rgba(255, 255, 255, .84);
  --glass-2:rgba(255, 255, 255, .70);
  --ring:   rgba(10, 32, 30, .08);
  --shadow-sm: 0 1px 2px rgba(6, 32, 29, .07);
  --shadow:    0 1px 2px rgba(6, 32, 29, .06), 0 8px 20px -8px rgba(6, 32, 29, .18);
  --shadow-lg: 0 1px 2px rgba(6, 32, 29, .07), 0 12px 28px -10px rgba(6, 32, 29, .24), 0 32px 56px -32px rgba(6, 32, 29, .3);

  --r-sm: 9px; --r-md: 13px; --r-lg: 18px; --r-pill: 999px;
  /* El mapa base se atenúa, pero conserva color: en gris puro el mapa parecía
     apagado. Un punto de calidez aparta los verdes de OSM del menta del dato. */
  --tile-filter: saturate(.62) sepia(.06) brightness(1.09) contrast(.88);
  --map-bg: #f4f4f1;
  --tile-opacity: .94;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #08100f;
    --surface-1: #101a19;
    --surface-2: #16211f;
    --surface-3: #1f2c2a;
    --border:    #2a3a38;
    --border-soft: rgba(190, 255, 248, .09);

    --text-primary:   #eef4f3;
    --text-secondary: #adbdbb;
    --text-muted:     #78888a;

    --accent:      #3dd2ba;
    --accent-hover:#5cdcc7;
    --accent-ink:  #04302a;
    --accent-text: #3dd2ba;
    --accent-soft: rgba(61, 210, 186, .16);

    /* La rampa se recorre al revés sobre fondo oscuro: más anuncios, más luz. */
    --d1: #0e6d5f;
    --d2: #149181;
    --d3: #1fb8a0;
    --d4: #3dd2ba;
    --d5: #8fe8d9;
    --d-sparse: #66787a;
    --zone-ink: #eafaf6;

    --glass:  rgba(16, 26, 25, .86);
    --glass-2:rgba(16, 26, 25, .72);
    --ring:   rgba(0, 0, 0, .5);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow:    0 1px 2px rgba(0,0,0,.45), 0 8px 20px -8px rgba(0,0,0,.6);
    --shadow-lg: 0 1px 2px rgba(0,0,0,.5), 0 12px 28px -10px rgba(0,0,0,.65), 0 32px 56px -32px rgba(0,0,0,.8);
    /* 205° en vez de 180°: al invertir, las vías de OSM salían malva y
       competían con el menta; así caen en un coral que lo complementa. */
    --tile-filter: invert(1) hue-rotate(205deg) saturate(.5) brightness(.86) contrast(.9);
    --map-bg: #0d1614;
    --tile-opacity: .84;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #08100f;
  --surface-1: #101a19;
  --surface-2: #16211f;
  --surface-3: #1f2c2a;
  --border:    #2a3a38;
  --border-soft: rgba(190, 255, 248, .09);

  --text-primary:   #eef4f3;
  --text-secondary: #adbdbb;
  --text-muted:     #78888a;

  --accent:      #3dd2ba;
  --accent-hover:#5cdcc7;
  --accent-ink:  #04302a;
  --accent-text: #3dd2ba;
  --accent-soft: rgba(61, 210, 186, .16);

  /* La rampa se recorre al revés sobre fondo oscuro: más anuncios, más luz. */
  --d1: #0e6d5f;
  --d2: #149181;
  --d3: #1fb8a0;
  --d4: #3dd2ba;
  --d5: #8fe8d9;
  --d-sparse: #66787a;
  --zone-ink: #eafaf6;

  --glass:  rgba(16, 26, 25, .86);
  --glass-2:rgba(16, 26, 25, .72);
  --ring:   rgba(0, 0, 0, .5);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow:    0 1px 2px rgba(0,0,0,.45), 0 8px 20px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 1px 2px rgba(0,0,0,.5), 0 12px 28px -10px rgba(0,0,0,.65), 0 32px 56px -32px rgba(0,0,0,.8);
  --tile-filter: invert(1) hue-rotate(205deg) saturate(.5) brightness(.86) contrast(.9);
  --map-bg: #0d1614;
  --tile-opacity: .84;
}

* { box-sizing: border-box; }
/* Las reglas de display por clase ganan a [hidden]; esto lo zanja de una vez. */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv05" 1, "ss01" 1;
  overflow: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 620; letter-spacing: -.014em; }
p { margin: 0; }
/* Ojo: esta regla debe quedarse en la interfaz. Leaflet dibuja los círculos en
   un <svg> dentro de #map y un `svg { width: 18px }` global se los come. */
.overlay svg, .filters svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.brand svg, .search-icon, .pill svg { fill: currentColor; stroke: none; }

/* ---------- mapa ---------- */
/* El mapa base va translúcido sobre este fondo: recuesta el basemap
   sin apagar los datos que van encima. */
#map { position: fixed; inset: 0; background: var(--map-bg); }
.leaflet-container { font: inherit; background: var(--map-bg); }
.leaflet-tile-pane { filter: var(--tile-filter); }
.leaflet-control-zoom { display: none; }
.leaflet-control-attribution {
  background: var(--glass-2) !important;
  backdrop-filter: blur(10px);
  color: var(--text-muted); font-size: 10px;
  border-radius: var(--r-sm) 0 0 0; padding: 2px 7px;
}
.leaflet-control-attribution a { color: var(--text-secondary); }

/* ---------- rejilla de overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 500;
  display: grid;
  grid-template-columns: 380px 1fr;
  grid-template-rows: auto 1fr auto;
  padding: 16px;
  gap: 16px;
  pointer-events: none;
}
.overlay > * { pointer-events: auto; }
.sidebar { grid-row: 1 / 4; min-height: 0; display: flex; }
.stack { display: flex; flex-direction: column; gap: 12px; width: 100%; min-height: 0; }
.map-tools { grid-column: 2; grid-row: 1; justify-self: center; pointer-events: none; }
.map-tools > * { pointer-events: auto; }
.zoom-hint { grid-column: 2; grid-row: 2; align-self: end; justify-self: center; margin-bottom: 4px; }
.legend { grid-column: 2; grid-row: 3; justify-self: end; align-self: end; width: 232px; }
.toast { grid-column: 2; grid-row: 1; justify-self: end; }

/* ---------- superficies ---------- */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.7);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* ---------- marca ---------- */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 10px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  background: linear-gradient(145deg, var(--d2), var(--d4) 65%, var(--d5));
  box-shadow: 0 2px 8px -2px var(--accent), inset 0 1px 0 rgba(255,255,255,.35);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 9px; border-radius: 50%;
  background: var(--surface-1); opacity: .92;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 14.5px; font-weight: 640; letter-spacing: -.02em; }
.brand-text small { font-size: 11.5px; color: var(--text-muted); }
.brand .icon-btn { margin-left: auto; }

/* ---------- controles ---------- */
.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: var(--r-sm); border: 1px solid var(--border-soft);
  background: var(--glass); color: var(--text-secondary);
  cursor: pointer; transition: background .15s, color .15s, transform .15s;
  backdrop-filter: blur(14px);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.icon-btn:active { transform: scale(.95); }
.icon-btn.subtle { background: transparent; border-color: transparent; width: 32px; height: 32px; }
.icon-btn.subtle:hover { background: var(--surface-2); }
.icon-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }

.btn {
  font: inherit; font-weight: 560; font-size: 13.5px;
  padding: 0 15px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: progress; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

input, select {
  font: inherit; font-size: 13.5px; width: 100%;
  color: var(--text-primary); background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  padding: 8px 10px;
}
input::placeholder { color: var(--text-muted); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 28px; cursor: pointer;
}

/* ---------- buscador ---------- */
.search-card { padding: 10px; }
.search-row { display: flex; align-items: center; gap: 6px; position: relative; }
.search-icon { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
#keywords {
  height: 38px; padding-left: 34px; background: transparent; border-color: transparent;
  font-size: 14px; font-weight: 500;
}
#keywords:focus { outline: none; }
.search-row:focus-within { box-shadow: none; }
#keywords::-webkit-search-cancel-button { filter: grayscale(1) opacity(.5); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 4px 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 520; color: var(--text-secondary);
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-pill); padding: 3px 5px 3px 9px;
}
.chip button {
  all: unset; cursor: pointer; display: grid; place-items: center;
  width: 15px; height: 15px; border-radius: 50%; color: var(--text-muted);
  font-size: 13px; line-height: 1;
}
.chip button:hover { background: var(--surface-3); color: var(--text-primary); }

/* ---------- resultados ---------- */
.results { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.results-head { padding: 13px 15px 11px; border-bottom: 1px solid var(--border-soft); }
.results-head h2 { font-size: 13.5px; }
.results-head p { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.results-head .accent { color: var(--accent-text); font-weight: 600; }

.zones { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.zones::-webkit-scrollbar { width: 9px; }
.zones::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 9px; border: 3px solid transparent; background-clip: content-box; }

.zone {
  border-radius: var(--r-md); padding: 9px 10px; cursor: pointer;
  border: 1px solid transparent; transition: background .13s, border-color .13s;
}
.zone + .zone { margin-top: 2px; }
.zone:hover { background: var(--surface-2); }
.zone.active { background: var(--surface-2); border-color: var(--border-soft); }
.zone-top { display: flex; align-items: center; gap: 9px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.zone-title { font-size: 13px; font-weight: 570; letter-spacing: -.01em; }
.zone-count {
  margin-left: auto; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text-secondary); background: var(--surface-2);
  border-radius: var(--r-pill); padding: 2px 8px; white-space: nowrap;
}
.zone.active .zone-count { background: var(--surface-3); }
.zone-sub {
  margin: 4px 0 0 19px; font-size: 11.5px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.zone-items { margin: 9px 0 3px; padding: 0; list-style: none; display: none; }
.zone.active .zone-items { display: block; }
.zone-more { display: none; }
.zone.active .zone-more { display: block; }
.zone-item {
  display: flex; align-items: center; gap: 9px; padding: 5px 4px;
  border-radius: var(--r-sm); text-decoration: none; color: inherit;
}
.zone-item:hover { background: var(--surface-3); }
.zone-item img, .thumb-fallback {
  width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-soft);
}
.zone-item-title {
  font-size: 12px; line-height: 1.32; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.zone-item-price { margin-left: auto; font-size: 12.5px; font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag {
  font-size: 9.5px; font-weight: 620; text-transform: uppercase; letter-spacing: .04em;
  padding: 1px 5px; border-radius: 5px; background: var(--surface-3); color: var(--text-muted);
  vertical-align: 1px;
}

.zone-more {
  width: 100%; margin-top: 2px; padding: 6px;
  font: inherit; font-size: 11.5px; font-weight: 560; color: var(--accent-text);
  background: transparent; border: 0; border-radius: var(--r-sm); cursor: pointer; text-align: left;
}
.zone-more:hover { background: var(--accent-soft); }

.empty { padding: 26px 20px 30px; text-align: center; }
.empty h3 { font-size: 13.5px; margin-bottom: 5px; }
.empty p { font-size: 12px; color: var(--text-muted); }

.skeleton { padding: 8px; }
.skeleton div {
  height: 46px; border-radius: var(--r-md); margin-bottom: 6px;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
  background-size: 220% 100%; animation: shimmer 1.15s linear infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }

/* ---------- píldoras sobre el mapa ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 12.5px; font-weight: 560;
  color: var(--text-primary); background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid var(--border-soft); border-radius: var(--r-pill);
  padding: 8px 15px 8px 12px; cursor: pointer; box-shadow: var(--shadow);
  animation: drop .22s cubic-bezier(.2,.9,.3,1.2);
}
.pill:hover { background: var(--surface-1); }
.pill svg { width: 15px; height: 15px; color: var(--accent-text); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

.zoom-hint {
  font-size: 11.5px; color: var(--text-secondary);
  background: var(--glass); backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft); border-radius: var(--r-pill);
  padding: 6px 13px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 7px;
}
.zoom-hint b { color: var(--text-primary); font-weight: 600; }

.toast {
  max-width: 300px; padding: 10px 13px; font-size: 12.5px;
  background: var(--glass); backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft); border-radius: var(--r-md);
  box-shadow: var(--shadow); color: var(--text-secondary);
}
.toast.error { border-color: #e34948; color: #e34948; }

/* ---------- leyenda ---------- */
.legend { padding: 12px 13px; }
.legend-head { display: flex; align-items: center; gap: 8px; }
.legend h3 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 620; }
.legend .scale {
  margin-left: auto; width: 54px; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--d1), var(--d2), var(--d3), var(--d4), var(--d5));
}
.legend ul { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.legend .swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.legend .swatch.ring {
  background: color-mix(in srgb, var(--d3) 22%, transparent);
  border: 2px solid var(--d3);
}
.legend .swatch.ring.is-dashed { background: none; border: 1.5px dashed var(--d3); opacity: .75; }
/* Eco de la viñeta suelta: cuadrado redondeado, no círculo. */
.legend .swatch.pin-swatch {
  width: 13px; height: 13px; border-radius: 4px;
  background: var(--surface-3); border: 1.5px dashed var(--d-sparse);
}
.legend .swatch.pin-swatch.is-lone { background: transparent; opacity: .8; }
.legend li { align-items: flex-start; }
.legend li .swatch { margin-top: 2px; }
.legend-sub {
  margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--border-soft);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); font-weight: 620;
}
#legend-strokes { margin-top: 7px; }
.legend-note { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border-soft); font-size: 10.5px; line-height: 1.4; color: var(--text-muted); }

/* ---------- filtros ---------- */
.filters {
  position: fixed; z-index: 600; top: 122px; left: 16px; width: 380px;
  padding: 14px; box-shadow: var(--shadow-lg);
  animation: drop .18s ease-out;
}
.filters-head { display: flex; align-items: center; margin-bottom: 12px; }
.filters-head h3 { font-size: 13px; }
.filters-head .icon-btn { margin-left: auto; font-size: 13px; }
.filters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field span { font-size: 11px; font-weight: 540; color: var(--text-muted); }
.filters-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.hint { font-size: 10.5px; line-height: 1.4; color: var(--text-muted); }
.filters-foot .btn { margin-left: auto; }

/* ---------- marcas del mapa ---------- */
.zone-circle { filter: drop-shadow(0 1px 3px rgba(6, 32, 29, .22)); }

/* La cifra es la etiqueta del círculo: va centrada en él y escalada a su
   tamaño, no es una chapa aparte. El halo la despega del mapa base. */
.zone-count-icon { pointer-events: none; }
.zone-count-label {
  display: grid; place-items: center;
  width: var(--size); height: var(--size); border-radius: 50%;
  font: 700 var(--fs)/1 Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  color: var(--zone-ink);
  text-shadow: 0 0 3px var(--map-bg), 0 0 8px var(--map-bg), 0 1px 2px var(--map-bg);
  transition: transform .14s;
}
/* Zona demasiado pequeña para albergar la cifra: el círculo se resuelve como
   disco sólido y el número va dentro. */
.zone-count-label.is-dot {
  background: var(--c); color: var(--ink);
  border: 2px solid var(--map-bg);
  box-shadow: 0 2px 6px rgba(6, 32, 29, .3);
  text-shadow: none; pointer-events: auto; cursor: pointer;
}
.zone-count-label.is-dot:hover { transform: scale(1.12); }

/* Zona ampliada: chapa de trazo discontinuo, a juego con el círculo que la
   acompaña, para que la cifra no quede suelta en medio de un área enorme. */
.zone-count-label.is-widened {
  background: var(--glass); border: 1.5px dashed var(--c);
  color: var(--text-secondary); font-weight: 620;
  backdrop-filter: blur(4px); box-shadow: var(--shadow-sm);
  text-shadow: none; pointer-events: auto; cursor: pointer;
}

/* viñeta de anuncio: posición decorativa dentro de la zona, no la real */
/* Anuncio suelto (por debajo del mínimo de la zona): trazo discontinuo para
   avisar de que ni siquiera hay zona, sólo provincia. */
.pin.is-loose .pin-inner {
  box-shadow: 0 2px 6px rgba(6, 32, 29, .28), 0 0 0 2px var(--map-bg);
  outline: 1.5px dashed var(--d-sparse); outline-offset: 1px;
}
.pin.is-loose .pin-price { background: linear-gradient(transparent, rgba(0,0,0,.75) 55%); }

.pin { transition: transform .16s cubic-bezier(.2,.9,.3,1.3); }
.pin:hover { transform: translateY(-3px) scale(1.06); z-index: 1000; }
.pin-inner {
  position: relative; width: 46px; height: 46px; border-radius: 12px;
  background: var(--surface-1); overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.3), 0 0 0 2px var(--surface-1);
}
.pin-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin-price {
  position: absolute; left: 0; right: 0; bottom: 0;
  font: 620 9.5px/1 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.82) 55%);
  padding: 9px 3px 3px; text-align: center;
}

/* ---------- popup ---------- */
.leaflet-popup-content-wrapper {
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.7);
  color: var(--text-primary); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 4px;
}
.leaflet-popup-tip { background: var(--surface-1); border: 1px solid var(--border-soft); }
.leaflet-popup-content { margin: 11px 12px; width: 262px !important; font-size: 13px; }
.leaflet-popup-close-button { color: var(--text-muted) !important; padding: 8px 8px 0 0 !important; }
.popup h3 { font-size: 13px; }
.popup-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.popup ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 218px; overflow-y: auto; }
.popup .disclaimer {
  margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--border-soft);
  font-size: 10px; color: var(--text-muted);
}
.popup-item { display: flex; gap: 10px; }
.popup-item img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-3); }
.popup-item .meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.popup-item a { color: inherit; text-decoration: none; font-weight: 560; font-size: 12.5px; line-height: 1.3; }
.popup-item a:hover { text-decoration: underline; }
.popup-item .price { font-size: 15px; font-weight: 660; letter-spacing: -.02em; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .overlay { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; padding: 10px; gap: 10px; }
  .sidebar { grid-row: 1; }
  .stack { max-height: 62vh; }
  .map-tools, .zoom-hint, .toast { grid-column: 1; }
  .map-tools { grid-row: 2; align-self: start; }
  .zoom-hint { grid-row: 3; justify-self: center; }
  .legend { display: none; }
  .filters { left: 10px; right: 10px; width: auto; top: 116px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
