/* ═══════════════════════════════════════════════════════════════════════════
   map.css — /map/ the Live Map, dressed in the haven look.

   STRUCTURE comes from dominion.css (.shell, .panel, .inst, .btn, .tool, .tag,
   .input, .page-head) and the LOOK from haven.css (loaded after this sheet, so
   nothing here may out-cascade the theme). This file owns only what the map
   page adds: the stage and its floating instruments, the layer rows, the you /
   selection cards, the modal, the tooltip, the friends drawer, and the marker
   vocabulary inside the 1024-logical SVG.

   ★ CLASSES ARE mp-* ON PURPOSE. The live page's .empty / .chip / .row / .k /
     .v / .section all collide with dominion's vocabulary, and DESIGN.md's law
     is that a short generic name is not a namespace. The live IDS are kept
     (map.js and a future map3d.js bind to them); the classes are this tree's.
   ★ COLOUR LAW: gold is light, never ink. Every word here reads in a --t-*
     token; ember arrives only as the connection dot, the active switch, a
     border and a glow. The POI category colours, the red self pin, the cyan
     friend ring, the magenta waypoint and the AI palette are DATA - the
     meaning of a marker - and are carried as the file / the live page carry
     them, never re-themed.
   ★ NO backdrop-filter ON THE STAGE INSTRUMENTS. haven.css keeps blur on the
     chrome only (seventeen pages of blurred glass made scrolling step); the
     live page drops every blur during a gesture for the same reason. The
     instruments here are flat tinted plates, so a pan costs nothing extra.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── layout ─────────────────────────────────────────────────────────────── */
.mp-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) 330px;
  gap: var(--s5); align-items: start;
}
.mp-stagecol { min-width: 0; }
.mp-rail { display: grid; gap: var(--s4); min-width: 0; }
.mp-rail .panel-h { gap: var(--s3); }
.mp-rail .panel-h .tag { margin-left: auto; flex: 0 0 auto; }
.mp-rail .panel-b { padding: 12px; }

/* the live page's fixed-height viewport, as a panel that keeps its box */
.mp-viewport {
  position: relative; overflow: hidden;
  height: clamp(520px, 68vh, 780px);
  background: var(--panel);
  isolation: isolate;
}
.mp-stage { position: absolute; inset: 0; z-index: 1; }
#leafmap { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--void); z-index: 1; }
.leaflet-container { background: var(--void); font: inherit; outline: none; }
/* neutralise the global `svg{max-width:100%}` reset for anything Leaflet creates
   or relocates inside the stage (id beats the element selector) */
#leafmap svg { width: auto; height: auto; max-width: none; max-height: none; animation: none; cursor: auto; }
/* before Leaflet mounts it (or if Leaflet is refused) the overlay fills the stage */
.mp-stage > #mapSvg { position: absolute; inset: 0; width: 100%; height: 100%; }
#mapSvg { pointer-events: none; }
#mapSvg .mk, #mapSvg .wp { pointer-events: auto; }
#mapSvg .mk-area, #mapSvg #layer-guide, #mapSvg #layer-you { pointer-events: none; }
#mapSvg.is-moving { will-change: transform; }

/* the neutral ground the POI overlay sits on — the FIXTURES lane only, where the
   tile pyramid stays on the island. ★ In the live lane the tiles paint UNDER this
   SVG (Leaflet overlay pane z 400 > tile pane z 200), so an opaque ground here
   covers the whole island — exactly how the live map rendered black on
   2026-08-22 while every tile had loaded. map.js adds `tiles-live` the moment it
   mounts the real tile layer; the ground leaves and the island shows. */
#mapSvg .mp-ground { fill: var(--panel-up); stroke: var(--line-up); stroke-width: 1px; vector-effect: non-scaling-stroke; }
#mapSvg.tiles-live .mp-ground { display: none; }
/* the live page's own unavailable vocabulary, shown when the basemap is not there */
#mapSvg .basemap-fallback { display: none; }
#mapSvg.img-failed .basemap-fallback { display: block; }
#mapSvg .mp-bf-1 { font: 600 22px/1 var(--data); letter-spacing: 4px; fill: var(--t-sec); }
#mapSvg .mp-bf-2 { font: 500 11px/1 var(--data); letter-spacing: 2px; fill: var(--t-dim); }

/* the tilt-to-3D host: a sibling over the flat map, revealed by .mode-3d */
#map3d { position: absolute; inset: 0; z-index: 6; opacity: 0; pointer-events: none; background: var(--void); touch-action: none; transition: opacity .3s ease; }
#map-viewport.mode-3d #map3d { opacity: 1; pointer-events: auto; }
#map-viewport.mode-3d #leafmap { visibility: hidden; }
.mp-3d-off {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px;
  text-align: center; color: var(--t-sec); font: 500 13px/1.5 var(--data); letter-spacing: .04em;
}

/* ── the floating instruments ───────────────────────────────────────────── */
.mp-hud {
  position: absolute; left: 16px; top: 16px; z-index: 7; pointer-events: none;
  display: flex; flex-direction: column; gap: 5px;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.mp-hud-row {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px; min-width: 166px;
  background: rgba(6, 5, 6, .86); border: 1px solid var(--line); border-radius: var(--r);
}
.mp-hud-k { color: var(--t-dim); font-weight: 500; }
.mp-hud-v { color: var(--t-hi); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.mp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--t-off); flex: 0 0 auto; transition: background .25s, box-shadow .25s; }
.mp-dot.on { background: var(--ember-core); box-shadow: 0 0 8px rgba(232, 144, 26, .8); animation: mp-pulse 1.6s ease-in-out infinite; }
@keyframes mp-pulse { 0%, 100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }

.mp-tag {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 6; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--t-dim);
}
.mp-tag-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ember); }

.mp-compass { position: absolute; right: 18px; top: 18px; width: 56px; height: 56px; z-index: 7; pointer-events: none; opacity: .8; }
.mp-compass svg { width: 100%; height: 100%; filter: drop-shadow(0 0 4px rgba(0, 0, 0, .55)); }
.mp-cp-ring { fill: none; stroke: var(--line-hot); stroke-width: 1; }
.mp-cp-ring2 { fill: none; stroke: var(--line-up); stroke-width: .6; }
.mp-cp-n { fill: var(--ember); filter: drop-shadow(0 0 4px rgba(232, 144, 26, .9)); }
.mp-cp-s { fill: var(--t-off); }
.mp-cp-t { font: 500 8px/1 var(--data); letter-spacing: 1px; fill: var(--t-dim); }
.mp-cp-tn { font-size: 9px; font-weight: 600; fill: var(--t-sec); }

/* tilt: a vertical slider pinned to the right edge. The input is 24px wide -
   the live one is 10px, under this tree's 22px target floor. */
.mp-tilt {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 12px 8px; background: rgba(6, 5, 6, .86); border: 1px solid var(--line); border-radius: var(--r);
}
.mp-tilt-lab { font: 600 9px/1 var(--data); letter-spacing: .16em; color: var(--t-sec); cursor: pointer; user-select: none; padding: 6px 4px; }
.mp-tilt-lab.on { color: var(--ember-ink); }
#tilt { writing-mode: vertical-lr; direction: rtl; width: 24px; height: 140px; margin: 0; accent-color: var(--ember); cursor: grab; background: transparent; }
#tilt:active { cursor: grabbing; }
.mp-tilt-val { font: 600 10px/1 var(--data); color: var(--ember-core); min-width: 30px; text-align: center; }

.mp-bottom { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 7; display: flex; gap: 8px; align-items: stretch; pointer-events: none; }
.mp-zoom {
  display: flex; align-items: center; gap: 3px; padding: 4px; pointer-events: auto;
  background: rgba(6, 5, 6, .86); border: 1px solid var(--line); border-radius: var(--r);
}
.mp-zoom .tool { height: 32px; min-width: 32px; padding: 0 10px; font-size: 15px; letter-spacing: 0; justify-content: center; }
.mp-zoom .tool[disabled] { color: var(--t-off); cursor: default; }
.mp-zoom .tool:not([disabled])#centerMe { color: var(--ember-ink); }
.mp-zoomread { padding: 0 8px; min-width: 54px; font-size: 10px; font-weight: 600; letter-spacing: .1em; color: var(--t-hi); text-align: center; }

.mp-editorbar {
  position: absolute; left: 50%; bottom: 68px; transform: translateX(-50%); z-index: 9;
  display: flex; gap: 8px; align-items: center; padding: 8px;
  background: rgba(6, 5, 6, .92); border: 1px solid var(--ember-deep); border-radius: var(--r);
}
.mp-editorbar[hidden] { display: none; }
.mp-editorbadge { padding: 0 8px; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ember-core); }
.mp-editorbadge.dirty::after { content: " ·"; color: var(--violet-ink); }

/* the lines under the stage */
.mp-under { margin: 10px 0 0; font-size: 10.5px; letter-spacing: .08em; color: var(--t-dim); }
.mp-under[hidden] { display: none; }
.mp-attrib { margin: 6px 0 0; font-size: 10px; letter-spacing: .06em; color: var(--t-dim); word-break: break-word; }

/* the vignette the live theme draws over the terrain */
.mp-viewport::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(132% 100% at 50% 47%, transparent 60%, rgba(2, 1, 3, .42) 100%);
}

/* ── markers (inside the 1024-logical SVG) ──────────────────────────────── */
.mk { transition: opacity .2s, filter .15s var(--quick); }
.mk .glyph { transform: scale(calc(var(--marker-k, 1) * 1.32)); transform-origin: 0 0; transition: transform .12s var(--quick); }
/* a dark halo so every glyph reads on the ground; a lit one on hover */
.mk .glyph { filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .95)) drop-shadow(0 0 3px rgba(0, 0, 0, .55)); }
.mk:hover .glyph, .mk:focus-visible .glyph { filter: drop-shadow(0 0 2px rgba(0, 0, 0, .95)) drop-shadow(0 0 6px rgba(232, 144, 26, .55)); transform: scale(calc(var(--marker-k, 1) * 1.14)); }
#mapSvg.is-moving .mk .glyph { filter: none; }
#mapSvg.is-moving .mk-label { display: none; }
.mk-label {
  font-family: var(--data); font-size: 9px; fill: var(--t-body); letter-spacing: .04em;
  paint-order: stroke; stroke: #0b0810; stroke-width: 3px; stroke-linejoin: round;
  opacity: 0; transition: opacity .18s var(--quick); pointer-events: none;
}
#gd-mp[data-zoom="in"] .mk-label { opacity: .92; }
.mk-zone .zone-label { pointer-events: none; opacity: .95; }
/* area names are NAMES: the engraved roman, scaled with the map like a region feature */
.mk-area { pointer-events: none; }
.area-label {
  font-family: var(--display); font-size: 12px; font-weight: 700; fill: var(--t-sec);
  letter-spacing: .14em; text-transform: uppercase; pointer-events: none;
  paint-order: stroke; stroke: rgba(4, 2, 7, .85); stroke-width: 3px; stroke-linejoin: round; opacity: .82;
}
#gd-mp[data-zoom="in"] .area-label { opacity: .94; }
.wp { transition: filter .15s var(--quick); }
.wp:hover { filter: brightness(1.25) drop-shadow(0 0 12px rgba(232, 121, 249, .67)); }
@keyframes youPulse { 0%, 100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.18); } }
#layer-you > g { filter: drop-shadow(0 0 5px rgba(255, 34, 34, .55)); }
#layer-friends { pointer-events: none; }
.fr-mk .fr-ring { filter: drop-shadow(0 0 4px rgba(95, 208, 224, .55)); }
.fr-mk .fr-label { font-family: var(--data); font-size: 10px; fill: var(--t-hi); letter-spacing: .04em; paint-order: stroke; stroke: rgba(4, 2, 7, .88); stroke-width: 3px; stroke-linejoin: round; }
.fr-mk .fr-sub { font-family: var(--data); font-size: 8px; fill: #bfeff2; letter-spacing: .05em; text-transform: uppercase; paint-order: stroke; stroke: rgba(4, 2, 7, .88); stroke-width: 2.5px; stroke-linejoin: round; opacity: .9; }
/* waypoint guidance */
.guide-line { animation: guideDash 1s linear infinite; }
@keyframes guideDash { to { stroke-dashoffset: -28; } }
.guide-target { animation: guideTargetPulse 1.7s ease-in-out infinite; }
@keyframes guideTargetPulse { 0%, 100% { opacity: .75; } 50% { opacity: .22; } }
#mapSvg.is-moving .guide-line { animation: none; }
.mp-wga {
  position: absolute; z-index: 8; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px;
  padding: 5px 10px 5px 7px; background: rgba(6, 5, 6, .92); border: 1px solid #e879f9; border-radius: var(--r-pill);
  cursor: pointer; color: #f5c2ff; font: 500 10px/1 var(--data); letter-spacing: .05em; white-space: nowrap;
  box-shadow: 0 0 16px -2px rgba(232, 121, 249, .55); animation: wgaPulse 1.6s ease-in-out infinite;
}
.mp-wga:hover { background: rgba(232, 121, 249, .18); }
@keyframes wgaPulse { 0%, 100% { box-shadow: 0 0 12px -3px rgba(232, 121, 249, .45); } 50% { box-shadow: 0 0 22px 0 rgba(232, 121, 249, .85); } }
.mp-wga .wga-tri { flex: 0 0 auto; transition: transform .12s linear; }
.mp-wga .wga-txt { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
#map-viewport.mode-3d .mp-wga { display: none !important; }

/* ── the layer rows (live .lyr) ─────────────────────────────────────────── */
.mp-lyrs { display: flex; flex-direction: column; gap: 3px; }
.mp-bulk { display: flex; gap: 6px; margin-bottom: 9px; flex-wrap: wrap; }
.mp-bulk-btn {
  flex: 1 1 30%; min-height: 30px; padding: 6px 4px; cursor: pointer;
  border: 1px solid var(--line-up); border-radius: var(--r); background: transparent; color: var(--t-sec);
  font: 500 9px/1 var(--data); letter-spacing: .12em; text-transform: uppercase; transition: color var(--quick), border-color var(--quick), background var(--quick);
}
.mp-bulk-btn:hover { color: var(--t-hi); border-color: var(--line-hot); background: var(--panel-up); }
.mp-lyr {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 7px 9px;
  border: 1px solid transparent; border-radius: var(--r); background: transparent; cursor: pointer; text-align: left;
  transition: background var(--quick), border-color var(--quick);
}
.mp-lyr:hover { background: var(--panel-up); border-color: var(--line); }
.mp-lyr.sel { outline: 1px dashed var(--ember); outline-offset: 1px; }
.mp-lyr-ic { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; opacity: .45; transition: opacity var(--quick); }
.mp-lyr.on .mp-lyr-ic { opacity: 1; }
.mp-lyr-nm { flex: 1 1 auto; min-width: 0; font: 500 11px/1.2 var(--data); letter-spacing: .05em; color: var(--t-ter); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--quick); }
.mp-lyr.on .mp-lyr-nm { color: var(--t-hi); }
.mp-lyr-ct { flex: 0 0 auto; font-size: 10px; letter-spacing: .04em; color: var(--t-dim); min-width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.mp-lyr.on .mp-lyr-ct { color: var(--t-sec); }
.mp-lyr-warn { margin: 4px 2px 2px; padding: 8px 10px; border-left: 2px solid var(--violet-ink); color: var(--t-sec); font: 500 10.5px/1.5 var(--data); letter-spacing: .04em; }
.mp-lyr-warn[hidden] { display: none; }
/* the switch, shared by the rows and the drawer's visibility toggle */
.mp-tg { flex: 0 0 auto; position: relative; width: 34px; height: 19px; border-radius: var(--r-pill); background: var(--panel-hi); border: 1px solid var(--line-up); transition: background var(--quick), border-color var(--quick), box-shadow var(--quick); }
.mp-tg::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--t-ter); transition: transform var(--quick), background var(--quick); }
.on > .mp-tg, .mp-tg.on { background: var(--ember); border-color: var(--ember); box-shadow: 0 0 12px -3px rgba(232, 144, 26, .8); }
.on > .mp-tg::after, .mp-tg.on::after { transform: translateX(15px); background: #fff; }
.mp-lyr-friends.on > .mp-tg { background: #5fd0e0; border-color: #5fd0e0; box-shadow: 0 0 12px -3px rgba(95, 208, 224, .6); }

/* ── the You card ───────────────────────────────────────────────────────── */
.mp-you { padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(255, 255, 255, .02); transition: border-color .25s; }
.mp-you.live { border-color: rgba(232, 144, 26, .45); background: rgba(232, 144, 26, .05); }
.mp-you-empty { font: 400 12px/1.6 var(--ui); color: var(--t-sec); }
.mp-you-hdr { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mp-ava { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; background: linear-gradient(135deg, var(--ember), var(--violet-deep)) center / cover; }
.mp-who { font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: .08em; color: var(--t-hi); text-transform: uppercase; line-height: 1.1; word-break: break-word; }
.mp-sub { font: 500 9px/1.3 var(--data); letter-spacing: .18em; color: var(--t-dim); text-transform: uppercase; margin-top: 4px; }
.mp-you.live .mp-sub { color: var(--ember-ink); }
.mp-coord { font: 500 11px/1.5 var(--data); letter-spacing: .08em; color: var(--t-hi); padding-top: 8px; border-top: 1px dashed var(--line-up); }
.mp-coord .mp-ck { color: var(--ember-ink); font-weight: 600; margin-right: 6px; }
.mp-coord .mp-ck.dim { color: var(--t-dim); }
.mp-coord .mp-ck.warm { color: var(--violet-ink); }
.mp-note { font: 400 11px/1.55 var(--ui); color: var(--t-ter); margin-top: 6px; }
.mp-signin { display: inline-block; margin-top: 10px; }
.mp-vbars { display: flex; flex-direction: column; gap: 5px; padding-top: 8px; border-top: 1px dashed var(--line-up); font-family: var(--data); letter-spacing: .08em; margin-top: 8px; }

/* vitals bars - shared by the rail card and the combat HUD */
.vh-row { display: flex; align-items: center; gap: 7px; }
.vh-k { flex: 0 0 64px; font-size: 8.5px; color: var(--t-dim); text-transform: uppercase; letter-spacing: .14em; }
.vh-track { flex: 1 1 auto; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.vh-fill { display: block; height: 100%; border-radius: 4px; transition: width .5s var(--quick); }
.vh-fill.hp { background: linear-gradient(90deg, #3ddc84, #7fe7a8); }
.vh-fill.st { background: linear-gradient(90deg, #ffd54f, #ffe082); }
.vh-fill.hu { background: linear-gradient(90deg, #ff9046, #ffb47a); }
.vh-fill.th { background: linear-gradient(90deg, #4fb6ff, #8fd2ff); }
.vh-fill.o2 { background: linear-gradient(90deg, #59e0d8, #9ff0ea); }
.vh-fill.gr { background: linear-gradient(90deg, #ff9046, #ffd54f); }
.vh-fill.sp { background: linear-gradient(90deg, #b39ddb, #d1c4e9); }
.vh-fill.bt { background: linear-gradient(90deg, #ff7043, #ffab91); }
.vh-fill.fr { background: linear-gradient(90deg, #d7ccc8, #efebe9); }
.vh-fill.bl { background: linear-gradient(90deg, #ff5252, #ff8a80); }
.vh-fill.da { background: linear-gradient(90deg, #ffd54f, #fff59d); }
.vh-fill.db { background: linear-gradient(90deg, #ff8a65, #ffab91); }
.vh-fill.dc { background: linear-gradient(90deg, #7fd8c9, #b2ebe2); }
.vh-fill.low { background: linear-gradient(90deg, #ff5252, #ff8a65); }
.vh-v { flex: 0 0 32px; text-align: right; font-size: 9px; color: var(--t-sec); }

/* the combat HUD over the map, left side, collapsible (live #vitalsHud) */
.mp-vh {
  position: absolute; left: 16px; top: 164px; z-index: 8; display: none; flex-direction: column;
  width: 248px; max-width: calc(100% - 40px); max-height: calc(100% - 232px);
  background: rgba(6, 5, 6, .9); border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--data); letter-spacing: .06em; overflow: hidden;
}
.mp-vh.on { display: flex; }
.mp-vh-hd { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; user-select: none; }
.mp-vh-hd:hover { background: rgba(255, 255, 255, .03); }
.mp-vh-nm { flex: 1 1 auto; font-size: 10.5px; letter-spacing: .16em; color: var(--t-hi); text-transform: uppercase; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-vh-gp { font-size: 9.5px; color: var(--ember-core); font-weight: 600; }
.mp-vh-chev { color: var(--t-dim); font-size: 10px; transition: transform .25s; }
.mp-vh.min .mp-vh-chev { transform: rotate(-90deg); }
.mp-vh-mini { height: 3px; background: rgba(255, 255, 255, .08); display: none; }
.mp-vh-mini i { display: block; height: 100%; background: linear-gradient(90deg, #3ddc84, #7fe7a8); transition: width .5s; }
.mp-vh-mini i.low { background: linear-gradient(90deg, #ff5252, #ff8a65); }
.mp-vh.min .mp-vh-mini { display: block; }
.mp-vh-body { display: flex; flex-direction: column; gap: 8px; padding: 2px 12px 12px; overflow-y: auto; scrollbar-width: thin; }
.mp-vh.min .mp-vh-body { display: none; }
.mp-vh-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.mp-vchip { font-size: 8.5px; letter-spacing: .12em; color: var(--t-sec); border: 1px solid var(--line-up); border-radius: 5px; padding: 2px 6px; text-transform: uppercase; }
.mp-vchip.prime { color: #ffd86b; border-color: rgba(255, 200, 90, .5); }
.mp-vchip.elder { color: #c9b8ff; border-color: rgba(160, 130, 255, .45); }
.mp-vchip.bleed { color: #ff6b6b; border-color: rgba(255, 80, 80, .55); animation: mp-pulse 1.4s ease-in-out infinite; }
.mp-vstat { display: flex; flex-direction: column; gap: 3px; }
.mp-vstat .r1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.mp-vstat .ic { font-size: 10px; flex: 0 0 auto; color: var(--t-dim); }
.mp-vstat .lb { flex: 1 1 auto; font-size: 8.5px; letter-spacing: .14em; color: var(--t-dim); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-vstat .vl { flex: 0 0 auto; font-size: 10px; color: var(--t-hi); }
.mp-vh .vh-track { height: 6px; }
.mp-vsec { margin-top: 2px; font-size: 8.5px; letter-spacing: .2em; color: var(--t-dim); text-transform: uppercase; border-top: 1px dashed var(--line-up); padding-top: 9px; }

/* ── the Selection card ─────────────────────────────────────────────────── */
.mp-pin { display: block; }
.mp-pin-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.mp-pin-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.mp-pin-name { flex: 1; min-width: 0; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--t-hi); text-transform: uppercase; line-height: 1.1; word-break: break-word; }
.mp-pin-x { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; border: 0; background: none; color: var(--t-sec); font-size: 18px; line-height: 1; cursor: pointer; }
.mp-pin-x:hover { background: var(--panel-up); color: var(--t-hi); }
.mp-stat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; font-size: 11px; border-top: 1px solid var(--line); }
.mp-stat:first-of-type { border-top: none; }
.mp-stat .mp-sk { color: var(--t-dim); letter-spacing: .14em; text-transform: uppercase; font: 500 10px/1.3 var(--data); }
.mp-stat .mp-sv { color: var(--t-hi); font: 500 11px/1.3 var(--data); font-variant-numeric: tabular-nums; text-align: right; }
.mp-stat .mp-sv.from { color: var(--ember-core); }
.mp-pin-desc { font-size: 12px; color: var(--t-sec); line-height: 1.55; margin: 8px 0 0; }
.mp-pin-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mp-pin-row .btn { flex: 1 1 auto; }
/* "go there" is the magenta of the guide line and arrow it arms */
.mp-pin-row .btn.mp-goto { border-color: #e879f9; color: #f5c8ff; }
.mp-pin-row .btn.mp-goto:hover { background: rgba(232, 121, 249, .18); }
.mp-pin-edit { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.mp-pin-edit label { font: 500 9px/1.4 var(--data); letter-spacing: .18em; color: var(--t-dim); text-transform: uppercase; display: flex; flex-direction: column; gap: 4px; }
.mp-pin-edit textarea { min-height: 50px; resize: vertical; font: inherit; font-size: 12px; padding: 7px 9px; background: var(--void); border: 1px solid var(--line-up); color: var(--t-hi); border-radius: var(--r); }

/* ── tooltip + toast ────────────────────────────────────────────────────── */
.mp-tip {
  position: fixed; z-index: 150; display: none; max-width: 240px; padding: 8px 10px; pointer-events: none;
  background: rgba(6, 5, 6, .96); border: 1px solid var(--line-up); border-radius: var(--r);
  font-size: 10px; letter-spacing: .1em; color: var(--t-body); text-transform: uppercase;
}
.mp-tip.show { display: block; animation: tipIn .15s ease; }
@keyframes tipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mp-tip .h { color: var(--ember-core); margin-bottom: 3px; display: block; font-size: 11px; }
.mp-tip .hint { color: var(--t-dim); font-size: 9px; }
.mp-toast {
  position: absolute; left: 50%; top: 70px; transform: translate(-50%, -12px); z-index: 9; pointer-events: none;
  padding: 8px 14px; background: rgba(6, 5, 6, .96); border: 1px solid var(--ember-deep); border-radius: var(--r);
  color: var(--t-hi); font: 500 11px/1.4 var(--data); letter-spacing: .08em; max-width: calc(100% - 40px); text-align: center;
  opacity: 0; transition: opacity .25s var(--quick), transform .25s var(--quick); box-shadow: var(--glow-2);
}
.mp-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── the modal (replaces native prompt()/confirm()) ─────────────────────── */
.mp-modal { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; padding: 16px; animation: modalIn .18s var(--quick); }
.mp-modal[hidden] { display: none; }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.mp-modal-scrim { position: absolute; inset: 0; background: rgba(2, 1, 3, .74); }
.mp-modal-card { position: relative; width: min(420px, 100%); padding: 22px 22px 18px; animation: modalCardIn .25s var(--quick); }
@keyframes modalCardIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.mp-corner { position: absolute; width: 14px; height: 14px; border: 1px solid var(--ember-deep); pointer-events: none; opacity: .8; }
.mp-corner.tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.mp-corner.tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.mp-corner.bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.mp-corner.br { bottom: 8px; right: 8px; border-left: none; border-top: none; }
.mp-modal-title { font-size: 17px; letter-spacing: .08em; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.mp-modal-title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ember); box-shadow: var(--glow-2); flex: 0 0 auto; }
.mp-modal-body { font-size: 13px; color: var(--t-body); line-height: 1.55; margin-bottom: 14px; }
.mp-modal-body .mp-modal-msg { font-size: 12px; color: var(--t-sec); margin-bottom: 10px; letter-spacing: .02em; }
.mp-modal-body input { width: 100%; font: 500 13px/1 var(--data); padding: 10px 12px; background: var(--void); border: 1px solid var(--line-up); border-radius: var(--r); color: var(--t-hi); outline: none; letter-spacing: .04em; }
.mp-modal-body input:focus { border-color: var(--ember-core); }
.mp-modal-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ── the friends drawer ─────────────────────────────────────────────────── */
.mp-fd-scrim { position: fixed; inset: 0; z-index: 145; background: rgba(2, 1, 3, .55); opacity: 0; pointer-events: none; transition: opacity .22s var(--quick); }
.mp-fd-scrim[hidden] { display: none; }
#gd-mp.fd-open .mp-fd-scrim { opacity: 1; pointer-events: auto; }
.mp-fd {
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 92vw; z-index: 146;
  display: flex; flex-direction: column; background: rgba(8, 6, 7, .97);
  border-left: 1px solid var(--line-up); box-shadow: -24px 0 60px -30px rgba(0, 0, 0, .8);
  transform: translateX(100%); transition: transform .26s var(--quick);
}
.mp-fd[hidden] { display: none; }
#gd-mp.fd-open .mp-fd { transform: translateX(0); }
.mp-fd-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.mp-fd-title { flex: 1; font-size: 17px; letter-spacing: .1em; }
.mp-fd-x { width: 30px; height: 30px; border-radius: 7px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--t-sec); cursor: pointer; }
.mp-fd-x:hover { background: var(--panel-up); color: var(--t-hi); }
.mp-fd-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px calc(24px + var(--livebar-h, 34px)); display: flex; flex-direction: column; gap: 18px; scrollbar-width: thin; }
.mp-fd-status { padding: 8px 10px; border-radius: var(--r); background: var(--panel-up); border: 1px solid var(--line-up); color: var(--t-sec); font-size: 11px; line-height: 1.5; }
.mp-fd-status[hidden] { display: none; }
.mp-fd-status.err { border-color: var(--violet-ink); color: var(--t-hi); }
.mp-fd-sec { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.mp-fd-sec:last-child { border-bottom: none; padding-bottom: 0; }
.mp-fd-h { font-size: 12px; margin: 0 0 10px; gap: 8px; }
.mp-fd-h .tag { margin-left: auto; }
.mp-fd-link { display: block; padding: 10px 12px; border: 1px solid var(--line-up); border-radius: var(--r); font: 500 11px/1.5 var(--data); letter-spacing: .06em; color: var(--t-sec); text-align: center; transition: color var(--quick), border-color var(--quick); }
.mp-fd-link:hover { color: var(--t-hi); border-color: var(--line-hot); }
.mp-fd-vis { display: flex; align-items: center; gap: 12px; width: 100%; padding: 4px 0; border: none; background: none; text-align: left; cursor: pointer; }
.mp-fd-vis-copy { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.mp-fd-vis-label { font: 600 13px/1.3 var(--ui); color: var(--t-hi); letter-spacing: .02em; }
.mp-fd-vis-help { font: 400 11px/1.5 var(--ui); color: var(--t-ter); }
.mp-fd-coderow { display: flex; gap: 8px; margin-bottom: 8px; }
.mp-fd-code { flex: 1; min-width: 0; font-size: 15px; letter-spacing: .14em; color: var(--t-hi); background: var(--void); border: 1px solid var(--line-up); border-radius: var(--r); padding: 7px 12px; text-align: center; user-select: all; }
.mp-fd-addrow { display: flex; gap: 8px; }
.mp-fd-addrow .input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .1em; }
.mp-fd-addrow .input::placeholder { text-transform: none; letter-spacing: .02em; }
.mp-fd-list { display: flex; flex-direction: column; gap: 8px; }
.mp-fd-list + .mp-fd-list { margin-top: 8px; }
.mp-fd-empty { font-size: 11px; color: var(--t-ter); letter-spacing: .03em; padding: 6px 2px; line-height: 1.5; }
.mp-fd-row { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: var(--r); background: var(--panel-up); border: 1px solid var(--line); flex-wrap: wrap; }
.mp-fd-ava { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; background: linear-gradient(135deg, var(--ember), var(--violet-deep)) center / cover; }
.mp-fd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-fd-name { font-size: 12.5px; color: var(--t-hi); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-fd-sub { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--t-ter); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-fd-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--t-off); flex: 0 0 auto; }
.mp-fd-dot.on { background: var(--ember-core); box-shadow: 0 0 6px rgba(232, 144, 26, .7); }
.mp-fd-onmap { flex: 0 0 auto; font: 500 8.5px/1.2 var(--data); letter-spacing: .08em; text-transform: uppercase; color: #5fd0e0; border: 1px solid rgba(95, 208, 224, .5); border-radius: 5px; padding: 3px 6px; white-space: nowrap; }
.mp-fd-act { display: flex; gap: 6px; flex: 0 0 auto; }

/* ── debug panel (?debug) ───────────────────────────────────────────────── */
.mp-debug { position: absolute; left: 16px; bottom: 64px; z-index: 8; max-width: 320px; padding: 9px 11px; pointer-events: none; background: rgba(6, 5, 6, .9); border: 1px solid var(--line); border-radius: var(--r); font: 400 10px/1.55 var(--data); color: var(--t-sec); letter-spacing: .03em; }
.mp-debug b { color: var(--ember-core); }

/* ── the page root's own states ─────────────────────────────────────────── */
#gd-mp.gesturing #leafmap { will-change: transform; }

/* ── reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mp-dot.on, .mp-vchip.bleed, .guide-line, .guide-target, .mp-wga { animation: none; }
  .mp-modal, .mp-modal-card, .mp-tip.show { animation: none; }
}

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .mp-wrap { grid-template-columns: minmax(0, 1fr) 290px; gap: var(--s4); }
}
@media (max-width: 960px) {
  .mp-wrap { grid-template-columns: minmax(0, 1fr); }
  .mp-viewport { height: clamp(420px, 62vh, 640px); }
  .mp-compass { display: none; }
}
@media (max-width: 700px) {
  .mp-hud { flex-direction: row; flex-wrap: wrap; gap: 4px; left: 8px; top: 8px; right: 56px; font-size: 8.5px; letter-spacing: .08em; }
  .mp-hud-row { min-width: 0; padding: 4px 7px; gap: 5px; }
  .mp-hud-row:nth-child(3), .mp-hud-row:nth-child(4) { display: none; }
  .mp-hud-row:first-child .mp-hud-k { display: none; }
  .mp-tag { display: none; }
  .mp-tilt { padding: 6px 5px; gap: 4px; right: 8px; }
  #tilt { height: 84px; }
  .mp-tilt-lab { font-size: 8px; letter-spacing: .1em; }
  .mp-tilt-val { font-size: 8.5px; min-width: 22px; }
  .mp-vh { left: 8px; top: 46px; width: min(232px, calc(100% - 88px)); max-height: calc(100% - 120px); }
  .mp-vh-hd { padding: 8px 10px; }
  .mp-vh-body { padding: 0 10px 10px; gap: 7px; }
  .mp-bottom { left: 8px; right: 8px; bottom: 8px; }
  .mp-zoom .tool { height: 36px; min-width: 36px; font-size: 16px; }
  .mp-wga { padding: 8px; }
  .mp-wga .wga-txt { display: none; }
  .mp-fd { width: 100vw; max-width: 100vw; border-left: none; }
  .mp-rail .panel-h { flex-wrap: wrap; }
}
