/* ==============================================================
   INDEX HERO DEMO SCENES, shared stage styles
   Drop-in CSS for 4 cycling demos: gaia / swarms / relay / focus
   ============================================================== */

/* --- stage container & framing --- */
.demo-wrap {
  display: flex; flex-direction: column; gap: 10px;
  --c-active: var(--c-gaia);
}
.demo-header {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 2px 2px 10px; border-bottom: 1px solid var(--rule-soft);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-mute);
  min-height: 26px;
}
.demo-wrap:has(.dh-left--card) .demo-header {
  align-items: flex-start;
  min-height: 0;
}
.demo-header .dh-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; flex-wrap: wrap; row-gap: 2px; }
.demo-header .dh-left--card {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.demo-header .dh-crn { color: var(--ink-mute); font-size: 9px; letter-spacing: 0.14em; }
.demo-header .dh-crn b { color: var(--ink-2); font-weight: 600; }
.demo-header .dh-prod .scene-label-prod,
.demo-header .dh-crn .scene-label-prod {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--c-active);
  transition: color .3s;
}
.demo-header .dh-sep { color: var(--ink-faint); font-size: 9px; }
.demo-header .dh-sub { color: var(--ink-2); font-weight: 400; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); }
.demo-header .dh-sub--prose {
  text-transform: none;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 400;
  width: 100%;
}
.demo-header .dh-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.demo-header .dh-phase {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--c-active) 10%, transparent);
  color: var(--c-active);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em;
  border: 1px solid color-mix(in srgb, var(--c-active) 28%, transparent);
}
.demo-header .dh-phase::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--c-active);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-active) 25%, transparent);
  animation: dhPulse 1.6s ease-in-out infinite;
}
@keyframes dhPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.demo-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--card-2);
  border: 1px solid var(--rule);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(20,19,17,0.04), 0 30px 80px -40px rgba(20,19,17,0.28);
  --c-active: var(--c-gaia);
}
.demo-stage::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at center, var(--rule-soft) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.25; pointer-events: none; z-index: 0;
}
/* scene-crn removed, replaced by .demo-header above the stage */

.demo-stage .scene-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  z-index: 10;
  display: flex; gap: 8px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  border: 1px solid var(--rule);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.demo-stage .scene-dot {
  width: 28px; height: 4px; border-radius: 2px;
  background: var(--rule);
  border: none; cursor: pointer; padding: 0;
  transition: background .25s;
  position: relative;
}
.demo-stage .scene-dot:hover { background: var(--ink-faint); }
.demo-stage .scene-dot.on { background: var(--c-active); }
.demo-stage .scene-dot span {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-mute); opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.demo-stage .scene-dot:hover span, .demo-stage .scene-dot.on span { opacity: 1; color: var(--c-active); }

.demo-scene {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  z-index: 2;
  transition: opacity .3s;
}
.demo-scene.fading { opacity: 0; }

/* --- shared sub-components (all scenes use these) --- */
/* s-head is rendered inside each scene but visually suppressed, the
   product + scene label + phase now live in the persistent .demo-header
   sitting ABOVE the stage. We still keep the JSON so scene builders work. */
.demo-scene .s-head { display: none; }
.s-head {
  padding: 16px 20px 16px 22px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  backdrop-filter: blur(6px);
}
.s-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); }
.s-tag b { color: var(--c-active); }
.s-pulse { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-dim); }
.s-pulse::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-active);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-active) 60%, transparent);
  animation: s-beat 1.6s ease-in-out infinite;
}
@keyframes s-beat {
  0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-active) 60%, transparent); }
  50%     { box-shadow: 0 0 0 8px color-mix(in srgb, var(--c-active) 0%, transparent); }
}
.s-prompt {
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  display: flex; gap: 10px; align-items: center;
}
.s-you {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--c-active); text-transform: uppercase;
  padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--c-active) 30%, var(--rule));
  border-radius: 5px; background: color-mix(in srgb, var(--c-active) 8%, transparent);
  flex-shrink: 0;
}
.s-txt {
  font-family: var(--font-sans); font-size: 13px; color: var(--ink); line-height: 1.4;
  flex: 1;
}
.s-caret {
  display: inline-block; width: 6px; height: 13px; background: var(--ink);
  vertical-align: -2px; margin-left: 2px;
  animation: s-blink 1s steps(2) infinite;
}
@keyframes s-blink { 50% { opacity: 0; } }

.s-foot {
  border-top: 1px solid var(--rule);
  background: var(--card);
  display: grid;
  grid-template-columns: 1.35fr 1fr;
}
.s-log {
  padding: 12px 16px;
  border-right: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-2);
  height: 108px; overflow: hidden;
}
.s-lt { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 6px; }
.s-stream { display: flex; flex-direction: column; gap: 3px; }
.s-line { display: flex; gap: 8px; line-height: 1.5; animation: s-slide .4s ease both; }
@keyframes s-slide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.s-line .t { color: var(--ink-faint); min-width: 36px; }
.s-line .b { color: var(--c-active); font-weight: 500; flex-shrink: 0; }
.s-line .m { color: var(--ink-2); }
.s-line.ok .b { color: #16a34a !important; }
.s-line.warn .b { color: #b45309 !important; }

.s-mem { padding: 12px 16px; font-family: var(--font-mono); height: 108px; overflow: hidden; }
.s-mt { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 8px; display: flex; justify-content: space-between; }
.s-mt b { color: var(--c-active); }
.s-bars { display: flex; flex-direction: column; gap: 5px; }
.s-bar { display: grid; grid-template-columns: 62px 1fr 36px; gap: 8px; align-items: center; font-size: 10px; }
.s-bar .k { color: var(--ink-dim); letter-spacing: 0.04em; }
.s-bar .tr { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.s-bar .fl { height: 100%; background: var(--c-active); transition: width .6s cubic-bezier(.3,.7,.3,1); }
.s-bar .v { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ============================= GAIA SCENE ============================= */
.g-orbit { position: relative; flex: 1; min-height: 240px; overflow: hidden; }
.g-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.g-ring { fill: none; stroke: var(--rule); stroke-width: 1; opacity: 0.55; }
.g-ring.inner { stroke-dasharray: 2 6; }
.g-line { fill: none; stroke: var(--c-active); stroke-width: 1.2; stroke-linecap: round; opacity: 0; }
.g-line.on { opacity: 0.75; stroke-dasharray: 4 3; animation: g-flow 1.2s linear infinite; }
@keyframes g-flow { to { stroke-dashoffset: -14; } }

.g-core {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 82px; height: 82px;
  border-radius: 50%;
  background: var(--ink);
  border: 1.5px solid var(--c-active);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--c-active) 6%, transparent),
    0 0 0 14px color-mix(in srgb, var(--c-active) 3%, transparent),
    0 0 28px color-mix(in srgb, var(--c-active) 28%, transparent);
  display: grid; place-items: center; z-index: 3;
}
.g-core-t { font-family: var(--font-serif); font-style: italic; font-size: 24px; color: var(--paper); letter-spacing: -0.01em; line-height: 1; }
.g-core-s { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.14em; color: color-mix(in srgb, var(--c-active) 80%, var(--paper)); margin-top: 4px; text-transform: uppercase; }
.g-core::before {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--c-active) 40%, transparent);
  animation: g-pulse 2.4s ease-out infinite;
}
@keyframes g-pulse { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.5); opacity: 0; } }

.g-brain {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--card-2);
  border: 1px solid var(--rule);
  display: grid; place-items: center;
  z-index: 2;
  transition: all .35s cubic-bezier(.2,.8,.3,1);
}
.g-brain .ic { font-family: var(--font-serif); font-style: italic; font-size: 16px; color: var(--ink); line-height: 1; }
.g-brain .lbl {
  position: absolute; font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap; padding: 2px 6px;
  background: var(--paper); border: 1px solid var(--rule-soft);
  border-radius: 3px; pointer-events: none;
}
.g-brain[data-pos="top"] .lbl { top: -17px; left: 50%; transform: translateX(-50%); }
.g-brain[data-pos="bottom"] .lbl { bottom: -17px; left: 50%; transform: translateX(-50%); }
.g-brain[data-pos="left"] .lbl { top: 50%; right: calc(100% + 6px); transform: translateY(-50%); }
.g-brain[data-pos="right"] .lbl { top: 50%; left: calc(100% + 6px); transform: translateY(-50%); }
.g-brain.active {
  background: color-mix(in srgb, var(--c-active) 12%, var(--card-2));
  border-color: var(--c-active);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-active) 12%, transparent);
  transform: scale(1.08);
}
.g-brain.active .ic, .g-brain.active .lbl { color: var(--c-active); }

/* ============================= GAIA SCENE — particle portal ============================= */
.g-portal {
  position: absolute; inset: 0;
  background: #0b0d12;
  overflow: hidden;
  border-radius: 17px; /* match demo-stage radius minus 1px border */
}
.g-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.g-portal-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  font-family: var(--font-mono);
  color: rgba(255, 248, 232, 0.78);
}
.g-corner-l, .g-corner-r {
  position: absolute; top: 14px;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
}
.g-corner-l { left: 16px; }
.g-corner-r { right: 16px; align-items: flex-end; }
.g-corner-k { color: rgba(255, 248, 232, 0.45); }
.g-corner-v { color: rgba(255, 200, 140, 0.95); font-weight: 600; }
.g-phase-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(217, 119, 87, 0.45);
  background: rgba(217, 119, 87, 0.10);
  border-radius: 999px;
  color: #ffc89a;
  font-size: 9px; letter-spacing: 0.16em;
}
.g-phase-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #ffb088;
  box-shadow: 0 0 0 2px rgba(217, 119, 87, 0.25);
  animation: g-phase-pulse 1.6s ease-in-out infinite;
}
@keyframes g-phase-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.g-core-card {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 12px 22px;
  background: rgba(11, 13, 18, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 200, 140, 0.18);
  border-radius: 999px;
}
.g-core-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  color: #fff8e8;
  letter-spacing: -0.01em;
  line-height: 1;
}
.g-core-sub {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.22em;
  color: #ffc89a;
  margin-top: 5px;
  text-transform: uppercase;
}

.g-foot {
  position: absolute; left: 0; right: 0; bottom: 38px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  font-size: 9.5px;
  pointer-events: none;
}
.g-log, .g-mem {
  background: rgba(11, 13, 18, 0.55);
  border: 1px solid rgba(255, 248, 232, 0.10);
  border-radius: 8px;
  padding: 8px 10px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  min-height: 78px;
}
.g-log-head, .g-mem-head {
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 248, 232, 0.4);
  margin-bottom: 6px;
}
.g-mem-head b { color: #fff8e8; font-variant-numeric: tabular-nums; font-weight: 600; }
.g-stream { display: flex; flex-direction: column; gap: 3px; }
.g-line {
  display: flex; gap: 6px;
  line-height: 1.4;
  animation: g-slide .35s ease both;
}
.g-line .t { color: rgba(255, 248, 232, 0.32); min-width: 32px; font-size: 8.5px; }
.g-line .b { color: #ffc89a; font-weight: 500; flex-shrink: 0; font-size: 8.5px; }
.g-line .m { color: rgba(255, 248, 232, 0.78); font-size: 8.5px; }
.g-line.ok .b { color: #7fd4c8 !important; }
@keyframes g-slide {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}
.g-bars { display: flex; flex-direction: column; gap: 4px; }
.g-bar { display: grid; grid-template-columns: 50px 1fr; gap: 6px; align-items: center; }
.g-bar .k {
  color: rgba(255, 248, 232, 0.50);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.g-bar .tr {
  height: 3px;
  background: rgba(255, 248, 232, 0.10);
  border-radius: 2px;
  overflow: hidden;
}
.g-bar .fl {
  height: 100%;
  background: linear-gradient(90deg, #ffb088, #ffc89a);
  transition: width .6s cubic-bezier(.3,.7,.3,1);
}

/* Make the dot pill stay readable on the dark portal */
.demo-stage[data-active="gaia"] .scene-dots {
  background: rgba(11, 13, 18, 0.75);
  border-color: rgba(255, 248, 232, 0.15);
}
.demo-stage[data-active="gaia"] .scene-dot {
  background: rgba(255, 248, 232, 0.18);
}
.demo-stage[data-active="gaia"] .scene-dot.on { background: #ffb088; }
.demo-stage[data-active="gaia"] .scene-dot:hover { background: rgba(255, 248, 232, 0.35); }
.demo-stage[data-active="gaia"] .scene-dot:hover span,
.demo-stage[data-active="gaia"] .scene-dot.on span { color: #ffc89a; }

/* Suppress the cream radial-dot grid behind the portal */
.demo-stage[data-active="gaia"]::before { display: none; }

@media (max-width: 640px) {
  .g-foot { grid-template-columns: 1fr; bottom: 44px; }
  .g-mem { display: none; }
  .g-corner-l, .g-corner-r { font-size: 8px; }
}

/* ============================= SWARMS SCENE ============================= */
.sw-stage { flex: 1; padding: 12px; overflow: hidden; display: flex; }
.sw-tiles {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 1fr;
  gap: 2px;
  background: var(--rule-soft);
  padding: 2px;
  border-radius: 4px;
  align-content: stretch;
}
.sw-tile {
  aspect-ratio: 3 / 4;
  background: var(--card);
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition: transform .15s;
}
a.sw-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.sw-tile:hover {
  transform: translateY(-1px);
  z-index: 1;
}
a.sw-tile:focus-visible {
  outline: 2px solid var(--c-swarms);
  outline-offset: 1px;
}
.sw-tile.pending { background: repeating-linear-gradient(45deg, var(--card), var(--card) 3px, var(--paper-2) 3px, var(--paper-2) 6px); }
.sw-tile.running::after {
  content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c-active) 25%, transparent), transparent);
  animation: sw-sweep 1.2s linear infinite; z-index: 2;
}
@keyframes sw-sweep { to { left: 100%; } }
.sw-tile .sw-id { position: absolute; top: 2px; left: 2px; font-family: var(--font-mono); font-size: 6.5px; color: var(--ink-faint); z-index: 3; }
.sw-tile .sw-sc { position: absolute; bottom: 2px; right: 2px; font-family: var(--font-mono); font-size: 6.5px; padding: 0 3px; background: color-mix(in srgb, var(--paper) 90%, transparent); color: var(--ink); z-index: 3; display: none; border-radius: 2px; }
.sw-tile.done { border-color: transparent; }
.sw-mini { position: absolute; inset: 1px; display: flex; flex-direction: column; padding: 2px; opacity: 0; transition: opacity .3s; font-family: var(--font-mono); }
.sw-tile.done .sw-mini { opacity: 1; }
.sw-mini .m-head { display: flex; justify-content: space-between; margin-bottom: 2px; }
.sw-mini .m-logo { width: 6px; height: 6px; border-radius: 1px; }
.sw-mini .m-nav { display: flex; gap: 1px; }
.sw-mini .m-nav i { width: 4px; height: 1px; background: currentColor; opacity: 0.4; display: block; }
.sw-mini .m-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.sw-mini .m-hero .bar { display: block; height: 2px; background: currentColor; border-radius: 1px; margin-bottom: 1px; opacity: 0.8; }
.sw-mini .m-hero .bar.w1 { width: 80%; }
.sw-mini .m-hero .bar.w2 { width: 55%; opacity: 0.55; }
.sw-mini .m-hero .bar.w3 { width: 40%; opacity: 0.35; }
.sw-mini .m-btn { display: block; height: 2.5px; width: 16px; background: currentColor; border-radius: 1px; margin-top: 2px; }
.sw-mini .m-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; margin-top: 2px; }
.sw-mini .m-cards i { display: block; height: 3px; background: currentColor; opacity: 0.3; border-radius: 1px; }
.sw-mini.L-center { align-items: center; }
.sw-mini.L-stack .m-cards { grid-template-columns: 1fr; gap: 1px; }
.sw-mini.L-stack .m-cards i { height: 2px; }

.sw-stats { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.s-kv { display: grid; grid-template-columns: 50px 1fr; gap: 6px; font-size: 10px; align-items: baseline; }
.s-kv .k { color: var(--ink-dim); letter-spacing: 0.04em; }
.s-kv b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ============================= RELAY SCENE ============================= */
.rl-desk { flex: 1; padding: 14px 14px 8px; overflow: hidden; position: relative; display: flex; flex-direction: column; gap: 10px; }
.rl-prompt-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(200, 95, 43, 0.10), rgba(200, 95, 43, 0.04));
  border: 1px solid rgba(200, 95, 43, 0.30);
  border-radius: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; color: var(--ink);
  transition: opacity .5s ease;
}
.rl-prompt-banner.fade { opacity: 0.25; }
.rl-prompt-banner b { color: var(--c-relay); letter-spacing: 0.14em; text-transform: uppercase; font-size: 10px; }
.rl-prompt-banner .fan {
  display: inline-flex; gap: 3px; margin-left: auto;
}
.rl-prompt-banner .fan i {
  width: 4px; height: 14px; background: var(--c-relay); opacity: 0.3; border-radius: 1px;
  animation: rl-fan 1.2s ease-in-out infinite;
}
.rl-prompt-banner .fan i:nth-child(2) { animation-delay: .12s; }
.rl-prompt-banner .fan i:nth-child(3) { animation-delay: .24s; }
.rl-prompt-banner .fan i:nth-child(4) { animation-delay: .36s; }
@keyframes rl-fan { 0%, 100% { opacity: 0.2; transform: scaleY(0.6); } 50% { opacity: 1; transform: scaleY(1); } }

.rl-grid {
  flex: 1;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  position: relative;
  min-height: 0;
}
.rl-win {
  position: relative;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  transform: scale(0.7); opacity: 0;
  animation: rl-spawn .5s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes rl-spawn { to { transform: scale(1); opacity: 1; } }
.rl-win.active { border-color: var(--c-relay); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-relay) 22%, transparent); }
.rl-win.done { border-color: rgba(34, 128, 74, 0.35); background: rgba(34, 128, 74, 0.03); }
.rl-win.clicking::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 14px; height: 14px; border: 2px solid var(--c-relay); border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: rl-click .6s ease-out;
  pointer-events: none;
}
@keyframes rl-click {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}
.rl-wtop {
  padding: 4px 6px;
  background: #f4f1ea;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.06em; color: var(--ink-mute);
  text-transform: uppercase;
}
.rl-wtop i { width: 5px; height: 5px; border-radius: 50%; background: #e0d7c5; }
.rl-wtop span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-wbody {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-size: 10px; color: var(--ink);
  text-align: center; padding: 4px; line-height: 1.2;
  position: relative;
}
.rl-win.done .rl-wbody::before {
  content: '✓'; position: absolute; top: 3px; right: 5px;
  color: rgba(34, 128, 74, 0.85); font-size: 11px; font-weight: 600;
}
.rl-win.gated .rl-wbody::before {
  content: '⏸'; position: absolute; top: 3px; right: 5px;
  color: var(--c-relay); font-size: 11px;
}
.rl-wp {
  height: 2px; background: var(--rule); position: relative;
}
.rl-wp::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--c-relay);
  width: var(--p, 0%);
  transition: width .32s cubic-bezier(.4,.1,.3,1);
}
.rl-win.done .rl-wp::before { background: rgba(34, 128, 74, 0.65); }

.rl-cursor {
  position: absolute; left: 30%; top: 30%;
  width: 14px; height: 14px;
  pointer-events: none;
  z-index: 5;
  transition: left .4s cubic-bezier(.4,.1,.3,1), top .4s cubic-bezier(.4,.1,.3,1);
  transform: translate(-2px, -2px);
}
.rl-cursor svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2)); }
.rl-cursor .lbl {
  position: absolute; left: 16px; top: 12px;
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.08em;
  background: var(--ink); color: var(--paper); padding: 2px 5px; border-radius: 3px;
  white-space: nowrap;
}
.rl-cursor.b .lbl { background: var(--c-relay); }

.rl-mbar {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
  padding: 6px 10px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  color: var(--ink-mute);
}
.rl-mbar .tag { color: var(--c-relay); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }
.rl-mbar .step { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.rl-mbar .bar { flex: 0 0 70px; height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.rl-mbar .bar > i { display:block; height: 100%; background: var(--c-relay); width: 0%; transition: width .3s ease; }
.rl-mbar .par b { color: var(--ink); }

/* ============================= FOCUS SCENE ============================= */
.fc-stage { flex: 1; display: grid; grid-template-columns: 1fr 180px; gap: 10px; padding: 12px; overflow: hidden; }
.fc-matrix { font-family: var(--font-mono); font-size: 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.fc-row { display: grid; grid-template-columns: 1.2fr 0.7fr 0.5fr 0.7fr 0.9fr; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--rule-soft); transition: background .3s; align-items: center; }
.fc-row:last-child { border-bottom: none; }
.fc-row.head { color: var(--ink-mute); font-size: 8px; letter-spacing: 0.14em; background: var(--paper-2); }
.fc-row .t { color: var(--ink-faint); font-size: 9px; }
.fc-row .st { color: var(--ink-faint); font-size: 9px; }
.fc-row.hit { background: color-mix(in srgb, var(--c-active) 10%, transparent); }
.fc-row.hit .t, .fc-row.hit .st { color: var(--c-active); font-weight: 600; }

.fc-graph { position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.fc-svg { width: 100%; height: 100%; }
.fc-edge { stroke: var(--rule); stroke-width: 0.6; opacity: 0.6; }
.fc-node circle { fill: var(--paper); stroke: var(--ink-faint); stroke-width: 1; transition: all .3s; }
.fc-node text { fill: var(--ink-2); font-family: var(--font-mono); font-size: 5.5px; }
.fc-node.hit circle { fill: var(--c-active); stroke: var(--c-active); r: 9; }
.fc-node.hit text { fill: var(--c-active); font-weight: 700; }
.fc-caption { position: absolute; bottom: 6px; left: 8px; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.14em; color: var(--ink-mute); text-transform: uppercase; }

.fc-subs { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-mono); font-size: 10px; }
.fc-sitem { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.fc-sitem i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.fc-sitem em { color: var(--ink-faint); font-style: normal; margin-left: auto; font-size: 9px; }
