/* Onboarding scenes for the implementation page (content/partials/onboarding-scene-*.html).
   Each scene tells one causal story from the onboarding film in the Control Tower system:
   tokens only, both themes, Horizon for the one "handled" accent, signal orange only for
   NEEDS YOU, the plane glyph only for agents. Decorative (aria-hidden); meaning lives in page text.

   Lifecycle (assets/onboarding-scenes.js):
   - No script: no animation is attached, every element shows its complete end state.
   - [data-ob-run]: story animations attach. Every keyframe animates FROM a start value TO the
     element's own resting style, so the resting style IS the end state. Paused until [data-ob-live].
   - [data-ob-live]: playing. Timelines are scene clocks: --t is an element's start time on the
     scene's own clock (documented literal per the motion doc), durations and curves are tokens.
   - .ob-clock fires `animationend` at --ob-story; the controller marks [data-ob-done].
   Only transform (translate/scale/rotate) and opacity animate. The frame reserves its size with
   aspect-ratio per container width, so nothing shifts while a scene plays or fonts load. */

/* ---------- Frame ---------- */
.ob-scene {
  container: ob-scene / inline-size;
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
}
.ob-scene *,
.ob-scene *::before,
.ob-scene *::after {
  box-sizing: border-box;
}
.ob-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: var(--ob-ratio, 4 / 5);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-2);
}
/* The 1px inner highlight that gives dark panels their edge. */
.ob-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 var(--glow);
}
.ob-bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 46px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.ob-bar > .ob-i {
  width: 15px;
  height: 15px;
  color: var(--fg-3);
}
.ob-title {
  flex: none;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.ob-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--fg-3);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ob-bar-end {
  display: grid;
  flex: none;
  align-items: center;
  justify-items: end;
  margin-left: auto;
}
.ob-bar-end > * {
  grid-area: 1 / 1;
}
.ob-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.ob-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 1.2px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 30%, transparent 100%);
}
.ob-i {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  color: inherit;
}
.ob-plane {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@container ob-scene (max-width: 359px) {
  .ob-meta { display: none; }
}

/* ---------- Shared atoms ---------- */
.ob-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--fg-2);
  font: 500 13px/1 var(--font-sans);
  white-space: nowrap;
}
.ob-chip .ob-i {
  width: 13px;
  height: 13px;
}
.ob-chip.is-horizon {
  border-color: var(--horizon-line);
  background: var(--horizon-soft);
  color: var(--horizon-ink);
}
.ob-chip.is-needs {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.ob-chip.is-quiet {
  color: var(--fg-3);
  border-style: dashed;
}
.ob-dot {
  position: relative;
  display: inline-block;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.ob-label {
  font: 500 13px/1.2 var(--font-sans);
  color: var(--fg-3);
  white-space: nowrap;
}
.ob-av {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--bg-sunken);
  color: var(--fg-2);
  font: 600 13px/1 var(--font-sans);
}
.ob-skel {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.ob-tick {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg-elev);
}
.ob-tick .ob-i {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}
.ob-clock {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Motion vocabulary ---------- */
@keyframes ob-clock { from { opacity: 0; } to { opacity: 0; } }
@keyframes ob-in { from { opacity: 0; translate: var(--dx, 0) var(--dy, 6px); } }
@keyframes ob-pop { from { opacity: 0; scale: var(--s0, 0.9); } }
@keyframes ob-fade { from { opacity: 0; } }
@keyframes ob-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes ob-grow-x { from { scale: 0 1; } }
@keyframes ob-grow-y { from { scale: 1 0; } }
@keyframes ob-wipe { from { translate: -100% 0; } }
@keyframes ob-unwipe { from { translate: 100% 0; } }
/* Visible for a beat, then gone (active-row highlights, travelling sparks). */
@keyframes ob-blip {
  0% { opacity: 0; }
  14%, 72% { opacity: 1; }
  100% { opacity: 0; }
}

.ob-scene[data-ob-run] .ob-clock { animation: ob-clock var(--ob-story) linear both; }
.ob-scene[data-ob-run] .a-in { animation: ob-in var(--d, var(--dur-3)) var(--e, var(--ease-out)) var(--t, 0s) both; }
.ob-scene[data-ob-run] .a-pop { animation: ob-pop var(--d, var(--dur-3)) var(--e, var(--ease-spring)) var(--t, 0s) both; }
.ob-scene[data-ob-run] .a-fade { animation: ob-fade var(--d, var(--dur-3)) var(--e, var(--ease)) var(--t, 0s) both; }
.ob-scene[data-ob-run] .a-out { animation: ob-out var(--d, var(--dur-1)) var(--e, var(--ease-exit)) var(--t, 0s) both; }
.ob-scene[data-ob-run] .a-grow-x { animation: ob-grow-x var(--d, var(--dur-3)) var(--e, var(--ease-out)) var(--t, 0s) both; }
.ob-scene[data-ob-run] .a-grow-y { animation: ob-grow-y var(--d, var(--dur-3)) var(--e, var(--ease-out)) var(--t, 0s) both; }
.ob-scene[data-ob-run] .a-blip { animation: ob-blip var(--d, 1s) var(--e, var(--ease)) var(--t, 0s) both; }
/* Left-to-right reveal with transforms only: the window slides in while its content slides back. */
.a-wipe { display: block; overflow: hidden; }
.a-wipe { position: relative; }
.a-wipe > :not(.ob-caret-life) { display: block; }
.ob-scene[data-ob-run] .a-wipe { animation: ob-wipe var(--d, var(--dur-4)) var(--e, var(--ease-in-out)) var(--t, 0s) both; }
.ob-scene[data-ob-run] .a-wipe > :not(.ob-caret-life) { animation: ob-unwipe var(--d, var(--dur-4)) var(--e, var(--ease-in-out)) var(--t, 0s) both; }
.a-grow-x { transform-origin: 0 50%; }
.a-grow-y { transform-origin: 50% 100%; }
.a-out { opacity: 0; }

/* Offscreen, hidden tab, or before the 40% start: hold the current frame. */
.ob-scene[data-ob-run]:not([data-ob-live]) *,
.ob-scene[data-ob-run]:not([data-ob-live]) *::before,
.ob-scene[data-ob-run]:not([data-ob-live]) *::after {
  animation-play-state: paused !important;
}

/* =====================================================================
   DISCOVERY: four questions answered in order (job, who, good, measure).
   ===================================================================== */
.ob-scene[data-ob-scene="discovery"] { --ob-story: 3.9s; }
.ob-scene[data-ob-scene="discovery"] .ob-frame { --ob-ratio: 2 / 3; }
.ob-dq-segs {
  display: grid;
  grid-template-columns: repeat(4, 16px);
  gap: 4px;
}
.ob-dq-segs > i {
  position: relative;
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
}
.ob-dq-segs > i > b {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--fg);
}
.ob-dq-segs > i:last-child > b { background: var(--horizon-2); }
.ob-dq {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 12px;
}
.ob-dq-row {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 20px;
  grid-template-areas: "icon q state" "a a a";
  align-items: center;
  column-gap: 10px;
  row-gap: 8px;
  padding: 10px 12px 11px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-subtle);
}
.ob-dq-hl {
  position: absolute;
  inset: -1px;
  border: 1px solid var(--horizon-line);
  border-radius: inherit;
  background: var(--horizon-soft);
  box-shadow: 0 0 0 3px var(--horizon-soft);
  opacity: 0;
  pointer-events: none;
}
.ob-dq-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--fg-2);
}
.ob-dq-q {
  grid-area: q;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ob-dq-state {
  grid-area: state;
  position: relative;
  width: 20px;
  height: 20px;
}
.ob-dq-state > i {
  position: absolute;
  inset: 0;
  border: 1px dashed var(--line-3);
  border-radius: 50%;
}
.ob-dq-state > .ob-tick { position: absolute; inset: 0; }
.ob-dq-a {
  grid-area: a;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 26px;
  padding-left: 2px;
}
.ob-dq-ph {
  position: absolute;
  left: 2px;
  top: 50%;
  width: 52%;
  margin-top: -3px;
}
.ob-dq-text {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.ob-dq-text .a-wipe { padding-right: 3px; }
.ob-caret-life {
  position: absolute;
  right: 0;
  top: 50%;
  width: 1.5px;
  height: 16px;
  margin-top: -8px;
  opacity: 0;
}
.ob-caret-life > i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--fg);
}
.ob-scene[data-ob-run] .ob-caret-life > i { animation: var(--caret-blink); }
.ob-dq-people {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ob-dq-people .ob-av + .ob-av { margin-left: -8px; }
.ob-dq-people .ob-av { box-shadow: 0 0 0 2px var(--bg-subtle); }
.ob-dq-chips {
  display: flex;
  gap: 6px;
  min-width: 0;
}
.ob-dq-chips .ob-chip {
  height: 26px;
  padding: 0 9px 0 7px;
  color: var(--fg);
  font: 500 12.5px/1 var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}
.ob-dq-chips .ob-chip .ob-i { width: 12px; height: 12px; color: var(--fg-3); }
.ob-dq-chips .ob-chip:nth-child(3) { display: none; }
.ob-dq-metric {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.ob-dq-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 6px;
  align-items: end;
  gap: 3px;
  height: 24px;
}
.ob-dq-bars > i {
  display: block;
  border-radius: 1.5px;
  background: var(--fg-4);
}
.ob-dq-bars > i:last-child { background: var(--horizon-2); }
.ob-dq-metric > span {
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1;
  padding-bottom: 2px;
}
@container ob-scene (min-width: 340px) {
  .ob-scene[data-ob-scene="discovery"] .ob-frame { --ob-ratio: 4 / 5; }
  .ob-dq { padding: 14px; }
  .ob-dq-chips .ob-chip:nth-child(3) { display: inline-flex; }
}
@container ob-scene (min-width: 400px) {
  .ob-scene[data-ob-scene="discovery"] .ob-frame { --ob-ratio: 1 / 1; }
}
/* One line per question from here: icon, question, answer, state. */
@container ob-scene (min-width: 480px) {
  .ob-scene[data-ob-scene="discovery"] .ob-frame { --ob-ratio: 3 / 2; }
  .ob-dq { padding: 18px; gap: 10px; }
  .ob-dq-row {
    grid-template-columns: 30px minmax(9.5em, 0.8fr) minmax(0, 1.3fr) 20px;
    grid-template-areas: "icon q a state";
    padding: 11px 14px 11px 11px;
  }
  .ob-dq-a { min-height: 30px; }
}
@container ob-scene (min-width: 600px) {
  .ob-scene[data-ob-scene="discovery"] .ob-frame { --ob-ratio: 16 / 9; }
}
@container ob-scene (min-width: 760px) {
  .ob-scene[data-ob-scene="discovery"] .ob-frame { --ob-ratio: 2 / 1; font-size: 15px; }
  .ob-dq { padding: 24px 28px; gap: 12px; }
  .ob-dq-row { grid-template-columns: 34px minmax(13em, 0.8fr) minmax(0, 1.3fr) 22px; padding: 13px 18px 13px 13px; column-gap: 14px; }
  .ob-dq-icon { width: 34px; height: 34px; border-radius: 9px; }
  .ob-dq-text { font-size: 15px; }
  .ob-dq-chips .ob-chip { height: 28px; font-size: 13px; }
}
@container ob-scene (min-width: 960px) {
  .ob-scene[data-ob-scene="discovery"] .ob-frame { --ob-ratio: 5 / 2; }
  .ob-dq { padding: 28px 40px; }
}

/* =====================================================================
   STALL: the demo peaks, then each missing piece knocks the line down
   until it flattens short of production.
   ===================================================================== */
.ob-scene[data-ob-scene="stall"] { --ob-story: 4.2s; }
.ob-scene[data-ob-scene="stall"] .ob-frame { --ob-ratio: 3 / 5; }
.ob-st-demo { color: var(--horizon-ink); border-color: var(--horizon-line); background: var(--horizon-soft); opacity: 0; }
.ob-st-stalled { color: var(--fg-3); }
.ob-st-stalled .ob-dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.ob-st {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  height: 100%;
  padding: 14px;
}
.ob-st-chart {
  position: relative;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-subtle);
}
.ob-st-plot {
  position: absolute;
  inset: 44px 14px 36px;
}
.ob-st-plot > svg,
.ob-st-seg {
  position: absolute;
  top: 0;
  height: 100%;
  overflow: visible;
}
.ob-st-rules { left: 0; width: 100%; }
.ob-st-rules path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
}
.ob-st-rules .ob-st-goal { stroke: var(--line-3); stroke-dasharray: 3 3; }
.ob-st-seg { overflow: hidden; }
.ob-st-seg > svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; }
.ob-st-rise,
.ob-st-fall {
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.ob-st-rise { stroke: var(--horizon-2); }
.ob-st-fall { stroke: var(--fg-4); stroke-dasharray: 5 5; }
.ob-st-peak,
.ob-st-n,
.ob-st-tag { position: absolute; }
.ob-st-peak {
  width: 0;
  height: 0;
}
.ob-st-peak > i {
  position: absolute;
  left: -6px;
  top: -6px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg-elev);
  border-radius: 50%;
  background: var(--horizon-2);
  box-shadow: 0 0 0 5px var(--horizon-soft);
}
.ob-st-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  margin: -36px 0 0;
  padding: 0 9px 0 7px;
  translate: -50% 0;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.ob-st-tag .ob-i { width: 12px; height: 12px; color: var(--horizon-ink); stroke-width: 2.4; }
.ob-st-n {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 1px solid var(--line-3);
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--fg-2);
  font: 600 13px/1 var(--font-sans);
}
.ob-st-target {
  position: absolute;
  top: 12px;
  right: 12px;
}
.ob-st-target .ob-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ob-st-target .ob-i { width: 13px; height: 13px; }
.ob-st-x,
.ob-st-end {
  position: absolute;
  bottom: 12px;
}
.ob-st-x { left: 14px; }
.ob-st-end { right: 12px; color: var(--fg-2); }
.ob-st-causes {
  display: grid;
  gap: 8px;
}
.ob-st-head { padding: 0 2px 2px; }
.ob-st-cause {
  position: relative;
  min-height: 44px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
}
.ob-st-cause-in {
  position: absolute;
  inset: -1px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: inherit;
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
}
.ob-st-cause-in > span:last-child { min-width: 0; text-wrap: balance; }
.ob-st-cause-in .ob-i { color: var(--fg-3); }
.ob-st-num {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg-elev);
  font: 600 13px/1 var(--font-sans);
}
@container ob-scene (max-width: 399px) {
  .ob-st-x { display: none; }
}
@container ob-scene (min-width: 340px) {
  .ob-scene[data-ob-scene="stall"] .ob-frame { --ob-ratio: 4 / 5; }
}
@container ob-scene (min-width: 420px) {
  .ob-scene[data-ob-scene="stall"] .ob-frame { --ob-ratio: 1 / 1; }
  .ob-st { padding: 16px; }
}
/* Chart beside the causes. */
@container ob-scene (min-width: 600px) {
  .ob-scene[data-ob-scene="stall"] .ob-frame { --ob-ratio: 16 / 9; }
  .ob-st {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
  }
  .ob-st-causes { align-content: center; gap: 10px; }
  .ob-st-cause { min-height: 52px; }
}
@container ob-scene (min-width: 760px) {
  .ob-scene[data-ob-scene="stall"] .ob-frame { --ob-ratio: 2 / 1; font-size: 15px; }
  .ob-st { padding: 24px; gap: 20px; }
  .ob-st-plot { inset: 52px 20px 40px; }
  .ob-st-cause { min-height: 58px; }
  .ob-st-cause-in { font-size: 14px; padding: 0 16px; gap: 12px; }
}
@container ob-scene (min-width: 960px) {
  .ob-scene[data-ob-scene="stall"] .ob-frame { --ob-ratio: 5 / 2; }
}

/* =====================================================================
   LOOP: feedback travels Operator -> System and results travel back.
   Three laps prove the pilot slice; then the work spreads across the
   client's operation. The pulse rides a rotating arm (transform only);
   on wide frames the circle is stretched into an ellipse and the pulse
   is counter-rotated and counter-scaled so it stays round.
   ===================================================================== */
.ob-scene[data-ob-scene="loop"] { --ob-story: 4.7s; }
.ob-scene[data-ob-scene="loop"] .ob-frame { --ob-ratio: 5 / 8; --sx: 1; }
.ob-lp-state-a { opacity: 0; }
.ob-lp {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  height: 100%;
  padding: 14px;
}
.ob-lp-zone { position: relative; min-height: 0; }
.ob-lp-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58%;
  aspect-ratio: 1;
  translate: -50% -50%;
}
.ob-lp-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
}
.ob-lp-ring.is-lit {
  border: 1.5px solid var(--horizon-line);
  box-shadow: 0 0 0 4px var(--horizon-soft), inset 0 0 0 4px var(--horizon-soft);
}
.ob-lp-spin {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  aspect-ratio: 1;
  margin-left: -50%;
  rotate: 90deg;
  scale: var(--sx) 1;
}
.ob-lp-arm,
.ob-lp-arm2 {
  position: absolute;
  inset: 0;
}
.ob-lp-keep {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 0;
}
.ob-lp-keep2 { position: absolute; inset: 0; }
.ob-lp-pulse {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--horizon-2);
  box-shadow: 0 0 0 4px var(--horizon-soft), 0 0 16px 2px var(--horizon-line);
  scale: calc(1 / var(--sx)) 1;
}
@keyframes ob-lp-laps {
  0% { rotate: 0deg; } 16.667% { rotate: 180deg; } 33.333% { rotate: 360deg; }
  50% { rotate: 540deg; } 66.667% { rotate: 720deg; } 83.333% { rotate: 900deg; } 100% { rotate: 1080deg; }
}
@keyframes ob-lp-laps-back {
  0% { rotate: 0deg; } 16.667% { rotate: -180deg; } 33.333% { rotate: -360deg; }
  50% { rotate: -540deg; } 66.667% { rotate: -720deg; } 83.333% { rotate: -900deg; } 100% { rotate: -1080deg; }
}
@keyframes ob-lp-turn { to { rotate: 360deg; } }
@keyframes ob-lp-turn-back { to { rotate: -360deg; } }
/* Three laps of ~1.05s each, easing into the System and back into the Operator every half lap. */
.ob-scene[data-ob-run] .ob-lp-arm { animation: ob-lp-laps 3.15s var(--ease-in-out) 0.4s both; }
.ob-scene[data-ob-run] .ob-lp-keep { animation: ob-lp-laps-back 3.15s var(--ease-in-out) 0.4s both; }
/* After the story the pulse keeps circling slowly: the loop never stops. */
.ob-scene[data-ob-run] .ob-lp-arm2 { animation: ob-lp-turn 7s linear 4.7s infinite; }
.ob-scene[data-ob-run] .ob-lp-keep2 { animation: ob-lp-turn-back 7s linear 4.7s infinite; }
/* Without a running story the pulse rests at the Operator, under its card. */

.ob-lp-center {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 8px;
  translate: -50% -50%;
}
.ob-lp-fde {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px 0 3px;
  border: 1px solid var(--horizon-line);
  border-radius: 999px;
  background: var(--bg-elev);
  box-shadow: 0 0 0 4px var(--horizon-soft), var(--shadow-1);
  font-size: 12.5px;
  color: var(--fg-2);
  white-space: nowrap;
}
.ob-lp-fde b { color: var(--fg); font-weight: 600; }
.ob-lp-fde .ob-av { width: 22px; height: 22px; }
.ob-lp-fde .ob-av .ob-i { width: 12px; height: 12px; }
.ob-lp-laps {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  gap: 6px;
  margin-top: 26px;
  translate: -50% 0;
}
.ob-lp-laps > i {
  position: relative;
  width: 8px;
  height: 8px;
  border: 1px solid var(--line-3);
  border-radius: 50%;
}
.ob-lp-laps > i > b {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: var(--horizon-2);
}
.ob-lp-card {
  position: absolute;
  left: 50%;
  display: grid;
  gap: 8px;
  width: 152%;
  padding: 10px 12px 12px;
  translate: -50% -50%;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-2);
}
.ob-lp-op { top: 0; }
.ob-lp-sys { top: 100%; }
.ob-lp-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}
.ob-lp-head .ob-i { width: 14px; height: 14px; color: var(--fg-3); }
.ob-lp-head b { font-weight: 560; }
.ob-lp-head em {
  margin-left: auto;
  color: var(--fg-3);
  font: 500 13px/1 var(--font-sans);
  font-style: normal;
}
.ob-lp-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-template-rows: 6px 6px;
  column-gap: 8px;
  row-gap: 5px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--bg-subtle);
}
.ob-lp-avatar {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--line-2);
}
.ob-lp-item .ob-skel:last-child { width: 62%; }
.ob-lp-say { display: grid; }
.ob-lp-say > * { grid-area: 1 / 1; }
.ob-lp-msg,
.ob-lp-msg > span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.ob-lp-msg .ob-i { width: 14px; height: 14px; color: var(--fg-3); }
.ob-lp-final { color: var(--fg); }
.ob-lp-final .ob-i { color: var(--horizon-ink); stroke-width: 2.4; }
.ob-lp-log { display: grid; gap: 4px; }
.ob-lp-line {
  position: relative;
  display: flex;
  align-items: center;
  height: 20px;
}
.ob-lp-line > .ob-skel { width: 70%; opacity: 0.6; }
.ob-lp-line-in {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  color: var(--fg-2);
  font-size: 13px;
  white-space: nowrap;
}
.ob-lp-line-in code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--fg-3);
  font: 500 12px/1 var(--font-mono);
}
.ob-lp-line-in.is-pass { color: var(--fg); font-weight: 500; }
.ob-lp-line-in.is-pass .ob-i { width: 14px; height: 14px; color: var(--horizon-ink); stroke-width: 2.4; }
.ob-lp-ops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.ob-lp-ops-head { grid-column: 1 / -1; padding: 0 2px 2px; }
.ob-lp-cell {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.ob-lp-cell.is-slice { border: 1px dashed var(--horizon-line); }
.ob-lp-cell.is-later { border-style: dashed; background: transparent; }
.ob-lp-cell > .ob-label { position: relative; z-index: 1; color: var(--fg-2); }
.ob-lp-cell.is-later > .ob-label { color: var(--fg-3); }
.ob-lp-cell-lit {
  position: absolute;
  inset: -1px;
  border: 1px solid var(--line-3);
  border-radius: inherit;
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
}
.ob-lp-cell.is-slice .ob-lp-cell-lit { border-color: var(--horizon-line); box-shadow: 0 0 0 3px var(--horizon-soft); }
.ob-lp-cell-state {
  position: relative;
  z-index: 1;
  display: grid;
  height: 18px;
}
.ob-lp-cell-state > * { grid-area: 1 / 1; align-self: center; }
.ob-lp-tag {
  justify-self: start;
  color: var(--horizon-ink);
  font-size: 12.5px;
  font-weight: 500;
}
.ob-lp-on {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
}
.ob-lp-on .ob-plane { width: 14px; height: 14px; color: var(--fg); }
.ob-lp-cell.is-slice .ob-lp-on .ob-plane { color: var(--horizon-ink); }
.ob-lp-later { color: var(--fg-3); font-size: 13px; }
/* Phones: compact cards so the loop itself stays visible between them. */
@container ob-scene (max-width: 519px) {
  .ob-lp-item { display: none; }
  .ob-lp-log { grid-auto-flow: column; justify-content: start; gap: 6px; }
  .ob-lp-line { width: 30px; }
  .ob-lp-line.is-last { width: 120px; }
  .ob-lp-line > .ob-skel { width: 100%; }
  .ob-lp-line-in span { display: none; }
  .ob-lp-line-in { gap: 6px; }
  .ob-lp-card { padding: 10px 12px; }
}
@container ob-scene (max-width: 379px) {
  .ob-lp-head em { display: none; }
}
@container ob-scene (min-width: 340px) {
  .ob-scene[data-ob-scene="loop"] .ob-frame { --ob-ratio: 3 / 4; }
}
@container ob-scene (min-width: 420px) {
  .ob-scene[data-ob-scene="loop"] .ob-frame { --ob-ratio: 4 / 5; }
  .ob-lp-orbit { width: 50%; }
  .ob-lp-card { width: 160%; }
}
@container ob-scene (min-width: 520px) {
  .ob-scene[data-ob-scene="loop"] .ob-frame { --ob-ratio: 1 / 1; }
  .ob-lp { padding: 18px; }
  .ob-lp-ops { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ob-lp-orbit { width: 40%; }
  .ob-lp-card { width: 180%; max-width: 330px; }
}
/* Side by side: Operator left, System right, the loop stretched into an ellipse. */
@container ob-scene (min-width: 600px) {
  .ob-scene[data-ob-scene="loop"] .ob-frame { --ob-ratio: 4 / 3; --sx: 2; }
  .ob-lp { padding: 20px 22px; gap: 16px; }
  .ob-lp-orbit { width: auto; height: 66%; aspect-ratio: 2; }
  .ob-lp-spin { rotate: 0deg; margin-left: 0; translate: -50% 0; }
  .ob-lp-card { top: 50%; width: min(15.5em, calc(50% - 14px)); max-width: none; }
  .ob-lp-op { left: 0; }
  .ob-lp-sys { left: 100%; }
  .ob-lp-center { top: 0; }
  .ob-lp-laps { top: 100%; margin-top: 0; translate: -50% -50%; padding: 6px 8px; border-radius: 999px; background: var(--bg-elev); }
  .ob-lp-ops-head { padding-top: 2px; }
  .ob-lp-head em { display: none; }
}
@container ob-scene (min-width: 760px) {
  .ob-scene[data-ob-scene="loop"] .ob-frame { font-size: 14px; }
}
@container ob-scene (min-width: 860px) {
  .ob-scene[data-ob-scene="loop"] .ob-frame { --ob-ratio: 16 / 10; --sx: 1.9; font-size: 15px; }
  .ob-lp-orbit { height: 66%; aspect-ratio: 1.9; }
  .ob-lp-card { width: min(16em, calc(50% - 20px)); padding: 12px 14px 14px; gap: 10px; }
  .ob-lp-cell { padding: 12px 14px; }
  .ob-lp-head em { display: inline; }
}
@container ob-scene (min-width: 1040px) {
  .ob-scene[data-ob-scene="loop"] .ob-frame { --ob-ratio: 2 / 1; }
}

/* =====================================================================
   PLATFORM: the layers drop into place bottom-up (plumbing, workflows,
   knowledge base, guardrails), the model docks on top, then the four
   platform layers light as one: what Mach 1 handles.
   ===================================================================== */
.ob-scene[data-ob-scene="platform"] { --ob-story: 3.6s; }
.ob-scene[data-ob-scene="platform"] .ob-frame { --ob-ratio: 1 / 1; }
@keyframes ob-drop { from { opacity: 0; translate: 0 var(--drop, -22px); } }
.ob-scene[data-ob-run] .a-drop { animation: ob-drop var(--d, var(--dur-4)) var(--e, var(--ease-out)) var(--t, 0s) both; }
.ob-pf-wait { opacity: 0; }
.ob-pf {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 16px 14px;
}
.ob-pf-art {
  display: flex;
  width: 100%;
}
.ob-pf-svg {
  flex: none;
  width: 52%;
  height: auto;
  aspect-ratio: 262 / 336;
  overflow: visible;
}
.ob-pf-svg polygon,
.ob-pf-svg path,
.ob-pf-svg ellipse { vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pf-top { fill: var(--bg-elev); stroke: var(--line-3); stroke-width: 1; }
.pf-side-l { fill: var(--bg-sunken); stroke: var(--line-3); stroke-width: 1; }
.pf-side-r { fill: var(--line); stroke: var(--line-3); stroke-width: 1; }
.pf-mark { fill: none; stroke: var(--fg-4); stroke-width: 1.25; stroke-linecap: round; }
.pf-node { fill: var(--bg-elev); stroke: var(--fg-3); stroke-width: 1.25; }
.pf-box { fill: var(--bg-subtle); stroke: var(--line-3); stroke-width: 1; }
.pf-workflows .pf-box { fill: var(--bg-sunken); stroke: var(--fg-4); }
.pf-rail { fill: none; stroke: var(--fg-4); stroke-width: 1; stroke-dasharray: 4 3; }
.pf-post { fill: var(--bg-sunken); stroke: var(--fg-3); stroke-width: 1; }
.pf-lead { fill: none; stroke: var(--line-3); stroke-width: 1; }
.pf-ghost { fill: none; stroke: var(--line-3); stroke-width: 1; stroke-dasharray: 3 4; }
.pf-lit { fill: none; stroke: var(--horizon-line); stroke-width: 1.5; }
.pf-shadow { fill: var(--glow); stroke: none; }
.pf-cube-top { fill: var(--bg-elev); stroke: var(--fg-3); }
.pf-cube .pf-side-l { fill: var(--bg-sunken); stroke: var(--fg-3); }
.pf-cube .pf-side-r { fill: var(--line-2); stroke: var(--fg-3); }
.pf-chip { fill: var(--fg); stroke: none; }
.pf-pins { fill: none; stroke: var(--fg-3); stroke-width: 1.25; stroke-linecap: round; }
.ob-scene[data-ob-run] .pf-lit { animation: ob-fade var(--dur-3) var(--ease) 2.6s both; }
.ob-scene[data-ob-run] .pf-workflows .pf-lit { animation-delay: 2.68s; }
.ob-scene[data-ob-run] .pf-knowledge .pf-lit { animation-delay: 2.76s; }
.ob-scene[data-ob-run] .pf-guardrails .pf-lit { animation-delay: 2.84s; }
.ob-pf-labels {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.ob-pf-label {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  translate: 0 -50%;
}
.ob-pf-lead {
  flex: none;
  width: 12px;
  height: 1px;
  background: var(--line-3);
}
.ob-pf-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-left: 9px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.ob-pf-name .ob-i { width: 15px; height: 15px; color: var(--fg-3); }
.ob-pf-names { display: grid; min-width: 0; }
.ob-pf-names > * { grid-area: 1 / 1; }
.ob-pf-name.is-dim { color: var(--fg-3); }
.ob-pf-name.is-dim .ob-i { color: var(--fg-4); }
.ob-pf-name:not(.is-dim) { background: var(--bg-elev); }
.ob-pf-label.is-model .ob-pf-name:not(.is-dim) { color: var(--fg-2); }
.ob-pf-bracket {
  position: absolute;
  left: 0;
  top: 31.55%;
  bottom: 23.81%;
  width: 1.5px;
  margin-left: 11px;
  border-radius: 1px;
  background: linear-gradient(to bottom, var(--horizon-1), var(--horizon-2), var(--horizon-3));
  transform-origin: 50% 100%;
}
.ob-pf-group {
  position: absolute;
  left: 20px;
  top: calc(76.19% + 20px);
  font: 500 12.5px/1 var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}
@container ob-scene (max-width: 359px) {
  .ob-pf-name .ob-i,
  .ob-pf-group .ob-i { display: none; }
  .ob-pf-name { padding-left: 6px; }
  .ob-pf-lead { width: 8px; }
  .ob-pf-bracket { margin-left: 7px; }
  .ob-pf-group { left: 14px; }
}
@container ob-scene (min-width: 360px) {
  .ob-scene[data-ob-scene="platform"] .ob-frame { --ob-ratio: 10 / 9; }
  .ob-pf { padding: 12px 14px; }
  .ob-pf-svg { width: 56%; }
}
@container ob-scene (min-width: 480px) {
  .ob-scene[data-ob-scene="platform"] .ob-frame { --ob-ratio: 5 / 4; }
  .ob-pf-art { width: auto; height: min(100%, 340px); }
  .ob-pf-svg { width: auto; height: 100%; }
  .ob-pf-labels { flex: none; }
  .ob-pf-lead { width: 28px; }
  .ob-pf-bracket { margin-left: 27px; }
  .ob-pf-group { left: 36px; }
  .ob-pf-labels { width: 200px; }
}
@container ob-scene (min-width: 640px) {
  .ob-scene[data-ob-scene="platform"] .ob-frame { --ob-ratio: 16 / 10; font-size: 14px; }
  .ob-pf-art { height: min(100%, 420px); }
  .ob-pf-lead { width: 56px; }
  .ob-pf-bracket { margin-left: 55px; }
  .ob-pf-group { left: 64px; }
  .ob-pf-name { font-size: 14px; gap: 9px; padding-left: 12px; }
  .ob-pf-labels { width: 240px; }
}
@container ob-scene (min-width: 900px) {
  .ob-scene[data-ob-scene="platform"] .ob-frame { --ob-ratio: 2 / 1; }
  .ob-pf-art { height: min(100%, 460px); }
  .ob-pf-lead { width: 96px; }
  .ob-pf-bracket { margin-left: 95px; }
  .ob-pf-group { left: 104px; }
  .ob-pf-name { font-size: 15px; }
  .ob-pf-labels { width: 300px; }
}

/* =====================================================================
   KNOWLEDGE: three kinds of business knowledge dock into the agent one
   by one; only once it knows the business do the workflow steps build,
   each drawing on the knowledge it needs.
   ===================================================================== */
.ob-scene[data-ob-scene="knowledge"] { --ob-story: 3.9s; }
.ob-scene[data-ob-scene="knowledge"] .ob-frame { --ob-ratio: 9 / 16; }
.ob-kn-wait { opacity: 0; }
.ob-kn {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: center;
  height: 100%;
  padding: 14px;
}
.ob-kn-col { display: grid; gap: 8px; align-content: start; min-width: 0; }
.ob-kn-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
}
.ob-kn-head b { font-weight: 560; }
.ob-kn-num {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg-elev);
  font: 600 13px/1 var(--font-sans);
}
.ob-kn-num.is-second {
  background: transparent;
  border: 1px solid var(--line-3);
  color: var(--fg-2);
}
.ob-kn-num.is-second > i {
  position: absolute;
  inset: -1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg-elev);
  font-style: normal;
}
.ob-kn-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.ob-kn-slot {
  position: relative;
  min-height: 76px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
}
.ob-kn-card {
  position: absolute;
  inset: -1px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 8px;
  padding: 9px 9px 8px;
  border: 1px solid var(--line-2);
  border-radius: inherit;
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
}
.ob-kn-ic {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--fg-2);
}
.ob-kn-ic .ob-i { width: 14px; height: 14px; }
.ob-kn-ok { justify-self: end; width: 16px; height: 16px; }
.ob-kn-ok .ob-i { width: 10px; height: 10px; }
.ob-kn-txt {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  gap: 3px;
  min-width: 0;
}
.ob-kn-txt b { font-size: 13px; font-weight: 560; line-height: 1.2; }
.ob-kn-txt small { display: none; color: var(--fg-3); font-size: 12.5px; line-height: 1.3; }
.ob-kn-mid {
  display: grid;
  grid-template-rows: 18px auto 18px;
  justify-items: center;
  padding: 2px 0;
}
.ob-kn-wire {
  position: relative;
  width: 1px;
  height: 100%;
  overflow: hidden;
}
.ob-kn-wire.is-in { background: repeating-linear-gradient(to bottom, var(--line-3) 0 3px, transparent 3px 6px); }
.ob-kn-wire-line { position: absolute; inset: 0; background: var(--line-3); transform-origin: 50% 0; }
.ob-kn-spark {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.ob-kn-spark > b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  background: linear-gradient(to bottom, transparent, var(--horizon-2));
}
@keyframes ob-kn-run-y {
  0% { opacity: 0; translate: 0 -100%; }
  20%, 80% { opacity: 1; }
  100% { opacity: 0; translate: 0 0; }
}
@keyframes ob-kn-run-x {
  0% { opacity: 0; translate: -100% 0; }
  20%, 80% { opacity: 1; }
  100% { opacity: 0; translate: 0 0; }
}
.ob-scene[data-ob-run] .ob-kn-spark { animation: ob-kn-run-y 0.45s var(--ease-in-out) var(--t) both; }
.ob-scene[data-ob-run] .ob-kn-wire-line { animation-name: ob-grow-y; }
.ob-kn-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 2px 0 26px;
}
.ob-kn-arcs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ob-kn-arcs path { fill: none; stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ob-kn-arc-base path { stroke: var(--line-2); }
.ob-kn-arc-on { stroke: var(--horizon-2); }
.ob-kn-core {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--horizon-soft);
  box-shadow: 0 0 0 1px var(--horizon-line), 0 0 28px 4px var(--horizon-soft);
}
.ob-kn-orb .ob-plane { position: relative; width: 20px; height: 20px; color: var(--fg); }
.ob-kn-orb-label {
  position: absolute;
  top: 100%;
  left: 50%;
  display: grid;
  justify-items: center;
  margin-top: 7px;
  translate: -50% 0;
}
.ob-kn-orb-label > * { grid-area: 1 / 1; text-align: center; line-height: 1.3; }
.ob-kn-orb-label > .a-out { opacity: 0; }
.ob-kn-knows { color: var(--horizon-ink); }
.ob-kn-rows { display: grid; gap: 6px; }
.ob-kn-row {
  position: relative;
  min-height: 36px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
}
.ob-kn-row-in {
  position: absolute;
  inset: -1px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: inherit;
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
}
.ob-kn-n {
  flex: none;
  width: 16px;
  color: var(--fg-3);
  font: 500 13px/1 var(--font-sans);
}
.ob-kn-row-t {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ob-kn-tag {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border: 1px solid var(--horizon-line);
  border-radius: 7px;
  background: var(--horizon-soft);
  color: var(--horizon-ink);
}
.ob-kn-tag .ob-i { width: 13px; height: 13px; }
@container ob-scene (min-width: 340px) {
  .ob-scene[data-ob-scene="knowledge"] .ob-frame { --ob-ratio: 7 / 10; }
}
@container ob-scene (min-width: 420px) {
  .ob-scene[data-ob-scene="knowledge"] .ob-frame { --ob-ratio: 3 / 4; }
  .ob-kn { padding: 18px; }
  .ob-kn-cards { gap: 8px; }
}
@container ob-scene (min-width: 520px) {
  .ob-scene[data-ob-scene="knowledge"] .ob-frame { --ob-ratio: 1 / 1; }
  .ob-kn-txt small { display: block; }
  .ob-kn-slot { min-height: 96px; }
}
/* Side by side: knowledge, the agent, the workflow. */
@container ob-scene (min-width: 560px) {
  .ob-scene[data-ob-scene="knowledge"] .ob-frame { --ob-ratio: 16 / 10; }
  .ob-kn {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1fr) minmax(104px, 0.5fr) minmax(0, 1fr);
    align-items: start;
    padding: 20px 18px;
  }
  .ob-kn-txt small { display: none; }
  .ob-kn-col { gap: 10px; }
  .ob-kn-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ob-kn-slot { min-height: 0; height: 46px; }
  .ob-kn-card { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: none; align-items: center; align-content: center; gap: 10px; padding: 0 12px 0 10px; }
  .ob-kn-txt { grid-column: auto; grid-row: auto; }
  .ob-kn-ok { grid-column: 3; grid-row: 1; }
  .ob-kn-mid { grid-template-rows: none; grid-template-columns: minmax(10px, 1fr) auto minmax(10px, 1fr); align-items: center; align-self: center; width: 100%; padding: 0; }
  .ob-kn-wire { width: 100%; height: 1px; }
  .ob-kn-wire.is-in { background: repeating-linear-gradient(to right, var(--line-3) 0 3px, transparent 3px 6px); }
  .ob-kn-wire-line { transform-origin: 0 50%; }
  .ob-scene[data-ob-run] .ob-kn-wire-line { animation-name: ob-grow-x; }
  .ob-kn-spark > b { left: auto; top: 0; bottom: 0; width: 22px; height: auto; background: linear-gradient(to right, transparent, var(--horizon-2)); }
  .ob-scene[data-ob-run] .ob-kn-spark { animation-name: ob-kn-run-x; }
  .ob-kn-orb { width: 68px; height: 68px; margin: 0 4px; }
  .ob-kn-orb-label { margin-top: 10px; }
  .ob-kn-orb-label > * { width: 108px; white-space: normal; }
  .ob-kn-row { min-height: 0; height: 42px; }
}
@container ob-scene (min-width: 700px) {
  .ob-scene[data-ob-scene="knowledge"] .ob-frame { font-size: 14px; }
  .ob-kn { padding: 22px; grid-template-columns: minmax(0, 1fr) minmax(130px, 0.5fr) minmax(0, 1fr); }
  .ob-kn-txt small { display: block; }
  .ob-kn-slot { height: 58px; }
  .ob-kn-orb { width: 76px; height: 76px; margin: 0 6px; }
}
@container ob-scene (min-width: 900px) {
  .ob-scene[data-ob-scene="knowledge"] .ob-frame { --ob-ratio: 5 / 2; font-size: 15px; }
  .ob-kn { padding: 32px 40px; grid-template-columns: minmax(0, 1fr) minmax(170px, 0.55fr) minmax(0, 1fr); }
  .ob-kn-col { gap: 12px; }
  .ob-kn-cards, .ob-kn-rows { gap: 10px; }
  .ob-kn-slot { height: 74px; }
  .ob-kn-row { height: 52px; }
  .ob-kn-ic { width: 32px; height: 32px; border-radius: 8px; }
  .ob-kn-ic .ob-i { width: 16px; height: 16px; }
  .ob-kn-head { font-size: 15px; }
  .ob-kn-tag { width: 28px; height: 28px; }
  .ob-kn-orb { width: 108px; height: 108px; }
  .ob-kn-orb .ob-plane { width: 24px; height: 24px; }
  .ob-kn-txt b, .ob-kn-row-t { font-size: 14px; }
}

/* =====================================================================
   SAMPLE: the agent drafts 20 contacts, the operator checks each against
   their own judgment (approve, or flag one that needs a person), the
   workflow is iterated until the flagged ones are fixed, then it scales
   out to the full list.
   ===================================================================== */
.ob-scene[data-ob-scene="sample"] { --ob-story: 4.3s; }
.ob-scene[data-ob-scene="sample"] .ob-frame { --ob-ratio: 5 / 8; }
.ob-sm-wait { opacity: 0; }
.ob-sm-needs,
.ob-sm-iterating { opacity: 0; }
@keyframes ob-ghost { from { opacity: 0.45; scale: 0.86; } }
.ob-scene[data-ob-run] .a-ghost { animation: ob-ghost var(--dur-2) var(--ease-out) var(--t, 0s) both; }
.ob-sm {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 8px;
  height: 100%;
  padding: 14px;
}
.ob-sm-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-subtle);
}
.ob-sm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
}
.ob-sm-head b { font-weight: 560; }
.ob-sm-head .ob-label { overflow: hidden; text-overflow: ellipsis; }
.ob-sm-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.ob-sm-tile {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  grid-template-rows: 4px 4px;
  align-content: center;
  column-gap: 5px;
  row-gap: 5px;
  height: 38px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
}
.ob-sm-av {
  grid-row: span 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-2);
}
.ob-sm-l1,
.ob-sm-l2 {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.ob-sm-l1 { width: 80%; background: var(--line-2); }
.ob-sm-l2 { position: relative; overflow: hidden; }
.ob-sm-l2 > b {
  position: absolute;
  inset: 0;
  width: 64%;
  border-radius: inherit;
  background: var(--fg-4);
}
.ob-sm-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg-elev);
  box-shadow: 0 0 0 2px var(--bg-subtle);
}
.ob-sm-badge .ob-i { width: 9px; height: 9px; stroke-width: 2.8; }
.ob-sm-badge.is-fixed { background: var(--bg-elev); color: var(--fg); box-shadow: 0 0 0 2px var(--bg-subtle), inset 0 0 0 1px var(--fg-3); }
.ob-sm-badge.is-fixed .ob-i { stroke-width: 2.2; }
.ob-sm-scan {
  position: absolute;
  inset: -1px;
  border: 1px solid var(--horizon-line);
  border-radius: inherit;
  background: var(--horizon-soft);
  opacity: 0;
}
.ob-sm-flag {
  position: absolute;
  inset: -1px;
  border: 1px solid var(--accent-line);
  border-radius: inherit;
  background: var(--accent-soft);
  opacity: 0;
}
.ob-sm-flag > i {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-subtle);
}
.ob-sm-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--fg-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.ob-sm-key { display: inline-flex; align-items: center; gap: 6px; }
.ob-sm-key .ob-sm-badge { position: static; box-shadow: none; }
.ob-sm-key .ob-sm-badge.is-fixed { box-shadow: inset 0 0 0 1px var(--fg-3); }
.ob-sm-iter { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--fg-3); }
.ob-sm-iter > span:last-child { display: inline; }
.ob-sm-spin { display: grid; place-items: center; }
.ob-sm-spin .ob-i { width: 14px; height: 14px; }
@keyframes ob-sm-turn { from { rotate: -360deg; } }
.ob-scene[data-ob-run] .ob-sm-spin { animation: ob-sm-turn 0.7s var(--ease-in-out) 2.45s both; }
.ob-sm-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  color: var(--fg-3);
}
.ob-sm-link > i {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-3);
  transform-origin: 50% 0;
}
.ob-scene[data-ob-run] .ob-sm-link > i { animation-name: ob-grow-y; }
.ob-sm-link .ob-i { position: relative; width: 14px; height: 14px; rotate: 90deg; background: var(--bg-elev); border-radius: 50%; }
.ob-sm-field {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
}
.ob-sm-field > i {
  display: block;
  height: 14px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background-color: var(--bg-elev);
  background-image: linear-gradient(var(--fg-4), var(--fg-4));
  background-size: 46% 2px;
  background-position: 4px 50%;
  background-repeat: no-repeat;
}
.ob-sm-field > i:nth-child(n + 37) { display: none; }
/* The scale payoff: the full list rests lit, not faint. */
.ob-sm-full { border-color: var(--horizon-line); }
.ob-sm-field > i {
  border-color: var(--horizon-line);
  background-color: var(--horizon-soft);
  background-image: linear-gradient(var(--horizon-2), var(--horizon-2));
}
.ob-sm-full-state { display: grid; justify-items: end; }
.ob-sm-full-state > * { grid-area: 1 / 1; }
.ob-sm-full-state > .a-out { opacity: 0; }
.ob-sm-full-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--horizon-ink);
  font: 500 13px/1.2 var(--font-sans);
}
.ob-sm-full-done .ob-i { width: 13px; height: 13px; stroke-width: 2.4; }
.ob-sm-scaled { display: none; }
.ob-st-short { display: none; }
@container ob-scene (min-width: 340px) {
  .ob-scene[data-ob-scene="sample"] .ob-frame { --ob-ratio: 3 / 4; }
  .ob-sm-tile { height: 40px; }
}
@container ob-scene (min-width: 440px) {
  .ob-scene[data-ob-scene="sample"] .ob-frame { --ob-ratio: 1 / 1; }
  .ob-sm { padding: 18px; gap: 10px; }
  .ob-sm-tiles { gap: 8px; }
  .ob-sm-tile { height: 44px; padding: 0 9px; }
  .ob-sm-field > i { height: 16px; }
}
/* Side by side: the reviewed sample, then the full list. */
@container ob-scene (min-width: 560px) {
  .ob-scene[data-ob-scene="sample"] .ob-frame { --ob-ratio: 16 / 10; }
  .ob-sm-tiles { gap: 6px; }
  .ob-sm-tile { height: 40px; padding: 0 6px; }
  .ob-sm-iter > span:last-child { display: none; }
  .ob-sm {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 22px;
  }
  .ob-sm-panel { height: 100%; align-content: space-between; padding: 14px; }
  .ob-sm-link { height: 100%; }
  .ob-sm-link > i { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 1px; transform-origin: 0 50%; }
  .ob-scene[data-ob-run] .ob-sm-link > i { animation-name: ob-grow-x; }
  .ob-sm-link .ob-i { rotate: 0deg; }
  .ob-sm-field { align-self: center; gap: 5px; }
  .ob-sm-field > i:nth-child(n + 37) { display: block; }
  .ob-sm-field > i { height: 18px; }
}
@container ob-scene (min-width: 700px) {
  .ob-scene[data-ob-scene="sample"] .ob-frame { --ob-ratio: 16 / 9; font-size: 14px; }
  .ob-sm-tile { height: 44px; padding: 0 9px; }
  .ob-sm-iter > span:last-child { display: inline; }
}
@container ob-scene (min-width: 900px) {
  .ob-scene[data-ob-scene="sample"] .ob-frame { --ob-ratio: 2 / 1; font-size: 15px; }
  .ob-sm { padding: 28px; gap: 10px; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); }
  .ob-sm-panel { padding: 18px; }
  .ob-sm-tiles { gap: 10px; }
  .ob-sm-tile { height: 52px; grid-template-columns: 14px minmax(0, 1fr); grid-template-rows: 5px 5px; column-gap: 8px; row-gap: 6px; padding: 0 12px; border-radius: 10px; }
  .ob-sm-av { width: 14px; height: 14px; }
  .ob-sm-l1, .ob-sm-l2 { height: 5px; }
  .ob-sm-badge { width: 18px; height: 18px; }
  .ob-sm-badge .ob-i { width: 11px; height: 11px; }
  .ob-sm-field { gap: 6px; }
  .ob-sm-field > i { height: 24px; border-radius: 5px; background-position: 5px 50%; }
  .ob-sm-head, .ob-sm-foot { font-size: 14px; }
}

/* =====================================================================
   PRODUCTION: the onboarding rail completes, the workflow goes live, and
   the outcome line rises to meet the goal set in discovery.
   ===================================================================== */
.ob-scene[data-ob-scene="production"] { --ob-story: 3.5s; }
.ob-scene[data-ob-scene="production"] .ob-frame { --ob-ratio: 4 / 5; }
.ob-pd-wait { opacity: 0; }
.ob-pd-live { color: var(--fg); border-color: var(--line-3); }
.ob-pd-ping::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0;
}
.ob-scene[data-ob-done] .ob-pd-ping::after { animation: t-ping 2.4s var(--ease-out) infinite; }
.ob-pd {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  padding: 16px 14px 14px;
}
.ob-pd-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.ob-pd-track {
  position: absolute;
  left: calc(100% / 12);
  right: calc(100% / 12);
  top: 10px;
  height: 2px;
  margin-top: -1px;
  border-radius: 1px;
  background: var(--line-2);
  overflow: hidden;
}
.ob-pd-track > i {
  position: absolute;
  inset: 0;
  background: var(--fg);
}
.ob-pd-node {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
}
.ob-pd-dot {
  position: relative;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-3);
  border-radius: 50%;
  background: var(--bg-elev);
}
.ob-pd-done {
  position: absolute;
  inset: -1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg-elev);
}
.ob-pd-done .ob-i { width: 11px; height: 11px; stroke-width: 2.8; }
.ob-pd-node:last-child .ob-pd-done { background: var(--horizon-2); box-shadow: 0 0 0 4px var(--horizon-soft); }
.ob-pd-name {
  display: none;
  max-width: 100%;
  overflow: hidden;
  color: var(--fg-2);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ob-pd-track + .ob-pd-node .ob-pd-name,
.ob-pd-node:last-child .ob-pd-name { display: block; }
.ob-pd-track + .ob-pd-node { justify-items: start; }
.ob-pd-track + .ob-pd-node .ob-pd-name,
.ob-pd-node:last-child .ob-pd-name { max-width: none; overflow: visible; }
.ob-pd-track + .ob-pd-node .ob-pd-dot { margin-left: calc(50% - 10px); }
.ob-pd-node:last-child { justify-items: end; }
.ob-pd-node:last-child .ob-pd-dot { margin-right: calc(50% - 10px); }
.ob-pd-chart {
  position: relative;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-subtle);
}
.ob-pd-y {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ob-pd-y .ob-i { width: 13px; height: 13px; }
.ob-pd-legend {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.2;
}
.ob-pd-legend > i { width: 14px; height: 0; border-top: 1.5px dashed var(--fg-3); }
.ob-pd-plot {
  position: absolute;
  inset: 52px 16px 16px;
}
.ob-pd-plot > svg,
.ob-pd-seg { position: absolute; top: 0; height: 100%; }
.ob-pd-rules { left: 0; width: 100%; overflow: visible; }
.ob-pd-rules path,
.ob-pd-seg path { fill: none; vector-effect: non-scaling-stroke; }
.ob-pd-rules path { stroke: var(--line); stroke-dasharray: 2 4; }
.ob-pd-rules .ob-pd-goal { stroke: var(--fg-3); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ob-pd-rules .ob-pd-golive { stroke: var(--line-3); stroke-dasharray: 3 3; }
.ob-pd-rules .ob-pd-before { stroke: var(--fg-4); stroke-width: 2; stroke-dasharray: none; stroke-linecap: round; }
.ob-pd-seg { overflow: hidden; }
.ob-pd-seg > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ob-pd-seg .ob-pd-area {
  fill: var(--horizon-soft);
  stroke: none;
}
.ob-pd-seg .ob-pd-rise { stroke: var(--horizon-2); stroke-width: 2.5; stroke-linecap: round; }
.ob-pd-tag {
  position: absolute;
  top: 0;
  translate: -50% 0;
  padding: 3px 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--fg-2);
  font: 500 13px/1 var(--font-sans);
  white-space: nowrap;
}
.ob-pd-hit {
  position: absolute;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg-elev);
  box-shadow: 0 0 0 3px var(--bg-subtle);
}
.ob-pd-hit .ob-i { width: 11px; height: 11px; stroke-width: 2.8; }
.ob-pd-tip { position: absolute; width: 0; height: 0; }
.ob-pd-tip > i {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg-elev);
  border-radius: 50%;
  background: var(--horizon-2);
}
.ob-pd-tip > i::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid var(--horizon-2);
  border-radius: 50%;
  opacity: 0;
}
.ob-scene[data-ob-done] .ob-pd-tip > i::after { animation: t-ping 2.4s var(--ease-out) infinite; }
@container ob-scene (max-width: 399px) {
  .ob-pd-prod { display: none; }
}
@container ob-scene (max-width: 379px) {
  .ob-pd-legend > span { display: none; }
  .ob-pd-legend::after { content: "Goal"; }
}
@container ob-scene (min-width: 360px) {
  .ob-scene[data-ob-scene="production"] .ob-frame { --ob-ratio: 1 / 1; }
}
@container ob-scene (min-width: 480px) {
  .ob-scene[data-ob-scene="production"] .ob-frame { --ob-ratio: 5 / 4; }
  .ob-pd { padding: 20px 18px 18px; gap: 18px; }
  .ob-pd-name { display: block; }
  .ob-pd-track + .ob-pd-node .ob-pd-name, .ob-pd-node:last-child .ob-pd-name { max-width: 100%; overflow: hidden; }
  .ob-pd-track + .ob-pd-node, .ob-pd-node:last-child { justify-items: center; }
  .ob-pd-track + .ob-pd-node .ob-pd-dot, .ob-pd-node:last-child .ob-pd-dot { margin: 0; }
}
@container ob-scene (min-width: 600px) {
  .ob-scene[data-ob-scene="production"] .ob-frame { --ob-ratio: 16 / 10; }
}
@container ob-scene (min-width: 680px) {
  .ob-scene[data-ob-scene="production"] .ob-frame { --ob-ratio: 16 / 9; font-size: 14px; }
  .ob-pd { padding: 24px 24px 22px; }
  .ob-pd-name { font-size: 13px; }
  .ob-pd-plot { inset: 60px 24px 20px; }
}
@container ob-scene (min-width: 900px) {
  .ob-scene[data-ob-scene="production"] .ob-frame { --ob-ratio: 2 / 1; font-size: 15px; }
  .ob-pd { padding: 28px 32px 26px; gap: 22px; }
  .ob-pd-dot { width: 24px; height: 24px; }
  .ob-pd-track { top: 12px; }
}

/* =====================================================================
   PHONES (frame 400px wide or less): compact variants with an explicit
   reserved height, so a phone screen holds a whole scene with room for
   its copy. Each keeps the same story and end state as the wide layout.
   ===================================================================== */
@container ob-scene (max-width: 400px) {
  .ob-scene[data-ob-scene] .ob-frame { aspect-ratio: auto; height: var(--ob-ph, auto); }
  .ob-scene[data-ob-scene="platform"] .ob-frame { height: auto; }

  /* STALL: shorter chart, the three causes as a row of numbered cells. */
  .ob-scene[data-ob-scene="stall"] .ob-frame { --ob-ph: 300px; }
  .ob-st { gap: 8px; padding: 10px; }
  .ob-st-plot { inset: 40px 12px 30px; }
  .ob-st-target { top: 10px; right: 10px; }
  .ob-st-x, .ob-st-end { bottom: 9px; }
  .ob-st-head { display: none; }
  .ob-st-causes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ob-st-cause { min-height: 66px; border-radius: 10px; }
  .ob-st-cause-in {
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    gap: 6px;
    padding: 8px;
    font-size: 12.5px;
  }
  .ob-st-cause-in > .ob-st-short { flex: 1 0 100%; display: block; text-wrap: balance; }
  .ob-st-cause-in > .ob-st-long { display: none; }
  .ob-st-num { width: 18px; height: 18px; }
  .ob-st-cause-in .ob-i { width: 14px; height: 14px; }

  /* LOOP: compact Operator and System cards on a smaller loop, the client
     operation as a 2 by 2 block of single-line cells. */
  .ob-scene[data-ob-scene="loop"] .ob-frame { --ob-ph: 348px; }
  .ob-lp { gap: 8px; padding: 10px 12px; }
  .ob-lp-zone { min-height: 180px; }
  .ob-lp-orbit { width: 126px; }
  .ob-lp-card { width: min(250px, calc(100cqw - 48px)); gap: 4px; padding: 7px 10px 8px; border-radius: 12px; }
  .ob-lp-head { gap: 6px; font-size: 12.5px; }
  .ob-lp-head .ob-i { width: 13px; height: 13px; }
  .ob-lp-center { translate: -50% -72%; }
  .ob-lp-fde { height: 28px; font-size: 12px; }
  .ob-lp-laps { margin-top: 12px; }
  .ob-lp-line { height: 18px; }
  .ob-lp-ops { gap: 5px; }
  .ob-lp-ops-head { padding-bottom: 0; }
  .ob-lp-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 32px; padding: 0 9px; border-radius: 9px; }
  .ob-lp-cell > .ob-label { letter-spacing: 0.02em; }
  .ob-lp-cell-state { justify-items: end; }
  .ob-lp-on, .ob-lp-tag, .ob-lp-later { font-size: 12.5px; }

  /* PLATFORM: keeps its proportions, a little wider than tall. */
  .ob-scene[data-ob-scene="platform"] .ob-frame { aspect-ratio: 6 / 5; }
  .ob-pf { padding: 10px 12px; }
  .ob-pf-svg { width: 48%; }

  /* DISCOVERY: one tight row per question, question over answer. */
  .ob-scene[data-ob-scene="discovery"] .ob-frame { --ob-ph: 310px; }
  .ob-dq { gap: 6px; padding: 10px; }
  .ob-dq-row {
    grid-template-columns: 28px minmax(0, 1fr) 20px;
    grid-template-areas: "icon q state" "icon a state";
    row-gap: 3px;
    padding: 7px 10px 7px 8px;
    border-radius: 10px;
  }
  .ob-dq-icon { width: 28px; height: 28px; border-radius: 7px; }
  .ob-dq-icon .ob-i { width: 14px; height: 14px; }
  .ob-dq-a { min-height: 22px; padding-left: 0; }
  .ob-dq-ph { left: 0; width: 60%; }
  .ob-dq-text { font-size: 13.5px; }
  .ob-dq-people .ob-av { width: 22px; height: 22px; font-size: 12px; }
  .ob-dq-people .ob-chip, .ob-dq-chips .ob-chip { height: 22px; }
  .ob-dq-chips { gap: 5px; }
  .ob-dq-chips .ob-chip { padding: 0 7px 0 6px; font-size: 12px; gap: 4px; }
  .ob-dq-bars { height: 18px; grid-auto-columns: 5px; }

  /* KNOWLEDGE: three compact chips dock into a small agent orb, then the
     four workflow steps build as a compact list. */
  .ob-scene[data-ob-scene="knowledge"] .ob-frame { --ob-ph: 340px; }
  .ob-kn { align-content: start; padding: 10px 12px; }
  .ob-kn-col { gap: 6px; }
  .ob-kn-head { font-size: 12.5px; }
  .ob-kn-head .ob-kn-num { width: 18px; height: 18px; }
  .ob-kn-cards { gap: 6px; }
  .ob-kn-slot { min-height: 40px; border-radius: 10px; }
  .ob-kn-card { display: flex; align-items: center; justify-content: center; padding: 0 6px; }
  .ob-kn-ic, .ob-kn-ok { display: none; }
  .ob-kn-txt { text-align: center; }
  .ob-kn-txt b { font-size: 12.5px; line-height: 1.15; text-wrap: balance; }
  .ob-kn-txt small { display: none; }
  .ob-kn-mid { grid-template-rows: 6px auto 6px; padding: 0; }
  .ob-kn-orb { width: 46px; height: 46px; margin: 0; }
  .ob-kn-orb .ob-plane { width: 16px; height: 16px; }
  .ob-kn-core { inset: 6px; }
  .ob-kn-orb-label { top: 50%; left: 100%; justify-items: start; margin: 0 0 0 10px; translate: 0 -50%; }
  .ob-kn-orb-label > * { width: 8em; text-align: left; white-space: normal; }
  .ob-kn-rows { gap: 4px; }
  .ob-kn-row { min-height: 0; height: 27px; border-radius: 8px; }
  .ob-kn-row-in { gap: 8px; padding: 0 4px 0 8px; }
  .ob-kn-row-t { font-size: 12.5px; }
  .ob-kn-tag { width: 20px; height: 20px; border-radius: 6px; }
  .ob-kn-tag .ob-i { width: 12px; height: 12px; }

  /* SAMPLE: a smaller reviewed grid, then one bar that fills when the
     workflow scales to the full list. */
  .ob-scene[data-ob-scene="sample"] .ob-frame { --ob-ph: 310px; }
  .ob-sm { align-content: start; gap: 8px; padding: 10px; }
  .ob-sm-panel { gap: 8px; padding: 10px; border-radius: 12px; }
  .ob-sm-tiles { gap: 5px; }
  .ob-sm-tile { height: 26px; padding: 0 6px; border-radius: 7px; grid-template-rows: 3px 3px; row-gap: 4px; }
  .ob-sm-l1, .ob-sm-l2 { height: 3px; }
  .ob-sm-av { width: 8px; height: 8px; }
  .ob-sm-tile { grid-template-columns: 8px minmax(0, 1fr); }
  .ob-sm-link, .ob-sm-full { display: none; }
  .ob-sm-scaled {
    position: relative;
    display: block;
    height: 42px;
    overflow: hidden;
    border: 1px solid var(--horizon-line);
    border-radius: 12px;
    background: var(--bg-subtle);
  }
  .ob-sm-scaled-fill { position: absolute; inset: 0; background: var(--horizon-soft); }
  .ob-sm-scaled-in {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 10px 0 12px;
    font-size: 13px;
  }
  .ob-sm-scaled-in > .ob-i { width: 15px; height: 15px; color: var(--horizon-ink); }
  .ob-sm-scaled-in b { font-weight: 560; white-space: nowrap; }
  .ob-sm-scaled-t { display: grid; }
  .ob-sm-scaled-t > * { grid-area: 1 / 1; }
  .ob-sm-scaled-t > .is-before { opacity: 0; color: var(--fg-3); font-weight: 500; }
  .ob-sm-scaled-rows { display: grid; flex: 1 1 auto; gap: 3px; min-width: 16px; }
  .ob-sm-scaled-rows > i { display: block; height: 3px; border-radius: 2px; background: var(--horizon-2); opacity: 0.55; }
  .ob-sm-scaled-in .ob-tick { width: 20px; height: 20px; background: var(--horizon-2); color: var(--bg-elev); }

  /* PRODUCTION: same rail and rising line, a shorter chart. */
  .ob-scene[data-ob-scene="production"] .ob-frame { --ob-ph: 300px; }
  .ob-pd { gap: 10px; padding: 12px 12px 10px; }
  .ob-pd-plot { inset: 42px 14px 12px; }
  .ob-pd-y, .ob-pd-legend { top: 10px; }
}

/* The narrowest frames (a phone rail card at 320px is about 235px wide). */
@container ob-scene (max-width: 300px) {
  .ob-lp-on > :not(svg), .ob-lp-tag, .ob-lp-later { display: none; }
  .ob-lp-cell { gap: 4px; padding: 0 7px; }
  .ob-lp-cell > .ob-label { letter-spacing: 0; }
  .ob-lp-line.is-last { width: 104px; }
  .ob-st-target .ob-label { font-size: 0; gap: 0; }
  .ob-st-target .ob-i { width: 14px; height: 14px; }
  .ob-st-cause-in .ob-i { display: none; }
  .ob-sm-iter > span:last-child { display: none; }
  .ob-sm-scaled-rows { display: none; }
  .ob-sm-scaled-in .ob-tick { margin-left: auto; }
  .ob-pf-svg { width: 46%; }
  .ob-pf-name { font-size: 12px; padding-left: 5px; }
  .ob-pf-group { left: 12px; height: 22px; padding: 0 7px; font-size: 12px; }
}
@container ob-scene (max-width: 260px) {
  .ob-lp-cell-state { display: none; }
  .ob-pf-svg { width: 40%; }
}
