/* ═══════════════════════════════════════════════════════════════════
 * THE ARCHITECT — visual language
 *
 * Adapted from ~/.hermes/skins/neural.yaml — the alien-brain Neural
 * skin. Deep violet/purple matrix theme: synapse-violet phosphor on
 * dark-amethyst CRT void. The Architect's chamber is no longer the
 * off-white Reloaded set — it's the inside of the lobster brain,
 * back-lit, electric.
 * ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Room (the architect's chamber background) */
  --room-bg:        #1a0a2e;   /* deep amethyst-black */
  --room-bg-shade:  #0a0414;   /* deeper at edges */
  --room-line:      #4B0082;   /* indigo seams */

  /* Monitor surface */
  --monitor-bg:     #060212;   /* CRT void, near-black violet */
  --monitor-frame:  #100623;
  --monitor-bezel:  #2d1a4a;

  /* Primary phosphor — synapse violet, the live signal */
  --phosphor:       #BF00FF;   /* vivid violet */
  --phosphor-dim:   #9B30FF;   /* medium violet (was 2b9a55) */
  --phosphor-deep:  #8B008B;   /* deep magenta */
  --orchid:         #DA70D6;   /* accent — orchid, between phosphor and lavender */
  --lavender:       #E6E6FA;   /* readable text on dark */

  /* State signals */
  --ok:             #00FA9A;   /* mint — success / strengthen */
  --warning:        #FFD700;   /* gold — pruned / decaying */
  --danger:         #FF6B6B;
  --bridge:         #76d9ff;   /* cyan — REM bridges */

  --link:           var(--orchid);
  --muted:          #5d3d7e;   /* muted violet */

  --font-system: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:   'JetBrains Mono', 'IBM Plex Mono', Consolas, monospace;

  --bar-h:    44px;
  --oracle-h: 36px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--room-bg);
  color: var(--lavender);
  font-family: var(--font-system);
  font-size: 13px;
  letter-spacing: 0.02em;
  font-feature-settings: "tnum", "ss01";
}

/* TOP BAR ─────────────────────────────────────────────────────── */

#bar {
  height: var(--bar-h);
  border-bottom: 1px solid var(--room-line);
  background: var(--room-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  text-transform: uppercase;
  font-size: 12px;
}
.bar-left, .bar-right { display: flex; gap: 8px; align-items: baseline; }
.title { font-weight: 700; letter-spacing: 0.18em; }
.dot   { color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; }
.strong { font-family: var(--font-mono); font-weight: 600; }

#status-light { color: var(--phosphor); font-size: 10px; line-height: 1; }
#status-light.warn { color: var(--warning); }
#status-light.dead { color: var(--danger); }

/* ROOM (the wall layout) ──────────────────────────────────────── */

#room {
  position: absolute;
  top: var(--bar-h);
  bottom: var(--oracle-h);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 3fr) minmax(180px, 1fr);
  gap: 18px;
  padding: 18px;
  background:
    radial-gradient(ellipse at center, var(--room-bg) 0%, var(--room-bg-shade) 100%);
}

.wall {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 10px;
}

/* MONITORS (the architect's wall of variations) ───────────────── */

.monitor {
  position: relative;
  border: 1px solid var(--room-line);
  background: var(--monitor-frame);
  border-radius: 6px;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  text-align: left;
  font-family: var(--font-system);
  color: var(--phosphor-dim);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.12em;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  overflow: hidden;
}
.monitor::before {
  /* CRT screen surface — soft violet bloom toward top-left */
  content: '';
  position: absolute;
  inset: 4px;
  background:
    radial-gradient(ellipse at top left, rgba(191,0,255,0.08) 0%, transparent 60%),
    var(--monitor-bg);
  border-radius: 4px;
  z-index: 0;
}
.monitor::after {
  /* faint scanline — slightly violet-tinted */
  content: '';
  position: absolute;
  inset: 4px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(75, 0, 130, 0.18) 2px,
    rgba(75, 0, 130, 0.18) 3px
  );
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
}
.monitor > * { position: relative; z-index: 2; }
.monitor:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--phosphor-dim), 0 4px 14px rgba(0,0,0,0.18);
}
.monitor.active {
  box-shadow: 0 0 0 2px var(--phosphor), 0 0 18px rgba(191, 0, 255, 0.45);
}
.monitor .mid {
  font-size: 9px;
  color: var(--phosphor-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
}
.monitor .mname {
  font-size: 11px;
  color: var(--phosphor);
  font-weight: 600;
  letter-spacing: 0.15em;
  margin-top: 2px;
}
.monitor .mline {
  flex: 1;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--phosphor-dim);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0;
  text-transform: none;
  overflow: hidden;
}

/* FOCAL POINT (center) ────────────────────────────────────────── */

.focal {
  display: flex;
  align-items: stretch;
  min-height: 0;                       /* allow flex shrinking — required for focal-body scroll */
}
.focal-frame {
  flex: 1;
  background: var(--monitor-frame);
  border: 2px solid var(--phosphor-deep);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-height: 0;                       /* same — flex children must opt in */
  box-shadow:
    inset 0 0 0 1px var(--monitor-bezel),
    0 4px 22px rgba(75, 0, 130, 0.35);
}
.focal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--monitor-bezel);
  color: var(--phosphor);
  font-family: var(--font-system);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
}
.focal-id { color: var(--phosphor-dim); font-size: 16px; }
#focal-name { font-weight: 700; }
.focal-spacer { flex: 1; }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--phosphor-dim);
  color: var(--phosphor-dim);
  padding: 4px 10px;
  font-family: var(--font-system);
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
  border-radius: 3px;
}
.ghost-btn:hover { color: var(--phosphor); border-color: var(--phosphor); }

.focal-body {
  flex: 1;
  min-height: 0;                       /* CRITICAL: lets overflow-y actually scroll inside flex */
  padding: 18px 22px;
  background:
    radial-gradient(ellipse at center top, rgba(191, 0, 255, 0.05) 0%, transparent 70%),
    var(--monitor-bg);
  color: var(--lavender);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 4px;
  margin: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--phosphor-deep) transparent;
}
.focal-body::-webkit-scrollbar {
  width: 8px;
}
.focal-body::-webkit-scrollbar-track {
  background: transparent;
}
.focal-body::-webkit-scrollbar-thumb {
  background: var(--phosphor-deep);
  border-radius: 4px;
}
.focal-body::-webkit-scrollbar-thumb:hover {
  background: var(--phosphor);
}

.oracle {
  text-align: center;
  color: var(--phosphor-dim);
  font-style: italic;
  letter-spacing: 0.04em;
  margin: 30vh 0 0;
}

/* ORACLE FOOTER ────────────────────────────────────────────── */

#oracle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--oracle-h);
  border-top: 1px solid var(--room-line);
  background: var(--room-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

/* COMMON DATA STYLES inside focal-body ────────────────────── */

.focal-body h3 {
  font-family: var(--font-system);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--phosphor);
  font-size: 11px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--phosphor-dim);
  padding-bottom: 6px;
}
.focal-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.focal-body th, .focal-body td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px dashed var(--monitor-bezel);
  font-weight: normal;
}
.focal-body th { color: var(--phosphor-dim); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

/* Sticky table headers inside any scroll container with class
 * `sticky-thead-wrap`. Keeps id|label|salience|access pinned at the
 * top of the genealogy node list (and any other long table). */
.sticky-thead-wrap {
  max-height: 30vh;
  overflow-y: auto;
  border: 1px solid var(--monitor-bezel);
  border-radius: 4px;
}
.sticky-thead-wrap thead th,
.mv-gen-table-wrap thead th,
.focal-body thead th[data-sticky] {
  position: sticky;
  top: 0;
  background: var(--monitor-bg);
  z-index: 2;
  box-shadow: 0 1px 0 var(--phosphor-deep);
}
/* The genealogy mini-table specifically — same sticky behavior */
.mv-gen-table-wrap thead th {
  background: linear-gradient(to bottom, var(--monitor-bg) 0%, var(--monitor-bg) 90%, transparent 100%);
}
.focal-body td.id { color: var(--phosphor); font-weight: 600; }
.focal-body td.label { color: var(--phosphor-dim); }
.focal-body td .preview { color: var(--orchid); opacity: 0.85; }

.focal-body input,
.focal-body textarea {
  background: rgba(191, 0, 255, 0.06);
  border: 1px solid var(--phosphor-dim);
  color: var(--lavender);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: 3px;
  width: 100%;
}
.focal-body input:focus,
.focal-body textarea:focus {
  outline: none;
  border-color: var(--phosphor);
  box-shadow: 0 0 8px rgba(191, 0, 255, 0.3);
}

.focal-body button.act {
  background: var(--phosphor);
  color: var(--monitor-bg);
  border: 0;
  padding: 8px 16px;
  font-family: var(--font-system);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(191, 0, 255, 0.4);
}
.focal-body button.act:hover { background: var(--orchid); box-shadow: 0 0 16px rgba(218, 112, 214, 0.6); }

/* AUDIO TOGGLE + STATE BADGE (top bar) ─────────────────────────── */

.audio-btn {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--muted);
  width: 26px;
  height: 22px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  font-family: var(--font-system);
  margin-right: 4px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.audio-btn:hover { color: var(--phosphor); border-color: var(--phosphor); }
.audio-btn.on    { color: var(--phosphor); border-color: var(--phosphor); box-shadow: 0 0 6px rgba(74, 245, 137, 0.4); }

.state-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--muted);
  color: var(--muted);
  margin-right: 8px;
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

/* PHASE STATES — body classes drive the room mood ──────────────── */

body.state-awake .state-badge   { color: var(--phosphor-dim); border-color: var(--phosphor-dim); }

/* NREM — decay phase, gold-tinted dimming */
body.state-nrem {
  background: #150624;
}
body.state-nrem #room {
  background:
    radial-gradient(ellipse at center, #1a0a2e 0%, #0a0414 100%);
  filter: brightness(0.85) hue-rotate(-12deg);
}
body.state-nrem .state-badge {
  color: var(--warning); border-color: var(--warning); background: rgba(255, 215, 0, 0.08);
  animation: nrem-pulse 4s ease-in-out infinite;
}
/* NREM phase indicator stays on the badge only — not on every monitor.
 * The old wholesale `body.state-nrem .monitor { animation: nrem-flicker }`
 * pulsed all 9 tiles' opacity 1 → 0.78 → 1 indefinitely, which read as
 * a broken UI rather than a phase indicator. The badge alone carries
 * the signal now. */
@keyframes nrem-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* REM — bridge formation, cyan accent */
body.state-rem {
  background: #0e1a2a;
}
body.state-rem #room {
  background:
    radial-gradient(ellipse at center, #0e1a2a 0%, #06101c 100%);
  filter: hue-rotate(40deg) saturate(0.85);
}
body.state-rem .state-badge { color: var(--bridge); border-color: var(--bridge); background: rgba(118, 217, 255, 0.08); }
body.state-rem .monitor.active { box-shadow: 0 0 0 2px var(--bridge), 0 0 22px rgba(118, 217, 255, 0.55); }

/* INSIGHT — community surfacing, full violet bloom */
body.state-insight #room {
  animation: insight-pulse 2.4s ease-in-out;
}
body.state-insight .state-badge { background: var(--phosphor); color: var(--monitor-bg); border-color: var(--phosphor); }
@keyframes insight-pulse {
  0%   { background: var(--room-bg); box-shadow: inset 0 0 0 0 transparent; }
  40%  { background: #2a0d50; box-shadow: inset 0 0 200px rgba(191, 0, 255, 0.4); }
  100% { background: var(--room-bg); box-shadow: inset 0 0 0 0 transparent; }
}

/* SELECT — dark-theme styling for native <select> ───────────────
 * Native selects on dark themes default to OS chrome which is
 * unreadable (black text on dark background). Force lavender on
 * a violet-tinted bg with a custom phosphor chevron. .dr-select
 * is the dream-cycle picker; .focal-body select is generic. */
.focal-body select,
select.dr-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgba(45, 26, 74, 0.85);
  background-image: linear-gradient(45deg, transparent 50%, var(--phosphor) 50%),
                    linear-gradient(135deg, var(--phosphor) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--phosphor-dim);
  border-radius: 3px;
  color: var(--lavender);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 7px 28px 7px 10px;
  min-width: 320px;
  cursor: pointer;
}
.focal-body select:hover,
select.dr-select:hover { border-color: var(--phosphor); }
.focal-body select:focus,
select.dr-select:focus {
  outline: none;
  border-color: var(--phosphor);
  box-shadow: 0 0 8px rgba(191, 0, 255, 0.35);
}
/* Options can't be styled across all browsers, but most respect
 * background-color + color when not :checked. Set a violet bg so
 * the OS dropdown panel is at least legible. */
.focal-body select option,
select.dr-select option {
  background-color: #1a0a2e;
  color: var(--lavender);
  padding: 6px 10px;
  font-family: var(--font-mono);
}

/* MOBILE / NARROW VIEWPORTS ───────────────────────────────────── */

@media (max-width: 900px) {
  :root {
    --bar-h: 38px;
    --oracle-h: 28px;
  }
  #bar {
    font-size: 10px;
    padding: 0 10px;
  }
  .bar-left { gap: 4px; }
  .bar-left .muted, .bar-left .dot { display: none; }
  #pod-stats { display: none; }
  #status-text { display: none; }
  #room {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 8px;
    padding: 8px;
  }
  .wall {
    grid-template-rows: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }
  .wall.left  { order: 1; }
  .focal      { order: 2; min-height: 60vh; }
  .wall.right { order: 3; }
  .monitor {
    padding: 4px 6px;
  }
  .monitor .mline {
    display: none;       /* peek text doesn't fit; tap to enter focal */
  }
  .monitor .mname {
    font-size: 9px;
    letter-spacing: 0.08em;
  }
  .monitor .mid {
    font-size: 8px;
  }
  .focal-body {
    padding: 12px 14px;
    font-size: 12px;
  }
  .focal-body table { font-size: 11px; }
  .focal-body th, .focal-body td { padding: 4px 6px; }
}

@media (max-width: 480px) {
  .wall {
    grid-template-columns: repeat(3, 1fr);
  }
  .wall.left, .wall.right {
    grid-auto-rows: 38px;
  }
}

/* spinner — neural-skin glyph rotation (◉ ◈ ⬡ ◐ ◑) */
.spin::before {
  content: '◉';
  display: inline-block;
  margin-right: 6px;
  color: var(--phosphor);
  animation: spin-neural 1.6s steps(5, end) infinite;
}
@keyframes spin-neural {
  0%   { content: '◉'; }
  20%  { content: '◈'; }
  40%  { content: '⬡'; }
  60%  { content: '◐'; }
  80%  { content: '◑'; }
  100% { content: '◉'; }
}

/* SENSENMANN — pops up in M02 DREAM REPLAY when prune count > 0 */
.reaper-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  animation: reaper-fade 4.5s ease-out forwards;
  font-family: var(--font-mono);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
}
.reaper-overlay pre {
  color: var(--warning);
  font-size: 11px;
  line-height: 1.05;
  letter-spacing: 0;
  margin: 0;
  white-space: pre;
}
.reaper-overlay .reaper-tag {
  margin-top: 12px;
  font-family: var(--font-system);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warning);
}
@keyframes reaper-fade {
  0%   { opacity: 0; transform: scale(1.05); }
  10%  { opacity: 1; transform: scale(1.0); }
  70%  { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(0.95); }
}

/* PREVIEW ROOM — gate.js mode:"deny" rendering ───────────────────
   The cockpit dimmed. Walls remain (visual continuity with the
   live SPA so the visitor recognises what they're being shown the
   shadow of) but every monitor is dark + disabled. The focal slot
   becomes the threshold: a backlit doorway, the install command
   below, Alice peeking at mazemaker.online from behind a curtain
   along the bottom edge. */

.preview-wall {
  pointer-events: none;
}
.preview-monitor {
  opacity: 0.18;
  cursor: default;
  /* Strip the active-state hover lift — these aren't clickable. */
  filter: grayscale(0.6);
}
.preview-monitor:hover {
  /* Override the live .monitor:hover — no glow on dead monitors. */
  background: var(--monitor-frame);
  border-color: var(--room-line);
}

.preview-focal {
  /* Slightly more breathing room than the live focal — gives Alice
     a horizon to live on without crowding the door. */
}

.preview-body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
  padding: 0;
  overflow: hidden;
}

.preview-door-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 40px 32px 40px;
  text-align: center;
  position: relative;
  /* Children get z-index ≥ 2; Alice underneath gets z-index 0. */
  z-index: 0;
}
.preview-door-wrap > .preview-quote,
.preview-door-wrap > .preview-install,
.preview-door-wrap > .preview-fineprint {
  position: relative;
  z-index: 2;
}

/* Tenniel Alice — *bottom* panel of the looking-glass diptych:
   Alice on the OTHER side of the mirror, half-turned toward us,
   looking back into her own world (which is now *our* monitor
   room). Phosphor-tinted PNG, ink-luminance alpha, radial vignette
   from the imagemagick pipeline so the wallpaper / mantelpiece
   fades to transparent at the edges.

   Composes as a poltergeist: she's the one who walked through and
   is now scrying back through the glass. Sits behind all text via
   z-index 0; mix-blend-mode:screen makes her composite as
   projected light not paint; opacity capped at 0.32 so the text
   wins on IPS panels with weak contrast.

   Two-axis drift animation suggests scrying-through-glass: a
   shallow breath (opacity + tiny scale), AND a very slow side-to-
   side shimmer like she's moving across her side of the mirror,
   peering at our monitors from different angles. */
.preview-alice-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(560px, 78%);
  height: auto;
  transform: translate(-50%, -54%) scale(1.0);
  z-index: 0;
  pointer-events: none;
  user-select: none;
  opacity: 0.32;
  mix-blend-mode: screen;
  filter: blur(0.4px) saturate(1.1);
  animation:
    preview-alice-breathe 14s ease-in-out infinite,
    preview-alice-shimmer 23s ease-in-out infinite;
  will-change: transform, opacity, filter;
}
@keyframes preview-alice-breathe {
  /* opacity + scale only — translate is owned by the shimmer
     keyframe so the two animations layer cleanly. */
  0%, 100% { opacity: 0.32; }
  50%      { opacity: 0.42; }
}
@keyframes preview-alice-shimmer {
  /* Side-to-side parallax + slight blur jitter. She's behind the
     glass, drifting; not quite holding still. The 1px blur peak
     mid-cycle is the moment she's furthest "out of phase" with
     our 3-space — readable as her scrying through the glass. */
  0%   { transform: translate(-50%, -54%)         scale(1.000); filter: blur(0.4px) saturate(1.1); }
  25%  { transform: translate(calc(-50% - 6px), -54%) scale(1.008); filter: blur(0.7px) saturate(1.15); }
  50%  { transform: translate(-50%, -54%)         scale(1.014); filter: blur(1.1px) saturate(1.2); }
  75%  { transform: translate(calc(-50% + 6px), -54%) scale(1.008); filter: blur(0.7px) saturate(1.15); }
  100% { transform: translate(-50%, -54%)         scale(1.000); filter: blur(0.4px) saturate(1.1); }
}

.preview-quote {
  margin-bottom: 22px;
}
.preview-oracle {
  font-style: italic;
  color: #f0a8ff;     /* lifted off var(--phosphor) — needs to win against the apparition behind */
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  margin: 0;
  max-width: 460px;
  /* Stacked text-shadow doubles as a legibility halo: the inner
     two black layers carve a "void" around each glyph (kills
     contrast against any bright pixel of Alice behind), the outer
     phosphor layer adds a soft glow back so the carved-out look
     still belongs in the CRT room. */
  text-shadow:
    0 0 4px rgba(6, 2, 18, 0.95),
    0 0 8px rgba(6, 2, 18, 0.85),
    0 0 14px rgba(191, 0, 255, 0.55);
}
.preview-quote-tail {
  color: #d8a0ff;
  font-size: 13px;
}

.preview-install {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 8px 0 6px 0;
  padding: 14px 20px;
  border: 1px dashed var(--phosphor-dim);
  border-radius: 6px;
  /* Heavier backplate than the rest — the install line is the
     primary CTA and has to be 100% legible regardless of what
     Alice is doing behind it. backdrop-filter:blur softens any
     ink lines that would otherwise show through the dark fill. */
  background: rgba(6, 2, 18, 0.78);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  max-width: 600px;
  width: 100%;
}
.preview-install-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--phosphor-dim);
}
.preview-install-cmd {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #f0a8ff;
  word-break: break-all;
  text-align: center;
  user-select: all;
  text-shadow: 0 0 6px rgba(6, 2, 18, 0.95);
}
.preview-copy {
  font-size: 10px;
  letter-spacing: 0.12em;
}

.preview-fineprint {
  margin-top: 18px;
  max-width: 500px;
  font-size: 11px;
  color: #c084e8;     /* brighter than --phosphor-dim so it survives Alice */
  line-height: 1.55;
  font-style: italic;
  text-shadow:
    0 0 4px rgba(6, 2, 18, 0.95),
    0 0 8px rgba(6, 2, 18, 0.8);
}

/* "Beyond the mirror" glimpse list — concrete teaser of what the
   cockpit IS. Punches the wonderland-architect-CUDA-BYOK keywords
   in voice, sandwiched between the quote and the install line so a
   reader who scans top-to-bottom catches them before they hit the
   commit-line. Same dark backplate + halo treatment as the install
   block so it survives Alice's apparition behind. */
.preview-glimpse {
  list-style: none;
  margin: 12px auto 14px auto;
  padding: 14px 22px;
  max-width: 600px;
  width: 100%;
  background: rgba(6, 2, 18, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid rgba(191, 0, 255, 0.22);
  border-radius: 6px;
  text-align: left;
  font-size: 12px;
  line-height: 1.7;
  color: #d8a0ff;
  text-shadow: 0 0 3px rgba(6, 2, 18, 0.95);
}
.preview-glimpse li {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: baseline;
  gap: 6px;
  padding: 2px 0;
}
/* The text body needs to be ONE grid item, not a bare text node
   sharing space with <b> and <a>. Without this wrapper the LI's
   children land 1-per-cell and the third (the prose after <b>)
   wraps into the 16px marker column word-by-word. */
.preview-glimpse li .glimpse-body {
  display: block;
  min-width: 0;
}
.preview-glimpse li b {
  color: #f0a8ff;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.preview-glimpse li code {
  font-family: var(--font-mono);
  color: #f0a8ff;
  background: rgba(191, 0, 255, 0.08);
  padding: 0 4px;
  border-radius: 2px;
  font-size: 11px;
}
.glimpse-mark {
  color: var(--phosphor);
  font-size: 10px;
  text-align: center;
}
.glimpse-link {
  color: #f0a8ff;
  text-decoration: underline;
  text-decoration-color: rgba(191, 0, 255, 0.45);
  text-underline-offset: 3px;
}
.glimpse-link:hover { color: #ffd0ff; }
.preview-fineprint em {
  color: #f0a8ff;
  font-style: normal;
}

/* DORMANT state badge in the top bar (preview mode only). */
.state-badge.preview {
  background: transparent;
  color: var(--phosphor-dim);
  border-color: var(--phosphor-dim);
  font-style: italic;
}

@media (max-width: 900px) {
  .preview-alice-img { width: 88%; }
  .preview-oracle { font-size: 13px; }
  .preview-install-cmd { font-size: 11px; }
}
