/* demo-shell.css — the Showcase Rig's overlay chrome (Phase 2).
 *
 * All classes are namespaced `.sf-demo-*` / `.sf-coach-*` so nothing collides with app globals
 * (the mock-CSS-namespace lesson). The whole layer only exists when demoShell.mount() runs
 * (guarded by ?demo) — absent `?demo`, this stylesheet is inert (no matching DOM).
 *
 * Inherits the swappable skin via tokens.css vars (with hard fallbacks so it still looks right
 * if a token is missing).
 *
 * The chrome is a FLOATING COACH-MARK CARD (game-tutorial style) — NOT a top control bar. The
 * card holds the step counter + title + copy + tour controls (‹ Back · dots · ▶ auto · Next ›)
 * + a ✕ skip + a ⚙ gear that opens the secondary presenter drawer. It anchors to the beat's
 * target (placement A, with a pointer) or centres itself (placement B). A no-dim HIGHLIGHT ring
 * lights the target — the surface stays fully visible. On a phone the card becomes a bottom sheet.
 */

.sf-demo-shell {
  position: fixed;
  inset: 0;
  z-index: 90000;               /* above surfaces + footer, below the global fault banner */
  pointer-events: none;         /* the card + drawer re-enable pointer events on themselves only */
  font-family: var(--sans, system-ui, sans-serif);
}

/* ── the floating coach-mark card ───────────────────────────── */
.sf-coach {
  pointer-events: auto;
  position: fixed;
  /* Title-fit sizing — the card sizes to its CONTENT (max-content) so a no-wrap title
     ("The Structure map", "Deploy → open the product", "Work Orders on the line") is never clipped:
     the header row grows to fit the full title (+ its 3 controls), the card grows with it, and the
     body copy wraps within. A comfortable min keeps short-title cards from looking cramped; the max
     is a sane ceiling that still fits the longest single-line title while keeping copy readable. */
  width: max-content;
  min-width: 340px;
  max-width: min(460px, calc(100vw - 32px));
  color: var(--ink, #e8eaff);
  background: linear-gradient(180deg, rgba(14, 18, 38, .97), rgba(8, 11, 24, .97));
  border: 1px solid var(--violet-line, rgba(150, 160, 220, .3));
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 0 1px rgba(139, 139, 255, .12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: left .3s cubic-bezier(.4, .9, .3, 1), top .3s cubic-bezier(.4, .9, .3, 1);
}

/* the pointer that points at the target (placement A). Hidden for placement B (centre/hero). */
.sf-coach__ptr {
  position: absolute;
  width: 15px; height: 15px;
  background: linear-gradient(135deg, rgba(14, 18, 38, .97), rgba(14, 18, 38, .97));
  border: 1px solid var(--violet-line, rgba(150, 160, 220, .3));
  transform: rotate(45deg);
}
/* which edge the pointer sits on — its two visible border sides face the target */
.sf-coach[data-ptr="top"] .sf-coach__ptr    { top: -8px;    border-right: 0; border-bottom: 0; }
.sf-coach[data-ptr="bottom"] .sf-coach__ptr { bottom: -8px; border-left: 0;  border-top: 0; }
.sf-coach[data-ptr="left"] .sf-coach__ptr   { left: -8px;   border-right: 0; border-top: 0; }
.sf-coach[data-ptr="right"] .sf-coach__ptr  { right: -8px;  border-left: 0;  border-bottom: 0; }
.sf-coach[data-place="b"] .sf-coach__ptr { display: none; }

.sf-coach__hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 8px 16px;
}
/* (The header STEP chip .sf-coach__step was removed — the inner mini-dots + footer beat-dots convey
    position now. The capsule keeps its own chip via .sf-coach__pstep, styled below.) */
.sf-coach__ttl {
  /* The title stays on ONE line (nowrap) and is NEVER clipped: no ellipsis / no overflow-hide, so the
     header grows to the title's natural width and the card (width:max-content) sizes up to fit it.
     Font dropped a step (15.5→15px) so the longest titles fit within the card's max-width ceiling.
     flex: 0 0 auto (not 1 1 auto) so the title takes exactly its content width and pushes the card
     wider — a shrinking flex item with min-width:0 would otherwise let it be squeezed + clipped. */
  flex: 0 0 auto;
  margin-right: auto;   /* push the ▸/⚙/✕ controls to the header's right edge as the card widens */
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .01em;
  color: var(--ink, #eef0ff);
  white-space: nowrap;
}
.sf-coach__gear,
.sf-coach__x,
.sf-coach__min {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  color: var(--ink3, #6b7099);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.sf-coach__min { font-size: 18px; }
.sf-coach__gear:hover,
.sf-coach__x:hover,
.sf-coach__min:hover { color: var(--ink, #e8eaff); border-color: var(--violet-line, rgba(139, 139, 255, .35)); }
.sf-demo-shell[data-open="true"] .sf-coach__gear {
  color: var(--ink, #e8eaff);
  border-color: var(--violet, #8b8bff);
  background: var(--violet-dim, rgba(139, 139, 255, .16));
}

/* ── Fix 3 · INNER mini-dots (one per caption within the beat) ──
 * A subtle row INSIDE the caption box (just under the header) showing which caption within THIS beat
 * is current — distinct from, and smaller/subtler than, the footer's per-BEAT dots. Populated per beat
 * in renderInnerDots; [hidden] when the beat has a single caption (nothing to page). */
.sf-coach__subdots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 16px 2px;
  margin-top: -2px;
}
.sf-coach__subdots[hidden] { display: none; }
.sf-coach__subdot {
  width: 4px; height: 4px;                 /* smaller than the 6px footer beat-dots */
  border-radius: 999px;
  background: rgba(150, 160, 220, .28);    /* subtler than the footer dots' #2a2f52 */
  transition: background .15s, transform .15s;
}
.sf-coach__subdot.is-active {
  background: var(--gold, #ffd27a);        /* the caption-within-beat accent (gold = the step-chip hue) */
  box-shadow: 0 0 5px rgba(255, 210, 122, .55);
  transform: scale(1.2);
}

.sf-coach__body {
  padding: 2px 16px 14px;
  color: var(--ink2, #aeb4d8);
  font-size: 13.5px;
  line-height: 1.55;
}

.sf-coach__ft {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--panel-line, rgba(150, 160, 220, .16));
}
.sf-coach__btn {
  flex: 0 0 auto;
  font: 600 12px var(--sans, system-ui, sans-serif);
  color: var(--ink2, #aeb4d8);
  background: var(--panel, rgba(10, 14, 30, .6));
  border: 1px solid var(--panel-line, rgba(150, 160, 220, .18));
  border-radius: 9px;
  padding: 7px 13px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.sf-coach__btn:hover { color: var(--ink, #e8eaff); border-color: var(--violet-line, rgba(150, 160, 220, .4)); }
.sf-coach__btn--go {
  color: #fff;
  border-color: rgba(255, 210, 122, .5);
  background: linear-gradient(135deg, rgba(255, 210, 122, .22), rgba(255, 178, 77, .12));
}
.sf-coach__btn--go:hover { border-color: rgba(255, 210, 122, .8); }

/* step-0 action row (Continue · Skip · Skip All) — initial caption only */
.sf-coach__step0 {
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 14px;
}
.sf-coach[data-step0="true"] .sf-coach__step0 { display: flex; }
.sf-coach[data-step0="true"] .sf-coach__ft { display: none; }
.sf-coach__step0 .sf-coach__btn { flex: 1; font-size: 11.5px; padding: 8px 10px; text-align: center; }
.sf-coach__step0 .s0-skip,
.sf-coach__step0 .s0-skipall {
  flex: 0 0 auto;
  background: none;
  border-color: rgba(150,160,220,.18);
  color: var(--ink3, #6b7099);
  font-weight: 500;
}
.sf-coach__step0 .s0-skip:hover,
.sf-coach__step0 .s0-skipall:hover {
  color: var(--ink2, #aeb4d8);
  border-color: rgba(150,160,220,.38);
  background: rgba(150,160,220,.06);
}

.sf-coach__dots {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.sf-coach__dot {
  flex: 0 0 auto;
  width: 6px; height: 6px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: #2a2f52;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.sf-coach__dot:hover { background: #3d4372; }
.sf-coach__dot.is-active { background: var(--violet, #8b8bff); box-shadow: 0 0 7px var(--violet, #8b8bff); transform: scale(1.15); }

.sf-coach__auto {
  flex: 0 0 auto;
  color: var(--ink3, #6b7099);
  background: none;
  border: 0;
  font: 600 11px var(--mono, ui-monospace, monospace);
  letter-spacing: .04em;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 7px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.sf-coach__auto:hover { color: var(--ink2, #aeb4d8); }
.sf-coach__auto[aria-pressed="true"] { color: var(--violet, #8b8bff); background: var(--violet-dim, rgba(139, 139, 255, .14)); }

/* ── Build 1 · collapse-to-pill ─────────────────────────────
 * The card collapses to a compact PILL so the viewer can study the surface unobscured. The full
 * body is hidden and the pill shown when [data-collapsed="true"]; expanded is the inverse. The
 * pill keeps the card's anchor/position (positionCard re-runs after each toggle). */
.sf-coach__pill {
  display: none;                 /* shown only when collapsed */
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  color: var(--ink, #eef0ff);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 16px;
}
.sf-coach__pstep {
  flex: 0 0 auto;
  font: 700 9.5px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold, #ffd27a);
  border: 1px solid rgba(255, 210, 122, .35);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}
.sf-coach__pttl {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Replay ▸ — the scene-end twin of the Next/Continue button (setCapsuleSceneEnd shows it
   when a beat's scene finishes; Replay re-runs the same scene from its window head). */
.sf-coach__preplay {
  flex: 0 0 auto;
  font: 600 11.5px var(--sans, system-ui, sans-serif);
  color: var(--ink, #eef0ff);
  border: 1px solid rgba(139, 139, 255, .45);
  background: linear-gradient(135deg, rgba(139, 139, 255, .18), rgba(90, 110, 200, .1));
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
}
.sf-coach__preplay:hover { border-color: rgba(139, 139, 255, .8); }
.sf-coach__pill.is-scene-end .sf-coach__pgo { box-shadow: 0 0 14px rgba(255, 200, 80, .45); }
.sf-coach__pgo {
  flex: 0 0 auto;
  font: 600 11.5px var(--sans, system-ui, sans-serif);
  color: #fff;
  border: 1px solid rgba(255, 210, 122, .5);
  background: linear-gradient(135deg, rgba(255, 210, 122, .22), rgba(255, 178, 77, .12));
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s;
}
.sf-coach__pgo:hover { border-color: rgba(255, 210, 122, .85); }
.sf-coach__pexp {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--ink3, #6b7099);
}
.sf-coach__pill:hover .sf-coach__pexp { color: var(--ink, #e8eaff); }

/* ── loop-phase capsule PROGRESS BAR ─────────────────────────
 * A thin track that fills over the loop cycle (fed off the real loop-progress stream via
 * setCapsuleProgress). Sits between the title and the ▸ Next button in the capsule. */
.sf-coach__pbar {
  flex: 1 1 90px;
  min-width: 54px;
  height: 5px;
  border-radius: 999px;
  background: var(--panel-line, rgba(150, 160, 220, .22));
  overflow: hidden;
  position: relative;
}
.sf-coach__pfill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold, #ffd27a), var(--heat, #ffb24d));
  box-shadow: 0 0 8px rgba(255, 200, 120, .5);
  transition: width .3s linear;
}
@media (prefers-reduced-motion: reduce) { .sf-coach__pfill { transition: none; } }
/* The progress bar belongs to the capsule (collapsed/loop) only — hide it in the expanded card. */
.sf-coach[data-collapsed="false"] .sf-coach__pbar { display: none; }

/* collapsed: hide the full body, show the pill, shrink the card to fit the pill */
.sf-coach[data-collapsed="true"] { width: auto; min-width: 0; max-width: min(420px, calc(100vw - 32px)); }
.sf-coach[data-collapsed="true"] .sf-coach__full { display: none; }
.sf-coach[data-collapsed="true"] .sf-coach__pill { display: flex; }
.sf-coach[data-collapsed="false"] .sf-coach__pill { display: none; }

/* ── Fix 4 · the loop capsule sits BOTTOM-CENTRE + fades when the pointer is far ──
 * The collapsed (loop-phase) capsule is pinned to the bottom-centre of the screen (positionCard clears
 * any inline placement so THIS rule governs), and rides at reduced opacity so it never blocks the view
 * of the looping scene — rising to full opacity on hover or when the pointer is near (JS toggles
 * `.is-near` off a proximity band). `!important` beats any stale inline left/top from a prior teach
 * step. Kept above any bottom sheet on mobile via the media block below. */
.sf-coach[data-collapsed="true"] {
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: calc(20px + env(safe-area-inset-bottom, 0)) !important;
  transform: translateX(-50%) !important;
  opacity: .5;
  transition: opacity .25s ease, left .3s cubic-bezier(.4, .9, .3, 1), top .3s cubic-bezier(.4, .9, .3, 1);
}
.sf-coach[data-collapsed="true"]:hover,
.sf-coach[data-collapsed="true"].is-near { opacity: 1; }
/* B2 (Director 2026-07-08): the collapsed capsule LIVES IN THE HEADER BAR, to the LEFT of
   the reactive capsule area. dockCapsule() measures .sf-caps each collapse/resize and sets
   the inline top/right (with priority); this rule is the shape + the no-caps fallback. */
.sf-coach[data-collapsed="true"] {
  top: 8px !important;
  bottom: auto !important;
  left: auto !important;
  right: 16px !important;      /* fallback — dockCapsule overrides with the measured offset */
  transform: none !important;
  opacity: .92;
}
.sf-coach[data-collapsed="true"] .sf-coach__pill { padding: 4px 8px; }
@media (prefers-reduced-motion: reduce) {
  .sf-coach[data-collapsed="true"] { transition: opacity .25s ease; }
}

/* ── secondary presenter drawer (opened by the card's ⚙ gear) ── */
.sf-demo-drawer {
  pointer-events: auto;
  position: fixed;
  top: 14px; right: 14px;
  width: min(340px, calc(100vw - 28px));
  padding: 12px 14px;
  border-radius: var(--r, 14px);
  color: var(--ink, #e8eaff);
  background: linear-gradient(180deg, rgba(10, 14, 30, .96), rgba(6, 8, 16, .95));
  border: 1px solid var(--violet-line, rgba(139, 139, 255, .28));
  box-shadow: 0 14px 46px rgba(0, 0, 0, .55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  z-index: 1;
}
.sf-demo-drawer[hidden] { display: none; }

.sf-demo-field { display: flex; flex-direction: column; gap: 6px; }
.sf-demo-label {
  font: 700 9px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink3, #6b7099);
}

.sf-demo-seg {
  display: inline-flex;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--panel-line, rgba(150, 160, 220, .18));
}
.sf-demo-seg-btn {
  font: 600 12px var(--sans, system-ui, sans-serif);
  color: var(--ink2, #aeb4d8);
  background: var(--panel, rgba(140, 150, 210, .05));
  border: 0;
  padding: 6px 12px;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.sf-demo-seg-btn + .sf-demo-seg-btn { border-left: 1px solid var(--panel-line, rgba(150, 160, 220, .18)); }
.sf-demo-seg-btn.is-active { color: #04050c; background: var(--violet, #8b8bff); }

.sf-demo-select,
.sf-demo-btn {
  font: 600 12px var(--sans, system-ui, sans-serif);
  color: var(--ink, #e8eaff);
  background: var(--panel, rgba(140, 150, 210, .06));
  border: 1px solid var(--panel-line, rgba(150, 160, 220, .18));
  border-radius: 9px;
  padding: 7px 12px;
  cursor: pointer;
}
.sf-demo-select { min-width: 170px; }
.sf-demo-btn:hover { border-color: var(--violet-line, rgba(139, 139, 255, .4)); }

.sf-demo-note { font-size: 11px; color: var(--ink3, #6b7099); padding-top: 5px; }

.sf-demo-diag { flex: 1 1 100%; margin-top: 2px; border-top: 1px solid var(--panel-line, rgba(150, 160, 220, .12)); padding-top: 10px; }
.sf-demo-diag-summary {
  font: 700 9px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3, #6b7099);
  cursor: pointer;
  list-style: none;
}
.sf-demo-diag-summary::-webkit-details-marker { display: none; }
.sf-demo-diag-body {
  margin: 8px 0 0;
  font: 500 10px/1.5 var(--mono, ui-monospace, monospace);
  color: var(--cyan, #8fd0ff);
  white-space: pre;
}

/* ── mobile: the coach-mark becomes a BOTTOM SHEET (phone-friendly / shareable) ── */
@media (max-width: 640px) {
  /* Card pins to the bottom as a full-width sheet regardless of beat placement. The pointer +
   * anchoring don't apply on a phone — the sheet is always at the bottom. */
  .sf-coach,
  .sf-coach[data-place="a"],
  .sf-coach[data-place="b"] {
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0)) !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
    border-radius: 16px;
  }
  /* the collapsed pill is also a full-width bottom sheet on a phone (Build 1). This rule matches the
   * Fix 4 desktop bottom-centre rule's specificity but comes LATER in source, so it re-pins the capsule
   * to a full-width sheet on a phone (overriding the desktop translateX(-50%) centring). Kept above any
   * bottom sheet; the proximity fade still applies (touch pointermove toggles .is-near). */
  .sf-coach[data-collapsed="true"] {
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0)) !important;
    transform: none !important;
    max-width: none !important;
  }
  .sf-coach__ptr { display: none !important; }
  .sf-coach__ttl { font-size: 15px; }
  .sf-coach__body { font-size: 13px; max-height: 34vh; overflow: auto; }
  .sf-coach__ft { gap: 6px; }
  .sf-coach__btn { padding: 8px 12px; }

  /* Drawer becomes a scrollable sheet above the card. */
  .sf-demo-drawer {
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom, 0));
    left: 8px; right: 8px;
    width: auto;
    max-height: 52vh;
    overflow: auto;
    gap: 12px;
  }
  .sf-demo-select { min-width: 0; width: 100%; }
}

/* single-beat: hide the tour nav + dots + auto so the card reads clean */
.sf-demo-shell:not([data-multibeat="true"]) .sf-coach__prev,
.sf-demo-shell:not([data-multibeat="true"]) .sf-coach__next,
.sf-demo-shell:not([data-multibeat="true"]) .sf-coach__auto,
.sf-demo-shell:not([data-multibeat="true"]) .sf-coach__dots {
  display: none;
}

/* ── First Light: target HIGHLIGHT (NO-DIM: outline + glow ring only) ──
 * THE ONE CHANGE FROM THE MOCK: no dim/backdrop. The surface stays fully visible; only the
 * beat's target gets a lit ring — an outline + soft glow box-shadow over its rect, with NO
 * full-screen overlay. The wrapper is inert (chrome only); the ring is the whole effect. */
.sf-demo-spot {
  position: fixed;
  inset: 0;
  z-index: 89990;               /* below the coach card (90000), above the surfaces */
  pointer-events: none;         /* never eats clicks — chrome only */
}
.sf-demo-spot-ring {
  position: fixed;
  border-radius: 14px;
  border: 2px solid var(--violet, #8b8bff);
  outline: 1px solid rgba(139, 167, 255, .35);
  background: transparent;
  box-shadow:
    0 0 0 2px rgba(139, 167, 255, .25),   /* a soft inner halo (NO screen-wide dim) */
    0 0 26px 4px rgba(139, 139, 255, .55); /* the glow ON the ring */
  pointer-events: none;
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
}
@media (prefers-reduced-motion: reduce) {
  .sf-demo-spot-ring { transition: none; }
}

/* ── teach-step SCOPED DIM (the per-tile spotlight scrim) ──
 * During a TILE teach-step the rest of the screen DIMS while the tile stays lit. A full-screen dark
 * overlay with a transparent rounded-rect "hole" punched over the tile via a CSS mask (set inline in
 * applyTileScrim). NO dim for the overall caption (step 0) — that's the whole point of teach step 0.
 * Sits below the ring (89990) and the coach card (90000); inert (chrome only, never eats clicks). */
.sf-demo-scrim {
  position: fixed;
  inset: 0;
  z-index: 89985;                /* below the spot ring (89990) + card (90000), above surfaces */
  pointer-events: none;          /* never eats clicks — chrome only */
  background: rgba(4, 6, 14, .62);
  transition: opacity .2s ease;
  animation: sf-demo-scrim-in .2s ease both;
}
@keyframes sf-demo-scrim-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sf-demo-scrim { animation: none; } }

/* ── Fix 6a · teach-phase pointer-CAPTURE veil ──
 * A fully TRANSPARENT full-screen layer that EATS pointer events over the whole surface during the
 * teach phase, so a fast/stray click can't fall through to the live Floor controls (the crash: a stray
 * click reached the forge-line → openZone). It sits ABOVE the surfaces but BELOW the tile scrim (89985),
 * the spot ring (89990) and the coach card (90000) — so the dim still paints over it and the card's own
 * buttons remain clickable, while nothing on the surface underneath is. Transparent → it never dims
 * anything (the focused tile stays full-brightness — Fix 5). Present only while teach is active. */
.sf-demo-veil {
  position: fixed;
  inset: 0;
  z-index: 89984;                /* above surfaces; below the scrim (89985) / ring (89990) / card (90000) */
  pointer-events: auto;          /* CAPTURE — swallow clicks so they never reach the live surface */
  background: transparent;        /* invisible — dims nothing */
  cursor: default;
}
/* FROST (B1 2026-07-07) — non-anchored captions only: a light frosted-glass wash between the
   caption card and the scene. Enough to see through; clearly directs focus to the caption. */
.sf-demo-veil.is-frost {
  background: rgba(6, 9, 20, .22);
  backdrop-filter: blur(3px) saturate(.94);
  -webkit-backdrop-filter: blur(3px) saturate(.94);
  transition: background .25s ease;
}

/* ── First Light: the THRESHOLD close card (CTA + capture + FAQ — spec §5) ─────
 * The funnel's conversion surface, shown on the final beat over the estate view.
 * All classes namespaced `.sf-fl-*`. A dimmed full-screen overlay hosting a single
 * centred card; on a phone it becomes a scrollable bottom sheet. Inherits skin
 * tokens with hard fallbacks so it looks right even if a token is missing. */
.sf-fl-overlay {
  position: fixed;
  inset: 0;
  z-index: 90050;                /* above the shell bar (90000), below the fault banner */
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: auto;
  background: radial-gradient(1000px 700px at 50% 0%, rgba(139, 139, 255, .12), transparent 60%),
              rgba(4, 6, 14, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: sf-fl-fade .25s ease;
  font-family: var(--sans, system-ui, sans-serif);
}
@keyframes sf-fl-fade { from { opacity: 0; } to { opacity: 1; } }

.sf-fl-card {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  color: var(--ink, #e8eaff);
  background: linear-gradient(180deg, rgba(12, 16, 34, .96), rgba(6, 8, 18, .96));
  border: 1px solid var(--violet-line, rgba(139, 139, 255, .3));
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
  padding: 26px 26px 24px;
}

.sf-fl-x {
  position: absolute; top: 14px; left: 14px;
  font: 600 12px var(--sans, system-ui, sans-serif);
  color: var(--ink3, #6b7099);
  background: transparent; border: 0; cursor: pointer; padding: 4px 6px;
}
.sf-fl-x:hover { color: var(--ink, #e8eaff); }

.sf-fl-eyebrow {
  font: 700 10px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--cyan, #36d6e0);
  margin: 8px 0 12px;
}
.sf-fl-title {
  font-size: 26px; font-weight: 700; letter-spacing: -.01em;
  margin: 0 0 10px;
}
.sf-fl-lede {
  font-size: 14px; line-height: 1.55;
  color: var(--ink2, #aeb4d8);
  margin: 0 0 20px;
}

/* hero CTA — "Claim your world" */
.sf-fl-cta {
  display: block; width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--heat, #ffb24d);
  color: #1a1206;
  background: linear-gradient(180deg, var(--kernel, #ffd27a), var(--heat, #ffb24d));
  font: 650 15px var(--sans, system-ui, sans-serif);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(255, 140, 60, .28);
  transition: filter .15s ease, transform .05s ease;
}
.sf-fl-cta:hover { filter: brightness(1.06); }
.sf-fl-cta:active { transform: translateY(1px); }
.sf-fl-cta:disabled { opacity: .55; cursor: default; filter: none; }

/* capture form */
.sf-fl-formwrap {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--panel-line, rgba(150, 160, 220, .14));
}
.sf-fl-formlabel {
  font: 700 9px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3, #6b7099);
  margin-bottom: 12px;
}
.sf-fl-form { display: flex; flex-direction: column; gap: 10px; }
.sf-fl-field {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--panel-line, rgba(150, 160, 220, .18));
  background: var(--panel-solid, rgba(10, 14, 30, .4));
  color: var(--ink, #e8eaff);
  font: 400 14px var(--sans, system-ui, sans-serif);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sf-fl-field::placeholder { color: var(--ink3, #6b7099); }
.sf-fl-field:focus {
  border-color: var(--violet-line, rgba(139, 139, 255, .4));
  box-shadow: 0 0 0 3px var(--violet-dim, rgba(139, 139, 255, .16));
}
.sf-fl-textarea { resize: vertical; min-height: 44px; }

.sf-fl-submit {
  margin-top: 2px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--violet, #8b8bff);
  color: #04050c;
  background: var(--violet, #8b8bff);
  font: 650 14px var(--sans, system-ui, sans-serif);
  cursor: pointer;
  transition: filter .15s ease;
}
.sf-fl-submit:hover { filter: brightness(1.08); }
.sf-fl-submit:disabled { opacity: .55; cursor: default; }

.sf-fl-link {
  margin-top: 12px;
  background: transparent; border: 0;
  color: var(--ink2, #aeb4d8);
  font: 600 13px var(--sans, system-ui, sans-serif);
  cursor: pointer; padding: 4px 0; text-align: left;
}
.sf-fl-link:hover { color: var(--ink, #e8eaff); }
.sf-fl-link:disabled { opacity: .5; cursor: default; }

.sf-fl-status {
  min-height: 16px;
  margin-top: 10px;
  font-size: 13px; line-height: 1.5;
  color: var(--ink3, #6b7099);
}
.sf-fl-status.is-ok { color: var(--built, #5fd0a0); }
.sf-fl-status.is-warn { color: var(--heat, #ffb24d); }

/* FAQ */
.sf-fl-faqlabel {
  font: 700 9px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3, #6b7099);
  margin: 24px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--panel-line, rgba(150, 160, 220, .14));
}
.sf-fl-faq { display: flex; flex-direction: column; gap: 2px; }
.sf-fl-faq-item {
  border-bottom: 1px solid var(--panel-line, rgba(150, 160, 220, .1));
}
.sf-fl-faq-q {
  cursor: pointer;
  list-style: none;
  padding: 11px 22px 11px 2px;
  font-size: 14px; font-weight: 550;
  color: var(--ink, #e8eaff);
  position: relative;
}
.sf-fl-faq-q::-webkit-details-marker { display: none; }
.sf-fl-faq-q::after {
  content: "+"; position: absolute; right: 4px; top: 10px;
  color: var(--ink3, #6b7099); font-family: var(--mono, ui-monospace, monospace);
}
.sf-fl-faq-item[open] .sf-fl-faq-q::after { content: "−"; }
.sf-fl-faq-a {
  padding: 0 4px 13px 2px;
  font-size: 13px; line-height: 1.55;
  color: var(--ink2, #aeb4d8);
}

/* threshold fork — two-option card row (sandbox locked vs continue with Forante) */
.sf-fl-fork {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 20px;
}
.sf-fl-fork-opt {
  border: 1px solid rgba(150,160,220,.18);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(150,160,220,.04);
}
.sf-fl-fork-opt--locked {
  opacity: .62;
  pointer-events: none;
}
.sf-fl-fork-opt--primary {
  border-color: rgba(95,208,160,.3);
  background: rgba(95,208,160,.05);
}
.sf-fl-fork-badge {
  display: inline-block;
  font: 700 7.5px/1 var(--mono, monospace);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink3, #6b7099);
  border: 1px solid rgba(150,160,220,.22);
  border-radius: 999px;
  padding: 2px 8px;
  width: fit-content;
}
.sf-fl-fork-head {
  font: 700 14px/1.2 var(--sans, system-ui, sans-serif);
  color: var(--ink, #eef0ff);
}
.sf-fl-fork-body {
  font: 400 12.5px/1.5 var(--sans, system-ui, sans-serif);
  color: var(--ink3, #6b7099);
  flex: 1;
}
.sf-fl-fork-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font: 600 12.5px var(--sans, system-ui, sans-serif);
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(150,160,220,.25);
  background: rgba(150,160,220,.07);
  color: var(--ink2, #aeb4d8);
  transition: filter .15s ease;
}
.sf-fl-fork-btn:hover { filter: brightness(1.12); }
.sf-fl-fork-btn:disabled { opacity: .45; cursor: default; }
.sf-fl-fork-btn--go {
  background: rgba(95,208,160,.12);
  border-color: rgba(95,208,160,.4);
  color: var(--good, #5fd0a0);
}

/* mobile: the card becomes a bottom sheet filling the viewport */
@media (max-width: 560px) {
  .sf-fl-overlay { padding: 0; place-items: end stretch; }
  .sf-fl-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    padding: 22px 18px calc(20px + env(safe-area-inset-bottom, 0));
  }
  .sf-fl-title { font-size: 22px; }
  .sf-fl-fork { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
 * B0 COLD-OPEN CAROUSEL (M6 · storyboard Act 0)
 * A Path-of-Exile-style carousel of element cards selling the reframe + the building
 * blocks, with a persistent Start CTA. Full-bleed overlay (no live surface behind it).
 * All classes namespaced `.sf-poe-*`. Inherits the skin via tokens.css vars (hard fallbacks).
 * ══════════════════════════════════════════════════════════════════════════ */
.sf-poe-overlay {
  position: fixed; inset: 0;
  z-index: 92000;                 /* above the demo bar (90000), below the fault banner */
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(90, 90, 200, .22), transparent 60%),
    linear-gradient(180deg, rgba(6, 8, 18, .96), rgba(4, 5, 12, .98));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-family: var(--sans, system-ui, sans-serif);
  color: var(--ink, #e8eaff);
  animation: sf-poe-in .35s ease both;
}
@keyframes sf-poe-in { from { opacity: 0; } to { opacity: 1; } }

.sf-poe-stage {
  width: min(980px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.sf-poe-eyebrow {
  font: 700 11px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .22em; color: var(--cyan, #8fd0ff); opacity: .9;
}

/* viewport clips the sliding track; arrows sit either side */
.sf-poe-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--r, 16px);
  border: 1px solid var(--violet-line, rgba(139, 139, 255, .28));
  background: linear-gradient(180deg, rgba(12, 16, 34, .8), rgba(8, 10, 22, .82));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.sf-poe-track {
  display: flex;
  transition: transform .42s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
/* each slide = 2 columns: LEFT rich copy, RIGHT representative visual */
.sf-poe-card {
  flex: 0 0 100%;
  box-sizing: border-box;
  padding: 34px 36px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center; gap: 30px;
  min-height: 380px;
  text-align: left;
  opacity: .55; transform: scale(.99);
  transition: opacity .42s ease, transform .42s ease;
}
.sf-poe-card.is-active { opacity: 1; transform: none; }
.sf-poe-copy {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.sf-poe-kicker {
  font: 700 11px/1 var(--mono, ui-monospace, monospace);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold, #ffcf7a); opacity: .92;
}
.sf-poe-title {
  margin: 2px 0 4px; font-size: 25px; font-weight: 800; letter-spacing: -.01em;
  line-height: 1.2; color: var(--ink, #f0f2ff);
}
.sf-poe-body {
  margin: 0;
  font-size: 14.5px; line-height: 1.58; color: var(--ink2, #aeb4d8);
}

/* RIGHT column — a plate image, or a scaled non-interactive iframe over a plate fallback */
.sf-poe-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r, 14px);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(10, 14, 30, .7), rgba(6, 8, 20, .8));
  border: 1px solid var(--violet-line, rgba(139, 139, 255, .22));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 30px rgba(0, 0, 0, .4);
}
.sf-poe-media-img,
.sf-poe-media-fallback {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
/* live construct loop (shared component) — fills the media box */
.sf-poe-media--live { background: none; border: 0; box-shadow: none; }
.sf-poe-media--live .scp-loop { position: absolute; inset: 0; border-radius: var(--r, 14px); }
/* iframe preview — laid over the fallback plate; revealed only once it loads. Non-interactive. */
.sf-poe-frame {
  position: absolute; inset: 0;
  width: 200%; height: 200%;              /* render at 2× then scale to 0.5 → a crisp, fitted thumbnail */
  transform: scale(.5); transform-origin: top left;
  border: 0;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.sf-poe-frame.is-loaded { opacity: 1; }

.sf-poe-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2;
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1;
  color: var(--ink, #e8eaff);
  background: rgba(10, 14, 30, .7);
  border: 1px solid var(--violet-line, rgba(139, 139, 255, .3));
  cursor: pointer; transition: background .15s ease, transform .1s ease;
}
.sf-poe-arrow:hover { background: rgba(30, 34, 60, .9); }
.sf-poe-arrow:active { transform: translateY(-50%) scale(.94); }
.sf-poe-prev { left: 10px; }
.sf-poe-next { right: 10px; }

.sf-poe-dots { display: flex; gap: 8px; }
.sf-poe-dot {
  width: 9px; height: 9px; padding: 0; border-radius: 999px;
  background: rgba(139, 139, 255, .28);
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.sf-poe-dot:hover { background: rgba(139, 139, 255, .5); }
.sf-poe-dot.is-active { background: var(--violet, #b39cff); transform: scale(1.25); }

.sf-poe-start {
  margin-top: 4px;
  padding: 13px 34px; border-radius: 999px;
  font-size: 15px; font-weight: 800; letter-spacing: .01em;
  color: #0a0c18;
  background: linear-gradient(180deg, var(--gold, #ffcf7a), #f0b455);
  border: 0; cursor: pointer;
  box-shadow: 0 12px 34px rgba(240, 180, 85, .35);
  transition: transform .1s ease, box-shadow .15s ease;
}
.sf-poe-start:hover { box-shadow: 0 16px 44px rgba(240, 180, 85, .5); }
.sf-poe-start:active { transform: scale(.97); }
.sf-poe-hint {
  font-size: 12px; color: var(--ink3, #6b7099); opacity: .85;
}

/* tablet/narrow: stack the two columns (copy over visual) */
@media (max-width: 820px) {
  .sf-poe-card {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 0;
    padding: 28px 26px 30px;
  }
  .sf-poe-media { aspect-ratio: 16 / 9; max-height: 34vh; }
}
/* mobile: full-width cards, tighter padding, hide the side arrows (swipe + dots drive it) */
@media (max-width: 560px) {
  .sf-poe-overlay { padding: 14px; }
  .sf-poe-card { padding: 24px 18px 28px; }
  .sf-poe-title { font-size: 21px; }
  .sf-poe-body { font-size: 13.5px; }
  .sf-poe-media { aspect-ratio: 16 / 10; max-height: 28vh; }
  .sf-poe-arrow { display: none; }
  .sf-poe-start { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sf-poe-overlay { animation: none; }
  .sf-poe-track, .sf-poe-card, .sf-poe-frame { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
 * B0 START CEREMONY — "entering Starforge"
 * A bespoke CY2-flavoured cinematic on the Start ▸ CTA: letterbox bars sweep in, a plate is
 * revealed by two gates opening (centre-out iris wipe), a brief "STARFORGE" title, then a
 * dissolve → the Floor. Reduced-motion collapses to a plain fade. Skippable (click/Esc).
 * ══════════════════════════════════════════════════════════════════════════ */
.sf-poe-cer {
  position: fixed; inset: 0;
  z-index: 93000;                 /* above the carousel (92000), below the fault banner */
  display: grid; place-items: center;
  background: #05060e;
  cursor: pointer;
  overflow: hidden;
  animation: sf-poe-cer-fade-in .28s ease both;
}
@keyframes sf-poe-cer-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* the plate stage — the gates sit over the plate and part to reveal it */
.sf-poe-cer-stage { position: absolute; inset: 0; overflow: hidden; }
.sf-poe-cer-plate {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(.8) saturate(1.05);
  transform: scale(1.06);
  animation: sf-poe-cer-plate-settle 2.3s ease both;
}
@keyframes sf-poe-cer-plate-settle {
  from { transform: scale(1.14); filter: brightness(.5) saturate(1.05); }
  to   { transform: scale(1.02); filter: brightness(.86) saturate(1.05); }
}

/* two gate panels cover the plate, then slide apart (centre-out iris/wipe) */
.sf-poe-cer-gate {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background:
    linear-gradient(180deg, rgba(14, 16, 34, .98), rgba(6, 7, 16, .99));
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .7);
  animation-duration: 1.5s;
  animation-timing-function: cubic-bezier(.7, 0, .2, 1);
  animation-fill-mode: both;
  animation-delay: .35s;
}
.sf-poe-cer-gate-l { left: 0; border-right: 1px solid rgba(255, 207, 122, .5); animation-name: sf-poe-cer-gate-l; }
.sf-poe-cer-gate-r { right: 0; border-left: 1px solid rgba(255, 207, 122, .5); animation-name: sf-poe-cer-gate-r; }
@keyframes sf-poe-cer-gate-l { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes sf-poe-cer-gate-r { from { transform: translateX(0); } to { transform: translateX(100%); } }

/* ── SHIP-PORTRAIT REVEAL (Director 2026-07-07) — when the commissioned class has a
   generated portrait, the ceremony opens ON the ship: the portrait fills the screen
   full-bleed (each gate carries half of it), HOLDS a beat before any title, and then the
   IMAGE ITSELF splits open as the doors — revealing the yard + STARFORGE behind it. */
.sf-poe-cer-gate { overflow: hidden; }
.sf-poe-cer-ship {
  position: absolute; top: 0; left: 0; width: 100vw; height: 100%;
  background-size: cover; background-position: center;
  display: none;
}
.sf-poe-cer-ship-r { left: -50vw; }
.sf-poe-cer.has-ship .sf-poe-cer-ship { display: block; }
.sf-poe-cer.has-ship .sf-poe-cer-gate { box-shadow: none; animation-delay: 1.5s; }
/* plate + title wait for the hold — the ship reads alone first */
.sf-poe-cer.has-ship .sf-poe-cer-plate { animation-delay: 1.2s; }
.sf-poe-cer.has-ship .sf-poe-cer-title { animation-delay: 1.2s; }
.sf-poe-cer.is-reduced .sf-poe-cer-ship { display: none; }

/* letterbox bars sweep in from top/bottom */
.sf-poe-cer-bar {
  position: absolute; left: 0; right: 0; height: 12vh; z-index: 3;
  background: #04050c;
  animation: sf-poe-cer-bar-in .5s ease both;
}
.sf-poe-cer-bar-t { top: 0; transform-origin: top; }
.sf-poe-cer-bar-b { bottom: 0; transform-origin: bottom; }
@keyframes sf-poe-cer-bar-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* the STARFORGE title — fades up as the gates part, then dissolves out */
.sf-poe-cer-title {
  position: relative; z-index: 4;
  font: 800 clamp(30px, 7vw, 62px)/1 var(--u-font-zone, var(--sans, system-ui, sans-serif));
  letter-spacing: .22em; text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 34px rgba(255, 207, 122, .6), 0 2px 20px rgba(0, 0, 0, .8);
  animation: sf-poe-cer-title 2.3s ease both;
}
@keyframes sf-poe-cer-title {
  0%   { opacity: 0; transform: translateY(10px) scale(.96); letter-spacing: .34em; }
  35%  { opacity: 0; }
  55%  { opacity: 1; transform: translateY(0) scale(1); letter-spacing: .22em; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.03); }
}

/* reduced motion → a plain fade; no gates/bars/settle choreography */
.sf-poe-cer.is-reduced .sf-poe-cer-gate,
.sf-poe-cer.is-reduced .sf-poe-cer-bar { display: none; }
.sf-poe-cer.is-reduced .sf-poe-cer-plate { animation: none; transform: scale(1); filter: brightness(.8) saturate(1.05); }
.sf-poe-cer.is-reduced .sf-poe-cer-title { animation: sf-poe-cer-fade-in .3s ease both; }

/* ══════════════════════════════════════════════════════════════════════════
 * STAGE TURN PREVIEW (TX-B "Contained Pane")
 * Carousel stages slide: in-process render matching uplift-stage-lobby-mock.html
 * TX-B view using real appHeader.css classes for the header strip.
 * Scoped under .sfstg to avoid collisions. No mock affordances.
 * ══════════════════════════════════════════════════════════════════════════ */
.sfstg { display: flex; flex-direction: column; width: 100%; height: 100%; background: #04050c; font: 13px/1.4 var(--sans, system-ui, sans-serif); color: var(--ink, #eef0ff); overflow: hidden; }
/* header: .sf-strip supplies the glass background/border; we add layout */
.sfstg .sf-strip { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 12px; }
/* shared spacer (header + footer) */
.sfstg__sp { flex: 1; }
/* body wrapper — positions the absolute bottom band correctly */
.sfstg__wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.sfstg__body { flex: 1; min-height: 0; display: flex; gap: 11px; padding: 10px 12px 100px; }
/* left: question column */
.sfstg__qcol { flex: 1.35; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
/* right: portrait + tiles */
.sfstg__bcol { flex: 1; display: flex; flex-direction: column; gap: 9px; min-height: 0; }
/* typography */
.sfstg__zttl { font: 600 13.5px var(--sans, system-ui, sans-serif); letter-spacing: .01em; }
.sfstg__zttl b { color: var(--good, #5fd0a0); }
.sfstg__micro { font: 600 9px var(--mono, ui-monospace, monospace); letter-spacing: .12em; text-transform: uppercase; color: var(--ink3, #6b7099); }
/* question row */
.sfstg__qrow { display: flex; align-items: center; gap: 8px; flex: none; }
.sfstg__question { margin: 0; font: 600 13.5px var(--sans, system-ui, sans-serif); color: var(--ink, #eef0ff); }
.sfstg__advis { margin-left: auto; font: 700 7.5px var(--mono, ui-monospace, monospace); letter-spacing: .09em; text-transform: uppercase; color: var(--good, #5fd0a0); border: 1px solid rgba(95,208,160,.38); border-radius: 999px; padding: 2px 8px; white-space: nowrap; flex: none; }
/* option cards */
.sfstg__opts { display: flex; flex-direction: column; gap: 7px; flex: 1; min-height: 0; overflow: hidden; }
.sfstg__opt { padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(150,160,220,.13); background: rgba(10,14,30,.5); flex: none; display: flex; flex-direction: column; gap: 3px; }
.sfstg__opt--sel { border-color: rgba(95,208,160,.45); background: rgba(95,208,160,.05); }
.sfstg__opt-r1 { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sfstg__radio { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(150,160,220,.45); flex: none; }
.sfstg__radio--sel { border-color: var(--good, #5fd0a0); background: radial-gradient(circle, var(--good,#5fd0a0) 35%, transparent 40%); }
.sfstg__ot { font: 600 11.5px var(--sans, system-ui, sans-serif); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sfstg__rec { font: 700 7px var(--mono, ui-monospace, monospace); letter-spacing: .07em; text-transform: uppercase; color: var(--kernel, #ffd27a); border: 1px solid rgba(255,210,122,.3); border-radius: 999px; padding: 1px 6px; white-space: nowrap; flex: none; }
.sfstg__od { font: 10.5px var(--sans, system-ui, sans-serif); color: var(--ink3, #6b7099); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sfstg__votes { font: 500 10px var(--mono, ui-monospace, monospace); color: var(--ink2, #aeb4d8); display: flex; align-items: center; gap: 4px; }
.sfstg__votes b { color: var(--ink, #eef0ff); }
.sfstg__tok { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(150,160,220,.28); background: rgba(10,14,30,.7); display: inline-flex; align-items: center; justify-content: center; font: 700 7.5px var(--mono, ui-monospace, monospace); color: var(--ink2, #aeb4d8); flex: none; }
/* footer action row */
.sfstg__foot { display: flex; align-items: center; gap: 5px; flex: none; overflow: hidden; }
.sfstg__fbtn { display: inline-flex; align-items: center; font: 600 10.5px var(--sans, system-ui, sans-serif); color: var(--ink2, #aeb4d8); border: 1px solid rgba(150,160,220,.13); border-radius: 999px; padding: 5px 10px; background: rgba(6,9,20,.5); cursor: default; white-space: nowrap; }
.sfstg__fbtn--primary { color: #04211d; font-weight: 650; border: 0; background: linear-gradient(135deg, var(--good,#5fd0a0), var(--cyan,#36d6e0)); }
.sfstg__sealb { display: inline-flex; align-items: center; font: 650 10.5px var(--sans, system-ui, sans-serif); color: #1a1206; border: 0; border-radius: 999px; padding: 5px 10px; background: linear-gradient(180deg, var(--kernel,#ffd27a), var(--heat,#ffb24d)); cursor: default; white-space: nowrap; }
/* portrait pane */
.sfstg__pane { flex: none; height: 190px; position: relative; border-radius: 10px; overflow: hidden; border: 1px solid rgba(150,160,220,.13); }
.sfstg__pim { position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; filter: saturate(1.05); }
.sfstg__psc { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,6,16,.1) 55%, rgba(4,6,16,.7)); }
.sfstg__plabel { position: absolute; left: 9px; bottom: 6px; font: 600 8px var(--mono, ui-monospace, monospace); letter-spacing: .07em; text-transform: uppercase; color: var(--good, #5fd0a0); z-index: 2; }
/* tile grid below portrait */
.sfstg__bgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sfstg__tile { padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(150,160,220,.13); background: rgba(10,14,30,.5); display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.sfstg__clock { font: 700 18px var(--sans, system-ui, sans-serif); color: var(--cyan, #36d6e0); font-variant-numeric: tabular-nums; }
.sfstg__clockh { font: 10.5px var(--sans, system-ui, sans-serif); color: var(--ink3, #6b7099); }
.sfstg__clockh b { color: var(--ink2, #aeb4d8); }
.sfstg__pres { display: flex; flex-direction: column; gap: 5px; }
.sfstg__presrow { display: flex; align-items: center; gap: 6px; font: 11.5px var(--sans, system-ui, sans-serif); color: var(--ink2, #aeb4d8); }
.sfstg__role { margin-left: auto; font: 600 7.5px var(--mono, ui-monospace, monospace); letter-spacing: .09em; text-transform: uppercase; color: var(--ink3, #6b7099); }
/* bottom band — absolute at the base so it floats over the body scroll */
.sfstg__band { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; background: linear-gradient(180deg, transparent, rgba(2,4,10,.92) 38%); }
.sfstg__disp { flex: 1.3; display: flex; gap: 9px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(150,160,220,.13); background: rgba(10,14,30,.5); backdrop-filter: blur(5px); min-width: 0; }
.sfstg__kern { width: 22px; height: 22px; border-radius: 50%; flex: none; background: radial-gradient(circle at 40% 35%, #fff, var(--kernel,#ffd27a) 45%, var(--heat,#ffb24d)); box-shadow: 0 0 12px rgba(255,178,77,.45); }
.sfstg__dispatcht { font: 11.5px/1.5 var(--sans, system-ui, sans-serif); color: var(--ink2, #aeb4d8); flex: 1; min-width: 0; }
.sfstg__dispatcht b { color: var(--ink, #eef0ff); }
.sfstg__spine { flex: 1.3; display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(150,160,220,.13); background: rgba(10,14,30,.5); overflow: hidden; backdrop-filter: blur(5px); }
.sfstg__sn { display: inline-flex; align-items: center; font: 600 8.5px var(--mono, ui-monospace, monospace); letter-spacing: .06em; text-transform: uppercase; color: var(--ink3, #6b7099); padding: 3px 7px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; flex: none; }
.sfstg__sn--done { color: var(--good, #5fd0a0); }
.sfstg__sn--now { color: var(--ink, #eef0ff); border-color: rgba(255,210,122,.38); background: rgba(255,210,122,.07); }
.sfstg__sn--timer { color: var(--cyan, #36d6e0); font-variant-numeric: tabular-nums; }
.sfstg__arr { color: rgba(150,160,220,.35); font-size: 7px; flex: none; }
.sfstg__afft { flex: .6; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(150,160,220,.13); background: rgba(10,14,30,.5); backdrop-filter: blur(5px); }
.sfstg__affn { display: flex; flex-direction: column; gap: 4px; }
.sfstg__affr { display: grid; grid-template-columns: 48px 1fr auto; gap: 5px; align-items: center; }
.sfstg__affk { font: 600 7px var(--mono, ui-monospace, monospace); letter-spacing: .06em; text-transform: uppercase; color: var(--ink3, #6b7099); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sfstg__affb { height: 3px; border-radius: 999px; background: rgba(150,160,220,.1); }
.sfstg__affb i { display: block; height: 100%; border-radius: 999px; }
.sfstg__affv { font: 600 9.5px var(--mono, ui-monospace, monospace); color: var(--ink2, #aeb4d8); text-align: right; font-variant-numeric: tabular-nums; }

/* ══════════════════════════════════════════════════════════════════════════
 * FLOOR PREVIEW (.spd-*)
 * Carousel floor slide: plate-workshop.png background + ship structure map
 * + live WO panel. Scoped under .spd- to avoid collisions.
 * ══════════════════════════════════════════════════════════════════════════ */
.spd-wrap { position: relative; width: 100%; height: 100%; background: #04050c; overflow: hidden; color: var(--ink, #eef0ff); font: 13px/1.4 var(--sans, system-ui, sans-serif); }
.spd-plate { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .82; z-index: 0; pointer-events: none; }
.spd-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,5,12,.66) 0%, rgba(4,5,12,.38) 30%, rgba(4,5,12,.62) 70%, rgba(4,5,12,.92) 100%); z-index: 1; pointer-events: none; }
.spd-body { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; }

/* header */
.spd-ch { display: flex; align-items: center; gap: 8px; padding: 6px 11px; flex: none; border-bottom: 1px solid rgba(150,160,220,.1); }
.spd-brand { font: 700 10.5px var(--mono, monospace); letter-spacing: .22em; text-transform: uppercase; color: rgba(180,200,255,.7); flex: none; }
.spd-cr { font: 400 11px var(--sans, system-ui, sans-serif); color: rgba(150,160,220,.65); }
.spd-cr b { color: rgba(200,210,255,.85); font-weight: 600; }
.spd-chip { font: 700 8.5px var(--mono, monospace); letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(255,178,77,.35); color: rgba(255,178,77,.85); background: rgba(255,178,77,.08); }
.spd-seal { border-color: rgba(139,139,255,.35); color: rgba(139,139,255,.85); background: rgba(139,139,255,.08); }

/* pipeline band */
.spd-band { display: flex; flex: none; padding: 0 11px; height: 28px; align-items: stretch; overflow: hidden; border-bottom: 1px solid rgba(150,160,220,.08); }
.spd-zseg { display: flex; align-items: center; gap: 4px; padding: 0 6px; border-right: 1px solid rgba(150,160,220,.06); min-width: 0; }
.spd-zseg:last-child { border-right: none; }
.spd-zl { font: 700 7.5px var(--mono, monospace); letter-spacing: .12em; text-transform: uppercase; color: var(--zc); opacity: .55; flex: none; }
.spd-sns { display: flex; gap: 3px; align-items: center; }
.spd-sn { position: relative; cursor: default; }
.spd-dot { display: block; width: 5px; height: 5px; border-radius: 50%; background: rgba(150,160,220,.15); transition: background .3s, box-shadow .3s; }
.spd-sn.dn .spd-dot { background: var(--zc); opacity: .55; }
.spd-sn.ht .spd-dot { background: var(--zc); opacity: 1; box-shadow: 0 0 5px var(--zc); }

/* floor main */
.spd-fm { display: flex; flex: 1; gap: 11px; padding: 10px 11px; min-height: 0; }
.spd-struct { flex: 1.2; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.spd-micro { font: 700 8.5px var(--mono, monospace); letter-spacing: .12em; text-transform: uppercase; color: rgba(150,160,220,.55); }
.spd-land { font: 700 8px var(--mono, monospace); letter-spacing: .1em; text-transform: uppercase; color: rgba(95,208,160,.8); border: 1px solid rgba(95,208,160,.3); border-radius: 20px; padding: 2px 9px; cursor: pointer; }
.spd-leg { display: flex; align-items: center; gap: 5px; flex: none; font: 600 7.5px var(--mono, monospace); letter-spacing: .1em; text-transform: uppercase; color: rgba(150,160,220,.5); }
.spd-ldot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; flex: none; }

/* work orders */
.spd-wos { flex: 1; display: flex; flex-direction: column; gap: 0; min-height: 0; }
.spd-worow { display: flex; align-items: baseline; gap: 7px; padding: 5px 0; border-bottom: 1px solid rgba(150,160,220,.07); font: 500 10.5px var(--sans, system-ui, sans-serif); }
.spd-woid { font: 700 9px var(--mono, monospace); letter-spacing: .08em; color: rgba(139,167,255,.7); flex: none; width: 86px; }
.spd-wonm { flex: 1; color: rgba(180,190,230,.82); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spd-wostage { display: flex; align-items: center; gap: 5px; flex: none; font: 600 9px var(--mono, monospace); letter-spacing: .08em; color: rgba(255,178,77,.85); }
.spd-hdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid; flex: none; }
.spd-actfeed { overflow: hidden; margin-top: 3px; }
.spd-fr { display: flex; gap: 6px; padding: 3px 0; border-top: 1px solid rgba(150,160,220,.06); font: 500 9.5px var(--mono, monospace); }
.spd-fk { color: rgba(139,167,255,.65); flex: none; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.spd-fm2 { color: rgba(150,160,220,.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes spdKgPulse { 0%,100% { opacity: .7; } 50% { opacity: 1; } }
