/* =========================================================
   Midnight 1911 · map page (map.html)
   Property map on Leaflet, restyled for «ნეონის ნუარი».
   Reads site.css tokens only. Loaded after leaflet.css.
   ========================================================= */

/* ---------- hero: counts strip ---------- */
/* shorter than the default page hero so the map starts near the fold */
.phero--map { min-height: clamp(320px, 42vh, 460px); }
.phero--map .phero__inner { padding-block: 28px clamp(28px, 4vw, 44px); }
.phero--map .phero__title { max-width: none; font-size: clamp(40px, 5.6vw, 80px); }
.phero--map .phero__actions { margin-top: 22px; }
@media (min-width: 1024px) {
  .phero--map .phero__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 48px; }
  .phero--map .phero__inner > * { grid-column: 1; }
  .phero--map .phero__inner > .mstats { grid-column: 2; grid-row: 1 / span 5; align-self: end; margin: 0; }
}
.mstats {
  margin: 30px 0 0; display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, auto);
  border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; position: relative;
  background: color-mix(in srgb, var(--ink-0) 76%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.mstats::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--edge); opacity: .8; }
.mstats__cell { display: flex; flex-direction: column-reverse; gap: 2px; padding: 12px 22px; min-width: 0; }
.mstats__cell + .mstats__cell { border-left: 1px solid var(--line); }
.mstats dt { font-size: 13px; font-weight: 600; color: var(--steel-2); }
.mstats dd { margin: 0; font-size: 30px; line-height: 1.05; }
@media (max-width: 420px) {
  .mstats { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .mstats__cell { padding: 10px 12px; }
  .mstats dd { font-size: 26px; }
}

/* ---------- section ---------- */
.mapsec { position: relative; padding-block: clamp(28px, 4vw, 48px) clamp(72px, 9vw, 128px); }

/* toolbar: chips + region + search + tone */
.mtools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.mtools__fields { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1 1 520px; justify-content: flex-end; min-width: 0; }
.mselect, .msearch { position: relative; display: flex; align-items: center; min-width: 0; }
.mselect .ico, .msearch .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--steel-3); pointer-events: none;
}
.mselect { flex: 0 1 230px; }
.msearch { flex: 1 1 240px; max-width: 380px; }
.mselect select, .msearch input {
  width: 100%; min-height: 46px; padding: 0 16px 0 42px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--ink-1); color: var(--steel-0);
  font: 500 15px/1.2 var(--font-sans); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
.mselect select {
  padding-right: 40px; cursor: pointer; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--steel-2) 50%), linear-gradient(135deg, var(--steel-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.mselect select option { background: var(--ink-2); color: var(--steel-0); }
.msearch input::placeholder { color: var(--steel-3); }
.mselect select:focus, .msearch input:focus { border-color: color-mix(in srgb, var(--teal) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 16%, transparent); }
.mselect select:focus-visible, .msearch input:focus-visible { outline: none; }
.mtone { min-height: 46px; }
.mmeta { margin: 14px 0 12px; min-height: 22px; font-size: 13.5px; color: var(--steel-3); }
.mmeta b { font-family: var(--font-num); font-weight: 600; color: var(--tube-teal); }

/* ---------- layout: map + side list ---------- */
.mlayout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 20px; align-items: stretch; }
.mapframe, .mside { height: clamp(540px, 76vh, 880px); }

/* ---------- map frame ---------- */
.mapframe {
  position: relative; isolation: isolate; overflow: hidden; min-width: 0;
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--ink-film); box-shadow: var(--shadow-card);
}
.mapframe::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; z-index: 1100; pointer-events: none;
  background: var(--edge);
}
.mapframe__stage { position: absolute; inset: 0; }
/* keyboard skip past the 141 map markers; hidden until focused */
.mskip {
  position: absolute; left: 12px; top: 12px; z-index: 1200;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--teal) 60%, transparent);
  background: var(--ink-0); color: var(--tube-teal); font-weight: 600; font-size: 14px; text-decoration: none;
}
.mskip:not(:focus) { width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mskip[hidden] { display: none; }
.mside__title:focus { outline: none; }
.mside__title:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.mapframe.is-adding .mapframe__stage, .mapframe.is-adding .leaflet-container { cursor: crosshair; }

.mapframe__legend, .mapframe__info {
  position: absolute; z-index: 1000; pointer-events: none;
  border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px;
  background: color-mix(in srgb, var(--ink-0) 80%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13px; color: var(--steel-1);
}
.mapframe__legend { left: 12px; bottom: 12px; display: grid; gap: 6px; }
.mapframe__info { right: 12px; top: 14px; display: grid; gap: 2px; max-width: 230px; }
.mapframe__info b { font-size: 13.5px; color: var(--steel-0); }
.mapframe__info span { font-weight: 600; color: var(--tube-teal); }
.mlg { display: inline-flex; align-items: center; gap: 9px; }
.mlg__dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid var(--tube); background: var(--ink-0); box-shadow: var(--glow-teal-soft); }
.mlg__dot--sale { --tube: var(--teal); }
.mlg__dot--free { --tube: var(--red); box-shadow: var(--glow-red-soft); }
.mapframe__note {
  position: absolute; z-index: 1000; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(360px, calc(100% - 32px)); padding: 14px 16px; text-align: center;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--red) 50%, transparent);
  background: color-mix(in srgb, var(--ink-0) 88%, transparent); color: var(--steel-1); font-size: 14px;
}
.mapframe__note[hidden] { display: none; }
.mapframe__error {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 24px; text-align: center; color: var(--steel-1);
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, color-mix(in srgb, var(--red) 12%, transparent), transparent),
    var(--ink-1);
}
.mapframe__error .ico { width: 40px; height: 40px; color: var(--tube-red); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--red) 50%, transparent)); }
.mapframe__error p { max-width: 38ch; font-size: 15px; }
.mapframe__error b { display: block; font-size: 18px; color: var(--steel-0); margin-bottom: 4px; }
.mapframe.is-failed .mapframe__legend, .mapframe.is-failed .mapframe__info { display: none; }

/* ---------- Leaflet, restyled ---------- */
.mapframe .leaflet-container {
  background: var(--ink-film); font-family: var(--font-sans); font-size: 14px; color: var(--steel-1);
  outline-offset: -2px;
}
.mapframe .leaflet-container:focus-visible { outline: 2px solid var(--focus); }
/* night tint over the sepia paper map; the tone toggle switches it off */
.mapframe .leaflet-tile-pane { filter: sepia(.35) hue-rotate(150deg) saturate(.55) brightness(.6) contrast(1.12); transition: filter .4s var(--ease); }
.mapframe.is-day .leaflet-tile-pane { filter: none; }

/* zoom */
.mapframe .leaflet-touch .leaflet-bar, .mapframe .leaflet-bar {
  border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden;
  background: var(--ink-1); box-shadow: 0 10px 24px -12px var(--ink-film);
}
.mapframe .leaflet-touch .leaflet-bar a, .mapframe .leaflet-bar a {
  width: 42px; height: 42px; line-height: 40px; font: 500 22px/40px var(--font-num);
  background: var(--ink-1); color: var(--steel-0); border-bottom: 1px solid var(--line);
  transition: background-color .2s, color .2s;
}
.mapframe .leaflet-bar a:last-child { border-bottom: 0; }
.mapframe .leaflet-bar a:hover, .mapframe .leaflet-bar a:focus-visible { background: var(--ink-3); color: var(--tube-teal); }
.mapframe .leaflet-bar a:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; border-radius: 10px; }
.mapframe .leaflet-bar a.leaflet-disabled { background: var(--ink-1); color: var(--steel-4); }
.mapframe .leaflet-top.leaflet-left .leaflet-control { margin: 14px 0 0 12px; }

/* attribution (Map © Rockstar Games stays visible) */
.mapframe .leaflet-control-attribution {
  display: flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; margin: 0 !important;
  border-top-left-radius: 10px; background: color-mix(in srgb, var(--ink-0) 82%, transparent);
  color: var(--steel-2); font-size: 11.5px; line-height: 1.3;
}
.mapframe .leaflet-control-attribution a { display: inline-flex; align-items: center; min-height: 30px; color: var(--tube-teal); text-decoration: none; }
.mapframe .leaflet-control-attribution a:hover { color: var(--white); text-decoration: underline; }
.mapframe .leaflet-control-attribution svg { display: none !important; }

/* markers: neon blips, centred on the coordinate, 40px hit area */
.mk-wrap { background: none; border: 0; border-radius: 50%; }
.mk-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.mk { --tube: var(--teal); width: 40px; height: 40px; display: grid; place-items: center; }
.mk--free { --tube: var(--red); }
.mk--premium { --tube: var(--amber); }
.mk--sold { --tube: var(--steel-3); }
.mk__blip {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--tube); color: color-mix(in srgb, var(--tube) 45%, var(--white));
  background: color-mix(in srgb, var(--ink-0) 82%, transparent);
  box-shadow: 0 0 0 1px var(--ink-film), 0 0 10px color-mix(in srgb, var(--tube) 55%, transparent);
  transition: transform .16s var(--ease), background-color .16s, box-shadow .16s, color .16s;
}
.mk__blip svg { width: 13px; height: 13px; fill: currentColor; display: block; }
.mk-wrap:hover .mk__blip, .mk-wrap:focus-visible .mk__blip { transform: scale(1.22); }
.mk.is-active .mk__blip {
  background: var(--tube); color: var(--ink-0); transform: scale(1.28);
  box-shadow: 0 0 0 2px var(--ink-film), 0 0 6px var(--tube), 0 0 22px color-mix(in srgb, var(--tube) 70%, transparent);
}

/* popups */
.mapframe .leaflet-popup-content-wrapper {
  position: relative; overflow: hidden; border-radius: 14px; padding: 0;
  background: linear-gradient(170deg, var(--ink-3), var(--ink-1) 70%); color: var(--steel-1);
  border: 1px solid var(--line-2); box-shadow: 0 24px 48px -20px var(--ink-film), var(--glow-teal-soft);
}
.mapframe .leaflet-popup-content-wrapper::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--edge); }
.mapframe .leaflet-popup-tip { background: var(--ink-1); border: 1px solid var(--line-2); box-shadow: none; }
.mapframe .leaflet-popup-content { margin: 14px 44px 16px 16px; line-height: 1.45; font-size: 14px; }
.mapframe .leaflet-container a.leaflet-popup-close-button {
  top: 4px; right: 4px; width: 40px; height: 40px; display: grid; place-items: center;
  font: 400 24px/1 var(--font-sans); color: var(--steel-2); border-radius: 10px;
}
.mapframe .leaflet-container a.leaflet-popup-close-button:hover { color: var(--white); background: var(--ink-4); }
.pp__name { font-size: 16px; font-weight: 700; color: var(--steel-0); line-height: 1.3; }
.pp__meta { margin-top: 4px; color: var(--steel-2); font-size: 13.5px; }
.pp__price { margin-top: 6px; font-weight: 600; color: var(--tube-teal); }
.pp__btn { margin-top: 12px; }

/* ---------- side list ---------- */
.mside {
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: linear-gradient(170deg, var(--ink-2), var(--ink-1) 60%);
}
.mside::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--edge); }
.mside__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.mside__title { font-size: 20px; font-weight: 800; font-stretch: 78%; color: var(--steel-0); }
.mside__n { font-family: var(--font-num); font-size: 14px; color: var(--steel-2); font-variant-numeric: tabular-nums; }
.plist {
  list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent;
}
.plist::-webkit-scrollbar { width: 8px; }
.plist::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 8px; }
.plist > li + li { border-top: 1px solid var(--line-soft); }
.plist__empty { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; color: var(--steel-3); text-align: center; }
.plist__empty .ico { width: 26px; height: 26px; }

.pitem {
  --tube: var(--teal);
  position: relative; width: 100%; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 16px;
  border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer;
  transition: background-color .2s;
}
.pitem--free { --tube: var(--red); }
.pitem--premium { --tube: var(--amber); }
.pitem--sold { --tube: var(--steel-3); }
.pitem::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px;
  background: var(--tube); box-shadow: 0 0 10px var(--tube); opacity: 0; transition: opacity .2s;
}
.pitem:hover, .pitem.is-active { background: color-mix(in srgb, var(--tube) 7%, transparent); }
.pitem:hover::before, .pitem.is-active::before { opacity: 1; }
.pitem:focus-visible { outline-offset: -3px; }
.pitem__media {
  position: relative; width: 56px; height: 56px; flex: none; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--tube) 35%, transparent);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--tube) 16%, transparent), var(--ink-film) 75%);
  color: color-mix(in srgb, var(--tube) 50%, var(--white));
}
.pitem__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pitem__media.has-img .pitem__ph { visibility: hidden; }
.pitem__ph .ico { width: 24px; height: 24px; }
.pitem__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pitem__title { font-size: 15px; font-weight: 700; color: var(--steel-0); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem__loc { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--steel-2); min-width: 0; }
.pitem__loc .ico { width: 14px; height: 14px; color: var(--steel-3); }
.pitem__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.pitem__price { font-size: 13px; font-weight: 600; color: var(--tube-teal); }

/* admin tools (local to this browser) */
.madmin { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--ink-1); }
.madmin .btn[hidden] { display: none; }
.madmin .btn[aria-pressed="true"] { border-color: color-mix(in srgb, var(--teal) 65%, transparent); color: var(--tube-teal); box-shadow: inset 0 0 12px color-mix(in srgb, var(--teal) 14%, transparent); }

/* ---------- detail / edit dialog ---------- */
.pdlg {
  --tube: var(--teal);
  width: min(560px, calc(100% - 32px)); max-height: min(92vh, 92svh); padding: 0; overflow: auto;
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: linear-gradient(170deg, var(--ink-3), var(--ink-1) 55%); color: var(--steel-1);
  box-shadow: 0 40px 90px -30px var(--ink-film);
  overscroll-behavior: contain;
}
.pdlg::backdrop { background: color-mix(in srgb, var(--ink-film) 78%, transparent); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.pdlg[open] { display: block; }
.pdlg__close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass); color: var(--steel-0);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pdlg__close:hover { border-color: color-mix(in srgb, var(--teal) 60%, transparent); }
.pdlg__close .ico { width: 22px; height: 22px; }

.pdlg__media {
  position: relative; aspect-ratio: 16 / 8; overflow: hidden; display: grid; place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 55% 70% at 50% 100%, color-mix(in srgb, var(--tube) 22%, transparent), transparent 70%),
    linear-gradient(to bottom, var(--ink-film), var(--ink-2));
}
.pdlg__media::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--edge); z-index: 2; }
.pdlg__media--free { --tube: var(--red); }
.pdlg__media--premium { --tube: var(--amber); }
.pdlg__media--sold { --tube: var(--steel-3); }
.pdlg__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pdlg__media img[hidden], .pdlg__ph[hidden] { display: none; }
.pdlg__ph { color: color-mix(in srgb, var(--tube) 45%, var(--white)); }
.pdlg__ph .ico { width: 72px; height: 72px; filter: drop-shadow(0 0 6px var(--tube)) drop-shadow(0 0 22px color-mix(in srgb, var(--tube) 55%, transparent)); }
.pdlg__badge { position: absolute; left: 16px; top: 16px; z-index: 2; background: color-mix(in srgb, var(--ink-0) 70%, transparent); }
.pdlg__gal { display: flex; gap: 8px; padding: 10px 16px 0; overflow-x: auto; }
.pdlg__gal[hidden] { display: none; }
.pdlg__th { flex: none; width: 76px; height: 52px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: var(--ink-film); opacity: .7; }
.pdlg__th img { width: 100%; height: 100%; object-fit: cover; }
.pdlg__th:hover, .pdlg__th.is-active { opacity: 1; }
.pdlg__th.is-active { border-color: var(--teal); }

.pdlg__body { padding: 22px 24px 24px; }
.pdlg__name { padding-right: 48px; font-size: clamp(26px, 5vw, 34px); font-weight: 800; font-stretch: 66%; line-height: 1.1; color: var(--steel-0); }
#viewMode .pdlg__name { padding-right: 0; }
.pdlg__loc { margin-top: 6px; display: flex; align-items: center; gap: 6px; color: var(--steel-2); font-size: 14.5px; }
.pdlg__loc .ico { width: 16px; height: 16px; color: var(--steel-3); }
.pdlg__row { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pdlg__price { font-size: 20px; font-weight: 700; color: var(--tube-teal); text-shadow: var(--glow-teal-soft); }
.pdlg__desc { margin-top: 12px; color: var(--steel-2); font-size: 15px; }
.pdlg__feat { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.pdlg__feat[hidden] { display: none; }
.pdlg__chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--ink-1); color: var(--steel-1); font-size: 13.5px;
}
.pdlg__chip .ico { width: 15px; height: 15px; color: var(--steel-3); }
.pdlg__actions { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pdlg__actions .btn[hidden] { display: none; }
.pdlg__spacer { flex: 1; }

/* edit form */
.pdlg__form { padding-top: 26px; }
.pdlg__form[hidden], #viewMode[hidden] { display: none; }
.pdlg__form .pdlg__name { margin-bottom: 16px; }
.prow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pfield { margin-bottom: 12px; min-width: 0; }
.pfield label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--steel-2); }
.pfield input, .pfield select, .pfield textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--ink-1); color: var(--steel-0);
  font: 500 16px/1.3 var(--font-sans); outline: none; transition: border-color .2s, box-shadow .2s;
}
.pfield textarea { resize: vertical; min-height: 80px; }
.pfield select option { background: var(--ink-2); }
.pfield input:focus, .pfield select:focus, .pfield textarea:focus { border-color: color-mix(in srgb, var(--teal) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 16%, transparent); }
@media (max-width: 479px) { .prow { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* ---------- toast ---------- */
.mtoast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 70;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 55%, transparent);
  background: color-mix(in srgb, var(--ink-0) 92%, transparent); color: var(--steel-0);
  font-size: 14.5px; font-weight: 600; box-shadow: var(--glow-teal-soft);
  transform: translate(-50%, 16px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s;
}
.mtoast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
  .mlayout { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 1023px) {
  .mlayout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .mapframe { height: clamp(380px, 64vh, 620px); height: clamp(380px, 64svh, 620px); }
  .mside { height: auto; max-height: 76vh; max-height: 76svh; }
  .mtools__fields { justify-content: flex-start; flex-basis: 100%; }
  .msearch { max-width: none; }
}
@media (max-width: 719px) {
  /* phones: the map runs edge to edge; legend + info move under it */
  .mlayout { margin-inline: calc(-1 * var(--gutter)); }
  .mside { margin-inline: var(--gutter); }
  .mapframe {
    display: flex; flex-direction: column; height: auto; overflow: visible;
    border-radius: 0; border-inline: 0; background: var(--ink-1);
  }
  .mapframe__stage { position: relative; inset: auto; height: clamp(360px, 62vh, 560px); height: clamp(360px, 62svh, 560px); overflow: hidden; }
  .mapframe__legend, .mapframe__info {
    position: static; max-width: none; border: 0; border-radius: 0; background: none;
    backdrop-filter: none; -webkit-backdrop-filter: none; padding: 10px var(--gutter);
  }
  .mapframe__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; border-top: 1px solid var(--line); }
  .mapframe__info { display: flex; flex-wrap: wrap; gap: 4px 10px; padding-top: 0; padding-bottom: 12px; }
  .mapframe__info b { font-weight: 600; color: var(--steel-1); }
  .mtools__fields { gap: 8px; }
  .mselect { flex: 1 1 100%; }
  .msearch { flex: 1 1 0; max-width: none; }
  /* tone toggle shrinks to an icon button beside the search box */
  .mtone { flex: none; width: 46px; padding: 0; justify-content: center; border-radius: 12px; }
  .mtone .ico { width: 20px; height: 20px; }
  .mtone__t { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 399px) {
  #filters { gap: 6px; flex-wrap: nowrap; }
  #filters .chip { padding: 0 11px; gap: 5px; font-size: 13.5px; min-width: 0; }
  #filters .chip .ico { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .pdlg[open] { animation: pdlg-in .24s var(--ease) both; }
  .pdlg[open]::backdrop { animation: fade-in .24s var(--ease) both; }
}
@keyframes pdlg-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  .mk__blip, .pitem, .pitem::before, .mapframe .leaflet-tile-pane, .mtoast { transition: none; }
  .mk-wrap:hover .mk__blip, .mk-wrap:focus-visible .mk__blip { transform: none; }
  .mk.is-active .mk__blip { transform: none; }
}
