/* ==========================================================================
 * Festival Studio - Venue map screen (js/views/map.js, js/map/panels*.js)
 *
 * The map fills the page; everything else floats on it as flat cards in the
 * studio's own dark panel color, so the chrome reads the same on the light
 * Outdoors style, on Dark and on Satellite. No backdrop blur: a blurred
 * panel over a WebGL canvas costs a frame on every map move.
 *
 * st-map__*        the frame: tab strip, the venue pane and its overlay grid
 * st-map-card      the floating card look
 * st-map-list      left panel: tabs with counts, search, rows
 * st-map-row       one row of a list;  st-map-group  a group heading
 * st-map-tools     toolbar;  st-map-shapes  the Area tool's shape switch
 * st-map-mode      the bar that replaces the toolbar while an outline is at work
 * st-map-preview   attendee preview bar;  st-map-controls  style / fit / preview
 * st-map-insp      right panel: the inspector;  st-map-plan  its venue plan panel
 * st-map-hint      the guidance line at the bottom
 * st-map-first     first-run card on an empty festival
 * st-map-legend    vendor spots by tier (Milestone H), over the map
 *
 * The Tour tab is styled in tour.css. The shared kit is in /studio/studio.css.
 * ========================================================================== */

/* ---------- frame ---------- */
.st-map { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.st-map__strip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 16px; min-height: 40px;
  padding: 0 var(--st-page-pad); border-bottom: 1px solid var(--st-border); background: var(--st-bg);
}
.st-map__strip .st-tabs { border-bottom: 0; }
.st-map__strip .st-tab { height: 40px; }
.st-map__summary { font-size: 12.5px; color: var(--st-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; border-radius: 6px; }
.st-map__summary:hover { color: var(--st-text); text-decoration: underline; text-underline-offset: 3px; }

.st-map__venue {
  --st-map-list-w: 300px;
  --st-map-side-w: 320px;
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: var(--st-bg-elev);
  container: st-map / inline-size;
}
.st-map__tour { flex: 1 1 auto; min-height: 0; }
.st-map__tour-loading { height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--st-text-dim); font-size: 13.5px; }

/* The frame of the map, and inside it the element of the Mapbox map itself (replaced when the
   map has to be rebuilt). Two classes on purpose: mapbox-gl.css sets
   .mapboxgl-map { position: relative } and loads after this file. */
.st-map__venue > .st-map__canvas { position: absolute; inset: 0; }
.st-map__canvas > .st-map__gl { position: absolute; inset: 0; }
.st-map__loading { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: var(--st-bg-elev); }

/* The panels sit in a grid laid over the map. The grid and its cells let
   the pointer through; only the cards take it. */
.st-map__overlay {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: grid; gap: 12px; padding: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "list top top" "list mid side" "list hint side";
}
.st-map__list { grid-area: list; display: flex; flex-direction: column; align-items: flex-start; min-height: 0; }
.st-map__top { grid-area: top; display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
/* The toolbar, with the Area tool's shape switch under it IN the flow: the row then belongs to the
   top grid row and pushes the inspector down, instead of lying over its heading in a narrow window. */
.st-map__tools { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.st-map__mid { grid-area: mid; display: flex; justify-content: center; align-items: flex-start; min-width: 0; min-height: 0; }
.st-map__side { grid-area: side; display: flex; flex-direction: column; width: var(--st-map-side-w); min-height: 0; }
/* The side padding keeps the line clear of Mapbox's zoom buttons and attribution, which sit in the corners of this row. */
.st-map__hint { grid-area: hint; display: flex; justify-content: center; min-width: 0; padding: 0 46px; container: st-map-hint / inline-size; }
/* The local "emulator" badge sits at the bottom center of the window. */
body:has(.st-env-badge) .st-map__hint { padding-bottom: 30px; }

.st-map-card, .st-map-list, .st-map-insp {
  pointer-events: auto;
  background: color-mix(in srgb, var(--st-bg-elev) 94%, transparent);
  border: 1px solid var(--st-border-strong);
  border-radius: var(--st-r-12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}
/* The two reading panels are solid: their sticky headings need one flat color behind them. */
.st-map-list, .st-map-insp { background: var(--st-bg-elev); }

/* Mapbox keeps its logo bottom left and its zoom buttons bottom right:
   move both out from under the panels. */
.st-map__venue.has-list .mapboxgl-ctrl-bottom-left { left: calc(var(--st-map-list-w) + 12px); }
.st-map__venue.has-side .mapboxgl-ctrl-bottom-right { right: calc(var(--st-map-side-w) + 12px); }

/* ---------- small shared pieces ---------- */
.st-map-kbd { display: inline-flex; align-items: center; gap: 3px; vertical-align: baseline; }
.st-map-kbd kbd {
  min-width: 18px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--st-border-strong);
  background: rgba(255, 255, 255, 0.06); color: var(--st-text-dim);
  font: 600 11px/1.45 var(--st-font); text-align: center; white-space: nowrap;
}
.st-map-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9); }
.st-map-chip { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid transparent; }
.st-map-badge { flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.st-map-badge--activity { background: #8b5cf6; }

/* ---------- left: the lists ---------- */
.st-map-list { flex: 1 1 auto; display: flex; flex-direction: column; width: var(--st-map-list-w); min-height: 0; overflow: hidden; }
.st-map__list-toggle { padding: 3px; }
.st-map__list-toggle .st-btn { color: var(--st-text); }

.st-map-list__head { flex: 0 0 auto; border-bottom: 1px solid var(--st-border); }
.st-map-list__tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.st-map-list__tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; padding: 9px 4px 7px 12px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--st-text-muted); text-align: left;
  transition: color var(--st-ease), border-color var(--st-ease);
}
.st-map-list__tab:hover { color: var(--st-text-dim); }
.st-map-list__tab:focus-visible { outline-offset: -2px; border-radius: 8px; }
.st-map-list__tab-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.st-map-list__count { font-size: 15px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--st-text-dim); }
.st-map-list__tab.is-active { color: var(--st-text); border-bottom-color: var(--st-violet-2); }
.st-map-list__tab.is-active .st-map-list__count { color: var(--st-text); }
.st-map-list__todo { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--st-amber); }
.st-map-list__tab.has-todo .st-map-list__todo { display: inline-block; }

.st-map-list__search { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 10px 8px 6px 10px; }
.st-map-list__search .st-search { flex: 1 1 auto; }
/* scroll-padding: a row scrolled into view from above stops below the sticky group heading (38px), not under it. */
.st-map-list__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 8px; scroll-padding-top: 38px; }
.st-map-list__body:focus-visible { outline-offset: -2px; }
.st-map-list__rows { display: flex; flex-direction: column; gap: 1px; }
.st-map-list__loading { padding: 14px 8px; }
.st-map-list__note { padding: 6px 8px 8px; font-size: 12px; line-height: 1.45; color: var(--st-text-muted); }
.st-map-list__foot { flex: 0 0 auto; padding: 8px 14px 9px; border-top: 1px solid var(--st-border); font-size: 12.5px; }
.st-map-list__foot .st-textlink { display: inline-flex; align-items: center; gap: 5px; }
.st-map-list .st-empty--compact { padding: 22px 12px 18px; }
.st-map-list .st-empty__title { font-size: 14px; }
.st-map-list .st-empty__body { font-size: 12.5px; }
.st-map-list.is-locked .st-map-row { opacity: 0.6; }

.st-map-group {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 4px 4px 2px 8px;
  background: var(--st-bg-elev); color: var(--st-text-muted); text-align: left;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.st-map-group__count { font-variant-numeric: tabular-nums; color: var(--st-text-dim); letter-spacing: 0; }
.st-map-group--toggle { margin-top: 6px; border-top: 1px solid var(--st-border); cursor: pointer; }
.st-map-group--toggle:hover { color: var(--st-text); }
.st-map-group--toggle:focus-visible { outline-offset: -2px; border-radius: 6px; }
/* Every heading is the same height, so the one that sticks covers the one it replaces. */
.st-map-group .st-btn { height: 28px; letter-spacing: 0; text-transform: none; }

.st-map-row { display: flex; align-items: center; gap: 4px; min-height: 34px; padding-right: 4px; border-radius: var(--st-r-8); }
.st-map-row:hover, .st-map-row.is-hover { background: rgba(255, 255, 255, 0.055); }
.st-map-row.is-selected { background: rgba(109, 92, 255, 0.24); }
.st-map-row.is-placing { background: rgba(109, 92, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.6); }
.st-map-row.is-dragging { opacity: 0.5; }
.st-map-row--place[draggable="true"] { cursor: grab; }
.st-map-row__main {
  flex: 1 1 auto; min-width: 0; min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px;
  border-radius: var(--st-r-8); color: var(--st-text); font-size: 13px; text-align: left;
}
.st-map-row__main:focus-visible { outline-offset: -2px; }
a.st-map-row__main:hover .st-map-row__name { text-decoration: underline; }
.st-map-row__booth {
  flex: 0 0 auto; min-width: 24px; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--st-text-dim); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.st-map-row__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-map-row__name.is-unnamed { color: var(--st-text-muted); }
.st-map-row__meta { flex: 0 0 auto; font-size: 12px; color: var(--st-text-muted); white-space: nowrap; }
.st-map-row__flag { flex: 0 0 auto; color: var(--st-lavender); }
.st-map-row__warn { flex: 0 0 auto; color: var(--st-amber); }
.st-map-row__shape { flex: 0 0 auto; color: var(--st-text-muted); }
.st-map-row__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.st-map-row__text .st-map-row__name { flex: 0 0 auto; }
.st-map-row__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--st-text-muted); font-variant-numeric: tabular-nums; }
.st-map-row--tall .st-map-row__main { padding-top: 6px; padding-bottom: 6px; }
.st-map-row--removed .st-map-row__main { opacity: 0.6; }
.st-map-row__status { flex: 0 0 auto; padding-right: 6px; font-size: 12px; font-weight: 600; color: var(--st-lavender); white-space: nowrap; }
.st-map-row__action.st-btn { height: 26px; padding: 0 9px; }

/* ---------- top: toolbar ---------- */
.st-map-tools { display: flex; align-items: center; gap: 2px; padding: 4px; }
.st-map-tool {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 56px; height: 46px; padding: 0 8px; border-radius: var(--st-r-8);
  color: var(--st-text-dim); font-size: 11.5px; font-weight: 500; line-height: 1;
  transition: background var(--st-ease), color var(--st-ease);
}
.st-map-tool:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: var(--st-text); }
.st-map-tool.is-active, .st-map-tool.is-active:hover:not(:disabled) { background: var(--st-violet); color: #fff; }
.st-map-tool:disabled { opacity: 0.4; cursor: not-allowed; }
.st-map-tool--icon { min-width: 38px; padding: 0; }
.st-map-tools__sep { flex: 0 0 auto; width: 1px; height: 26px; margin: 0 4px; background: var(--st-border-strong); }

/* Tooltip naming the tool and its key. Plain text from data-tip. It opens under the toolbar, and
   under the shape switch while that is showing (--st-map-tip-drop, set by views/map.js): the
   switch is what the host picks from next and must not be covered. */
.st-map-tool[data-tip]::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 9px + var(--st-map-tip-drop, 0px)); left: 50%; transform: translateX(-50%); z-index: 6;
  padding: 5px 8px; border-radius: 6px; background: #05060a; border: 1px solid var(--st-border-strong); color: var(--st-text);
  font-size: 12px; font-weight: 500; line-height: 1.2; white-space: nowrap; pointer-events: none; opacity: 0;
  transition: opacity var(--st-ease);
}
.st-map-tool[data-tip]:hover::after { opacity: 1; transition-delay: 350ms; }
.st-map-tool[data-tip]:focus-visible::after { opacity: 1; }

.st-map-shapes { display: flex; flex-wrap: wrap; justify-content: center; max-width: 100%; gap: 2px; padding: 3px; }
.st-map-shape {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px;
  color: var(--st-text-dim); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: background var(--st-ease), color var(--st-ease);
}
.st-map-shape:hover { background: rgba(255, 255, 255, 0.07); color: var(--st-text); }
.st-map-shape.is-active { background: rgba(109, 92, 255, 0.3); color: #fff; }

.st-map-mode { display: flex; align-items: center; gap: 6px; width: min(540px, 100%); padding: 7px 7px 7px 14px; border-color: rgba(124, 92, 255, 0.65); }
.st-map-mode__icon { flex: 0 0 auto; display: grid; color: var(--st-lavender); }
.st-map-mode__title { min-width: 0; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }

.st-map-preview { display: flex; flex-direction: column; gap: 10px; width: min(600px, 100%); padding: 10px 12px 12px; border-color: rgba(124, 92, 255, 0.65); }
.st-map-preview__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-map-preview__title { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.st-map-preview__title .st-icon { color: var(--st-lavender); }
.st-map-preview__zoom { font-size: 12.5px; color: var(--st-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-map-preview__tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.st-map-preview__tier {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px 9px 7px; border-radius: var(--st-r-8);
  border: 1px solid var(--st-border-strong); text-align: left; color: var(--st-text-dim);
  transition: background var(--st-ease), border-color var(--st-ease), color var(--st-ease);
}
.st-map-preview__tier:hover { background: rgba(255, 255, 255, 0.05); color: var(--st-text); }
.st-map-preview__tier.is-active { background: rgba(109, 92, 255, 0.2); border-color: rgba(124, 92, 255, 0.7); color: #fff; }
.st-map-preview__tier-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.st-map-preview__tier-zoom { font-size: 11.5px; color: var(--st-text-muted); font-variant-numeric: tabular-nums; }
.st-map-preview__tier.is-active .st-map-preview__tier-zoom { color: #d7d1ff; }
.st-map-preview__text { font-size: 12.5px; line-height: 1.45; color: var(--st-text-dim); }

.st-map-controls { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; padding: 4px; }
.st-map-controls .st-btn--ghost { color: var(--st-text); }
.st-map-controls__plan.is-active, .st-map-controls__plan.is-active:hover { background: rgba(109, 92, 255, 0.24); color: #fff; }

/* ---------- right: inspector ---------- */
.st-map-insp { flex: 0 1 auto; width: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.st-map-insp--loading { padding: 18px 16px; }
.st-map-insp__panel { display: flex; flex-direction: column; }
.st-map-insp__panel:focus-visible { outline: none; }
.st-map-insp__head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 11px 8px 10px 14px;
  background: var(--st-bg-elev); border-bottom: 1px solid var(--st-border); border-radius: var(--st-r-12) var(--st-r-12) 0 0;
}
.st-map-insp__lead { flex: 0 0 auto; display: grid; place-items: center; min-width: 22px; color: var(--st-lavender); }
.st-map-insp__lead:empty { display: none; }
.st-map-insp__lead .st-map-chip { width: 22px; height: 22px; border-radius: 6px; }
.st-map-insp__lead .st-map-dot { width: 12px; height: 12px; }
.st-map-insp__titles { flex: 1 1 auto; min-width: 0; }
.st-map-insp__kind { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--st-text-muted); }
.st-map-insp__title { display: flex; align-items: baseline; gap: 7px; font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.st-map-insp__title.is-unnamed { color: var(--st-text-dim); }
.st-map-insp__title:empty { display: none; }
.st-map-insp__booth { flex: 0 0 auto; color: var(--st-text-dim); font-variant-numeric: tabular-nums; }
.st-map-insp__body { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.st-map-insp__body > div:empty { display: none; }
.st-map-insp__foot {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--st-bg-elev); border-top: 1px solid var(--st-border); border-radius: 0 0 var(--st-r-12) var(--st-r-12);
}
.st-map-insp__facts { font-size: 12.5px; line-height: 1.45; color: var(--st-text-dim); font-variant-numeric: tabular-nums; }
.st-map-insp__note { font-size: 12px; line-height: 1.5; color: var(--st-text-muted); }
.st-map-insp__group { display: flex; flex-direction: column; gap: 8px; }
.st-map-insp__group-title { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--st-text-muted); }
.st-map-insp__toggles { display: flex; flex-direction: column; gap: 12px; }
.st-map-insp__value { font-size: 12.5px; font-weight: 600; color: var(--st-text); font-variant-numeric: tabular-nums; }
.st-map-insp__line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--st-text-dim); }
.st-map-insp__line .st-map-insp__facts { color: var(--st-text); font-weight: 500; }
.st-map-insp__error { font-size: 12.5px; font-weight: 600; color: var(--st-red-text); }
.st-map-insp__result { padding: 8px 10px; border-radius: var(--st-r-8); border: 1px solid var(--st-border); background: rgba(255, 255, 255, 0.03); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.st-map-insp__result > span { display: flex; gap: 8px; }
.st-map-insp__result-label { flex: 0 0 auto; color: var(--st-text-muted); }
.st-map-insp__result.is-error { border-color: rgba(251, 191, 36, 0.38); background: rgba(251, 191, 36, 0.07); }
.st-map-insp__result.is-error .st-icon { flex: 0 0 auto; margin-top: 2px; color: var(--st-amber); }
.st-map-insp__badges { display: flex; flex-wrap: wrap; gap: 6px; }
/* An area in a live spot bidding (Milestone F): the tag, the note, the way there. */
.st-map-insp__bidding { display: flex; flex-direction: column; gap: 6px; }
.st-map-insp__bidding[hidden] { display: none; }
.st-map-insp__bidding .st-map-insp__badges { align-items: center; min-width: 0; }
.st-map-insp__bidding .st-map-insp__badges > .st-truncate { min-width: 0; flex: 1 1 0; }
.st-map-insp__add.st-btn { align-self: flex-start; margin-left: -4px; padding: 0 8px; color: var(--st-lavender); }
.st-map-insp__todo {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--st-r-10);
  border: 1px solid rgba(251, 191, 36, 0.38); background: rgba(251, 191, 36, 0.07); font-size: 13px; color: var(--st-text-dim);
}
.st-map-insp .st-field { gap: 7px; }
/* The label of an area that was just drawn: offered ("Press Enter to name it"), not focused. */
.st-map-insp .st-field.is-offered .st-input { border-color: var(--st-violet-2); box-shadow: 0 0 0 1px var(--st-violet-2); }
.st-map-insp .st-field.is-offered .st-input::placeholder { color: var(--st-lavender); opacity: 1; }
.st-map-insp .st-callout { padding: 10px 12px; font-size: 13px; }
.st-map-insp .st-swatches { gap: 5px; }
.st-map-insp .st-swatch { width: 21px; height: 21px; }
.st-map-insp .st-swatch .st-icon { width: 12px; height: 12px; }
.st-map-insp .st-swatch:hover { box-shadow: 0 0 0 2px var(--st-bg-elev), 0 0 0 3px rgba(255, 255, 255, 0.35); }
.st-map-insp .st-swatch.is-active { box-shadow: 0 0 0 2px var(--st-bg-elev), 0 0 0 4px var(--st-focus); }
.st-map-insp .st-toggle__label { font-size: 13px; }
.st-map-insp .st-toggle__desc { font-size: 12px; }
.st-map-insp__slider .st-field__label { align-items: center; }

.st-map-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.st-map-act.st-btn { justify-content: flex-start; gap: 6px; min-width: 0; padding: 0 8px; font-weight: 500; }
.st-map-act .st-btn__label { overflow: hidden; text-overflow: ellipsis; }
.st-map-act--wide { grid-column: 1 / -1; }
.st-map-acts--ruled { padding-top: 14px; border-top: 1px solid var(--st-border); }

/* ---------- right: the venue plan panel (map/panels-plan.js) ---------- */
.st-map-plan__drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px 18px;
  border: 1.5px dashed var(--st-border-strong); border-radius: var(--st-r-12); background: rgba(255, 255, 255, 0.02);
  color: var(--st-text); text-align: center; transition: border-color var(--st-ease), background var(--st-ease);
}
.st-map-plan__drop:hover, .st-map-plan__drop.is-drop { border-color: var(--st-violet-2); background: rgba(109, 92, 255, 0.08); }
.st-map-plan__drop:focus-visible { outline-offset: 2px; }
.st-map-plan__drop.is-busy { opacity: 0.6; cursor: progress; }
.st-map-plan__drop-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(109, 92, 255, 0.18); color: var(--st-lavender); }
.st-map-plan__drop-title { font-size: 13.5px; font-weight: 600; }
.st-map-plan__drop-sub { font-size: 12px; line-height: 1.45; color: var(--st-text-muted); }
.st-map-plan__working { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--st-text-dim); }
.st-map-plan__working[hidden], .st-map-plan .st-map-insp__error[hidden] { display: none; }

/* A checkerboard behind the picture, so a plan with a transparent background still reads. */
.st-map-plan__thumb {
  position: relative; display: grid; place-items: center; min-height: 96px; max-height: 190px; overflow: hidden;
  border: 1px solid var(--st-border); border-radius: var(--st-r-8);
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.05) 0 25%, transparent 0 50%) 0 0 / 16px 16px;
}
.st-map-plan__thumb img { display: block; max-width: 100%; max-height: 190px; object-fit: contain; }
.st-map-plan__thumb.is-drop { border-color: var(--st-violet-2); box-shadow: 0 0 0 1px var(--st-violet-2); }
.st-map-plan[data-face="picture"] .st-map-plan__thumb, .st-map-plan[data-face="picture"] .st-map-plan__thumb img { max-height: 260px; }
.st-map-plan__thumb-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; font-size: 12.5px; color: var(--st-text-muted); }
.st-map-plan__thumb-empty[hidden], .st-map-plan__thumb img[hidden] { display: none; }
.st-map-plan__status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--st-text-muted); }
.st-map-plan__status.is-on { color: var(--st-green); }
.st-map-plan .st-callout[hidden] { display: none; }
.st-map-plan__align.st-btn { align-self: flex-start; }
/* Lining up: a compact bar (Milestone E QA - the full panel covered the plan's top-right corner). */
.st-map-plan[data-face="align"] .st-map-insp__head { padding-top: 8px; padding-bottom: 7px; }
.st-map-plan[data-face="align"] .st-map-insp__body { gap: 10px; padding: 10px 12px 12px; }
.st-map-plan[data-face="align"] .st-map-insp__facts { margin: 0; }
.st-map-plan__how { font-size: 12.5px; color: var(--st-text-muted); }
.st-map-plan__how-sum {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; border-radius: var(--st-r-8);
  color: var(--st-text-dim);
}
.st-map-plan__how-sum::-webkit-details-marker { display: none; }
.st-map-plan__how-sum:hover { color: var(--st-text); }
.st-map-plan__how-sum:focus-visible { outline: 2px solid var(--st-focus); outline-offset: 2px; }
.st-map-plan__how[open] .st-map-plan__how-sum { color: var(--st-text); }
.st-map-plan__how-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.st-map-steps { display: flex; flex-direction: column; gap: 8px; }
.st-map-steps li { display: flex; gap: 9px; font-size: 13px; line-height: 1.45; color: var(--st-text-dim); }
.st-map-steps__n {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.09); color: var(--st-text-dim); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.st-map-steps li.is-current { color: var(--st-text); }
.st-map-steps li.is-current .st-map-steps__n { background: var(--st-violet); color: #fff; }
.st-map-steps li.is-done { color: var(--st-text-muted); }
.st-map-steps li.is-done .st-map-steps__n { background: rgba(52, 211, 153, 0.18); color: var(--st-green); }

/* The kit has no slider. The filled part of the track follows --st-range. */
.st-map-range { --st-range: 0%; -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 0; background: transparent; cursor: pointer; }
.st-map-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--st-violet-2) var(--st-range), rgba(255, 255, 255, 0.16) var(--st-range));
}
.st-map-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.st-map-range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); }
.st-map-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--st-violet-2); }
.st-map-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.st-map-range:focus-visible { outline: none; }
.st-map-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(179, 168, 255, 0.65); }
.st-map-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgba(179, 168, 255, 0.65); }

.st-map-dims { display: flex; flex-direction: column; gap: 12px; }
.st-map-dim { display: grid; grid-template-columns: 62px minmax(0, 1fr) 88px; align-items: center; gap: 10px; }
.st-map-dim__label { font-size: 12.5px; font-weight: 600; color: var(--st-text-dim); }
.st-map-dim__input { position: relative; display: flex; align-items: center; }
.st-map-dim__input .st-input { padding-right: 24px; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.st-map-dim__input .st-input::-webkit-inner-spin-button, .st-map-dim__input .st-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.st-map-dim__unit { position: absolute; right: 9px; font-size: 12px; color: var(--st-text-muted); pointer-events: none; }

.st-map-stepper { display: flex; align-items: center; gap: 6px; }
.st-map-stepper .st-input { width: 64px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.st-map-stepper .st-input::-webkit-inner-spin-button, .st-map-stepper .st-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.st-map-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.st-map-types__item {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border-radius: var(--st-r-8);
  border: 1px solid var(--st-border-strong); color: var(--st-text-dim); font-size: 13px; font-weight: 500; text-align: left;
  transition: background var(--st-ease), border-color var(--st-ease), color var(--st-ease);
}
.st-map-types__item:hover { background: rgba(255, 255, 255, 0.05); color: var(--st-text); }
.st-map-types__item.is-active { background: rgba(109, 92, 255, 0.2); border-color: rgba(124, 92, 255, 0.7); color: #fff; }

.st-map-facts { display: flex; flex-direction: column; }
.st-map-facts > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--st-border); font-size: 13px; }
.st-map-facts > div:first-child { padding-top: 0; }
.st-map-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.st-map-facts dt { color: var(--st-text-muted); }
.st-map-facts dd { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.st-map-facts dd.is-warn { color: var(--st-amber); }
.st-map-facts__link { text-align: left; }

.st-map-spots { display: flex; flex-direction: column; gap: 2px; }
.st-map-spots li { display: flex; align-items: center; gap: 4px; padding-right: 2px; border-radius: var(--st-r-8); }
.st-map-spots li:hover { background: rgba(255, 255, 255, 0.055); }
.st-map-spots li.is-current { background: rgba(109, 92, 255, 0.24); }
.st-map-spots__main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; border-radius: var(--st-r-8); font-size: 13px; text-align: left; }
.st-map-spots__main .st-icon { color: var(--st-text-muted); }

.st-map-keys summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 500; color: var(--st-text-dim); border-radius: 6px; }
.st-map-keys summary::-webkit-details-marker { display: none; }
.st-map-keys summary:hover { color: var(--st-text); }
.st-map-keys[open] summary .st-icon { transform: rotate(90deg); }
.st-map-keys dl { display: flex; flex-direction: column; gap: 7px; margin: 10px 0 0; }
.st-map-keys__row { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: baseline; gap: 8px; font-size: 12.5px; }
.st-map-keys__row dd { color: var(--st-text-dim); }

/* ---------- bottom: guidance ---------- */
.st-map-hint { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 34px; padding: 6px 14px 6px 12px; border-radius: 17px; font-size: 13px; line-height: 1.4; }
.st-map-hint__icon { flex: 0 0 auto; color: var(--st-lavender); }
.st-map-hint__text { min-width: 0; }
.st-map-hint__status {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; padding-left: 12px;
  border-left: 1px solid var(--st-border-strong); color: var(--st-green); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.st-map-hint__status .st-spinner { border-top-color: var(--st-green); }
/* A save that is taking long, or that the editor stopped waiting for: not "done", so not green.
   It is a sentence, not a word: it gets a line of its own under the guidance instead of squeezing it. */
.st-map-hint:has(.st-map-hint__status.is-waiting) { flex-wrap: wrap; row-gap: 4px; border-radius: var(--st-r-12); }
.st-map-hint:has(.st-map-hint__status.is-waiting) .st-map-hint__text { flex: 1 1 0; }
.st-map-hint__status.is-waiting {
  flex: 1 1 100%; margin-left: 23px; padding-left: 0; border-left: 0; color: var(--st-amber); white-space: normal;
}
.st-map-hint__status.is-waiting .st-spinner { flex: 0 0 auto; border-top-color: var(--st-amber); }
.st-map-hint__status.is-waiting .st-icon { flex: 0 0 auto; }
.st-map-hint__undo { margin-left: 2px; color: var(--st-lavender); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; border-radius: 4px; }
.st-map-hint__undo:hover { color: #fff; }

/* Squeezed between the lists and the inspector there is no room for a sentence: the inspector
   carries the guidance then, and this line only reports what was saved. */
@container st-map-hint (max-width: 250px) {
  .st-map-hint__text, .st-map-hint__icon { display: none; }
  .st-map-hint__status, .st-map-hint__status.is-waiting { margin-left: 0; padding-left: 0; border-left: 0; }
  .st-map-hint:has(.st-map-hint__status[hidden]) { display: none; }
}

/* ---------- middle: first run ---------- */
.st-map-first { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; width: min(480px, 100%); margin-top: 48px; padding: 16px 44px 16px 16px; }
.st-map-first__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--st-r-10); background: rgba(109, 92, 255, 0.2); color: var(--st-lavender); }
.st-map-first__title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.st-map-first__text p { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--st-text-dim); }
.st-map-first__actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; }
.st-map-first__close { position: absolute; top: 8px; right: 8px; }

/* ---------- a stand dragged from the list ---------- */
.st-map__drop { position: absolute; top: 0; left: 0; z-index: 2; width: 0; height: 0; pointer-events: none; color: #db2777; }
.st-map__drop .st-icon { position: absolute; left: -13px; top: -25px; max-width: none; fill: #fff; }
.st-map__drop-label {
  position: absolute; left: 16px; top: -26px; padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  background: #05060a; border: 1px solid var(--st-border-strong); color: var(--st-text); font-size: 12px; font-weight: 500;
}
.st-map__venue.is-dropping > .st-map__canvas::after { content: ""; position: absolute; inset: 6px; z-index: 1; border: 2px dashed var(--st-violet-2); border-radius: var(--st-r-12); pointer-events: none; }

/* ---------- states ---------- */
.st-map__venue.is-preview .st-map__list,
.st-map__venue.is-preview .st-map__mid,
.st-map__venue.is-preview .st-map__hint { display: none; }
.st-map__venue.is-preview .mapboxgl-ctrl-bottom-left { left: 0; }

/* The map could not start: the lists stay as links, the message takes the rest. */
.st-map__venue.is-fallback .st-map__top,
.st-map__venue.is-fallback .st-map__mid,
.st-map__venue.is-fallback .st-map__hint { display: none; }
.st-map__venue.is-fallback > .st-map__canvas { inset: 12px; border-radius: var(--st-r-12); }
.st-map__venue.is-fallback.has-list > .st-map__canvas { left: calc(var(--st-map-list-w) + 24px); }
.st-map__fallback-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.st-map-list.is-links .st-map-list__collapse { display: none; }

/* ---------- vendor spots (Milestone H) ---------- */
/* The inspector's "Vendor spot" group: the tier in its color, the spot's label, free or taken. */
.st-map-insp__spot {
  display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 8px 10px; font-size: 13px;
  border-radius: var(--st-r-8); border: 1px solid var(--st-border); background: rgba(255, 255, 255, 0.03);
}
.st-map-insp__spot[hidden], .st-map-insp__spotlinks[hidden] { display: none; }
.st-map-insp__spotrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-map-insp__spottier { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 55%; color: var(--st-text); }
.st-map-insp__spotlabel { flex: 1 1 0; min-width: 0; color: var(--st-text-dim); font-variant-numeric: tabular-nums; }
.st-map-insp__spotrow .st-badge { flex: 0 0 auto; margin-left: auto; }
.st-map-insp__spotwho { font-size: 12.5px; color: var(--st-text-dim); }
.st-map-insp__spotwho > .st-truncate { flex: 1 1 0; }
.st-map-insp__spotwho > .st-link { flex: 0 0 auto; }
.st-map-insp__spotlinks { margin-top: -4px; }
.st-map-insp__tieropt { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
/* A button that opens a menu: its chevron sits at the far end. */
.st-map-act--menu > .st-icon:last-child { margin-left: auto; color: var(--st-text-muted); }

/* The legend: the tiers that have spots, at the bottom left of the part of the map no panel covers.
   It grows upward from there; closed, it is one line. */
.st-map__mid { position: relative; }
.st-map-legend {
  position: absolute; left: 0; bottom: 0; display: flex; flex-direction: column;
  width: max-content; min-width: 208px; max-width: min(288px, 100%); max-height: 100%; overflow: hidden;
}
.st-map-legend[hidden] { display: none; }
.st-map-legend__head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 10px 6px 12px;
  border-radius: var(--st-r-12); color: var(--st-text); font-size: 12.5px; font-weight: 600; text-align: left;
}
.st-map-legend__head:hover { background: rgba(255, 255, 255, 0.05); }
.st-map-legend__head:focus-visible { outline-offset: -2px; }
.st-map-legend__head > .st-icon:first-child { flex: 0 0 auto; color: var(--st-lavender); }
.st-map-legend__title { flex: 0 0 auto; }
.st-map-legend__total { flex: 1 1 auto; min-width: 0; color: var(--st-text-muted); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.st-map-legend__chevron { flex: 0 0 auto; color: var(--st-text-muted); }
.st-map-legend.is-closed .st-map-legend__chevron { transform: rotate(180deg); }
.st-map-legend__rows { flex: 1 1 auto; min-height: 0; margin: 0; padding: 4px; overflow-y: auto; list-style: none; border-top: 1px solid var(--st-border); }
.st-map-legend__rows[hidden] { display: none; }
.st-map-legend__row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 4px 8px;
  border-radius: 8px; color: var(--st-text-dim); font-size: 12.5px; text-align: left;
}
.st-map-legend__row:hover { background: rgba(255, 255, 255, 0.06); }
.st-map-legend__row:focus-visible { outline-offset: -2px; }
.st-map-legend__dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
.st-map-legend__name { flex: 1 1 auto; min-width: 0; color: var(--st-text); font-weight: 500; }
.st-map-legend__count { flex: 0 0 auto; color: var(--st-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- less room ---------- */
@container st-map (max-width: 1080px) {
  .st-map__overlay, .st-map__venue > .st-map__canvas { --st-map-list-w: 264px; --st-map-side-w: 292px; }
  .st-map-tool { min-width: 38px; height: 36px; padding: 0; }
  .st-map-tool__label { display: none; }
  .st-map-controls__style .st-btn__label,
  .st-map-controls__plan .st-btn__label,
  .st-map-controls__preview .st-btn__label,
  .st-map__list-toggle .st-btn__label { display: none; }
  .st-map-shape { padding: 0 8px; }
  .st-map-first { margin-top: 44px; }
}
@container st-map (max-width: 720px) {
  .st-map__overlay {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "list top" "list mid" "side side" "hint hint";
  }
  .st-map__side { width: auto; max-height: 42cqh; }
  .st-map__top { flex-wrap: wrap; justify-content: flex-end; }
  /* The inspector is a sheet along the bottom here and would cover the zoom buttons; the wheel and pinch still zoom. */
  .st-map__venue.has-side .mapboxgl-ctrl-bottom-right { right: 0; }
  .st-map__venue.has-side .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl-group { display: none; }
}
