/* ═══════════════════════════════════════════════════
   MAPS TAB — Sprint 9 three-dock conversion (Map1)
   Bottom dock = map picker; right dock = Layers window.
   Loaded on /maker only; /studio keeps its main.css 2-col layout.
   Scoped to .maker .tab-map; element IDs unchanged (map.js wiring).
   ═══════════════════════════════════════════════════ */

.maker .tab-map .panel-body { display: flex; height: 100%; min-height: 0; }
/* Thumbnail couldn't render — show a faded map glyph so the cell reads as
   "loads on click", not a dead button (the data still loads when clicked). */
.maker .tab-map .thumb-failed {
  display: flex; align-items: center; justify-content: center;
  background: var(--chrome-lo);
}
.maker .tab-map .thumb-failed::after {
  content: '🗺️'; opacity: 0.32; font-size: 20px;
}
/* Left rail (Settings: Camera Mode · Export · BGM) — Adobe UX pass Phase 3.
   The .tab-map .controls-col chrome (border/padding/bg) lives in npc.css;
   the flex-basis was supplied by the old grid column and is restored here. */
.maker .tab-map .controls-col { flex: 0 0 var(--rail-left); width: var(--rail-left); }
.maker .tab-map .preview-col {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.maker .tab-map .preview-col .canvas-frame { flex: 1 1 auto; min-height: 0; }

/* ── MB-17 viewport render (Strategy B) ──────────────────────────────────────
   Live-tree maps render the WHOLE map once into an OFFSCREEN flatten, then
   blit only the visible window into a small, viewport-sized #map-preview-canvas
   (kills the modern 41 MB on-screen canvas + its compositor lag). The zero-
   content #map-canvas-spacer carries the FULL-map geometry — it's the flow
   element that drives native scroll + flex centering (so every scroll listener,
   scrollbar, and world↔screen coordinate consumer keeps working), while the
   main canvas is pinned to the visible corner like the bg/obj overlays. REST
   (no flatten) keeps the in-flow full-size canvas — .viewport-mode is off. */
.maker .tab-map #map-canvas-spacer {
  display: none;
  flex: 0 0 auto;
  margin: auto;
  pointer-events: none;
  visibility: hidden;   /* lays out (drives scroll) but never paints */
}
.maker .tab-map #map-canvas-frame.viewport-mode > #map-canvas-spacer { display: block; }
.maker .tab-map #map-canvas-frame.viewport-mode > #map-preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  z-index: 1;
}

/* ── Right dock — Layers / Structure only (settings moved to the left rail) ── */
.maker .tab-map .map-right-dock {
  width: var(--rail-right);
  flex: 0 0 var(--rail-right);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-5);
  overflow-y: auto;
  min-height: 0;
}
.maker .tab-map .map-right-dock .map-layer-toggle-list {
  display: flex; flex-direction: column; gap: 3px; margin-top: var(--sp-2);
}
.maker .tab-map .map-right-dock .check-row {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-4); color: var(--text); cursor: pointer;
}
.maker .tab-map .map-right-dock #map-layer-toggles .groupbox-label {
  font-size: var(--fs-3); text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-dim); margin-bottom: var(--sp-1);
}
/* Layers section fills the dock to the bottom (Derek 2026-07-30 — no inner
   scroll wheel unless the list truly overflows). */
.maker .tab-map .map-right-dock > .cv-shell-section { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.maker .tab-map .map-right-dock #map-layer-toggles { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.maker .tab-map .map-right-dock .map-layer-toggle-list { flex: 1 1 auto; overflow-y: auto; min-height: 0; }

/* ── Cinematic camera controls (MC-1) ── */
.maker .tab-map .map-cam-controls { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-3); }
.maker .tab-map .map-cam-controls[hidden] { display: none; }
.maker .tab-map .map-cam-hint { font-size: var(--fs-3); color: var(--text-dim); line-height: 1.3; }
.maker .tab-map .map-cam-slider { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-3); color: var(--text); }
.maker .tab-map .map-cam-slabel { display: flex; justify-content: space-between; color: var(--text-dim); }
.maker .tab-map .map-cam-slabel b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.maker .tab-map .map-cam-slider input[type="range"] { width: 100%; margin: 0; cursor: pointer; }
.maker .tab-map #map-cam-recenter { margin-top: 2px; }

/* ── Bottom dock — map picker (collapsible) ── */
/* Browse-dock host (internals built by SF2_BROWSE_DOCK in map.js) —
   now height-var driven + resizable like every other bottom dock. */
.maker .tab-map .map-picker-dock {
  flex: 0 0 var(--map-picker-dock-h, 270px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--border);
  background: var(--chrome-lo, rgba(0, 0, 0, 0.12));
}
.maker .tab-map .map-picker-dock.is-collapsed { flex-basis: 36px; }

/* Background-music row in the Export section (game maps only). */
.maker .tab-map .map-bgm-row { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); }
.maker .tab-map .map-bgm-label { flex: 1; font-size: var(--fs-4); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layer-export scale selector in the Export section. */
.maker .tab-map .map-layers-scale-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-2); font-size: var(--fs-4); color: var(--text-dim); }
.maker .tab-map .map-layers-scale-row select { font-size: var(--fs-4); padding: 2px var(--sp-2); border-radius: var(--r); border: 1px solid var(--border); background: var(--chrome); color: var(--text); }

/* ── Layers panel redesign (Derek 2026-07-30) — char-viewer-style rows ───────
   Header = the map itself; category rows carry eye · solo · palette · thumb. */
.maker .tab-map .map-cat-row {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 3px var(--sp-1); border-radius: var(--r); font-size: var(--fs-3); color: var(--text-mid);
}
/* [hidden] must beat the flex display — collapsed accordion rows (explode
   mode) toggle the attribute; without this they never visually hide. */
.maker .tab-map .map-cat-row[hidden] { display: none; }
.maker .tab-map .map-cat-row:hover { background: var(--accent-glow, rgba(74,158,192,0.08)); }
.maker .tab-map .map-cat-row.is-hidden .map-cat-name,
.maker .tab-map .map-cat-row.is-hidden .map-cat-thumbwrap { opacity: 0.4; }
.maker .tab-map .map-cat-row.count-zero { opacity: 0.45; }
.maker .tab-map .map-cat-head {
  font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border-lo); border-radius: var(--r) var(--r) 0 0;
  margin-bottom: 3px; padding-bottom: var(--sp-2);
}
.maker .tab-map .map-cat-btn {
  appearance: none; border: none; background: transparent; cursor: pointer;
  font-size: var(--fs-3); line-height: 1; padding: 1px; color: inherit; border-radius: var(--r); opacity: 0.85;
  display: inline-flex; align-items: center; justify-content: center;
}
.maker .tab-map .map-cat-btn:hover:not(:disabled) { opacity: 1; }
.maker .tab-map .map-cat-btn:disabled { opacity: 0.3; cursor: default; }
.maker .tab-map .map-cat-solo {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--text-dim); background: transparent; padding: 0;
}
.maker .tab-map .map-cat-solo.is-active { background: var(--accent); border-color: var(--accent); }
.maker .tab-map .map-cat-tag { margin-left: auto; font-size: var(--fs-2); filter: grayscale(1); }
.maker .tab-map .map-cat-tag.is-active { filter: none; }
.maker .tab-map .map-cat-thumbwrap {
  width: 26px; height: 26px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-lo); border-radius: var(--r); overflow: hidden;
  background: repeating-conic-gradient(rgba(127,127,127,0.12) 0% 25%, transparent 0% 50%) 50% / 8px 8px;
}
.maker .tab-map .map-cat-thumbwrap.head { width: 48px; height: 32px; border: none; }
.maker .tab-map .map-cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maker .tab-map .map-cat-count { font-size: var(--fs-2); color: var(--text-dim); }
/* Simulate section counts */
.maker .tab-map .map-sim-count { font-size: var(--fs-2); color: var(--text-dim); margin-left: auto; }
/* Advanced Export ▸ comp frame rate — a numeric field sitting in a checkbox
   column, so align it and keep the input from stretching to full width. */
.maker .tab-map .map-export-fps-row { display: flex; align-items: center; gap: var(--sp-2); }
.maker .tab-map .map-export-fps-row input[type="number"] { width: 62px; margin-left: auto; }

/* "Animate All" master row — reads as the parent of the sub-toggles below it
   (Derek 2026-08-01). Separator + weight distinguish it without a new control. */
.maker .tab-map .map-sim-all-row {
  font-weight: 600;
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-1);
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
}
/* [hidden] must beat the explicit display values above */
.maker .tab-map .map-cam-slider[hidden] { display: none; }
/* ── Advanced Export slide-out — full-height slide from LEFT (Characters-tab
   pattern, cv-export-panel clone scoped to Maps). z 20 = above the canvas,
   below the color dock (30). ── */
.maker .tab-map .map-export-panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--chrome-hi);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 16px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}
.maker .tab-map .map-export-panel.open    { transform: translateX(0); }
/* [hidden] must beat the explicit display values (doc gotcha 8.1) */
.maker .tab-map .map-export-panel[hidden] { display: none; }
.maker .tab-map .map-export-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border);
  font-size: var(--fs-3); font-weight: 600; color: var(--text);
  background: var(--chrome-lo, #f0f0f4); flex-shrink: 0;
}
.maker .tab-map .map-export-close {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text-dim); line-height: 1; padding: 0 2px;
}
.maker .tab-map .map-export-close:hover { color: var(--text); }
.maker .tab-map .map-export-body {
  overflow-y: auto; scrollbar-width: thin; flex: 1;
  padding: var(--sp-4) var(--sp-5) var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-6);
  font-size: var(--fs-3); color: var(--text);
}
.maker .tab-map .map-export-section { display: flex; flex-direction: column; gap: var(--sp-2); }
.maker .tab-map .map-export-section[hidden] { display: none; }
.maker .tab-map .map-export-section-label {
  font-size: var(--fs-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-dim, #777); border-bottom: 1px solid var(--border);
  padding-bottom: 2px; margin-bottom: 2px;
}
.maker .tab-map .map-export-mode-tabs { display: flex; gap: var(--sp-1); }
.maker .tab-map .map-export-tab {
  flex: 1; padding: var(--sp-2) var(--sp-2); font-size: var(--fs-3);
  border: 1px solid var(--border); background: var(--chrome-lo, #f4f4f4);
  border-radius: var(--r); cursor: pointer; color: var(--text);
}
.maker .tab-map .map-export-tab.active {
  background: var(--accent, #4a90e2); color: #fff; border-color: var(--accent, #4a90e2);
}
.maker .tab-map .map-export-static-row { font-size: var(--fs-3); color: var(--text-dim); }
/* Live zip-contents preview — cv-export-tree clone, height-capped so the
   Export button stays visible (WZ paths are deep). */
.maker .tab-map .map-export-tree {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-3);
  line-height: 1.5;
  white-space: pre;
  overflow: auto;
  max-height: 180px;
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  background: var(--chrome-lo, #f4f4f4);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
}
/* Extra Content rail section (tag/heavy-set opt-ins) */
.maker .tab-map #map-extra-content[hidden] { display: none; }
.maker .tab-map .map-extra-tag { font-weight: 600; }
.maker .tab-map .map-extra-count { font-size: var(--fs-2); color: var(--text-dim); }
/* Layered-only controls gray out in Exploded (disabled via JS sync) */
.maker .tab-map .check-row:has(input:disabled),
.maker .tab-map .map-layers-scale-row:has(select:disabled) { opacity: 0.45; }
.maker .tab-map .map-export-actions {
  margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--border);
}
.maker .tab-map .map-export-actions .btn { width: 100%; }
/* placeholder hides once the BGM row is populated */
.maker .tab-map #map-bgm-row:not([hidden]) ~ #map-bgm-none { display: none; }
/* P2 — Color & Effects dock: slide-up overlay above the map picker, Scenes-
   style bottom-properties columns (Derek 2026-07-30). */
.maker .tab-map .preview-col { position: relative; }
.maker .tab-map .map-color-dock {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 22px; align-items: flex-start;
  background: var(--chrome); border-top: 2px solid var(--accent);
  border-radius: var(--r) var(--r) 0 0; box-shadow: 0 -6px 20px rgba(0,0,0,0.18);
  padding: var(--sp-4) 16px var(--sp-5); max-height: 46%; overflow: auto;
  transform: translateY(105%); transition: transform 0.24s cubic-bezier(.3,.9,.3,1);
}
.maker .tab-map .map-color-dock.is-open { transform: translateY(0); }
.maker .tab-map .map-color-col { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.maker .tab-map .map-color-col-a { flex: 0 0 250px; }
.maker .tab-map .map-color-col-sliders { flex: 0 0 280px; }
.maker .tab-map .map-color-col-fx { flex: 1 1 auto; }
.maker .tab-map .map-color-title {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 11.5px; font-weight: 700; color: var(--text); margin-bottom: 2px;
}
.maker .tab-map .map-color-lab { font-size: var(--fs-1); font-weight: 700; letter-spacing: 0.08em; color: var(--text-dim); }
.maker .tab-map .map-color-close { margin-left: auto; border: none; background: none; cursor: pointer; font-size: 14px; color: var(--text-dim); }
.maker .tab-map .map-color-close:hover { color: var(--text); }
.maker .tab-map .map-color-looks { display: flex; flex-wrap: wrap; gap: 3px; max-height: 96px; overflow-y: auto; }
/* Look cards — preset thumbnails on the selected key (Scenes pattern) */
.maker .tab-map .map-look-card {
  position: relative; width: 44px; padding: 2px 1px 1px;
  appearance: none; border: 1px solid var(--border-lo); border-radius: var(--r);
  background: var(--chrome-hi); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.maker .tab-map .map-look-card:hover { border-color: var(--accent); }
.maker .tab-map .map-look-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.maker .tab-map .map-look-thumb { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#dfe4e9 0% 25%, #f4f6f8 0% 50%) 50% / 8px 8px; border-radius: var(--r); overflow: hidden; }
.maker .tab-map .map-look-label { font-size: var(--fs-1); font-weight: 600; color: var(--text-dim); max-width: 42px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maker .tab-map .map-look-del {
  position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--chrome-hi); border: 1px solid var(--border-lo);
  font-size: var(--fs-1); line-height: 10px; text-align: center; color: var(--text-dim); display: none;
}
.maker .tab-map .map-look-card:hover .map-look-del { display: block; }
.maker .tab-map .map-look-del:hover { color: #c0392b; border-color: #c0392b; }
.maker .tab-map .map-color-row { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-2); }
.maker .tab-map .map-color-row label { flex: 0 0 62px; font-weight: 600; color: var(--text-dim); }
.maker .tab-map .map-color-row { font-size: var(--fs-3); }
.maker .tab-map .map-color-row input[type="range"] { flex: 1; min-width: 0; }
.maker .tab-map .map-color-row span { width: 28px; text-align: right; color: var(--text-mid); }
.maker .tab-map .map-fx-group { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-2); }
.maker .tab-map .map-fx-group:not(.is-on) select, .maker .tab-map .map-fx-group:not(.is-on) input:not([data-fxon]) { opacity: 0.45; }
.maker .tab-map .map-fx-on { flex: 0 0 64px; display: inline-flex; gap: 3px; align-items: center; font-weight: 600; color: var(--text-dim); }
.maker .tab-map .map-fx-group input[type="color"] { width: 20px; height: 16px; padding: 0; border: 1px solid var(--border-lo); border-radius: var(--r); background: none; }
.maker .tab-map .map-fx-group select { max-width: 74px; font-size: var(--fs-2); }
.maker .tab-map .map-fx-group input[type="number"] { width: 38px; font-size: var(--fs-2); }
.maker .tab-map .map-cat-palette.is-on { color: var(--accent-text); opacity: 1; }
/* BGM transport + seek (Derek 2026-07-30) */
.maker .tab-map .map-bgm-row { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
.maker .tab-map .map-bgm-controls { display: flex; gap: var(--sp-2); }
.maker .tab-map .map-bgm-seek-row { display: flex; align-items: center; gap: var(--sp-2); }
.maker .tab-map .map-bgm-seek-row input[type="range"] { flex: 1; min-width: 0; }
.maker .tab-map .map-bgm-time { font-size: var(--fs-2); color: var(--text-dim); flex: 0 0 auto; }
/* BGM stop/download — same chrome as .sfx-play but NOT swept by the
   play-icon decorator (which injects a ▶ into every .sfx-play). */
.maker .sfx-ctl {
  flex: 0 0 auto; width: 22px; height: 20px; padding: 0; line-height: 1; font-size: var(--fs-2);
  border: 1px solid var(--border-lo); border-radius: var(--r); background: var(--chrome-lo); color: var(--text); cursor: pointer;
}
.maker .sfx-ctl:hover { border-color: var(--accent); color: var(--accent); }
/* World depth rows + Tiles/Objects sub-rows (Derek 2026-07-31) */
.maker .tab-map .map-cat-chev { width: 12px; flex: 0 0 12px; font-size: var(--fs-1); color: var(--text-dim); }
.maker .tab-map .map-cat-chev-spacer { width: 12px; flex: 0 0 12px; }
/* Scenes-style column alignment (Derek MB-19): NO margin-left indent — the
   fixed chev/spacer column keeps eye · solo · palette vertically aligned on
   EVERY row (so a drag runs straight down a column). Nesting reads from thin
   containment lines in the left gutter + tiered thumb sizes instead. */
.maker .tab-map .map-cat-sub { margin-left: 0; min-height: 24px; font-size: var(--fs-3); position: relative; padding-left: var(--sp-1); }
.maker .tab-map .map-cat-sub::before {
  content: ''; position: absolute; left: 3px; top: 2px; bottom: 2px; width: 2px;
  background: var(--border-lo, #c9cede); border-radius: var(--r);
}
.maker .tab-map .map-cat-thumbwrap.sub { width: 22px; height: 22px; }
/* Explode mode (Derek 2026-07-31) — header "Explode" toggle (char-tab
   parity) + drill-down piece rows */
.maker .tab-map .map-explode-hdr-btn {
  margin-left: auto;
  padding: 2px var(--sp-3);
  font-size: var(--fs-3);
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.maker .tab-map .map-explode-hdr-btn:hover { background: rgba(0, 0, 0, 0.05); }
.maker .tab-map .map-explode-hdr-btn.active {
  background: var(--accent, #4a90e2);
  border-color: var(--accent, #4a90e2);
  color: #fff;
}
.maker .tab-map .map-cat-head .map-cat-palette { margin-left: auto; }
.maker .tab-map .map-cat-piece { margin-left: 0; min-height: 22px; font-size: var(--fs-2); color: var(--text-dim); cursor: pointer; }
.maker .tab-map .map-cat-piece .map-cat-name { color: inherit; }
/* Object pieces sit one level deeper (under a depth's Objects sub-row): a
   second containment line at 8px + a smaller thumb mark the extra nesting,
   while the control columns stay put. */
.maker .tab-map .map-cat-piece2 { margin-left: 0; }
.maker .tab-map .map-cat-piece2::after {
  content: ''; position: absolute; left: 8px; top: 2px; bottom: 2px; width: 2px;
  background: rgba(74, 158, 192, 0.32); border-radius: var(--r);
}
.maker .tab-map .map-cat-piece2 .map-cat-thumbwrap.sub { width: 18px; height: 18px; }
/* Declutter (Derek MB-19): on SUB rows the eye/solo/color controls stay hidden
   until the row is hovered — but an ACTIVE control (layer hidden, soloed, or
   colored) stays visible so state is always legible. opacity (not display)
   keeps the button box, so columns stay aligned + drag-paint still hits them.
   Top-level category/depth rows keep their controls always on. */
.maker .tab-map .map-cat-sub .map-cat-eye,
.maker .tab-map .map-cat-sub .map-cat-solo,
.maker .tab-map .map-cat-sub .map-cat-palette { opacity: 0; transition: opacity 0.1s; }
.maker .tab-map .map-cat-sub:hover .map-cat-eye,
.maker .tab-map .map-cat-sub:hover .map-cat-solo,
.maker .tab-map .map-cat-sub:hover .map-cat-palette { opacity: 0.85; }
.maker .tab-map .map-cat-sub:hover .map-cat-palette:disabled { opacity: 0.3; }
/* Active/non-default controls stay visible even when the row isn't hovered. */
.maker .tab-map .map-cat-sub.is-hidden .map-cat-eye,
.maker .tab-map .map-cat-sub .map-cat-solo.is-active,
.maker .tab-map .map-cat-sub .map-cat-palette.is-on { opacity: 1; }
/* Selection (Derek 2026-07-31 / 2026-08-01): any row can be selected —
   pieces also get the viewport locate outline. */
.maker .tab-map .map-cat-row.is-selected {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-text, #257298);
  border-radius: var(--r);
}
/* Padlock (viewport-selection lock) — same chrome as the Explode button,
   but square + icon-only; margin-left stays auto only on the FIRST header
   button, so the lock hugs Explode. */
.maker .tab-map .map-lock-btn {
  margin-left: 0;
  padding: 2px var(--sp-2);
  line-height: 0;
}
.maker .tab-map .map-lock-btn svg { display: block; }
/* Mob pieces lock while the Mob Simulation runs (sim ignores per-mob hides) */
.maker .tab-map .map-cat-piece.is-sim-locked { opacity: 0.4; cursor: default; }
.maker .tab-map .map-cat-piece.is-sim-locked .map-cat-btn { pointer-events: none; }
.map-locate-outline {
  position: absolute; z-index: 8; pointer-events: none;
  border: 2px dashed #58b0ff; border-radius: var(--r);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.45);
  animation: map-locate-pulse 1.4s ease-in-out infinite;
}
@keyframes map-locate-pulse {
  0%, 100% { border-color: #58b0ff; }
  50%      { border-color: #d8efff; }
}

/* ── MB-22: AE export comp settings + framing rect ─────────────────────────
   The framing overlay clones the MC-1 crop-overlay pattern (absolute child of
   #map-canvas-frame, re-anchored to the visible viewport on scroll); the rect
   itself is sized from JS (comp ÷ zoom, world px → CSS px). */
.maker .tab-map .map-export-ae-comp { display: flex; flex-direction: column; gap: var(--sp-2); }
.maker .tab-map .map-export-ae-comp.disabled { opacity: 0.45; }
.maker .tab-map .map-export-comp-row { display: flex; align-items: center; gap: var(--sp-2); }
.maker .tab-map .map-export-comp-row select { margin-left: auto; }
.maker .tab-map .map-export-comp-custom { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-3); color: var(--text-dim); }
.maker .tab-map .map-export-comp-custom input[type="number"] { width: 62px; }
.maker .tab-map .map-frame-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;             /* above the MC-1 crop overlay (5) */
  pointer-events: none;
  overflow: hidden;
}
.maker .tab-map .map-frame-rect {
  position: absolute;
  border: 1px dashed var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}
.maker .tab-map .map-frame-label {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: var(--fs-3);
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.55);
  padding: 1px var(--sp-2);
  border-radius: var(--r);
  white-space: nowrap;
}
