/* LX Location Map — glass prism UI, LaunchX violet theme */
.lxm-root {
  --lxm-accent: #9423f9;
  --lxm-accent-2: #b47bff;
  --lxm-ink: #ece8f7;
  --lxm-muted: #b3acca;
  --lxm-dim: #8f88aa;
  --lxm-bg: #0b0a12;
  --lxm-glass: rgba(22, 17, 38, 0.52);
  --lxm-line: rgba(255, 255, 255, 0.09);
  --lxm-font: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --lxm-top: 16px;              /* raise this if your viewer header overlaps (e.g. 76px) */
  --lxm-panel-w: 372px;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  overflow: hidden;
  background: var(--lxm-bg);
  color: var(--lxm-ink);
  font-family: var(--lxm-font);
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}
.lxm-root *, .lxm-root *::before, .lxm-root *::after { box-sizing: border-box; }
:where(.lxm-root) button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.lxm-root button:focus-visible { outline: 2px solid var(--lxm-accent-2); outline-offset: 2px; }
.lxm-root [hidden] { display: none !important; }
.lxm-root > .lxm-map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.lxm-map canvas { outline: none; }
.lxm-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(6, 4, 14, 0.75) 100%),
    linear-gradient(180deg, rgba(6, 4, 14, 0.55), transparent 18%, transparent 82%, rgba(6, 4, 14, 0.6));
}

/* ---------- Glass prism ---------- */
.lxm-glass {
  position: relative;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.025) 38%, rgba(148, 35, 249, 0.07) 100%),
    var(--lxm-glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 24px 60px -18px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(10, 6, 20, 0.35);
}
.lxm-glass::before {             /* prism edge: refracted light along the rim */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(125deg,
    rgba(255, 255, 255, 0.42), rgba(196, 150, 255, 0.30) 22%, rgba(255, 255, 255, 0.04) 45%,
    rgba(255, 255, 255, 0.02) 62%, rgba(94, 200, 255, 0.22) 84%, rgba(255, 160, 230, 0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* ---------- Loader / toast ---------- */
.lxm-loader {
  position: absolute; inset: 0; z-index: 5; display: none; align-items: center; justify-content: center; gap: 10px;
  color: var(--lxm-muted); letter-spacing: 0.22em; text-transform: uppercase; font-size: 10.5px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(148, 35, 249, 0.10), transparent 70%), var(--lxm-bg);
}
.lxm-loader span { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(180, 123, 255, 0.25); border-top-color: var(--lxm-accent-2); animation: lxm-spin 0.9s linear infinite; }
.lxm-root.is-loading .lxm-loader { display: flex; }
@keyframes lxm-spin { to { transform: rotate(360deg); } }
.lxm-toast {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 8;
  padding: 10px 16px; border-radius: 999px; background: rgba(30, 14, 48, 0.9); border: 1px solid rgba(180, 123, 255, 0.35);
  font-size: 11px; letter-spacing: 0.04em; max-width: calc(100% - 32px); text-align: center; pointer-events: none;
}

/* ---------- 2D / 360 switch ---------- */
.lxm-switch {
  position: absolute; z-index: 4; top: var(--lxm-top); left: 50%; transform: translateX(-50%);
  display: flex; padding: 4px; border-radius: 999px; gap: 2px;
}
.lxm-switch button {
  padding: 8px 16px; border-radius: 999px; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lxm-muted);
  transition: color .2s, background .2s;
}
.lxm-switch button:hover { color: var(--lxm-ink); }
.lxm-switch button.is-on { color: #fff; background: linear-gradient(180deg, #a243ff, #7c19dc); box-shadow: 0 6px 18px -6px rgba(148, 35, 249, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

/* ---------- Panel ---------- */
.lxm-panel {
  position: absolute; z-index: 3; top: var(--lxm-top); left: 16px; bottom: 16px; width: var(--lxm-panel-w);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 22px;
}
/* Denser glass than the small controls: the list must stay readable over busy map tiles. */
.lxm-panel.lxm-glass {
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02) 38%, rgba(148, 35, 249, 0.06) 100%),
    rgba(15, 11, 27, 0.86);
}
.lxm-head { position: relative; padding: 20px 20px 14px; }
.lxm-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--lxm-muted); }
.lxm-eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--lxm-accent-2); box-shadow: 0 0 10px var(--lxm-accent); }
.lxm-head h2 { margin: 10px 0 4px; font-size: 19px; line-height: 1.2; letter-spacing: 0.02em; text-transform: uppercase; font-weight: 700; text-wrap: balance; }
.lxm-head p { margin: 0; color: var(--lxm-muted); font-size: 11.5px; line-height: 1.5; }
.lxm-panel-close { display: none; position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; place-items: center; background: rgba(255, 255, 255, 0.06); }

/* Key places: one quiet row split by hairlines, not three boxed cards */
.lxm-keys {
  display: grid; grid-template-columns: repeat(3, 1fr); margin: 2px 20px 18px;
  border-top: 1px solid var(--lxm-line); border-bottom: 1px solid var(--lxm-line);
}
.lxm-key {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 12px 10px 12px 12px; min-width: 0;
  text-align: left; transition: background .2s;
}
.lxm-key:first-child { padding-left: 0; }
.lxm-key + .lxm-key { border-left: 1px solid var(--lxm-line); }
.lxm-key:hover { background: rgba(255, 255, 255, 0.03); }
.lxm-key-ico { color: var(--c); display: grid; place-items: center; }
.lxm-key-val { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.lxm-key-name { font-size: 10.5px; color: var(--lxm-muted); line-height: 1.3; letter-spacing: 0.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; }

/* ---------- Filter: by distance / by travel time ---------- */
.lxm-filter { padding: 0 20px 14px; flex-shrink: 0; }
/* Mode: two equal tabs on one quiet track */
.lxm-mode { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.lxm-mode button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 6px; border-radius: 8px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--lxm-muted); white-space: nowrap; transition: background .2s, color .2s;
}
.lxm-mode button:hover { color: var(--lxm-ink); }
.lxm-mode button.is-on { color: #fff; background: var(--lxm-accent); box-shadow: 0 4px 14px -6px rgba(148, 35, 249, 0.9); }
/* Steps: plain text options, the chosen one gets a soft pill */
.lxm-steps { display: flex; justify-content: space-between; gap: 2px; margin-top: 10px; }
.lxm-steps button {
  flex: 1 1 0; min-width: 0; padding: 6px 2px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; color: var(--lxm-muted); font-variant-numeric: tabular-nums; transition: background .2s, color .2s;
}
.lxm-steps button:hover { color: var(--lxm-ink); }
.lxm-steps button.is-on { color: #fff; font-weight: 600; background: rgba(148, 35, 249, 0.28); }
.lxm-summary { padding: 14px 20px 6px; font-size: 11px; color: var(--lxm-dim); flex-shrink: 0; border-top: 1px solid var(--lxm-line); }
.lxm-summary b { color: var(--lxm-ink); font-weight: 600; }

/* Wrap onto extra lines so every category is visible (a hidden sideways scroll hid Landmarks etc.) */
.lxm-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 16px; flex-shrink: 0; }
.lxm-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto;
  font-size: 11px; color: var(--lxm-muted); background: rgba(255, 255, 255, 0.05);
  transition: color .2s, background .2s, opacity .2s;
}
.lxm-chip svg { color: var(--c); }
.lxm-chip em { font-style: normal; font-size: 10px; color: var(--lxm-dim); font-variant-numeric: tabular-nums; }
.lxm-chip:hover { color: var(--lxm-ink); background: rgba(255, 255, 255, 0.08); }
.lxm-chips.is-filtered .lxm-chip:not(.is-on) { opacity: 0.55; }
.lxm-chip.is-on { color: #fff; background: color-mix(in srgb, var(--c) 24%, transparent); }
.lxm-chip.is-on em { color: inherit; opacity: 0.8; }

.lxm-list { flex: 1; overflow-y: auto; padding: 0 10px 16px; scrollbar-width: thin; scrollbar-color: rgba(180, 123, 255, 0.3) transparent; }
.lxm-band h3 {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0; padding: 14px 10px 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lxm-accent-2);
}
.lxm-band h3 span { color: var(--lxm-dim); letter-spacing: 0.04em; font-weight: 400; text-transform: none; font-size: 10.5px; }
.lxm-item {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; width: 100%;
  padding: 9px 10px; border-radius: 10px; text-align: left; transition: background .15s;
}
.lxm-item:hover, .lxm-item.is-hover { background: rgba(255, 255, 255, 0.05); }
.lxm-item.is-active { background: rgba(148, 35, 249, 0.16); box-shadow: inset 0 0 0 1px rgba(180, 123, 255, 0.35); }
.lxm-item-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.lxm-item-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lxm-item-txt b { font-weight: 500; font-size: 12px; color: var(--lxm-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lxm-item-txt small, .lxm-item-d small { color: var(--lxm-dim); font-size: 10px; white-space: nowrap; }
.lxm-item-d { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-variant-numeric: tabular-nums; }
.lxm-item-d b { font-size: 12px; font-weight: 600; color: #fff; }
.lxm-empty { padding: 28px 16px; color: var(--lxm-muted); text-align: center; line-height: 1.6; }

/* ---------- Controls ---------- */
.lxm-controls { position: absolute; z-index: 3; right: 16px; bottom: 28px; display: flex; flex-direction: column; padding: 5px; gap: 2px; border-radius: 16px; }
.lxm-controls button { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--lxm-muted); transition: background .15s, color .15s; }
.lxm-controls button:hover { background: rgba(255, 255, 255, 0.07); color: var(--lxm-ink); }
.lxm-controls button.is-on { color: var(--lxm-accent-2); }
.lxm-north svg { transition: transform .1s linear; color: var(--lxm-accent-2); }
.lxm-root.is-editing .lxm-controls { right: calc(var(--lxm-edit-w, 360px) + 32px); }

/* ---------- Site marker ---------- */
.lxm-site { position: relative; width: 46px; height: 46px; display: grid; place-items: center; z-index: 5; cursor: default; }
.lxm-root.is-editing .lxm-site { cursor: grab; }
.lxm-site-core {
  position: relative; z-index: 2; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #c27dff, #8a1ff0 55%, #5a0fb0);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14), 0 0 0 9px rgba(148, 35, 249, 0.22), 0 10px 30px rgba(148, 35, 249, 0.75);
}
.lxm-site-pulse { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(180, 123, 255, 0.8); animation: lxm-pulse 2.8s cubic-bezier(.2, .6, .3, 1) infinite; }
.lxm-site-pulse.two { animation-delay: 1.4s; }
@keyframes lxm-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.6); opacity: 0; } }
.lxm-site-tag {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  background: rgba(20, 12, 36, 0.82); border: 1px solid rgba(180, 123, 255, 0.45); color: #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* ---------- POI markers ---------- */
/* MapLibre positions markers with position:absolute + transform. Our marker classes must never
   override that (viewer pages load this file after maplibre-gl.css, so specificity matters). */
.lxm-root .maplibregl-marker, .lxm-root .maplibregl-marker.lxm-poi, .lxm-root .maplibregl-marker.lxm-site {
  position: absolute; top: 0; left: 0;
}
.lxm-poi { position: relative; width: 30px; height: 30px; cursor: pointer; transition: opacity .25s; }
.lxm-poi-dot {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; color: var(--c);
  background: rgba(16, 12, 28, 0.78); border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 14%, transparent), 0 6px 16px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), background .2s, color .2s;
}
.lxm-poi-label {
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translate(-4px, -50%); opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; gap: 1px; white-space: nowrap; padding: 6px 10px; border-radius: 10px;
  background: rgba(16, 12, 28, 0.86); border: 1px solid rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: opacity .18s, transform .18s;
}
.lxm-poi-label b { font-size: 11px; font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.lxm-poi-label small { font-size: 9.5px; color: var(--lxm-muted); }
.lxm-poi.is-key .lxm-poi-label, .lxm-zoom-hi .lxm-poi .lxm-poi-label,
.lxm-poi.is-hover .lxm-poi-label, .lxm-poi.is-active .lxm-poi-label { opacity: 1; transform: translate(0, -50%); }
.lxm-poi.is-hover, .lxm-poi.is-active { z-index: 4; }
.lxm-poi.is-active .lxm-poi-label { opacity: 0; }   /* popup card already shows the name */
.lxm-poi.is-hover .lxm-poi-dot, .lxm-poi.is-active .lxm-poi-dot { transform: scale(1.22); background: var(--c); color: #120c20; }
.lxm-poi.is-hidden { opacity: 0; pointer-events: none; }

/* ---------- Popup ---------- */
.lxm-popup .maplibregl-popup-content {
  padding: 0; border-radius: 16px; background: rgba(20, 15, 34, 0.86); color: var(--lxm-ink, #ece8f7);
  border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  font-family: var(--lxm-font, ui-monospace, monospace);
}
.lxm-popup .maplibregl-popup-tip { display: none; }
.lxm-pop { padding: 14px 16px 12px; min-width: 250px; }
.lxm-pop-cat { display: flex; align-items: center; gap: 6px; color: var(--c); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; }
.lxm-pop-name { margin: 6px 0 12px; font-size: 14px; font-weight: 700; line-height: 1.3; }
.lxm-pop-stats { display: flex; gap: 6px; }
.lxm-pop-stats div { flex: 1; min-width: 0; white-space: nowrap; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.lxm-pop-stats small { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: #8d86a8; }
.lxm-pop-stats b { font-size: 13px; font-variant-numeric: tabular-nums; }
.lxm-pop-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; color: #c9a6ff; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; }
.lxm-pop-link:hover { color: #fff; }

/* ---------- Attribution ---------- */
.lxm-root .maplibregl-ctrl-attrib { background: rgba(14, 10, 24, 0.7) !important; color: #7d7698; font-size: 9.5px; }
.lxm-root .maplibregl-ctrl-attrib a { color: #a99fd0; }
.lxm-root .maplibregl-ctrl-attrib-button { filter: invert(1) hue-rotate(180deg); }
.lxm-root .maplibregl-ctrl-bottom-left { left: calc(var(--lxm-panel-w) + 24px); }

/* ---------- Mobile: panel becomes a bottom sheet ---------- */
.lxm-panel-toggle { display: none; }
@media (max-width: 760px) {
  .lxm-root { --lxm-panel-w: 100%; }
  .lxm-panel {
    top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 62%; border-radius: 22px;
    transform: translateY(calc(100% + 16px)); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  }
  .lxm-root.panel-open .lxm-panel { transform: none; }
  .lxm-panel-close { display: grid; }
  .lxm-panel-toggle {
    display: flex; align-items: center; gap: 8px; position: absolute; z-index: 3; left: 50%; bottom: 20px; transform: translateX(-50%);
    padding: 12px 18px; border-radius: 999px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  }
  .lxm-root.panel-open .lxm-panel-toggle, .lxm-root.panel-open .lxm-controls { display: none; }
  .lxm-controls { bottom: 84px; right: 12px; }
  .lxm-root .maplibregl-ctrl-bottom-left { left: 0; }
  .lxm-toast { bottom: auto; top: calc(var(--lxm-top) + 56px); }
}
@media (prefers-reduced-motion: reduce) {
  .lxm-site-pulse { animation: none; opacity: 0; }
  .lxm-root * { transition-duration: 0s !important; }
}
