/*
 * Leonida interactive map - styles.
 * Everything is scoped under .lmap so it can sit inside a WordPress/Elementor page.
 * Colours and fonts follow the site's own tokens (--gp-*, --font-*) when they exist
 * and fall back to the same values on a standalone page.
 */

.lmap {
  --lm-sea: #00a9c7;                                  /* replaced from map-config.json */
  --lm-night: var(--gp-night, #1b1a2f);
  --lm-surface: var(--gp-surface, #252644);
  --lm-elev: var(--gp-elev, #38365d);
  --lm-text: var(--gp-text, #ffffff);
  --lm-muted: var(--gp-muted, #d9d1f6);
  --lm-pink: var(--gp-pink, #ffb2c6);
  --lm-orange: var(--gp-orange, #ffad36);
  --lm-lime: var(--gp-lime, #e6ffa3);
  --lm-line: rgba(255, 255, 255, .1);
  --lm-display: var(--font-display, "Oswald"), "Arial Narrow", "Helvetica Neue", sans-serif;
  --lm-body: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --lm-shadow: 0 6px 20px rgba(10, 9, 24, .35);
  --lm-panel: 320px;

  position: relative;
  display: grid;
  grid-template-columns: var(--lm-panel) minmax(0, 1fr);
  width: 100%;
  height: min(82vh, 860px);
  min-height: 480px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(230, 255, 163, .22);
  border-radius: 20px;
  background: var(--lm-night);
  color: var(--lm-text);
  font: 400 14px/1.45 var(--lm-body);
  text-align: left;
  direction: ltr;
  -webkit-text-size-adjust: 100%;
}
.lmap,
.lmap *,
.lmap *::before,
.lmap *::after { box-sizing: border-box; }
.lmap p,
.lmap li { font-family: var(--lm-body); line-height: 1.45; letter-spacing: normal; text-transform: none; }

/* Full-page use (index.html) and full screen */
.lmap.lmap--page { height: 100vh; height: 100dvh; min-height: 0; border: 0; border-radius: 0; }
.lmap:fullscreen { border: 0; border-radius: 0; }
.lmap:-webkit-full-screen { border: 0; border-radius: 0; width: 100%; height: 100%; }
.lmap.lmap--pseudo-full {
  position: fixed; inset: 0; z-index: 2147483000;
  width: auto; height: auto; min-height: 0; border: 0; border-radius: 0;
}
html.lmap-lock, html.lmap-lock body { overflow: hidden !important; }

.lmap.lmap--closed { grid-template-columns: 0 minmax(0, 1fr); }
.lmap.lmap--narrow { grid-template-columns: minmax(0, 1fr); }

/* ---------------------------------------------------------------------------
   Buttons. A host theme usually styles every <button>, including :hover and
   :focus. These rules pin all of that down once; each component then only sets
   the --b-* variables, which a theme cannot reach.
   ------------------------------------------------------------------------ */
.lmap button.lm-b,
.lmap button.lm-b:hover,
.lmap button.lm-b:focus,
.lmap button.lm-b:active {
  -webkit-appearance: none; appearance: none;
  display: var(--b-display, inline-flex); align-items: center; justify-content: var(--b-justify, flex-start);
  gap: var(--b-gap, 8px);
  width: var(--b-width, auto); min-width: 0; max-width: 100%;
  height: var(--b-height, auto); min-height: 0;
  margin: 0; padding: var(--b-pad, 0);
  border: var(--b-border, 0); border-radius: var(--b-radius, 0);
  background: var(--b-bg, transparent); color: var(--b-fg, inherit);
  box-shadow: var(--b-shadow, none);
  font: var(--b-weight, 500) var(--b-size, 14px)/var(--b-lh, 1.45) var(--lm-body);
  letter-spacing: normal; text-transform: none; text-decoration: var(--b-deco, none); text-align: left;
  white-space: normal; cursor: pointer; transform: none; opacity: 1; outline: 0;
  transition: background-color .12s ease, color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.lmap button.lm-b:focus-visible { outline: 2px solid var(--lm-lime); outline-offset: 2px; }
.lmap svg { display: block; flex: none; fill: currentColor; }

/* ---------------------------------------------------------------------------
   Panel: search, category filters, list of places
   ------------------------------------------------------------------------ */
.lmap .lmap__panel {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  background: var(--lm-night);
  border-right: 1px solid var(--lm-line);
}
.lmap .lmap__panel::before {                           /* the site's sunset gradient, as a rule */
  content: ""; flex: none; height: 3px;
  background: var(--gp-grad, linear-gradient(135deg, #ffb2c6 0%, #ffad36 50%, #e6ffa3 100%));
}
.lmap.lmap--closed .lmap__panel { visibility: hidden; }

.lmap .lmap__head { flex: none; padding: 16px 16px 4px; }
.lmap .lmap__title,
.lmap h1.lmap__title,
.lmap h2.lmap__title {
  margin: 0 0 14px; padding: 0;
  font: 600 26px/1 var(--lm-display); letter-spacing: .03em; text-transform: uppercase;
  color: var(--lm-text);
}
.lmap .lmap__back,
.lmap a.lmap__back,
.lmap a.lmap__back:hover {
  display: inline-block; margin: 0 0 10px;
  color: var(--lm-muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
}
.lmap a.lmap__back:hover { color: var(--lm-text); }

.lmap .lmap__search { position: relative; display: block; margin: 0; }
.lmap .lmap__search svg {
  position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  color: var(--lm-muted); pointer-events: none;
}
.lmap input.lmap__q,
.lmap input.lmap__q:hover,
.lmap input.lmap__q:focus {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 44px; margin: 0; padding: 0 12px 0 40px;
  border: 1px solid var(--lm-line); border-radius: 12px;
  background: var(--lm-surface); color: var(--lm-text);
  font: 400 16px/1.2 var(--lm-body); letter-spacing: normal;
  box-shadow: none; outline: 0;
}
.lmap input.lmap__q:focus { border-color: var(--lm-lime); }
.lmap input.lmap__q::placeholder { color: var(--lm-muted); opacity: .7; }
.lmap input.lmap__q::-webkit-search-cancel-button { -webkit-appearance: none; }

.lmap .lmap__cats { flex: none; display: grid; gap: 2px; padding: 10px 8px 8px; }
.lmap .lmap__cat {
  --b-display: flex; --b-width: 100%; --b-pad: 7px 8px; --b-radius: 10px; --b-gap: 10px;
  --b-weight: 500; --b-size: 13.5px; --b-lh: 1.25;
}
.lmap .lmap__cat:hover { --b-bg: var(--lm-surface); }
.lmap .lmap__cat span.lmap__label { flex: 1 1 auto; min-width: 0; }
.lmap .lmap__cat span.lmap__num {
  flex: none; min-width: 26px; padding: 2px 7px; border-radius: 999px;
  background: var(--lm-surface); color: var(--lm-muted);
  font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums;
}
.lmap .lmap__cat:hover span.lmap__num { background: var(--lm-elev); }
.lmap .lmap__cat[aria-pressed="false"] { --b-fg: rgba(217, 209, 246, .55); }
.lmap .lmap__cat[aria-pressed="false"] .lmap__badge { background: var(--lm-elev); color: rgba(255, 255, 255, .45); }
.lmap .lmap__cat[aria-pressed="false"] .lmap__label { text-decoration: line-through; text-decoration-color: rgba(217, 209, 246, .4); }

.lmap .lmap__badge {
  flex: none; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--c, #8b8ba7); color: var(--g, #fff);
}
.lmap .lmap__badge svg { width: 14px; height: 14px; }

.lmap .lmap__status {
  flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0; padding: 10px 16px 8px; border-top: 1px solid var(--lm-line);
  color: var(--lm-muted); font-size: 12.5px;
}
.lmap .lmap__reset { --b-fg: var(--lm-lime); --b-weight: 600; --b-size: 12.5px; --b-deco: underline; text-underline-offset: 3px; }
.lmap .lmap__reset[hidden] { display: none; }

.lmap ul.lmap__list {
  flex: 1 1 auto; min-height: 0; margin: 0; padding: 0 8px 12px;
  list-style: none; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--lm-elev) transparent;
}
.lmap ul.lmap__list > li { margin: 0; padding: 0; list-style: none; }
.lmap ul.lmap__list > li::before { content: none; }
.lmap .lmap__item { --b-display: flex; --b-width: 100%; --b-pad: 8px; --b-radius: 10px; --b-gap: 10px; }
.lmap .lmap__item:hover { --b-bg: var(--lm-surface); }
.lmap .lmap__item[aria-current="true"] { --b-bg: var(--lm-elev); }
.lmap .lmap__item span.lmap__text { min-width: 0; display: grid; }
.lmap .lmap__item span.lmap__name { font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--lm-text); overflow-wrap: anywhere; }
.lmap .lmap__item span.lmap__meta { font-size: 12px; line-height: 1.35; color: var(--lm-muted); opacity: .85; }
.lmap .lmap__empty { margin: 0; padding: 18px 16px; color: var(--lm-muted); font-size: 13.5px; line-height: 1.5; }

/* ---------------------------------------------------------------------------
   Stage: the map and what floats on it
   ------------------------------------------------------------------------ */
.lmap .lmap__stage { position: relative; min-width: 0; min-height: 0; background: var(--lm-sea); }
.lmap .lmap__map { position: absolute; inset: 0; background: var(--lm-sea); }
.lmap .leaflet-container { background: var(--lm-sea); font: inherit; outline: 0; }
.lmap .leaflet-container:focus-visible { outline: 2px solid var(--lm-lime); outline-offset: -2px; }
/* Adjacent tiles add up instead of leaving hairline gaps at half zoom levels. */
.lmap .leaflet-container img.leaflet-tile { mix-blend-mode: plus-lighter; }

.lmap .lmap__toggle {
  position: absolute; left: 12px; top: 12px; z-index: 1000;
  --b-height: 40px; --b-pad: 0 14px 0 11px; --b-radius: 12px; --b-weight: 600;
  --b-bg: var(--lm-night); --b-fg: var(--lm-text); --b-shadow: var(--lm-shadow);
}
.lmap .lmap__toggle:hover { --b-bg: var(--lm-elev); }
.lmap .lmap__toggle svg { width: 18px; height: 18px; }
.lmap:not(.lmap--closed):not(.lmap--narrow) .lmap__toggle { --b-pad: 0 11px; }
.lmap:not(.lmap--closed):not(.lmap--narrow) .lmap__toggle span { display: none; }

.lmap .lmap__msg {
  position: absolute; inset: 0; z-index: 1100; display: grid; place-content: center; gap: 6px;
  margin: 0; padding: 24px; background: var(--lm-night); color: var(--lm-muted);
  font-size: 15px; line-height: 1.5; text-align: center;
}
.lmap .lmap__msg strong { color: var(--lm-text); font-weight: 600; }
.lmap .lmap__msg[hidden] { display: none; }

.lmap .lmap__toast {
  position: absolute; left: 50%; top: 14px; z-index: 1050;
  max-width: calc(100% - 24px); padding: 9px 14px; border-radius: 999px;
  background: var(--lm-night); color: var(--lm-text); box-shadow: var(--lm-shadow);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.lmap .lmap__toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.lmap .lmap__toast b { color: var(--lm-lime); font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Leaflet controls, dressed for the site */
.lmap .leaflet-top.leaflet-right .leaflet-control { margin: 12px 12px 0 0; }
.lmap .leaflet-bar { border: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--lm-shadow); }
.lmap .leaflet-bar a,
.lmap .leaflet-bar a:hover,
.lmap .leaflet-bar a:focus {
  display: grid; place-items: center;
  width: 40px; height: 40px; margin: 0; padding: 0;
  border: 0; border-bottom: 1px solid var(--lm-line); border-radius: 0;
  background: var(--lm-night); color: var(--lm-text);
  font: 500 22px/1 var(--lm-body); text-decoration: none; text-indent: 0;
}
.lmap .leaflet-bar a:last-child { border-bottom: 0; }
.lmap .leaflet-bar a:hover { background: var(--lm-elev); }
.lmap .leaflet-bar a:focus-visible { outline: 2px solid var(--lm-lime); outline-offset: -2px; }
.lmap .leaflet-bar a.leaflet-disabled,
.lmap .leaflet-bar a.leaflet-disabled:hover { background: var(--lm-night); color: rgba(255, 255, 255, .28); cursor: default; }
.lmap .leaflet-bar a svg { width: 18px; height: 18px; }

.lmap .leaflet-control-attribution,
.lmap .leaflet-container .leaflet-control-attribution {
  margin: 0; padding: 3px 9px; border-radius: 9px 0 0 0;
  background: rgba(27, 26, 47, .78); color: var(--lm-muted);
  font: 400 11px/1.5 var(--lm-body);
}
.lmap .leaflet-control-attribution a,
.lmap .leaflet-control-attribution a:hover { color: var(--lm-text); text-decoration: none; }
.lmap .leaflet-control-attribution a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------------
   Pins, tooltips, popups
   ------------------------------------------------------------------------ */
.lmap .lmap-pin { background: none; border: 0; }
.lmap .lmap-pin:focus-visible { outline: 0; }
.lmap .lmap-pin__in {
  position: absolute; inset: 0; display: block;
  transform-origin: 50% 100%; transition: transform .14s ease;
  filter: drop-shadow(0 2px 3px rgba(10, 9, 24, .5));
}
.lmap .lmap-pin__in i {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px;
  border: 2px solid #fff; border-radius: 50% 50% 50% 0;
  background: var(--c, #8b8ba7); transform: rotate(-45deg);
}
.lmap .lmap-pin__in svg { position: absolute; left: 7px; top: 7px; width: 16px; height: 16px; color: var(--g, #fff); }
.lmap .lmap-pin:hover .lmap-pin__in,
.lmap .lmap-pin:focus-visible .lmap-pin__in { transform: scale(1.14); }
.lmap .lmap-pin.is-on .lmap-pin__in { transform: scale(1.22); }
.lmap .lmap-pin.is-on .lmap-pin__in i,
.lmap .lmap-pin:focus-visible .lmap-pin__in i { border-color: var(--lm-lime); }

.lmap .leaflet-tooltip.lmap-tip {
  padding: 5px 10px; border: 0; border-radius: 8px;
  background: var(--lm-night); color: var(--lm-text); box-shadow: var(--lm-shadow);
  font: 600 13px/1.3 var(--lm-body); white-space: nowrap;
}
.lmap .leaflet-tooltip.lmap-tip::before { border-top-color: var(--lm-night); }

.lmap .leaflet-popup-content-wrapper {
  padding: 0; overflow: hidden; border: 1px solid var(--lm-line); border-radius: 14px;
  background: var(--lm-night); color: var(--lm-text);
  box-shadow: 0 14px 36px rgba(10, 9, 24, .5);
}
.lmap .leaflet-popup-content { margin: 0; font: inherit; line-height: 1.45; }
.lmap .leaflet-popup-tip { background: var(--lm-night); box-shadow: none; }
.lmap .leaflet-container a.leaflet-popup-close-button,
.lmap .leaflet-container a.leaflet-popup-close-button:hover {
  top: 8px; right: 8px; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  background: rgba(27, 26, 47, .7); color: var(--lm-muted);
  font: 400 20px/28px var(--lm-body); text-align: center; text-decoration: none;
}
.lmap .leaflet-container a.leaflet-popup-close-button:hover { background: var(--lm-elev); color: var(--lm-text); }

.lmap .lmap-pop { border-top: 3px solid var(--c, var(--lm-lime)); }
.lmap .lmap-pop img.lmap-pop__img {
  display: block; width: 100%; max-width: none; height: auto; aspect-ratio: 16 / 9;
  margin: 0; padding: 0; border: 0; border-radius: 0; object-fit: cover; background: var(--lm-surface);
}
.lmap .lmap-pop__body { padding: 14px 44px 16px 16px; }
.lmap .lmap-pop img + .lmap-pop__body { padding-right: 16px; }
.lmap .leaflet-popup-content h3.lmap-pop__name {
  margin: 0; padding: 0;
  font: 600 21px/1.12 var(--lm-display); letter-spacing: .02em; text-transform: uppercase;
  color: var(--lm-text); overflow-wrap: anywhere;
}
.lmap .leaflet-popup-content p.lmap-pop__cat {
  display: flex; align-items: center; gap: 7px; margin: 7px 0 0; padding: 0;
  color: var(--lm-muted); font-size: 12.5px; line-height: 1.3;
}
.lmap .lmap-pop__cat i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--lm-lime)); }
.lmap .leaflet-popup-content p.lmap-pop__text { margin: 10px 0 0; padding: 0; color: var(--lm-muted); font-size: 14px; line-height: 1.5; }
.lmap .leaflet-container a.lmap-pop__link,
.lmap .leaflet-container a.lmap-pop__link:hover,
.lmap .leaflet-container a.lmap-pop__link:focus {
  display: inline-block; margin: 14px 0 0; padding: 8px 14px; border-radius: 10px;
  background: var(--lm-lime); color: #1b1a2f;
  font: 600 13.5px/1.2 var(--lm-body); text-decoration: none;
}
.lmap .leaflet-container a.lmap-pop__link:hover { background: #fff; }
.lmap .leaflet-container a.lmap-pop__link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------------------------------------------------------------------------
   Coordinate picker (right-click, or dev mode)
   ------------------------------------------------------------------------ */
.lmap .lmap-pick {
  border: 2px solid #fff; border-radius: 50%; outline: 2px solid rgba(27, 26, 47, .9);
  background: radial-gradient(circle, var(--lm-pink) 0 3px, rgba(27, 26, 47, .9) 3.5px 5px, transparent 5.5px);
  pointer-events: none;
}

.lmap.lmap--dev .leaflet-container.leaflet-grab,
.lmap.lmap--dev .leaflet-container .leaflet-interactive.lmap-pin { cursor: crosshair; }
.lmap .lmap__hud {
  position: absolute; left: 12px; bottom: 12px; z-index: 1000;
  display: grid; gap: 2px; max-width: calc(100% - 24px); padding: 9px 12px; border-radius: 10px;
  background: rgba(27, 26, 47, .94); color: var(--lm-muted); box-shadow: var(--lm-shadow);
  font: 500 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; pointer-events: none;
}
.lmap .lmap__hud[hidden] { display: none; }
.lmap .lmap__hud b { color: var(--lm-lime); font-weight: 600; font-size: 15px; }
.lmap .lmap__hud-pick {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--lm-line); color: var(--lm-text);
}
.lmap .lmap__hud-pick[hidden] { display: none; }
.lmap .lmap__hud-btn {
  --b-pad: 5px 10px; --b-radius: 8px; --b-bg: var(--lm-elev); --b-fg: var(--lm-text); --b-weight: 600; --b-size: 12px;
  pointer-events: auto;
}
.lmap .lmap__hud-btn:hover { --b-bg: var(--lm-lime); --b-fg: #1b1a2f; }

/* ---------------------------------------------------------------------------
   Narrow layout: the panel becomes a bottom sheet
   ------------------------------------------------------------------------ */
.lmap.lmap--narrow .lmap__stage { grid-row: 1; grid-column: 1; }
.lmap.lmap--narrow .lmap__panel {
  grid-row: 1; grid-column: 1; align-self: end; z-index: 1200;
  max-height: min(72%, 560px); border-right: 0; border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 36px rgba(10, 9, 24, .45); overflow: hidden;
  transition: transform .22s ease, visibility 0s linear 0s;
}
.lmap.lmap--narrow.lmap--closed .lmap__panel { transform: translateY(100%); transition: transform .22s ease, visibility 0s linear .22s; }
.lmap.lmap--narrow .lmap__head { padding-top: 12px; }
.lmap.lmap--narrow .lmap__title { font-size: 22px; margin-bottom: 10px; }
@media (hover: none) and (pointer: coarse) {
  .lmap.lmap--narrow .leaflet-control-zoom { display: none; }            /* phones pinch to zoom */
}
.lmap.lmap--narrow .lmap__toast { top: 62px; }                          /* under the row of buttons */
.lmap.lmap--narrow .lmap__hud { bottom: 34px; }                         /* above the credit line */

@media (prefers-reduced-motion: reduce) {
  .lmap *, .lmap *::before, .lmap *::after { transition-duration: 0s !important; }
}

/* ---------------------------------------------------------------------------
   1.3: jump menu, two views (browse by type / results), grouped filters
   ------------------------------------------------------------------------ */
.lmap .lmap__jump { margin: 8px 0 0; }
.lmap .lmap__jump[hidden] { display: none; }
.lmap select.lmap__sel,
.lmap select.lmap__sel:hover,
.lmap select.lmap__sel:focus {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 40px; margin: 0; padding: 0 34px 0 12px;
  border: 1px solid var(--lm-line); border-radius: 12px;
  background: var(--lm-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23d9d1f6' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 13px center / 11px 7px;
  color: var(--lm-text); font: 500 14px/1.2 var(--lm-body); letter-spacing: normal;
  box-shadow: none; outline: 0; cursor: pointer;
}
.lmap select.lmap__sel:focus { border-color: var(--lm-lime); }
.lmap select.lmap__sel option,
.lmap select.lmap__sel optgroup { background: #252644; color: #fff; }

.lmap .lmap__tabs { flex: none; display: flex; gap: 4px; padding: 10px 8px 2px; }
.lmap button.lm-b.lmap__tab {
  --b-justify: center; --b-pad: 8px 10px; --b-radius: 10px; --b-weight: 600; --b-size: 13px;
  --b-fg: var(--lm-muted); flex: 1 1 0;
}
.lmap button.lm-b.lmap__tab:hover { --b-bg: var(--lm-surface); }
.lmap button.lm-b.lmap__tab[aria-selected="true"] { --b-bg: var(--lm-elev); --b-fg: var(--lm-text); }

.lmap .lmap__status { border-top: 0; padding-top: 8px; }
.lmap .lmap__acts { display: inline-flex; align-items: baseline; gap: 14px; }
.lmap[data-view="types"] ul.lmap__list { display: none; }
.lmap[data-view="list"] .lmap__cats { display: none; }
.lmap .lmap__cats {
  flex: 1 1 auto; min-height: 0; display: block; padding: 4px 8px 12px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--lm-elev) transparent;
}
.lmap .lmap__grp { margin: 0 0 2px; }
.lmap .lmap__gh { display: flex; align-items: center; gap: 2px; }
.lmap button.lm-b.lmap__gt {
  --b-display: flex; --b-width: 100%; --b-pad: 9px 8px; --b-radius: 10px; --b-gap: 8px;
  --b-weight: 600; --b-size: 13.5px; --b-lh: 1.25; flex: 1 1 auto;
}
.lmap button.lm-b.lmap__gt:hover { --b-bg: var(--lm-surface); }
.lmap button.lm-b.lmap__gt.is-off { --b-fg: rgba(217, 209, 246, .55); }
.lmap .lmap__gt span.lmap__label { flex: 1 1 auto; min-width: 0; }
.lmap .lmap__gt span.lmap__num {
  flex: none; min-width: 26px; padding: 2px 7px; border-radius: 999px;
  background: var(--lm-surface); color: var(--lm-muted);
  font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums;
}
.lmap .lmap__dot { flex: none; width: 10px; height: 10px; margin: 0 7px; border-radius: 50%; background: var(--c, #8b8ba7); }
.lmap .lmap__chev {
  flex: none; width: 7px; height: 7px; margin: 0 5px 3px 2px;
  border-right: 2px solid var(--lm-muted); border-bottom: 2px solid var(--lm-muted);
  transform: rotate(45deg); transition: transform .15s ease;
}
.lmap .lmap__gt[aria-expanded="true"] .lmap__chev { transform: rotate(-135deg); margin: 3px 5px 0 2px; }
.lmap .lmap__gb { display: grid; gap: 1px; padding: 0 0 8px 6px; }
.lmap .lmap__gb[hidden] { display: none; }
.lmap .lmap__row { display: flex; align-items: center; gap: 2px; }
.lmap .lmap__row .lmap__cat { flex: 1 1 auto; min-width: 0; }
.lmap button.lm-b.lmap__only {
  --b-pad: 6px 8px; --b-radius: 8px; --b-fg: var(--lm-lime); --b-size: 11.5px; --b-weight: 600; --b-lh: 1.2;
  flex: none; opacity: .8;
}
.lmap button.lm-b.lmap__only:hover { --b-bg: var(--lm-surface); opacity: 1; }
.lmap .lmap__more { margin: 0; padding: 10px 8px 4px; color: var(--lm-muted); font-size: 12.5px; line-height: 1.45; }

/* ---------------------------------------------------------------------------
   1.4: share, My plan, clusters, heatmap, Nearby, region chips, phone search bar
   ------------------------------------------------------------------------ */
.lmap .lmap__toast { top: 62px; }
.lmap.lmap--narrow .lmap__toast { top: 116px; }

/* Three tabs fit the 320px panel */
.lmap button.lm-b.lmap__tab { --b-pad: 8px 6px; --b-size: 12.5px; }
.lmap[data-view="nearby"] ul.lmap__list:not(.lmap__near),
.lmap[data-view="nearby"] .lmap__cats { display: none; }
.lmap:not([data-view="nearby"]) ul.lmap__near { display: none; }

/* Region chips float over the top of the map */
.lmap .lmap__chips {
  position: absolute; z-index: 1000; top: 12px; left: 64px; right: 64px;
  display: flex; gap: 8px; padding: 2px; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.lmap .lmap__chips::-webkit-scrollbar { display: none; }
.lmap .lmap__chips[hidden] { display: none; }
.lmap.lmap--closed:not(.lmap--narrow) .lmap__chips { left: 128px; }
.lmap button.lm-b.lmap__chip {
  flex: none; --b-height: 34px; --b-pad: 0 14px; --b-radius: 999px; --b-weight: 600; --b-size: 13px;
  --b-bg: var(--lm-night); --b-fg: var(--lm-text); --b-shadow: var(--lm-shadow); white-space: nowrap;
}
.lmap button.lm-b.lmap__chip:hover { --b-bg: var(--lm-elev); }
.lmap.lmap--narrow .lmap__chips { top: 64px; left: 12px; right: 12px; }

/* Phone: the search bar stays on the map while the sheet is closed */
.lmap button.lm-b.lmap__pill {
  --b-display: none; position: absolute; left: 12px; top: 12px; z-index: 1000;
  --b-width: calc(100% - 76px); --b-height: 44px; --b-pad: 0 14px; --b-radius: 14px; --b-size: 15px;
  --b-bg: var(--lm-night); --b-fg: var(--lm-muted); --b-shadow: var(--lm-shadow);
}
.lmap button.lm-b.lmap__pill svg { flex: none; width: 18px; height: 18px; fill: currentColor; }
.lmap.lmap--narrow.lmap--closed button.lm-b.lmap__pill { --b-display: flex; }
.lmap.lmap--narrow.lmap--closed button.lm-b.lmap__toggle { --b-display: none; }

/* Layer buttons (clusters, heatmap, My plan) */
.lmap .lmap-opts { margin-top: 10px; }
.lmap .lmap-opts a svg { width: 20px; height: 20px; fill: currentColor; }
.lmap .leaflet-bar.lmap-opts a.is-on,
.lmap .leaflet-bar.lmap-opts a.is-on:hover,
.lmap .leaflet-bar.lmap-opts a.is-on:focus { background: var(--lm-lime); color: #1b1a2f; }
.lmap.lmap--planning .leaflet-grab,
.lmap.lmap--planning .leaflet-dragging .leaflet-grab { cursor: crosshair; }

/* Cluster bubbles and the heatmap */
.lmap .lmap-cl { background: none; border: 0; }
.lmap .lmap-cl__in {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--c); color: var(--g); border: 2px solid #fff; cursor: pointer;
  font: 700 14px/1 var(--lm-body); font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .28), 0 4px 12px rgba(10, 9, 24, .5);
  transition: transform .12s ease;
}
.lmap .lmap-cl:hover .lmap-cl__in { transform: scale(1.1); }
.lmap .lmap-heat { position: absolute; left: 0; top: 0; pointer-events: none; opacity: .92; }

/* Popup buttons */
.lmap .lmap-pop__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lmap .leaflet-container .lmap-pop__acts a.lmap-pop__link { margin: 0; }
.lmap button.lm-b.lmap-pop__btn {
  --b-pad: 8px 12px; --b-radius: 10px; --b-bg: var(--lm-surface); --b-fg: var(--lm-text);
  --b-weight: 600; --b-size: 13px; --b-lh: 1.2; --b-gap: 6px; --b-justify: center;
}
.lmap button.lm-b.lmap-pop__btn:hover { --b-bg: var(--lm-elev); }
.lmap button.lm-b.lmap-pop__btn svg { flex: none; width: 16px; height: 16px; fill: currentColor; }
.lmap input.lmap-pop__in,
.lmap input.lmap-pop__in:focus {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 40px; margin: 0; padding: 0 12px;
  border: 1px solid var(--lm-line); border-radius: 10px; background: var(--lm-surface); color: var(--lm-text);
  font: 600 16px/1.2 var(--lm-body); box-shadow: none; outline: 0;
}
.lmap input.lmap-pop__in:focus { border-color: var(--lm-lime); }

/* My plan */
.lmap .lmap-stop { background: none; border: 0; }
.lmap .lmap-stop span {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--lm-lime); color: #1b1a2f; border: 2px solid #1b1a2f;
  font: 700 12px/1 var(--lm-body); box-shadow: 0 2px 8px rgba(10, 9, 24, .5);
}
.lmap .lmap__plan {
  position: absolute; left: 12px; bottom: 34px; z-index: 1100;
  display: flex; flex-direction: column; width: min(320px, calc(100% - 24px)); max-height: min(70%, 520px);
  border: 1px solid var(--lm-line); border-radius: 16px; overflow: hidden;
  background: var(--lm-night); box-shadow: 0 14px 36px rgba(10, 9, 24, .5);
}
.lmap .lmap__plan[hidden] { display: none; }
.lmap.lmap--narrow .lmap__plan { left: 12px; right: 12px; bottom: 12px; width: auto; max-height: 52%; }
.lmap .lmap-plan__hd { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 16px; }
.lmap h3.lmap-plan__title { margin: 0; padding: 0; font: 600 20px/1 var(--lm-display); letter-spacing: .03em; text-transform: uppercase; color: var(--lm-text); }
.lmap button.lm-b.lmap-plan__x { --b-width: 34px; --b-height: 34px; --b-justify: center; --b-radius: 10px; --b-fg: var(--lm-muted); }
.lmap button.lm-b.lmap-plan__x:hover { --b-bg: var(--lm-surface); --b-fg: var(--lm-text); }
.lmap button.lm-b.lmap-plan__x svg { width: 18px; height: 18px; fill: currentColor; }
.lmap .lmap-plan__tools { flex: none; display: flex; gap: 8px; padding: 8px 16px 10px; }
.lmap button.lm-b.lmap-plan__tool {
  flex: 1 1 0; --b-justify: center; --b-height: 40px; --b-pad: 0 10px; --b-radius: 12px; --b-weight: 600; --b-size: 13px; --b-gap: 7px;
  --b-bg: var(--lm-surface); --b-fg: var(--lm-text);
}
.lmap button.lm-b.lmap-plan__tool:hover { --b-bg: var(--lm-elev); }
.lmap button.lm-b.lmap-plan__tool[aria-pressed="true"] { --b-bg: var(--lm-lime); --b-fg: #1b1a2f; }
.lmap button.lm-b.lmap-plan__tool svg { flex: none; width: 18px; height: 18px; fill: currentColor; }
.lmap .lmap-plan__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 8px; scrollbar-width: thin; scrollbar-color: var(--lm-elev) transparent; }
.lmap p.lmap-plan__hint { margin: 0; padding: 4px 8px 10px; color: var(--lm-muted); font-size: 13px; line-height: 1.5; }
.lmap p.lmap-plan__label { margin: 8px 8px 4px; color: var(--lm-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lmap .lmap-plan__row { display: flex; align-items: center; gap: 4px; }
.lmap button.lm-b.lmap-plan__go { flex: 1 1 auto; --b-pad: 7px 8px; --b-radius: 10px; --b-size: 14px; --b-lh: 1.3; --b-weight: 600; --b-fg: var(--lm-text); text-align: left; }
.lmap button.lm-b.lmap-plan__go:hover { --b-bg: var(--lm-surface); }
.lmap button.lm-b.lmap-plan__del { flex: none; --b-width: 32px; --b-height: 32px; --b-justify: center; --b-radius: 9px; --b-fg: var(--lm-muted); }
.lmap button.lm-b.lmap-plan__del:hover { --b-bg: var(--lm-surface); --b-fg: var(--lm-text); }
.lmap button.lm-b.lmap-plan__del svg { width: 16px; height: 16px; fill: currentColor; }
.lmap .lmap-plan__ft { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--lm-line); }
.lmap button.lm-b.lmap-plan__sm {
  --b-height: 36px; --b-pad: 0 12px; --b-radius: 10px; --b-weight: 600; --b-size: 13px; --b-gap: 6px;
  --b-bg: var(--lm-surface); --b-fg: var(--lm-text);
}
.lmap button.lm-b.lmap-plan__sm:hover { --b-bg: var(--lm-elev); }
.lmap button.lm-b.lmap-plan__sm--main { --b-bg: var(--lm-lime); --b-fg: #1b1a2f; }
.lmap button.lm-b.lmap-plan__sm--main:hover { --b-bg: #fff; }
.lmap button.lm-b.lmap-plan__sm svg { flex: none; width: 16px; height: 16px; fill: currentColor; }

/* ---------------------------------------------------------------------------
   1.4.1: easier filter panel - switch per group, big targets, clear "Only"
   ------------------------------------------------------------------------ */
.lmap .lmap__grp { margin: 0 0 6px; border: 1px solid var(--lm-line); border-radius: 14px; background: rgba(255, 255, 255, .025); overflow: hidden; }
.lmap .lmap__grp:has(.lmap__gt[aria-expanded="true"]) { background: var(--lm-surface); border-color: rgba(255, 255, 255, .16); }
.lmap .lmap__gh { gap: 4px; padding: 0 6px 0 12px; min-height: 54px; }
.lmap button.lm-b.lmap__sw {
  position: relative; flex: none; --b-width: 42px; --b-height: 24px; --b-pad: 0; --b-radius: 999px;
  --b-bg: var(--lm-elev); transition: background .15s ease;
}
.lmap button.lm-b.lmap__sw::after { content: ""; position: absolute; inset: -12px -6px; }
.lmap button.lm-b.lmap__sw i {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; opacity: .5; transition: transform .15s ease, opacity .15s ease;
}
.lmap button.lm-b.lmap__sw[aria-checked="true"] { --b-bg: var(--c, var(--lm-lime)); }
.lmap button.lm-b.lmap__sw[aria-checked="true"] i { transform: translateX(18px); opacity: 1; }
.lmap button.lm-b.lmap__sw[aria-checked="mixed"] { --b-bg: linear-gradient(90deg, var(--c, var(--lm-lime)) 50%, var(--lm-elev) 50%); }
.lmap button.lm-b.lmap__sw[aria-checked="mixed"] i { transform: translateX(9px); opacity: 1; }
.lmap button.lm-b.lmap__gt { --b-pad: 14px 8px 14px 6px; --b-size: 14.5px; --b-gap: 10px; }
.lmap button.lm-b.lmap__gt:hover { --b-bg: transparent; }
.lmap button.lm-b.lmap__gt.is-off { --b-fg: rgba(217, 209, 246, .6); }
.lmap .lmap__gb { padding: 4px 6px 8px; border-top: 1px solid var(--lm-line); }
.lmap button.lm-b.lmap__onlyg {
  --b-display: flex; --b-width: 100%; --b-pad: 10px 10px; --b-radius: 10px; --b-size: 13px; --b-weight: 600; --b-lh: 1.2;
  --b-fg: var(--lm-lime); --b-bg: transparent;
}
.lmap button.lm-b.lmap__onlyg:hover { --b-bg: var(--lm-elev); }
.lmap .lmap__cat { --b-pad: 10px 8px; --b-size: 14px; }
.lmap .lmap__row { gap: 6px; }
.lmap button.lm-b.lmap__only {
  --b-pad: 9px 12px; --b-radius: 999px; --b-size: 12px; --b-bg: var(--lm-elev); --b-fg: var(--lm-lime); opacity: 1;
}
.lmap button.lm-b.lmap__only:hover { --b-bg: #4a4778; }

/* ---------------------------------------------------------------------------
   1.4.2: pick one type, it shows up. No on/off bookkeeping.
   ------------------------------------------------------------------------ */
.lmap .lmap__gh { padding: 0 6px 0 4px; min-height: 50px; }
.lmap .lmap__grp:has(.lmap__gt[aria-expanded="true"]) .lmap__gt { --b-fg: var(--lm-lime); }
.lmap .lmap__gb .lmap__cat[aria-pressed="false"] { --b-fg: var(--lm-text); }
.lmap .lmap__gb .lmap__cat[aria-pressed="false"] .lmap__label { text-decoration: none; }
.lmap .lmap__gb .lmap__cat[aria-pressed="false"] .lmap__badge { background: var(--c, #8b8ba7); color: var(--g, #fff); }
.lmap.lmap--filtered .lmap__gb .lmap__cat[aria-pressed="false"] { --b-fg: rgba(217, 209, 246, .6); }
.lmap.lmap--filtered .lmap__gb .lmap__cat[aria-pressed="false"] .lmap__badge { background: var(--lm-elev); color: rgba(255, 255, 255, .45); }
.lmap.lmap--filtered .lmap__gb .lmap__cat[aria-pressed="true"] { --b-bg: var(--lm-elev); --b-shadow: inset 0 0 0 2px var(--lm-lime); --b-fg: #fff; }
.lmap .lmap__cat { --b-pad: 12px 10px; --b-size: 14.5px; }
.lmap button.lm-b.lmap__onlyg { --b-pad: 12px 10px; --b-size: 13.5px; }
/* "Show everything" becomes a real button while a type is picked */
.lmap.lmap--filtered button.lm-b.lmap__reset {
  --b-pad: 7px 12px; --b-radius: 999px; --b-bg: var(--lm-lime); --b-fg: #1b1a2f; --b-deco: none; --b-size: 12.5px; --b-weight: 700;
}
.lmap.lmap--filtered button.lm-b.lmap__reset:hover { --b-bg: #fff; }
