/* ===================== THE WORKBENCH =====================
   Drag-and-play agent designer: palettes, canvas, wires,
   live packets, narration. The lead magnet. */

.workbench-section { padding: var(--section-padding); padding-top: clamp(2.5rem, 5vw, 3.5rem); }

.workbench {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #1c1c1f 0%, var(--surface) 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}
.workbench::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px; z-index: 2;
  background: linear-gradient(90deg, transparent, var(--accent) 35%, var(--accent-bright) 50%, var(--accent) 65%, transparent);
  opacity: 0.7;
}
.wb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wb-bar .l { color: var(--accent); }
.wb-presets { display: flex; gap: 0.5rem; align-items: center; }
.wb-presets span { color: var(--text-dim); margin-right: 0.25rem; }
.wb-preset {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.wb-preset:hover { color: var(--text); border-color: var(--border-hover); }
.wb-preset.is-active { color: var(--accent-bright); border-color: var(--accent-dim); background: var(--accent-soft); }

/* ---------- launcher ---------- */
.ws-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #1c1c1f 0%, var(--surface) 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  position: relative;
  overflow: hidden;
}
.ws-launcher::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 35%, var(--accent-bright) 50%, var(--accent) 65%, transparent);
  opacity: 0.7;
}
.ws-launcher-title { font-family: var(--font-heading); font-size: 1.5rem; }
.ws-launcher-sub { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--text-dim); margin-top: 0.3rem; }

/* ---------- the studio overlay ---------- */
.ws-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background:
    radial-gradient(circle at 50% 30%, rgba(212, 160, 82, 0.06), transparent 55%),
    var(--bg-deep);
  display: flex;
  flex-direction: column;
  animation: wsIn 0.5s var(--ease-out-expo);
}
@keyframes wsIn { from { opacity: 0; } to { opacity: 1; } }
.ws-overlay[hidden] { display: none; }
.ws-topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--border);
  background: rgba(12, 12, 14, 0.7);
  backdrop-filter: blur(8px);
}
.ws-brand { font-family: var(--font-heading); font-size: 1.05rem; color: var(--text); }
.ws-brand span { color: var(--accent); }
.ws-brand em { font-family: var(--font-mono); font-style: normal; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.ws-phase {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.ws-phase i {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--border-hover);
  transition: background 0.3s;
}
.ws-phase i.on { background: var(--accent); }
.ws-phase span { margin-left: 0.6rem; }
.ws-close {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px; height: 38px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.ws-close:hover { color: var(--text); border-color: var(--border-hover); }

/* the entry gate: black screen, the mark, a visible human check */
.ws-gate {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  background:
    radial-gradient(circle at 50% 40%, rgba(212, 160, 82, 0.05), transparent 55%),
    #0a0a0c;
  transition: opacity 0.4s var(--ease-out);
}
.ws-gate.is-done { opacity: 0; pointer-events: none; }
.ws-gate-mark {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text);
  animation: introUp 0.7s var(--ease-out-expo) both;
}
.ws-gate-mark span { color: var(--accent); }
.ws-gate-line {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  animation: introUp 0.7s var(--ease-out-expo) 0.15s both;
}
.ws-gate-line .ok { color: var(--success); }
.ws-gate-widget {
  min-height: 66px;
  min-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: introUp 0.7s var(--ease-out-expo) 0.3s both;
}
.ws-gate-note {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  animation: introUp 0.7s var(--ease-out-expo) 0.45s both;
}
@media (prefers-reduced-motion: reduce) {
  .ws-gate-mark, .ws-gate-line, .ws-gate-widget, .ws-gate-note { animation: none; }
}

/* intro: the movie opening */
.ws-intro[hidden] { display: none; }
.ws-intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
  text-align: center;
  padding: 2rem;
}
.ws-intro-mark {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text);
  opacity: 0;
  animation: introUp 0.9s var(--ease-out-expo) 0.2s forwards;
}
.ws-intro-mark span { color: var(--accent); }
.ws-intro-line {
  opacity: 0;
  animation: introUp 0.9s var(--ease-out-expo) forwards;
}
.ws-intro-line.l1 {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--accent);
  animation-delay: 0.7s;
}
.ws-intro-line.l2 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  color: var(--text);
  animation-delay: 1.4s;
}
.ws-intro-line.l3 {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-muted);
  animation-delay: 2.1s;
}
.ws-intro-skip {
  position: absolute;
  bottom: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0;
  animation: introUp 0.8s ease 2.8s forwards;
}
@keyframes introUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* stage inside the overlay: app layout, no page scroll */
.ws-stage[hidden] { display: none; }
.ws-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(1.25rem, 3vh, 2.5rem) clamp(1rem, 6vw, 6rem);
}
.ws-step { display: none; }
.ws-step.is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  animation: stepIn 0.5s var(--ease-out-expo);
}
/* the brief step is a real chat app: messages fill, input pinned */
.ws-step[data-ws="brief"].is-active { overflow: hidden; }
.ws-chatbox {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-width: none;
  padding: 0.5rem 0.25rem 1rem 0;
}
/* conversation hugs the input (messenger-style) instead of floating at the
   top of a void; margin-top:auto keeps scroll behavior intact */
.ws-chatbox > :first-child { margin-top: auto; }
.ws-chatrow { max-width: none; flex: none; }
.ws-step[data-ws="brief"] .ws-taps { flex: none; }
.wb-mic { padding: 0; }
.wb-mic svg { display: block; }

/* the process rail: follow along on the right while you work the left */
.ws-rail { display: none; }
@media (min-width: 960px) {
  .ws-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(210px, 22vw, 280px);
    grid-template-rows: minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
  }
  .ws-stage > .ws-step { grid-column: 1; grid-row: 1; }
  .ws-rail {
    display: block;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    border-left: 1px solid var(--border);
    padding-left: clamp(1.25rem, 2.5vw, 2rem);
  }
}
.ws-rail-head {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.4rem;
}
.ws-rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.35rem; }
.ws-rail li { display: flex; gap: 0.85rem; align-items: baseline; opacity: 0.45; transition: opacity 0.3s; }
.ws-rail li .n { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim); transition: color 0.3s; }
.ws-rail li b { display: block; font-size: 0.92rem; font-weight: 500; color: var(--text-muted); transition: color 0.3s; }
.ws-rail li i { display: block; font-style: normal; font-size: 0.75rem; font-weight: 300; color: var(--text-dim); margin-top: 0.15rem; }
.ws-rail li.is-live { opacity: 1; }
.ws-rail li.is-live .n { color: var(--accent); }
.ws-rail li.is-live b { color: var(--text); }
.ws-rail li.is-done { opacity: 0.75; }
.ws-rail li.is-done .n { color: var(--success); }
.ws-rail li.is-done .n::after { content: ' ✓'; }

/* sliders inside the overlay (it sits outside .workbench) */
.ws-overlay input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; cursor: pointer;
}
.ws-overlay input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 40%), var(--border) var(--fill, 40%));
}
.ws-overlay input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 26px; margin-top: -12px;
  background: var(--text); border: none; border-radius: 2px;
  box-shadow: 0 0 0 1px var(--bg), 0 4px 14px rgba(0, 0, 0, 0.55);
}
.ws-overlay input[type="range"]::-moz-range-track { height: 2px; background: var(--border); }
.ws-overlay input[type="range"]::-moz-range-progress { height: 2px; background: var(--accent); }
.ws-overlay input[type="range"]::-moz-range-thumb { width: 14px; height: 26px; background: var(--text); border: none; border-radius: 2px; }

/* taps: structured system tiles, label left / state right */
.ws-taps { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.8rem 0 1rem; }
.ws-taps.wb-connect {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  max-width: 780px;
}
.ws-taps .builder-tool, .ws-tap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.7rem 0.9rem;
  background: linear-gradient(180deg, #19191d, #131316);
  border: 1px solid var(--border-hover);
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.ws-taps .builder-tool::before { content: none; }
.ws-taps.wb-connect .builder-tool::after {
  content: '+';
  color: var(--text-dim);
  font-weight: 600;
}
.ws-taps .builder-tool:hover { color: var(--text); border-color: var(--accent-dim); }
.ws-taps .builder-tool.is-on {
  color: var(--accent-bright);
  border-color: var(--accent-dim);
  background: linear-gradient(180deg, rgba(212, 160, 82, 0.12), rgba(212, 160, 82, 0.05));
  box-shadow: inset 0 0 0 1px rgba(212, 160, 82, 0.12);
}
.ws-taps.wb-connect .builder-tool.is-on::after { content: '\2713'; color: var(--success); }
.ws-custom-row { display: flex; gap: 0.6rem; max-width: 480px; }
.ws-custom-row .builder-input { margin: 0; flex: 1; }

/* build grid: log + live activity */
.ws-buildgrid {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 1.5rem;
  align-items: start;
}
.ws-activity {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
}
.ws-activity-head {
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--success);
}
.ws-activity-list { padding: 0.8rem 1.1rem; min-height: 220px; }
.ws-task {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.45rem 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
}
.ws-task.is-in { opacity: 1; transform: none; }
.ws-task .spin {
  flex: none;
  width: 10px; height: 10px;
  border: 1.5px solid var(--border-hover);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: wsSpin 0.8s linear infinite;
  align-self: center;
}
@keyframes wsSpin { to { transform: rotate(360deg); } }
.ws-task .done { color: var(--success); flex: none; }
.ws-task .res { color: var(--text-dim); margin-left: auto; text-align: right; }
.ws-task.is-done { color: var(--text); }
.ws-task.is-done .res { color: var(--success); }

/* result inside overlay */
.ws-result {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}
.ws-result[hidden] { display: none; }

/* speed control */
.ws-speed { display: flex; gap: 0.35rem; }
.ws-speed-btn {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ws-speed-btn:hover { color: var(--text); }
.ws-speed-btn.is-on { color: var(--accent-bright); border-color: var(--accent-dim); background: var(--accent-soft); }

@media (max-width: 900px) {
  .ws-buildgrid { grid-template-columns: 1fr; }
  .ws-launcher { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-overlay { animation: none; }
  .ws-intro-mark, .ws-intro-line, .ws-intro-skip { animation: none; opacity: 1; }
  .ws-task { transition: none; }
  .ws-task .spin { animation: none; }
}

/* ---------- wizard stage ---------- */
.wb-stage { padding: clamp(1.75rem, 3.5vw, 2.75rem); }
.wb-textarea { max-width: 720px; resize: vertical; line-height: 1.6; font-size: 1.02rem; }
.wb-connect { max-width: 720px; }
.wb-followup { margin-top: 1.5rem; }

/* chat brief */
.wb-chat {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
  min-height: 60px;
}
.wb-msg {
  max-width: 56ch;
  padding: 0.8rem 1.05rem;
  border-radius: 12px;
  font-size: 0.93rem;
  font-weight: 300;
  line-height: 1.6;
  animation: msgIn 0.35s var(--ease-out-expo);
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wb-msg.agent {
  align-self: flex-start;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text-muted);
}
.wb-msg.agent b { color: var(--accent-bright); font-weight: 500; }
.wb-msg.user {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-bottom-right-radius: 4px;
  color: var(--text);
}
.wb-msg.typing { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.8rem; }
.wb-msg.typing i {
  display: inline-block; font-style: normal;
  animation: dotBlink 1.2s infinite;
}
.wb-msg.typing i:nth-child(2) { animation-delay: 0.2s; }
.wb-msg.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBlink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.wb-chat-row { display: flex; gap: 0.6rem; max-width: 720px; align-items: center; }
.wb-chat-input { margin: 0; flex: 1; }
.wb-mic {
  flex: none;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.wb-mic:hover { color: var(--text); border-color: var(--border-hover); }
.wb-mic.is-listening { color: var(--danger); border-color: var(--danger); animation: micPulse 1.2s infinite; }
@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.wb-chat-quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; max-width: 720px; }

/* the cost meter (step 2) */
.wb-meter {
  max-width: 640px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(212, 160, 82, 0.06), transparent 40%), var(--bg);
  padding: 1.4rem 1.5rem 1.2rem;
  margin-bottom: 1.6rem;
  position: relative;
  overflow: hidden;
}
.wb-meter::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent-bright) 50%, var(--accent) 70%, transparent);
}
.wb-meter-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 300; }
.wb-meter-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin-top: 0.3rem;
}
.wb-meter-value small { font-size: 0.34em; color: var(--text-dim); font-weight: 400; letter-spacing: 0; margin-left: 0.35rem; }
.wb-meter-sub { margin-top: 0.6rem; font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); }
.wb-meter-sub b { color: var(--success); font-weight: 600; }
.wb-meter-sub span { color: var(--text-dim); }

/* range inputs inside the workbench (mirror of .builder's) */
.workbench input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; cursor: pointer;
}
.workbench input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 40%), var(--border) var(--fill, 40%));
}
.workbench input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 26px; margin-top: -12px;
  background: var(--text); border: none; border-radius: 2px;
  box-shadow: 0 0 0 1px var(--bg), 0 4px 14px rgba(0, 0, 0, 0.55);
}
.workbench input[type="range"]::-moz-range-track { height: 2px; background: var(--border); }
.workbench input[type="range"]::-moz-range-progress { height: 2px; background: var(--accent); }
.workbench input[type="range"]::-moz-range-thumb { width: 14px; height: 26px; background: var(--text); border: none; border-radius: 2px; }

/* chat input as auto-growing textarea */
textarea.wb-chat-input {
  resize: none;
  overflow-y: auto;
  line-height: 1.5;
  min-height: 46px;
  max-height: 132px;
}

/* the story tour: narration card over the live canvas */
.ws-tour {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 2rem));
  background: rgba(18, 18, 20, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 0.9rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px var(--accent-glow);
  z-index: 6;
  animation: msgIn 0.4s var(--ease-out-expo);
}
.ws-tour-text {
  font-size: 0.93rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
}
.ws-tour-text b { color: var(--accent-bright); font-weight: 500; }
.ws-tour-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
}
.ws-tour-next {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 5px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.ws-tour-next:hover { background: var(--accent-bright); }
.ws-tour-skip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ws-tour-skip:hover { color: var(--text-muted); }

/* tour highlight on nodes and the agent core */
.wb-node.is-hi {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 24px var(--accent-glow), 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 5;
}
.wb-agent.is-hi {
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 60px var(--accent-glow), 0 18px 50px rgba(0, 0, 0, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .ws-tour { animation: none; }
}

/* ---------- the pipeline (v5 result) ---------- */
.wb-world {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  transition: transform 1.1s cubic-bezier(0.45, 0, 0.25, 1);
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) { .wb-world { transition: none; } }
.ws-stage-card {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 13.5%;
  min-width: 138px;
  background: linear-gradient(180deg, #1b1b1f, #141417);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 0.8rem 0.9rem 0.7rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  transition: border-color 0.3s, box-shadow 0.3s;
  z-index: 2;
}
.ws-stage-card.is-gate { border-color: var(--accent-dim); }
.ws-stage-card.is-flash { border-color: var(--success); }
.ws-stage-card.is-hi {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 30px var(--accent-glow), 0 14px 40px rgba(0, 0, 0, 0.45);
  z-index: 3;
}
.ws-stage-num {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.ws-stage-title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.1;
}
.ws-stage-desc {
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 0.3rem;
}
.ws-stage-work {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--success);
  border-top: 1px dashed var(--border);
  padding-top: 0.4rem;
  min-height: 1.6em;
}
.ws-stage-chips { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ws-chip-sys {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: 5px;
  padding: 0.2rem 0.45rem;
}
.ws-chip-sys .x { font-style: normal; color: var(--text-dim); cursor: pointer; }
.ws-chip-sys .x:hover { color: var(--danger); }
.ws-stage-count {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--success);
}
.ws-esc {
  position: absolute;
  top: 9%;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border-hover);
  border-radius: 7px;
  padding: 0.4rem 0.6rem;
  z-index: 2;
  transition: border-color 0.3s, color 0.3s;
}
.ws-esc .ws-esc-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  margin-right: 0.3rem;
}
.ws-esc.is-flash { border-color: var(--accent); color: var(--accent-bright); }
.ws-esc.is-flash .ws-esc-dot { background: var(--accent); }
.ws-esc-wire { stroke-dasharray: 3 5; opacity: 0.6; }

/* caption card for the pan (fixed to the canvas, not the world) */
.ws-caption {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  width: min(600px, calc(100% - 2rem));
  background: rgba(18, 18, 20, 0.93);
  backdrop-filter: blur(6px);
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 0.9rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px var(--accent-glow);
  z-index: 6;
}
.ws-caption[hidden] { display: none; }
.ws-caption-text { font-size: 0.95rem; font-weight: 300; color: var(--text-muted); line-height: 1.6; }
.ws-caption-text b { color: var(--accent-bright); font-weight: 500; }

/* the walkthrough: cinematic manifest - lines land and STAY */
.ws-mani {
  padding: clamp(2rem, 5vh, 3.5rem) clamp(1.25rem, 6vw, 5rem);
  max-width: 820px;
  margin: 0 auto;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.ws-mani-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
}
.ws-mani-head .k {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.ws-mani-head .s {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.ws-mani-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.ws-mani-item {
  display: flex;
  gap: 1.2rem;
  align-items: baseline;
  animation: callInMani 0.7s var(--ease-out-expo) both;
}
@keyframes callInMani { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.ws-mani-item .n {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  min-width: 1.6rem;
  transition: color 0.5s;
}
.ws-mani-item h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  line-height: 1.1;
  color: var(--text);
  margin: 0;
  transition: font-size 0.5s var(--ease-out), color 0.5s;
}
.ws-mani-item p {
  font-size: 1.02rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 56ch;
  margin: 0.5rem 0 0;
  overflow: hidden;
  max-height: 8rem;
  transition: max-height 0.5s var(--ease-out), opacity 0.5s, margin 0.5s;
}
.ws-mani-item p b { color: var(--accent-bright); font-weight: 500; }
/* past steps compact to their titles - the story so far stays scannable */
.ws-mani-item.is-past .n { color: var(--text-dim); }
.ws-mani-item.is-past h4 { font-size: 1.05rem; color: var(--text-muted); }
.ws-mani-item.is-past p { max-height: 0; opacity: 0; margin-top: 0; }
/* missed one? hover any past step and its story reopens */
.ws-mani-item.is-past:hover .n { color: var(--accent); }
.ws-mani-item.is-past:hover h4 { color: var(--text); }
.ws-mani-item.is-past:hover p { max-height: 8rem; opacity: 1; margin-top: 0.5rem; }
.ws-mani-cta {
  margin-top: 2.4rem;
  text-align: center;
}
.ws-mani-list { width: max-content; max-width: 100%; margin: 0 auto; }
.ws-mani-cta.is-in { animation: callInMani 0.7s var(--ease-out-expo) both; }
.ws-mani-cta[hidden] { display: none; }
.ws-mani-go {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.9rem 1.7rem;
  cursor: pointer;
  box-shadow: 0 0 30px var(--accent-glow);
  transition: background 0.2s, box-shadow 0.2s;
}
.ws-mani-go:hover { background: var(--accent-bright); box-shadow: 0 0 44px var(--accent-glow); }
.ws-mani-skip {
  position: absolute;
  bottom: 1rem;
  right: clamp(1.25rem, 6vw, 5rem);
}

/* slim, dark scrollbars everywhere inside the studio */
.ws-overlay * { scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent; }
.ws-overlay *::-webkit-scrollbar { width: 8px; height: 8px; }
.ws-overlay *::-webkit-scrollbar-track { background: transparent; }
.ws-overlay *::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }
.ws-overlay *::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* the brain: capability satellites above the core */
.wb-brain {
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.8rem;
  text-align: center;
  cursor: default;
  min-width: 108px;
}
.wb-brain-name { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text); }
.wb-brain-act {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  max-width: 15ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.25s;
}
.wb-brain.busy {
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow), 0 10px 30px rgba(0, 0, 0, 0.45);
}
.wb-brain.busy .wb-brain-name { color: var(--accent-bright); }
.wb-brain.busy .wb-brain-act { color: var(--accent-bright); }
.wb-brain-wire { stroke-dasharray: 2 5; opacity: 0.55; }
.wb-packet.brain { fill: var(--accent-bright); }

/* ---------- the droid: a colored-in character, caption below ---------- */
.wb-agent.wb-droid {
  width: auto;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -56%);
}
.wd-ring {
  position: absolute;
  top: 34%; left: 50%;
  width: 172px; height: 172px;
  transform: translate(-50%, -50%);
  border: 1px dashed var(--accent-dim);
  border-radius: 50%;
  opacity: 0.45;
  animation: wdSpin 30s linear infinite;
  pointer-events: none;
}
.wb-droid.is-thinking .wd-ring {
  animation-duration: 5s;
  opacity: 0.9;
  border-color: var(--accent);
  box-shadow: 0 0 26px var(--accent-glow);
}
@keyframes wdSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.wd-fig { position: relative; display: flex; flex-direction: column; align-items: center; }
.wd-head {
  position: relative;
  width: 54px; height: 34px;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent) 70%);
  border-radius: 14px 14px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  z-index: 1;
}
.wd-ant { position: absolute; top: -8px; left: 50%; width: 1.5px; height: 7px; background: var(--accent-dim); }
.wd-ant::after {
  content: '';
  position: absolute;
  top: -4px; left: -1.75px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-bright);
  animation: wdPing 2.2s infinite;
}
@keyframes wdPing { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; box-shadow: 0 0 8px var(--accent-glow); } }
.wd-eye {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-ink);
  animation: wdBlink 4.6s infinite;
}
.wd-eye + .wd-eye { animation-delay: 0.06s; }
@keyframes wdBlink { 0%, 91%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.15); } }
.wb-droid.is-thinking .wd-eye {
  background: #fff;
  box-shadow: 0 0 9px rgba(255, 255, 255, 0.8);
  animation: none;
}
.wd-torso {
  position: relative;
  width: 78px; height: 56px;
  margin-top: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dim) 90%);
  border-radius: 16px 16px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 34px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
/* little shoulder nubs - arms at rest */
.wd-torso::before, .wd-torso::after {
  content: '';
  position: absolute;
  top: 9px;
  width: 10px; height: 26px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dim));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.wd-torso::before { left: -13px; }
.wd-torso::after { right: -13px; }
/* the chest core: its heartbeat */
.wd-core {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6e6, var(--accent-bright) 45%, var(--accent-dim));
  box-shadow: 0 0 12px var(--accent-glow);
  animation: wdCore 3s ease-in-out infinite;
}
@keyframes wdCore { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.12); opacity: 1; } }
.wb-droid.is-thinking .wd-core { animation-duration: 0.9s; }

.wd-cap { margin-top: 10px; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .wd-ring, .wd-eye, .wd-ant::after, .wd-core { animation: none; }
}

/* system query flash: the agent checking a database */
.wb-wire.is-query { stroke: var(--info); stroke-width: 2; }
.wb-node.is-query { border-color: var(--info); box-shadow: 0 0 16px rgba(96, 165, 250, 0.3); }

/* stop control on the generation step */
.ws-build-stop {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.ws-build-stop:hover { color: var(--text-muted); }

/* the call beat over the live view */
.ws-cta-pop {
  width: min(58vw, 46rem);
  background: rgba(24, 20, 12, 0.97);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: clamp(1.8rem, 4vw, 3rem) clamp(1.8rem, 4.5vw, 3.25rem) clamp(1.2rem, 2.5vw, 1.8rem);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px var(--accent-glow);
  text-align: left;
}
.ws-pop-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 0.9rem;
}
.ws-pop-sub {
  font-size: 0.98rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 52ch;
  margin: 0 0 1.4rem;
}
.ws-pop-book {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.9rem 1.7rem;
  cursor: pointer;
  box-shadow: 0 0 30px var(--accent-glow);
  transition: background 0.18s, box-shadow 0.18s;
}
.ws-pop-book:hover { background: var(--accent-bright); box-shadow: 0 0 44px var(--accent-glow); }
.ws-pop-proof {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
.ws-pop-proof span {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}
.ws-pop-note {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--accent-dim);
}
.ws-cta-pop .ws-pop-later { display: block; margin: 1.1rem auto 0; }

/* the call moment: whole studio dims, one centered card, nothing competing */
.ws-live-book {
  display: inline-block;
  margin-top: 1.2rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.9rem 1.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, box-shadow 0.18s;
}
.ws-live-book:hover { background: var(--accent-bright); box-shadow: 0 0 24px var(--accent-glow); }

.ws-takeover {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: takeoverIn 0.45s var(--ease-out);
}
@keyframes takeoverIn { from { opacity: 0; } to { opacity: 1; } }
.ws-takeover .ws-cta-pop { animation: callInPop 0.55s var(--ease-out-expo) 0.05s both; }
.ws-takeover .ws-pop-title { animation: callInPop 0.6s var(--ease-out-expo) 0.15s both; }
.ws-takeover .ws-pop-sub { animation: callInPop 0.6s var(--ease-out-expo) 0.3s both; }
.ws-takeover .ws-pop-book { animation: callInPop 0.6s var(--ease-out-expo) 0.45s both; }
.ws-takeover .ws-pop-proof { animation: callInPop 0.6s var(--ease-out-expo) 0.6s both; }
.ws-takeover .ws-pop-note,
.ws-takeover .ws-pop-later { animation: callInPop 0.6s var(--ease-out-expo) 0.72s both; }
@media (max-width: 860px) { .ws-cta-pop { width: min(92vw, 46rem); } }
@keyframes callInPop { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ws-takeover, .ws-takeover .ws-cta-pop { animation: none; } }

/* the summon button */
.ws-reveal {
  display: block;
  margin: 1.75rem auto 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.9rem 1.7rem;
  cursor: pointer;
  /* own glow keyframe: board.css's youGlow animates BACKGROUND and would
     wash this button grey (that bug shipped once - don't share keyframes) */
  animation: revealIn 0.6s var(--ease-out-expo), revealGlow 3s ease-in-out 0.6s infinite;
  transition: background 0.15s;
}
.ws-reveal:hover { background: var(--accent-bright); }
@keyframes revealIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes revealGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(212, 160, 82, 0); }
  50% { box-shadow: 0 0 30px var(--accent-glow); }
}
@media (prefers-reduced-motion: reduce) { .ws-reveal { animation: none; } }

/* capture (call-first finish) */

/* refine bar (result) */
.wb-refine {
  border-top: 1px solid var(--border);
  padding: 1.1rem 1.4rem 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.wb-refine .wb-chat-row { max-width: 760px; }

/* ---------- result: canvas + cost race ---------- */
.wb-result-grid {
  display: grid;
  grid-template-columns: 1fr 264px;
  min-height: 440px;
}
.wb-race {
  border-left: 1px solid var(--border);
  padding: 1.4rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.wb-race-head {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}
.wb-race-head span { color: var(--accent); }
.wb-race-row, .wb-race-saved { display: flex; flex-direction: column; gap: 0.15rem; }
.wb-race-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 300; }
.wb-race-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.wb-race-value.human { color: var(--danger); }
.wb-race-value.agent { color: var(--success); }
.wb-race-saved {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.wb-race-value.saved { color: var(--accent-bright); font-size: 1.85rem; }
.wb-race-note {
  margin-top: auto;
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.55;
}

/* what it does every day */
.wb-daily {
  padding: 1.5rem 1.4rem 1.3rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
/* side by side: story left, action right - everything visible without scroll */
@media (min-width: 900px) {
  .wb-daily {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    text-align: left;
    padding: 1.4rem clamp(1.5rem, 4vw, 3rem);
  }
  .wb-daily .wb-daily-cta { text-align: center; }
  .wb-daily p { margin: 0; }
}
.wb-daily-cta .ws-live-book { margin-top: 0; }
@media (max-width: 899px) {
  .wb-daily-cta { margin-top: 1.2rem; }
}
.wb-daily-head {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.wb-daily p { color: var(--text-muted); font-weight: 300; font-size: 0.95rem; max-width: 66ch; margin: 0 auto; }
.wb-daily p b { color: var(--text); font-weight: 500; }
.wb-utils {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.8rem;
  color: var(--text-dim);
}

/* suggestions */
.wb-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.4rem 1.25rem;
}
.wb-suggest-head {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}
.wb-suggest-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), background 0.18s;
}
.wb-suggest-chip::before { content: '+ '; }
.wb-suggest-chip:hover { transform: translateY(-1px); background: rgba(212, 160, 82, 0.16); }

/* ---------- layout: palettes + canvas (legacy free mode) ---------- */
.wb-body {
  display: grid;
  grid-template-columns: 172px 1fr 172px;
  min-height: 480px;
}
.wb-palette {
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 1px solid var(--border);
}
.wb-palette-out { border-right: none; border-left: 1px solid var(--border); }
.wb-palette-head {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.wb-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.18s, border-color 0.18s, opacity 0.18s, transform 0.15s var(--ease-out);
}
.wb-chip::before { content: '+'; color: var(--text-dim); font-weight: 600; }
.wb-chip:hover { color: var(--text); border-color: var(--border-hover); transform: translateX(2px); }
.wb-palette-out .wb-chip:hover { transform: translateX(-2px); }
.wb-chip.is-placed { opacity: 0.38; cursor: default; }
.wb-chip.is-placed::before { content: '\2713'; color: var(--success); }
.wb-chip.is-placed:hover { transform: none; color: var(--text-muted); border-color: var(--border); }

/* ---------- canvas ---------- */
.wb-canvas {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(212, 160, 82, 0.05), transparent 55%),
    var(--bg);
  touch-action: none;
}
.wb-canvas::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}
.wb-wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.wb-wire { stroke: var(--border-hover); stroke-width: 1.5; fill: none; }
.wb-wire.is-new { stroke-dasharray: 400; stroke-dashoffset: 400; animation: wireDraw 0.7s var(--ease-out-expo) forwards; }
@keyframes wireDraw { to { stroke-dashoffset: 0; } }
.wb-packet { fill: var(--accent-bright); }
.wb-packet.out { fill: var(--success); }

/* the traveling job: a labeled item riding the wire, like the hero's chips */
.wb-job {
  position: absolute;
  transform: translate(-50%, 78%); /* below the wire: the pod arc owns the space above */
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent-bright);
  background: var(--bg-deep);
  border: 1px solid var(--accent-dim);
  border-radius: 3px;
  padding: 0.22rem 0.5rem;
  pointer-events: none;
  white-space: nowrap;
  z-index: 4;
  transition: opacity 0.25s, transform 0.25s;
}
.wb-job[hidden] { display: none; }
.wb-job.is-announce { transform: translate(-50%, -175%); } /* a toast above the source card */
/* a new item announcing itself at its source */
.wb-node.is-new { border-color: var(--accent); box-shadow: 0 0 18px var(--accent-glow), 0 10px 30px rgba(0, 0, 0, 0.45); }

.wb-hint {
  position: absolute;
  left: 50%; bottom: 0.9rem;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  white-space: nowrap;
  pointer-events: none;
}

/* nodes */
.wb-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: 9px;
  padding: 0.55rem 0.8rem;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: nodePop 0.4s var(--ease-out-expo);
  z-index: 3;
}
@keyframes nodePop {
  from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.wb-node.is-flash { border-color: var(--success); box-shadow: 0 0 18px rgba(62, 207, 142, 0.3), 0 10px 30px rgba(0,0,0,0.45); }
.wb-node .wb-count {
  font-size: 0.62rem;
  color: var(--success);
  min-width: 2.1em;
  text-align: right;
}
/* remove-x reveals on hover - resting nodes stay clean */
.wb-node .wb-x {
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1;
  padding: 0 0 0 0.15rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s;
}
.wb-node:hover .wb-x { opacity: 1; }
.wb-node .wb-x:hover { color: var(--danger); }
.wb-node:not(.wb-agent):not(.wb-brain):hover {
  border-color: var(--border-hover);
  transform: translate(-50%, -50%) translateY(-1px);
}

/* add a system without leaving the live view */
.wb-add {
  position: absolute;
  left: 1.1rem;
  bottom: 0.9rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wb-add-btn {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: none;
  border: 1px dashed var(--border-hover);
  border-radius: 7px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.wb-add-btn:hover { color: var(--accent-bright); border-color: var(--accent-dim); }
.wb-add input {
  width: 172px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--accent-dim);
  border-radius: 7px;
  padding: 0.45rem 0.6rem;
  outline: none;
}
.wb-add input::placeholder { color: var(--text-dim); }
.wb-add input { width: 240px; }
.wb-add-ack {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--success);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.45rem 0.7rem;
  animation: callIn 0.3s var(--ease-out);
}

/* the agent core */
.wb-agent {
  position: absolute;
  transform: translate(-50%, -50%);
  display: block; /* override .wb-node's flex row */
  width: 196px;
  text-align: center;
  background: linear-gradient(180deg, #201b12, var(--surface));
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  padding: 0.9rem 1rem 0.8rem;
  box-shadow: 0 0 34px var(--accent-glow), 0 18px 50px rgba(0, 0, 0, 0.5);
  z-index: 4;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
.wb-agent-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--accent-bright);
}
.wb-agent-sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.15rem;
}
.wb-agent-log {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-muted);
  background: rgba(12, 12, 14, 0.82);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  min-height: 0;
  line-height: 1.5;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wb-agent-log .ok { color: var(--success); }
.wb-agent.is-thinking { animation: agentPulse 0.6s ease; }
@keyframes agentPulse {
  0% { box-shadow: 0 0 34px var(--accent-glow), 0 18px 50px rgba(0,0,0,0.5); }
  40% { box-shadow: 0 0 60px var(--accent-glow), 0 0 0 6px var(--accent-soft), 0 18px 50px rgba(0,0,0,0.5); }
  100% { box-shadow: 0 0 34px var(--accent-glow), 0 18px 50px rgba(0,0,0,0.5); }
}

/* ---------- footer: narration + impact + CTA ---------- */
.wb-clear {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.wb-clear:hover { color: var(--text-muted); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .wb-result-grid { grid-template-columns: 1fr; min-height: 0; }
  .wb-result-grid .wb-canvas { height: 400px; }
  .wb-race {
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.25rem 2.25rem;
  }
  .wb-race-head { flex-basis: 100%; }
  .wb-race-note { margin-top: 0; flex-basis: 100%; }
  .wb-body { grid-template-columns: 1fr; min-height: 0; }
  .wb-palette, .wb-palette-out {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 1rem;
  }
  .wb-palette-head { flex-basis: 100%; margin-bottom: 0.1rem; }
  .wb-palette-out { order: 3; border-bottom: none; border-top: 1px solid var(--border); }
  .wb-canvas { order: 2; height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  .wb-node { animation: none; }
  .wb-wire.is-new { animation: none; stroke-dashoffset: 0; }
  .wb-agent.is-thinking { animation: none; }
  .wb-packet { display: none; }
  .wb-chip, .wb-preset { transition: none; }
}
