/* ─── Webspinner Studio — v0.2.6 ─────────────────────────────────────
   Persistent canvas (splash → stage with chat panel + ambient).
   Modals overlay the canvas with semi-transparent backdrop, never
   hide it. Chat panel is the user's lifeline — always visible. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep: #000;
  --bg-void: #020c1a;
  --cyan: #00e5ff;
  --cyan-soft: rgba(0, 229, 255, 0.65);
  --cyan-dim: rgba(0, 229, 255, 0.3);
  --cyan-ghost: rgba(0, 229, 255, 0.12);
  --gold: #ffd44f;
  --ice: #c8eeff;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Apple Garamond", serif;
  --mono: "Courier New", ui-monospace, monospace;
  --beat: 800ms;
  --chat-width: clamp(320px, 30vw, 460px);
}

html, body {
  width: 100%; height: 100%;
  background: var(--bg-deep);
  color: var(--cyan);
  font-family: var(--mono);
  overflow: hidden;
  user-select: none;
  cursor: default;
}

.layer {
  position: fixed; inset: 0;
  transition: opacity var(--beat) ease-in-out;
}
[hidden] { display: none !important; }

/* ─── SPLASH ─────────────────────────────────────────────────────── */

#splash {
  z-index: 90;
  background: radial-gradient(ellipse at 50% 50%, var(--bg-void) 0%, #000 80%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 40px;
}
body[data-state="boot"] #splash,
body[data-state="splash"] #splash { opacity: 1; }
body[data-state="splash-fading"] #splash {
  opacity: 0; pointer-events: none;
  transition: opacity 700ms ease-in-out;
}

.splash-bg-particles {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 22%, rgba(0,229,255,0.35) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 78% 84%, rgba(0,229,255,0.25) 50%, transparent 50%),
    radial-gradient(1px 1px at 88% 18%, rgba(0,229,255,0.4) 50%, transparent 50%),
    radial-gradient(2px 2px at 18% 82%, rgba(0,229,255,0.2) 50%, transparent 50%),
    radial-gradient(1px 1px at 92% 56%, rgba(0,229,255,0.35) 50%, transparent 50%);
  background-size: 600px 600px, 800px 800px, 500px 500px, 700px 700px, 900px 900px;
  animation: drift 80s linear infinite;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.splash-frame {
  position: relative;
  z-index: 2;
  width: min(72vw, 1100px);
  aspect-ratio: 1672 / 941;
  max-height: 76vh;
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 4px;
  box-shadow:
    0 0 80px rgba(0, 229, 255, 0.12),
    0 0 200px rgba(0, 229, 255, 0.06),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.splash-image, .splash-image picture, .splash-image img {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.splash-progress-shroud {
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: 11.4%;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(0, 229, 255, 0.25);
  transition: opacity 500ms ease-out;
}
.splash-progress-shroud::before {
  content: "";
  position: absolute; inset: 0;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.85), rgba(123, 47, 255, 0.85));
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.6);
  transition: width 220ms ease-out;
}
body[data-progress-done="true"] .splash-progress-shroud { opacity: 0; }

#splash { cursor: default; }
body[data-progress-done="true"] #splash { cursor: pointer; }
/* CTA is positioned absolutely so it's visible regardless of viewport
   size or how tall .splash-frame ends up (76vh max can push a flex
   sibling below the fold on short windows). Sits centered, near the
   bottom of the viewport, glowing. */
.splash-cta {
  position: absolute;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}
.splash-cta-text {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--cyan);
  text-transform: uppercase;
  text-shadow:
    0 0 12px rgba(0, 229, 255, 0.95),
    0 0 28px rgba(0, 229, 255, 0.55);
  background: rgba(0, 0, 0, 0.55);
  padding: 10px 28px;
  border-radius: 2px;
  border: 1px solid var(--cyan-soft);
  animation: cta-pulse 1.4s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%, 100% {
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.25), inset 0 0 12px rgba(0, 229, 255, 0.05);
    color: var(--cyan-soft);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
    border-color: rgba(0, 229, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.85), inset 0 0 22px rgba(0, 229, 255, 0.18);
    color: #fff;
    text-shadow: 0 0 16px rgba(0, 229, 255, 1), 0 0 36px rgba(0, 229, 255, 0.7);
    border-color: rgba(0, 229, 255, 0.95);
  }
}

@keyframes drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 600px 0, -800px 400px, 250px -250px, -350px -350px, 450px 450px; }
}

/* ─── STAGE — persistent canvas (chat + action area) ─────────────── */

#stage {
  z-index: 80;
  background: radial-gradient(ellipse at 50% 60%, var(--bg-void) 0%, #000 75%);
  display: grid;
  grid-template-columns: var(--chat-width) 1fr;
  opacity: 0;
}
/* Once splash starts fading, stage is visible and stays visible. */
body[data-state="splash-fading"] #stage,
body[data-state="void"] #stage,
body[data-state="signin"] #stage,
body[data-state="welcome"] #stage,
body[data-state="legal"] #stage,
body[data-state="pact"] #stage,
body[data-state="breath"] #stage,
body[data-state="prelaunch"] #stage,
body[data-state="ready"] #stage,
body[data-state="error"] #stage { opacity: 1; }

.void-particles {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(0,229,255,0.4) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(0,229,255,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 80% 20%, rgba(0,229,255,0.5) 50%, transparent 50%),
    radial-gradient(2px 2px at 35% 80%, rgba(0,229,255,0.25) 50%, transparent 50%),
    radial-gradient(1px 1px at 90% 60%, rgba(0,229,255,0.45) 50%, transparent 50%);
  background-size: 600px 600px, 800px 800px, 500px 500px, 700px 700px, 900px 900px;
  animation: drift 80s linear infinite;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

/* ─── CHAT PANEL (left, always visible) ──────────────────────────── */

.chat-panel {
  position: relative;
  z-index: 2;
  height: 100%;
  border-right: 1px solid rgba(0, 229, 255, 0.22);
  background: linear-gradient(180deg, rgba(2, 12, 26, 0.85) 0%, rgba(0, 0, 0, 0.92) 100%);
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  overflow: hidden;
}
.chat-panel-head {
  flex-shrink: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.16);
  margin-bottom: 22px;
}
.chat-panel-title {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 5px;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.85);
}
.chat-panel-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--cyan-soft);
  margin-top: 5px;
}

/* ─── CHAT LOG (scrollback of all utterances) ────────────────────── */

.chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scroll-behavior: smooth;
}
.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }
.chat-log::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.18);
  border-radius: 3px;
}

/* Each utterance is its own block with breathing room between. */
.utterance {
  margin-bottom: 18px;
}
.utterance:last-child { margin-bottom: 4px; }

/* Weaver utterance — modest serif italic, ice color */
.utterance.weaver {
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  line-height: 1.65;
  color: var(--ice);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.18);
  white-space: pre-wrap;
  word-spacing: 0.04em;
  letter-spacing: 0.1px;
}

/* User utterance — monospace, cyan, prefixed with ▸ */
.utterance.user {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.4px;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
  padding-left: 22px;
  position: relative;
}
.utterance.user::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--cyan-soft);
}

/* System utterance — small note. Kept compact + low-contrast so they
   feel marginal next to Weaver narration. Hidden by default in v0.3.0
   per Wizard feedback (debug telemetry, not user-facing prose). */
.utterance.system {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan-dim);
  border-left: 2px solid rgba(0, 229, 255, 0.25);
  padding-left: 10px;
  display: none;  /* hide by default — show via .show-system-notes on body for debugging */
}
body.show-system-notes .utterance.system { display: block; }

.weaver-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 320ms ease-out, transform 320ms ease-out;
}
.weaver-word.lit {
  opacity: 1;
  transform: none;
}
.weaver-cursor {
  display: inline-block;
  width: 6px;
  height: 0.95em;
  vertical-align: -0.12em;
  background: var(--cyan);
  margin-left: 3px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.85);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink {
  to { visibility: hidden; }
}

/* ─── ACTION AREA (right, becomes the workflow surface post-Genesis) */

.action-area {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

/* ─── WORKFLOW SURFACE (Drawflow canvas + toolbar, post-Genesis) ── */

.workflow-surface {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 720ms ease-out, transform 720ms ease-out;
}
.workflow-surface:not([hidden]) {
  opacity: 1;
  transform: none;
}

.workflow-canvas {
  flex: 1 1 auto;
  position: relative;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 229, 255, 0.04) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0, transparent 39px, rgba(0, 229, 255, 0.04) 40px),
    repeating-linear-gradient(90deg, transparent 0, transparent 39px, rgba(0, 229, 255, 0.04) 40px);
}

/* ─── TOP TOOLBAR (icon-only, hover for label) ───────────────────── */

.workflow-toolbar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: rgba(2, 12, 26, 0.88);
  border: 1px solid var(--cyan-soft);
  border-radius: 28px;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.22);
}
.workflow-toolbar-spacer { width: 4px; height: 1px; }

.workflow-icon {
  width: 42px;
  height: 42px;
  border-radius: 21px;
  background: rgba(0, 229, 255, 0.08);
  color: var(--cyan);
  border: 1px solid var(--cyan-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
  transition: background 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.workflow-icon:hover {
  background: rgba(0, 229, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
}
.workflow-icon-primary {
  background: rgba(0, 229, 255, 0.22);
  color: #fff;
  border-color: var(--cyan);
  font-size: 22px;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.5);
}
.workflow-icon-primary:hover {
  background: rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.85);
}

/* ─── WELCOME PANEL (shown when there's no open Workflow) ───────── */

.welcome-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 20px;
  text-align: center;
  pointer-events: none;
}
.welcome-mark {
  font-size: 56px;
  color: var(--cyan);
  margin-bottom: 26px;
  text-shadow: 0 0 28px rgba(0, 229, 255, 0.85), 0 0 60px rgba(0, 229, 255, 0.45);
  animation: welcome-pulse 2.4s ease-in-out infinite;
}
@keyframes welcome-pulse {
  0%, 100% { opacity: 0.7;  transform: translateY(0); }
  50%      { opacity: 1;    transform: translateY(-8px); }
}
.welcome-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 36px;
  color: #fff;
  margin-bottom: 16px;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.45);
}
.welcome-hint {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--ice);
  max-width: 520px;
  line-height: 1.55;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
}

/* ─── DRAWFLOW STYLE OVERRIDES (Studio aesthetic) ──────────────── */

.drawflow {
  background: transparent !important;
  width: 100%;
  height: 100%;
}

/* Each node — base frame */
.drawflow .drawflow-node {
  background: rgba(2, 12, 26, 0.96) !important;
  border: 1px solid var(--cyan-soft) !important;
  border-radius: 4px !important;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.18), inset 0 0 20px rgba(0, 229, 255, 0.04) !important;
  color: var(--ice) !important;
  padding: 14px 18px !important;
  min-width: 160px;
  min-height: auto;
  font-family: var(--mono);
}

/* Node title */
.drawflow .drawflow-node .title-box {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ice);
  letter-spacing: 0.4px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.18);
  padding-bottom: 6px;
  margin-bottom: 4px;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}
.drawflow .drawflow-node .body {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan-dim);
  margin-top: 4px;
}

/* Node-kind tints (per docs/v0.3.0-workflow-surface.md visual styling) */
.drawflow .drawflow-node.trigger {
  border-color: var(--gold) !important;
  box-shadow: 0 0 30px rgba(255, 212, 79, 0.22), inset 0 0 20px rgba(255, 212, 79, 0.05) !important;
}
.drawflow .drawflow-node.trigger .title-box {
  color: var(--gold);
  border-bottom-color: rgba(255, 212, 79, 0.28);
  text-shadow: 0 0 10px rgba(255, 212, 79, 0.5);
}
.drawflow .drawflow-node.agent {
  border-color: var(--cyan-soft) !important;
}
.drawflow .drawflow-node.output {
  border-color: rgba(255, 255, 255, 0.55) !important;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.12), inset 0 0 20px rgba(0, 229, 255, 0.04) !important;
}

/* Sockets (input/output dots) */
.drawflow .drawflow-node .input,
.drawflow .drawflow-node .output {
  background: var(--cyan) !important;
  box-shadow: 0 0 8px var(--cyan);
  border: none !important;
  width: 12px;
  height: 12px;
}
.drawflow .drawflow-node.trigger .output { background: var(--gold) !important; box-shadow: 0 0 8px var(--gold); }

/* Connection lines (SVG paths between sockets) */
.drawflow svg .connection .main-path {
  stroke: var(--cyan-soft) !important;
  stroke-width: 1.5;
  fill: none;
}
.drawflow svg .connection.selected .main-path {
  stroke: #fff !important;
  filter: drop-shadow(0 0 6px var(--cyan));
}

/* Selected node */
.drawflow .drawflow-node.selected {
  border-color: #fff !important;
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.45), inset 0 0 20px rgba(0, 229, 255, 0.08) !important;
}

/* Hide Drawflow's own zoom controls — we use trackpad pinch */
.drawflow .drawflow-delete { background: rgba(255, 80, 80, 0.85) !important; color: #fff !important; }

/* ─── STUDIO TOOLTIPS ────────────────────────────────────────────
   Replaces native `title` tooltips (small/grey/slow/black-on-grey,
   per Wizard 2026-04-25). Cyan-on-void to match Studio aesthetic;
   13px Boomer-readable; ~200ms dwell; floats above modals. */
.ws-tooltip {
  position: fixed;
  z-index: 1000;  /* above modal-host (200) and spinner-popup-host (180) */
  background: rgba(2, 12, 26, 0.96);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.4px;
  line-height: 1.45;
  color: var(--ice);
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
  box-shadow:
    0 0 18px rgba(0, 229, 255, 0.45),
    0 4px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  white-space: normal;       /* allow wrapping — text fits inside the border */
  text-align: center;
  max-width: 280px;          /* narrower so wrapping kicks in for long copy */
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}
.ws-tooltip.show {
  opacity: 1;
  transform: none;
}
.ws-tooltip[data-pos="above"]::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: rgba(2, 12, 26, 0.96);
  border-right: 1px solid var(--cyan);
  border-bottom: 1px solid var(--cyan);
}
.ws-tooltip[data-pos="below"]::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: rgba(2, 12, 26, 0.96);
  border-left: 1px solid var(--cyan);
  border-top: 1px solid var(--cyan);
}
/* (multi-line variant removed — base style now wraps naturally) */

/* ─── SPINNER POPUP (atomic mini-app overlay) ───────────────────── */

/* Spinner popup host starts AFTER the chat panel — same rule as
   modal-host. When NOT .live, fully clear background + filter so
   the void shows through cleanly (Safari otherwise leaks the
   backdrop-filter behind opacity:0). */
.spinner-popup-host {
  position: fixed;
  top: 0;
  left: var(--chat-width);
  right: 0;
  bottom: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms ease-out;
}
.spinner-popup-host.live {
  opacity: 1;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.spinner-popup-host:not(.live) {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.spinner-popup {
  background: rgba(2, 12, 26, 0.97);
  border: 1px solid var(--cyan-soft);
  border-radius: 6px;
  padding: 22px 26px 24px;
  width: clamp(420px, 64vw, 720px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  box-shadow: 0 0 80px rgba(0, 229, 255, 0.22), inset 0 0 30px rgba(0, 229, 255, 0.04);
  font-family: var(--mono);
  color: var(--ice);
  position: relative;
  transform: translateY(8px) scale(0.985);
  opacity: 0;
  transition: transform 360ms ease-out, opacity 360ms ease-out;
}

/* Fixed-size variant — used by Spinner mini-apps so the modal frame
   never grows when content loads. Per feedback_modals_fixed_size.md. */
.spinner-popup-fixed {
  width: 560px;
  height: 680px;
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  padding: 18px 22px 16px;
  overflow: hidden;
}
.spinner-popup-fixed .spinner-head { flex-shrink: 0; margin-bottom: 6px; }
.spinner-popup-fixed .spinner-step-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 2px 6px 0;
}
.spinner-popup-host.live .spinner-popup { transform: none; opacity: 1; }

.spinner-head {
  position: relative;
  text-align: center;
  margin: 4px 0 16px;
}
.spinner-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ice);
}
.spinner-subtitle {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 5px;
  color: var(--cyan-dim);
  text-transform: uppercase;
  margin-top: 4px;
}
.spinner-close {
  position: absolute;
  top: -2px; right: 0;
  background: transparent;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan-soft);
  width: 28px; height: 28px;
  border-radius: 14px;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.spinner-close:hover { background: rgba(0, 229, 255, 0.15); color: #fff; border-color: var(--cyan); }

/* ─── Workflow strip (inline, read-only mini-Drawflow) ──────────
   The same visual language as the workflow canvas: cyan-on-void
   step nodes connected by edges. Used by every Spinner so the
   workflow tool IS the step-strip. Per feedback_multistep_workflow_pattern.md. */
.workflow-strip {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 6px 0 12px;
  padding: 4px 2px;
  flex-shrink: 0;
}
.workflow-strip-node {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 6px 8px;
  background: rgba(2, 12, 26, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 4px;
  font-family: var(--mono);
  color: var(--cyan-dim);
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color 0.18s, color 0.18s, background 0.18s, box-shadow 0.18s;
  box-shadow: inset 0 0 8px rgba(0, 229, 255, 0.04);
}
.workflow-strip-node.pending { opacity: 0.55; }
.workflow-strip-node.done {
  color: var(--cyan-soft);
  border-color: rgba(0, 229, 255, 0.5);
  background: rgba(0, 229, 255, 0.06);
  cursor: pointer;
}
.workflow-strip-node.done:hover {
  color: #fff; border-color: var(--cyan); background: rgba(0, 229, 255, 0.18);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
}
.workflow-strip-node.active {
  color: #fff; border-color: var(--cyan); background: rgba(0, 229, 255, 0.22);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.55), inset 0 0 10px rgba(0, 229, 255, 0.12);
  animation: workflow-strip-pulse 1.6s ease-in-out infinite;
}
@keyframes workflow-strip-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(0, 229, 255, 0.45), inset 0 0 10px rgba(0, 229, 255, 0.10); }
  50%      { box-shadow: 0 0 28px rgba(0, 229, 255, 0.85), inset 0 0 14px rgba(0, 229, 255, 0.18); }
}
.workflow-strip-icon {
  font-size: 16px;
  line-height: 1;
}
.workflow-strip-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.workflow-strip-edge {
  flex: 1 1 auto;
  height: 1px;
  background: rgba(0, 229, 255, 0.22);
  position: relative;
  margin: 0 2px;
}
.workflow-strip-edge.done {
  background: linear-gradient(90deg, var(--cyan-soft), var(--cyan));
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.35);
}

/* ─── Context header (carry-forward of prior step results) ───── */
.spinner-context {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 130px;
  overflow-y: auto;
}
.spinner-context:empty { display: none; }
.spinner-context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(0, 229, 255, 0.04);
  border-left: 2px solid rgba(0, 229, 255, 0.45);
  border-radius: 0 3px 3px 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.spinner-context-item:hover {
  background: rgba(0, 229, 255, 0.10);
  border-left-color: var(--cyan);
}
.spinner-context-item img {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  flex-shrink: 0;
}
.spinner-context-icon {
  width: 32px;
  text-align: center;
  font-size: 18px;
  color: var(--cyan-soft);
  flex-shrink: 0;
}
.spinner-context-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.spinner-context-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
}
.spinner-context-detail {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: rgba(200, 238, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spinner-context-detail-multiline {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.45;
}
.spinner-context-skipped { opacity: 0.7; }

.spinner-body { padding: 4px 0; }

.spinner-prose {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(200, 238, 255, 0.9);
  margin-bottom: 14px;
}

.spinner-textarea {
  width: 100%;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid var(--cyan-soft);
  border-radius: 4px;
  color: var(--ice);
  caret-color: var(--cyan);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  padding: 12px 14px;
  outline: 0;
  resize: vertical;
  margin-bottom: 14px;
}
.spinner-textarea:focus { border-color: #fff; box-shadow: 0 0 14px rgba(0, 229, 255, 0.4); }
.spinner-textarea::placeholder { color: rgba(200, 238, 255, 0.3); }

.spinner-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.spinner-row-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.spinner-primary-btn,
.spinner-secondary-btn,
.spinner-back-btn,
.spinner-discard-btn,
.spinner-refine-btn,
.spinner-skip-btn,
.spinner-file-btn {
  background: rgba(0, 229, 255, 0.06);
  color: var(--cyan);
  border: 1px solid var(--cyan-soft);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 9px 18px;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.5);
  transition: background 0.15s, color 0.15s;
}
.spinner-primary-btn {
  background: rgba(0, 229, 255, 0.18);
  color: #fff;
  border-color: var(--cyan);
}
.spinner-primary-btn:hover { background: rgba(0, 229, 255, 0.35); box-shadow: 0 0 16px rgba(0, 229, 255, 0.4); }
.spinner-secondary-btn:hover, .spinner-back-btn:hover, .spinner-skip-btn:hover, .spinner-refine-btn:hover { background: rgba(0, 229, 255, 0.18); color: #fff; }
.spinner-discard-btn { color: rgba(255, 140, 66, 0.85); border-color: rgba(255, 140, 66, 0.55); }
.spinner-discard-btn:hover { background: rgba(255, 140, 66, 0.18); color: #fff; border-color: rgba(255, 140, 66, 0.85); }
.spinner-back-btn { letter-spacing: 2px; padding: 8px 12px; font-size: 10px; opacity: 0.85; }

.spinner-file-btn { display: inline-flex; align-items: center; }

.spinner-source-preview {
  margin-top: 14px;
  padding: 10px;
  background: rgba(0, 229, 255, 0.03);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 4px;
  text-align: center;
}
.spinner-source-preview img { max-width: 100%; max-height: 200px; border-radius: 3px; }
.spinner-source-meta {
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--cyan-dim);
  text-transform: uppercase;
}

.spinner-loading {
  height: 4px;
  background: rgba(0, 229, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
  position: relative;
}
.spinner-loading-bar {
  position: absolute;
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: spinner-loading-slide 1.4s ease-in-out infinite;
}
@keyframes spinner-loading-slide {
  0% { left: -30%; }
  100% { left: 100%; }
}

.spinner-prompt-display {
  background: rgba(0, 229, 255, 0.04);
  border-left: 2px solid var(--cyan-soft);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  color: rgba(200, 238, 255, 0.85);
  margin: 12px 0;
  border-radius: 0 3px 3px 0;
}
.spinner-prompt-display strong { color: var(--cyan); font-weight: normal; letter-spacing: 1px; text-transform: uppercase; font-size: 9px; margin-right: 6px; }

.spinner-result {
  margin: 12px 0;
  text-align: center;
  padding: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 4px;
}
.spinner-result img {
  max-width: 100%;
  max-height: 380px;
  border-radius: 3px;
  display: inline-block;
}

/* Before / After side-by-side comparison (REVIEW + KEPT steps).
   Both cells are the same fixed size; each image scales to fit
   inside its frame (object-fit: contain). Per Wizard 2026-04-25:
   "the last Modal should show a before and after image of the
   same size." */
.spinner-compare {
  display: flex;
  gap: 12px;
  margin: 10px 0;
  justify-content: center;
}
.spinner-compare-cell {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}
.spinner-compare-cell-single {
  flex: 0 0 auto;
  max-width: 80%;
}
.spinner-compare-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}
.spinner-compare-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
}
.spinner-compare-cell figcaption {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan-soft);
}

/* Fixed-frame source preview + result image — never grow the modal */
.spinner-source-preview-fixed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.spinner-source-preview-fixed img {
  max-width: 100%;
  max-height: 200px;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 3px;
  border: 1px solid rgba(0, 229, 255, 0.3);
}
.spinner-result-fixed {
  margin: 10px 0;
  text-align: center;
  padding: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 4px;
}
.spinner-result-fixed img {
  max-width: 100%;
  max-height: 320px;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 3px;
}

/* ─── Icon navigation bar (Back / Forward / Skip / etc.) ──────── */
.spinner-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(0, 229, 255, 0.15);
}
.spinner-nav-spacer { flex: 1 1 auto; }
.spinner-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 21px;
  background: rgba(0, 229, 255, 0.06);
  color: var(--cyan-soft);
  border: 1px solid rgba(0, 229, 255, 0.45);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
  transition: background 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.spinner-nav-btn:hover {
  background: rgba(0, 229, 255, 0.18);
  color: #fff;
  border-color: var(--cyan);
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.45);
}
.spinner-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.spinner-nav-btn.primary {
  background: rgba(0, 229, 255, 0.22);
  color: #fff;
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
  font-size: 22px;
}
.spinner-nav-btn.primary:hover {
  background: rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.85);
}
.spinner-nav-btn.warn {
  color: rgba(255, 140, 66, 0.95);
  border-color: rgba(255, 140, 66, 0.55);
}
.spinner-nav-btn.warn:hover {
  background: rgba(255, 140, 66, 0.18);
  color: #fff;
  border-color: rgba(255, 140, 66, 0.95);
}

.spinner-asset-meta {
  background: rgba(0, 229, 255, 0.04);
  border-left: 2px solid var(--cyan);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ice);
  margin: 12px 0;
  border-radius: 0 3px 3px 0;
}
.spinner-asset-meta div { margin-bottom: 4px; }
.spinner-asset-meta strong { color: var(--cyan); font-weight: normal; }

.spinner-key-note,
.spinner-error {
  margin-top: 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--cyan-dim);
  text-align: center;
  padding: 10px;
}
.spinner-error {
  color: rgba(255, 140, 66, 0.95);
  border: 1px solid rgba(255, 140, 66, 0.45);
  border-radius: 3px;
  background: rgba(255, 140, 66, 0.06);
}
.spinner-error strong { color: #fff; }
.spinner-error button { display: block; margin: 8px auto 0; }

/* Toolbar key-config button + dialog */
.workflow-btn-key {
  margin-left: auto;
  background: rgba(255, 212, 79, 0.08);
  color: var(--gold);
  border-color: rgba(255, 212, 79, 0.55);
  text-shadow: 0 0 6px rgba(255, 212, 79, 0.5);
}
.workflow-btn-key:hover { background: rgba(255, 212, 79, 0.22); color: #fff; }

/* Drop zone (Spinner SOURCE step) */
.spinner-dropzone {
  border: 2px dashed rgba(0, 229, 255, 0.45);
  border-radius: 6px;
  padding: 28px 20px;
  text-align: center;
  background: rgba(0, 229, 255, 0.03);
  margin-bottom: 14px;
  transition: background 0.18s, border-color 0.18s;
  cursor: default;
  outline: none;
}
.spinner-dropzone.drag-over {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--cyan);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.4);
}
.spinner-dropzone-icon {
  font-size: 36px;
  color: var(--cyan-soft);
  margin-bottom: 8px;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}
.spinner-dropzone-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ice);
  margin-bottom: 10px;
}
.spinner-dropzone-or {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--cyan-dim);
  margin: 8px 0;
}
.spinner-link-btn {
  background: transparent; border: 0; color: var(--cyan-soft);
  text-decoration: underline; cursor: pointer; font: inherit;
  padding: 0; margin: 0 0 0 8px;
}
.spinner-link-btn:hover { color: #fff; }

/* Help popup body — better-formatted than generic prose */
.help-body {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  color: rgba(200, 238, 255, 0.92);
}
.help-body p { margin-bottom: 12px; }
.help-body ul, .help-body ol { margin: 12px 0 12px 24px; padding: 0; }
.help-body li { margin-bottom: 8px; }
.help-body strong { color: var(--cyan); font-weight: normal; font-style: italic; }
.help-body em { color: var(--cyan-soft); }
.help-body kbd {
  font-family: var(--mono); font-size: 12px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--cyan-soft);
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--cyan);
}

/* Assets grid (in the assets popup) */
.spinner-asset-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  background: rgba(0, 229, 255, 0.04);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 4px;
  margin-bottom: 10px;
}
.spinner-asset-card img {
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  flex-shrink: 0;
}
.spinner-asset-card-meta {
  flex: 1; min-width: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ice);
}
.spinner-asset-card-meta strong { color: #fff; font-weight: normal; letter-spacing: 1.5px; }
.spinner-asset-card-prompt {
  font-family: var(--serif);
  font-style: italic;
  color: rgba(200, 238, 255, 0.7);
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}
.spinner-asset-card-id {
  margin-top: 6px;
  color: var(--cyan-dim);
  font-size: 9px;
  letter-spacing: 2px;
}

/* ─── SIGNED-IN PILL (top-right, persistent after auth) ──────────── */

.signed-in-pill {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(2, 12, 26, 0.85);
  border: 1px solid var(--cyan-soft);
  border-radius: 22px;
  padding: 8px 16px 8px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ice);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.18);
}
.signed-in-pill:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: #fff;
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.35);
}
.signed-in-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan) 0%, rgba(0, 229, 255, 0.2) 70%);
  box-shadow: 0 0 10px var(--cyan);
  flex-shrink: 0;
}
.signed-in-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ice);
  letter-spacing: 0;
}
.signed-in-tier {
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan-soft);
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid rgba(0, 229, 255, 0.3);
}
.signed-in-tier:empty { display: none; padding: 0; margin: 0; border: 0; }
.signed-in-action {
  font-size: 12px;
  color: var(--cyan-dim);
  margin-left: 4px;
}

/* ─── MODAL HOST (full-viewport overlay with semi-transparent backdrop) */

/* Modal host starts AFTER the chat panel so the panel is never
   obscured by the backdrop blur. Per feedback_chat_panel_never_obscured.md.
   When hidden, we explicitly clear background + backdrop-filter
   because Safari/WebKit keeps backdrop-filter rendering even at
   opacity:0 (residual blur/dim makes the void look washed out). */
.modal-host {
  position: fixed;
  top: 0;
  left: var(--chat-width);
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  opacity: 0;
  transition: opacity 320ms ease-out;
  pointer-events: none;
}
.modal-host[hidden] {
  display: none;  /* belt-and-braces: zero visual footprint when closed */
}
.modal-host:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-card {
  position: relative;
  z-index: 1;
  background: rgba(2, 12, 26, 0.96);
  border: 1px solid var(--cyan-soft);
  border-radius: 6px;
  padding: 32px 38px;
  width: clamp(360px, 56vw, 580px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  box-shadow:
    0 0 80px rgba(0, 229, 255, 0.22),
    inset 0 0 30px rgba(0, 229, 255, 0.04);
  font-family: var(--mono);
  text-align: left;
  transform: translateY(8px) scale(0.985);
  opacity: 0;
  transition: transform 360ms ease-out, opacity 360ms ease-out;
}
.modal-host:not([hidden]) .modal-card {
  transform: none;
  opacity: 1;
}

.modal-card::-webkit-scrollbar { width: 6px; }
.modal-card::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.18);
  border-radius: 3px;
}

/* Modal content building blocks (reused across all rituals) */
.modal-head {
  text-align: center;
  margin-bottom: 20px;
}
.modal-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  color: var(--ice);
  margin-bottom: 6px;
}
.modal-subtitle {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--cyan-dim);
  text-transform: uppercase;
}
.modal-body {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
  color: rgba(200, 238, 255, 0.88);
  margin-bottom: 22px;
}
.modal-body p { margin-bottom: 10px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--cyan);
}
.modal-body a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(0, 229, 255, 0.4);
  text-underline-offset: 3px;
}
.modal-body a:hover { color: #fff; text-decoration-color: var(--cyan); }
.modal-body code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan-soft);
}

.modal-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
  padding: 12px 14px;
  background: rgba(0, 229, 255, 0.04);
  border-left: 2px solid rgba(0, 229, 255, 0.35);
}
.modal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(200, 238, 255, 0.9);
  line-height: 1.4;
}
.modal-check input[type=checkbox] {
  margin-top: 1px;
  accent-color: var(--cyan);
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.modal-input {
  width: 100%;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid var(--cyan-soft);
  border-radius: 3px;
  color: var(--ice);
  caret-color: var(--cyan);
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 16px;
  outline: 0;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}
.modal-input::placeholder { color: rgba(200, 238, 255, 0.3); }
.modal-input:focus { border-color: #fff; box-shadow: 0 0 14px rgba(0, 229, 255, 0.45); }

.modal-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.modal-row .modal-input { margin-bottom: 0; }

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 4px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 229, 255, 0.10);
  color: var(--cyan);
  border: 1px solid var(--cyan-soft);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  padding: 12px 26px;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
  transition: background 0.18s, color 0.18s;
  min-width: 180px;
}
.primary-button:hover { background: rgba(0, 229, 255, 0.22); color: #fff; }
.primary-button:disabled {
  background: rgba(0, 229, 255, 0.04);
  color: var(--cyan-dim);
  border-color: rgba(0, 229, 255, 0.15);
  cursor: not-allowed;
  text-shadow: none;
}
.primary-button.full { width: 100%; }
.primary-button-icon {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan) 0%, rgba(0, 229, 255, 0.2) 70%);
  display: inline-block;
}

.modal-footnote {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--cyan-dim);
  text-transform: uppercase;
  text-align: center;
}
.modal-error {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #ff8c42;
  text-align: center;
}
.modal-status {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan-soft);
  text-align: center;
}
.modal-status.ok { color: var(--cyan); }
.modal-status.error { color: #ff8c42; }

/* ─── BRAND MARK ─────────────────────────────────────────────────── */

.brand-mark {
  position: fixed;
  right: 18px; bottom: 14px;
  z-index: 100;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 4px;
  color: rgba(0, 229, 255, 0.4);
  pointer-events: none;
}

/* ─── DEV BAR ────────────────────────────────────────────────────── */

body[data-dev="1"] .dev-bar { display: flex; }
.dev-bar {
  position: fixed; left: 12px; bottom: 12px;
  z-index: 200;
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--cyan-dim);
  padding: 6px 10px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--cyan-soft);
}
.dev-bar code { color: var(--cyan); }
.dev-bar button {
  background: transparent;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  padding: 3px 7px;
  cursor: pointer;
  text-transform: uppercase;
}
.dev-bar button:hover { background: var(--cyan-ghost); color: var(--cyan); }

/* ─── small-screen fallback ─────────────────────────────────────── */
@media (max-width: 720px) {
  #stage { grid-template-columns: 1fr; grid-template-rows: 40vh 1fr; }
  .chat-panel { border-right: 0; border-bottom: 1px solid rgba(0, 229, 255, 0.22); }
  .modal-card { width: calc(100vw - 40px); padding: 26px 22px; }
  .signed-in-pill { top: 12px; right: 12px; padding: 6px 12px 6px 10px; }
  .signed-in-name { font-size: 12px; }
  /* On small screens the chat panel goes to the top, so modals can
     go full-viewport again (the constraint above no longer applies). */
  .modal-host, .spinner-popup-host { left: 0; }
}
