/* ============================================================
   Worker Control Room — layout + components
   Uses brand tokens from brand/colors_and_type.css. Never re-derive.
   Halo System: charcoal base, magenta=action, violet=support,
   frosted glass, glow-not-flood, slow orbital motion.
   ============================================================ */

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

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg-base);
  color: var(--fg1);
  font-family: var(--font-body);
  overflow: hidden;
}

::selection { background: rgba(248, 0, 155, 0.3); }

/* ---- discreet scrollbars — thin, translucent, no track ---------- */
* {
  scrollbar-width: thin;                              /* Firefox */
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}
*::-webkit-scrollbar { width: 5px; height: 5px; }     /* WebKit/Blink */
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-pill);
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.24); }
*::-webkit-scrollbar-corner { background: transparent; }

button { font-family: var(--font-ui); cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

/* ---- ambient blooms behind the glass ------------------------- */
.bloom {
  position: fixed;
  width: 60vw; height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}
.bloom-magenta {
  top: -18vw; right: -12vw;
  background: radial-gradient(circle, rgba(248,0,155,0.34) 0%, rgba(248,0,155,0) 68%);
  animation: breathe 9s ease-in-out infinite;
}
.bloom-violet {
  bottom: -20vw; left: -14vw;
  background: radial-gradient(circle, rgba(140,107,240,0.30) 0%, rgba(140,107,240,0) 68%);
  animation: breathe 11s ease-in-out infinite reverse;
}

/* ============================================================
   APP FRAME
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  max-width: 1560px;
  margin: 0 auto;
}

/* ---- glass mixin (frosted cards) ----------------------------- */
.glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 10px 36px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.14);
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.brandmark { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.wordmark { height: 26px; width: auto; display: block; }
.topbar-sub { text-transform: uppercase; letter-spacing: 0.22em; color: var(--fg3); padding-left: 2px; }

.icp-switcher { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.icp-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: rgba(255,255,255,0.03);
  color: var(--fg2);
  font-size: 13px; font-weight: 500;
  transition: all .3s cubic-bezier(0.22,1,0.36,1);
}
.icp-pill:hover { border-color: var(--border-strong); color: var(--fg1); }
.icp-pill.is-active {
  color: #fff;
  border-color: var(--border-brand);
  background: linear-gradient(90deg, rgba(229,0,150,0.22), rgba(140,107,240,0.16));
  box-shadow: 0 0 20px rgba(248,0,155,0.28);
}
/* live status badge — only shown on the active pill, colored by run state */
.icp-pill { }
.live-badge {
  display: none;
  align-items: center; gap: 5px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px 2px 6px; border-radius: var(--radius-pill);
  color: var(--fg3);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-default);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--neutral-400); flex: none;
}
/* show the badge only on the active pill, and only once it has a status */
.icp-pill.is-active .live-badge { display: inline-flex; }

.icp-pill[data-status="running"] .live-badge {
  color: var(--brand); background: rgba(248,0,155,0.14); border-color: var(--border-brand);
}
.icp-pill[data-status="running"] .live-dot {
  background: var(--brand); box-shadow: 0 0 8px rgba(248,0,155,0.9);
  animation: pulse 1s ease-in-out infinite;
}
.icp-pill[data-status="waiting"] .live-badge {
  color: var(--warning); background: rgba(255,194,75,0.14); border-color: rgba(255,194,75,0.5);
}
.icp-pill[data-status="waiting"] .live-dot {
  background: var(--warning); box-shadow: 0 0 8px rgba(255,194,75,0.9);
  animation: pulse .8s ease-in-out infinite;
}
.icp-pill[data-status="done"] .live-badge {
  color: var(--success); background: rgba(47,211,122,0.14); border-color: rgba(47,211,122,0.45);
}
.icp-pill[data-status="done"] .live-dot { background: var(--success); }
.icp-pill[data-status="held"] .live-badge {
  color: var(--danger); background: rgba(255,84,112,0.14); border-color: rgba(255,84,112,0.45);
}
.icp-pill[data-status="held"] .live-dot { background: var(--danger); }
.icp-pill[data-status="idle"] .live-dot { background: var(--neutral-400); }

/* ============================================================
   STAGE — three columns
   ============================================================ */
.stage {
  display: grid;
  grid-template-columns: 268px 1fr 340px;
  gap: var(--space-5);
  min-height: 0;
}

.rail { min-height: 0; overflow: auto; }
.rail-left { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-6); }
.rail-right { display: flex; flex-direction: column; gap: var(--space-3); }

.rail-label {
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--fg3); font-weight: 600; font-family: var(--font-ui);
  margin-bottom: var(--space-3);
}

/* ---- left rail: worker head ---------------------------------- */
.worker-head .ws-eyebrow { display: block; margin-bottom: 6px; }
.worker-head .ws-eyebrow.flash { animation: triggerFlash 1.2s ease-out; }
.worker-name { margin: 0; }

/* ---- tools --------------------------------------------------- */
.tool-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.tool-chip {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
  transition: all .3s cubic-bezier(0.22,1,0.36,1);
}
.tool-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--neutral-500);
  flex: none;
  transition: all .3s ease;
}
.tool-name { font-size: 13px; color: var(--fg2); flex: 1; }
.tool-check { color: var(--success); font-size: 13px; opacity: 0; transition: opacity .3s ease; }

.tool-chip.is-active {
  border-color: var(--border-brand);
  background: rgba(248,0,155,0.08);
}
.tool-chip.is-active .tool-dot {
  background: var(--brand);
  box-shadow: 0 0 10px rgba(248,0,155,0.8);
  animation: pulse 1s ease-in-out infinite;
}
.tool-chip.is-done .tool-dot { background: var(--success); box-shadow: none; }
.tool-chip.is-done .tool-check { opacity: 1; }
.tool-chip.is-done .tool-name { color: var(--fg1); }

/* ---- status -------------------------------------------------- */
.status-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: rgba(255,255,255,0.03);
  font-size: 13px; font-weight: 500; color: var(--fg2);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral-400); flex: none; }
.status-chip[data-state="running"] { border-color: var(--border-brand); color: var(--fg1); }
.status-chip[data-state="running"] .status-dot { background: var(--brand); box-shadow: 0 0 10px rgba(248,0,155,0.8); animation: pulse 1s infinite; }
.status-chip[data-state="waiting"] {
  border-color: rgba(255,194,75,0.55); color: var(--warning);
  background: rgba(255,194,75,0.10);
  box-shadow: 0 0 20px rgba(255,194,75,0.22);
}
.status-chip[data-state="waiting"] .status-dot { background: var(--warning); box-shadow: 0 0 10px rgba(255,194,75,0.9); animation: pulse .8s infinite; }
.status-chip[data-state="done"] { border-color: rgba(47,211,122,0.5); color: var(--success); }
.status-chip[data-state="done"] .status-dot { background: var(--success); }
.status-chip[data-state="held"] { border-color: rgba(255,84,112,0.5); color: var(--danger); }
.status-chip[data-state="held"] .status-dot { background: var(--danger); }

.memory-note { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.mem-led { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(140,107,240,0.8); }
.mem-text { color: var(--fg3); }
.mem-detail {
  margin: 6px 0 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 11px;
  line-height: 1.5;
  color: var(--fg3);
}

/* ============================================================
   CENTER — core, spine, reasoning
   ============================================================ */
.center {
  display: flex; flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}

/* ---- orbital core — halo-network-node hero in a glass panel,
   over a larger dim halo-rings backdrop (matches "Orbiting Halo") --- */
.core-wrap { display: flex; justify-content: center; align-items: center; height: 190px; position: relative; flex: none; }
.core { position: relative; width: 190px; height: 190px; display: flex; align-items: center; justify-content: center; }

/* soft radial bloom behind everything */
.core-glow {
  position: absolute; inset: -28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248,0,155,0.38) 0%, rgba(140,107,240,0.16) 46%, transparent 72%);
  filter: blur(20px);
  animation: breathe 4.5s ease-in-out infinite;
  z-index: 0;
}

/* the halo SVG: vertical ring + tilted orbit with two orbiting dots */
.halo-svg {
  position: relative;
  width: 100%; height: 100%;
  overflow: visible;
  z-index: 2;
}

/* TWO logical dots orbit the tilted ellipse half a cycle apart — BOTH
   always visible, diametrically opposite (as in the reference image).
   Each logical dot = a back-layer SVG copy + a front-layer SVG copy
   moving in lockstep on the same offset-path; only the copy on the
   correct depth layer is shown at any moment.
   Path 0%->50% runs over the TOP (far / behind the ring),
   50%->100% runs under the BOTTOM (near / in front of it). */
.orbit-dot {
  /* identical ellipse to the drawn orbit (rx114 ry44 @120,120); the parent
     <g rotate(-26)> applies the tilt, so no rotation here. */
  offset-path: path("M 6 120 A 114 44 0 1 1 234 120 A 114 44 0 1 1 6 120");
  offset-rotate: 0deg;
  animation: 9s linear infinite;
  will-change: offset-distance;
}
.dot-a-front { animation-name: show-front-half; }
.dot-a-back  { animation-name: show-back-half; }
.dot-b-front { animation-name: show-front-half; animation-delay: -4.5s; }
.dot-b-back  { animation-name: show-back-half;  animation-delay: -4.5s; }

/* visible only on the bottom (near) half — the front-layer copy */
@keyframes show-front-half {
  0%   { offset-distance: 0%;    opacity: 0; }
  49.9%{ offset-distance: 49.9%; opacity: 0; }
  50%  { offset-distance: 50%;   opacity: 1; }
  99.9%{ offset-distance: 99.9%; opacity: 1; }
  100% { offset-distance: 100%;  opacity: 0; }
}
/* visible only on the top (far) half — the back-layer copy */
@keyframes show-back-half {
  0%   { offset-distance: 0%;    opacity: 1; }
  49.9%{ offset-distance: 49.9%; opacity: 1; }
  50%  { offset-distance: 50%;   opacity: 0; }
  99.9%{ offset-distance: 99.9%; opacity: 0; }
  100% { offset-distance: 100%;  opacity: 1; }
}

/* subtle life on the rings themselves */
.halo-ring  { animation: breathe 5s ease-in-out infinite; }
.orbit-front, .orbit-back { animation: breathe 5s ease-in-out infinite; }

/* --- glow state reactivity (dots orbit at constant speed) --- */
.core[data-state="idle"] .core-glow { opacity: 0.6; }
.core[data-state="reasoning"] .core-glow { animation-duration: 2s; filter: blur(24px); }
.core[data-state="acting"] .core-glow { opacity: 1; }
.core[data-state="waiting"] .core-glow {
  background: radial-gradient(circle, rgba(255,194,75,0.42) 0%, transparent 68%);
  animation: pulse 1.2s ease-in-out infinite;
}

/* ---- 7-stage spine ------------------------------------------- */
.spine {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0; flex: none;
}
.spine-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; position: relative; flex: 1; text-align: center;
}
.spine-node {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--fg3);
  border: 1px solid var(--border-default);
  background: rgba(255,255,255,0.03);
  transition: all .4s cubic-bezier(0.22,1,0.36,1);
  z-index: 2;
}
.spine-label {
  font-size: 11px; color: var(--fg3);
  font-family: var(--font-ui); font-weight: 500;
  max-width: 92px; line-height: 1.3;
  transition: color .3s ease;
}
.spine-link {
  position: absolute; top: 17px; left: 50%; width: 100%; height: 2px;
  background: var(--border-subtle);
  z-index: 1;
}
.spine-step.is-active .spine-node {
  color: #fff; border-color: transparent;
  background: var(--grad-halo-soft);
  box-shadow: 0 0 18px rgba(248,0,155,0.6);
  transform: scale(1.12);
}
.spine-step.is-active .spine-label { color: var(--fg1); }
.spine-step.is-done .spine-node { color: var(--success); border-color: rgba(47,211,122,0.5); background: rgba(47,211,122,0.1); }
.spine-step.is-done .spine-node::after { content: "✓"; position: absolute; font-size: 15px; }
.spine-step.is-done .spine-node { font-size: 0; }
.spine-step.is-done .spine-link { background: rgba(47,211,122,0.4); }

/* ---- narration ----------------------------------------------- */
.narration {
  text-align: center; color: var(--fg2);
  font-size: 14px; font-style: italic;
  padding: var(--space-2) var(--space-4);
  min-height: 20px; flex: none;
  animation: fadeIn .5s ease;
}

/* ---- reasoning stream ---------------------------------------- */
.reasoning {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: var(--space-4) var(--space-5);
}
.reasoning-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); flex: none; }
.reasoning-cursor {
  display: inline-block; width: 8px; height: 14px;
  background: var(--brand); opacity: 0;
  border-radius: 1px;
}
.reasoning-cursor.is-live { opacity: 1; animation: blink 1s step-end infinite; }
.reasoning-body {
  flex: 1; min-height: 0; overflow-y: auto;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  color: var(--fg2);
  display: flex; flex-direction: column; gap: 6px;
}
.reason-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.reason-line::before { content: "›"; color: var(--fg3); flex: none; }
.reason-text { flex: 1; }
.reason-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: var(--radius-pill); flex: none;
  color: var(--brand); background: rgba(248,0,155,0.12); border: 1px solid var(--border-brand);
}
.reason-tag.mem { color: var(--accent-soft); background: rgba(140,107,240,0.14); border-color: rgba(140,107,240,0.4); }
.reason-line.kind-decision .reason-text { color: var(--fg1); }
.reason-line.kind-memory .reason-text { color: var(--fg1); }

/* ============================================================
   RIGHT RAIL — outputs + ROI
   ============================================================ */
.outputs { display: flex; flex-direction: column; gap: var(--space-3); }
.outputs-label { flex: none; }

.out-card { padding: var(--space-4); }
.out-enter { opacity: 0; transform: translateY(10px); transition: opacity .5s cubic-bezier(0.22,1,0.36,1), transform .5s cubic-bezier(0.22,1,0.36,1); }
.out-in { opacity: 1; transform: translateY(0); }

.out-eyebrow { display: block; margin-bottom: 6px; }
.out-title { font-weight: 600; font-size: 14px; color: var(--fg1); }
.out-body { margin-top: 4px; }

.ingest-card { border-left: 2px solid var(--accent); }

.artifact-card .artifact-to { font-weight: 600; font-size: 13px; color: var(--fg1); }
.artifact-card .artifact-subject { font-size: 13px; color: var(--brand); margin: 2px 0 6px; }
.artifact-preview { color: var(--fg2); }

.count-card {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
.count-val {
  font-family: var(--font-display); font-weight: 600; font-size: 30px;
  line-height: 1; color: transparent;
  background: var(--grad-halo); -webkit-background-clip: text; background-clip: text;
}
.count-lbl { color: var(--fg3); }

/* ---- escalation card ----------------------------------------- */
.escalation-card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,194,75,0.55);
  background: linear-gradient(135deg, rgba(255,194,75,0.10), rgba(255,194,75,0.03));
  box-shadow: 0 0 28px rgba(255,194,75,0.22), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: escIn .5s cubic-bezier(0.22,1,0.36,1);
}
.esc-eyebrow {
  font-family: var(--font-ui); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--warning);
  margin-bottom: var(--space-2);
}
.esc-reason { font-size: 13px; color: var(--fg1); line-height: 1.5; margin-bottom: var(--space-2); }
.esc-question { font-size: 14px; font-weight: 600; color: var(--fg1); margin-bottom: 6px; }
.esc-detail { color: var(--fg3); margin-bottom: var(--space-4); }
.esc-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.esc-btn {
  padding: 9px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-strong); background: rgba(255,255,255,0.05); color: var(--fg1);
  transition: all .25s ease;
}
.esc-btn:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.1); }
.esc-approve {
  border: none; color: #fff;
  background: linear-gradient(90deg, #E50096 0%, #F8009B 52%, #FF5AC8 100%);
  box-shadow: 0 6px 22px rgba(248,0,155,0.4);
}
.esc-approve:hover { box-shadow: 0 8px 30px rgba(248,0,155,0.55); }
.esc-reject { color: var(--danger); border-color: rgba(255,84,112,0.4); }

.escalation-card.resolved { border-color: var(--border-default); background: rgba(255,255,255,0.03); box-shadow: none; }
.escalation-card.res-approve, .escalation-card.res-edit { border-color: rgba(47,211,122,0.4); }
.escalation-card.res-reject { border-color: rgba(255,84,112,0.4); }
.res-approve .esc-eyebrow, .res-edit .esc-eyebrow { color: var(--success); }
.res-reject .esc-eyebrow { color: var(--danger); }
.esc-resolved-msg { font-size: 13px; color: var(--fg1); line-height: 1.5; }

/* ---- logs + messages ----------------------------------------- */
.log-row { display: flex; align-items: flex-start; gap: var(--space-2); padding: 10px 14px; }
.log-check { color: var(--success); font-size: 13px; flex: none; }
.log-text { flex: 1; }
.message-card { border-left: 2px solid var(--brand); }
.msg-channel {
  font-family: var(--font-ui); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand);
  margin-bottom: 4px;
}
.msg-text { color: var(--fg1); }

/* ---- ROI card ------------------------------------------------ */
.roi-slot { flex: none; margin-top: auto; }
.roi-card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-brand);
  background: linear-gradient(135deg, rgba(248,0,155,0.10), rgba(140,107,240,0.06));
  box-shadow: var(--shadow-glow);
  opacity: 0; transform: translateY(14px) scale(0.98);
  transition: all .6s cubic-bezier(0.22,1,0.36,1);
}
.roi-card.roi-in { opacity: 1; transform: translateY(0) scale(1); }
.roi-eyebrow { display: block; margin-bottom: 6px; }
.roi-headline { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.25; color: var(--fg1); letter-spacing: -0.01em; }
.roi-stats { display: flex; gap: var(--space-4); margin: var(--space-4) 0; flex-wrap: wrap; }
.roi-stat { flex: 1; min-width: 120px; }
.roi-ba { display: flex; align-items: baseline; gap: 6px; }
.roi-before { font-size: 13px; color: var(--fg3); text-decoration: line-through; }
.roi-arrow { color: var(--brand); }
.roi-after { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--fg1); }
.roi-stat-lbl { margin-top: 2px; }
.roi-kicker { font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.3; margin-bottom: 6px; }
.roi-source { color: var(--fg3); font-style: italic; }

/* ============================================================
   TRANSPORT BAR
   ============================================================ */
.transport {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
}
.transport-group { display: flex; align-items: center; gap: var(--space-3); }

.tbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: rgba(255,255,255,0.04);
  color: var(--fg2); font-size: 13px; font-weight: 500;
  transition: all .25s cubic-bezier(0.22,1,0.36,1);
}
.tbtn:hover { border-color: var(--border-strong); color: var(--fg1); background: rgba(255,255,255,0.08); }
.tbtn-ico { font-size: 12px; }
.tbtn-lbl { text-transform: lowercase; }
.tbtn-primary {
  border: none; color: #fff; padding: 10px 22px;
  background: linear-gradient(90deg, #E50096 0%, #F8009B 52%, #FF5AC8 100%);
  box-shadow: 0 6px 22px rgba(248,0,155,0.4);
  font-weight: 600;
}
.tbtn-primary:hover { box-shadow: 0 8px 30px rgba(248,0,155,0.55); color: #fff; }
.tbtn-primary:active { transform: scale(0.98); }
.tbtn-primary.is-playing { background: linear-gradient(90deg, #B60088, #CD008E); }

.speed-toggle { display: inline-flex; border-radius: var(--radius-pill); border: 1px solid var(--border-default); overflow: hidden; }
.speed-btn { padding: 7px 14px; background: transparent; border: none; color: var(--fg3); font-size: 13px; font-weight: 600; transition: all .25s ease; }
.speed-btn.is-active { background: rgba(248,0,155,0.16); color: var(--brand); }

.narr-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.narr-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.narr-track {
  width: 34px; height: 18px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.1); border: 1px solid var(--border-default);
  position: relative; transition: all .3s ease; flex: none;
}
.narr-thumb {
  position: absolute; top: 1px; left: 1px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--fg3); transition: all .3s cubic-bezier(0.22,1,0.36,1);
}
.narr-toggle input:checked + .narr-track { background: rgba(248,0,155,0.3); border-color: var(--border-brand); }
.narr-toggle input:checked + .narr-track .narr-thumb { left: 17px; background: var(--brand); box-shadow: 0 0 8px rgba(248,0,155,0.8); }
.narr-lbl { color: var(--fg3); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.6; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes escIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes triggerFlash {
  0% { color: var(--brand); text-shadow: 0 0 16px rgba(248,0,155,0.9); }
  100% { color: var(--brand); text-shadow: none; }
}

/* ============================================================
   RESPONSIVE — down to 13" laptop (1280px)
   ============================================================ */
@media (max-width: 1440px) {
  .stage { grid-template-columns: 244px 1fr 320px; gap: var(--space-4); }
}
@media (max-width: 1320px) {
  .app { padding: var(--space-4) var(--space-5); }
  .stage { grid-template-columns: 224px 1fr 300px; }
  .core-wrap { height: 120px; }
  .core { width: 120px; height: 120px; }
  .spine-label { font-size: 10px; max-width: 78px; }
  .roi-headline { font-size: 17px; }
}

/* ============================================================
   REDUCED MOTION — snap content in, keep the sequence
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .orbit-dot, .halo-ring, .orbit-front, .orbit-back { animation: none !important; }
  /* static composition matching the reference: one dot top-right (behind
     the ring), one bottom-left (in front) */
  .dot-a-back  { offset-distance: 38% !important; opacity: 1 !important; }
  .dot-b-front { offset-distance: 88% !important; opacity: 1 !important; }
  .dot-a-front, .dot-b-back { opacity: 0 !important; }
  .core-glow { animation: none !important; opacity: 0.7 !important; }
  .bloom { animation: none !important; }
  .tool-chip.is-active .tool-dot,
  .status-dot,
  .reasoning-cursor.is-live { animation: none !important; }
  .out-enter { transition: none !important; opacity: 1 !important; transform: none !important; }
  .roi-card { transition: none !important; }
  .narration { animation: none !important; }
  * { scroll-behavior: auto !important; }
}
