/*
 * OAIZ instructional videos: player chrome, stage and the shared component kit.
 * Colours and motion mirror the light theme of packages/oaiz-ui/src/styles/tokens.css,
 * copied as plain values so a video plays offline from file://.
 * Scenes are drawn on a 1920x1080 stage that the player scales to the window.
 */

@font-face {
  font-family: 'Inter Variable';
  src: url('../assets/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: block;
}

:root {
  --white: oklch(1 0 0);
  --zinc-1: oklch(0.965 0.001 260);
  --zinc-2: oklch(0.89 0.003 260);
  --zinc-3: oklch(0.62 0.007 260);
  --zinc-4: oklch(0.48 0.01 260);
  --zinc-5: oklch(0.34 0.005 260);
  --blue-1: oklch(0.965 0.015 255);
  --blue-2: oklch(0.89 0.045 255);
  --blue-3: oklch(0.62 0.115 255);
  --blue-4: oklch(0.48 0.095 255);
  --blue-5: oklch(0.34 0.055 255);
  --purple-1: oklch(0.965 0.015 295);
  --purple-2: oklch(0.89 0.045 295);
  --purple-3: oklch(0.62 0.115 295);
  --purple-4: oklch(0.48 0.095 295);
  --purple-5: oklch(0.34 0.055 295);
  --green-1: oklch(0.965 0.015 145);
  --green-2: oklch(0.89 0.045 145);
  --green-3: oklch(0.62 0.115 145);
  --green-4: oklch(0.48 0.095 145);
  --green-5: oklch(0.34 0.055 145);
  --red-1: oklch(0.965 0.015 27);
  --red-2: oklch(0.89 0.045 27);
  --red-3: oklch(0.62 0.115 27);
  --red-4: oklch(0.48 0.095 27);
  --red-5: oklch(0.34 0.055 27);
  --amber-1: oklch(0.965 0.015 85);
  --amber-2: oklch(0.89 0.045 85);
  --amber-3: oklch(0.62 0.115 85);
  --amber-4: oklch(0.48 0.095 85);
  --amber-5: oklch(0.34 0.055 85);

  --bg: var(--white);
  --ink: var(--zinc-5);
  --muted: var(--zinc-4);
  --faint: var(--zinc-3);
  --secondary: color-mix(in oklch, var(--zinc-1) 80%, var(--zinc-2));
  --border: color-mix(in oklch, var(--zinc-1) 70%, var(--zinc-3));
  --hover: color-mix(in oklab, var(--amber-1) 70%, var(--zinc-2));
  --rail: color-mix(in oklab, var(--zinc-1) 80%, var(--amber-1));
  --ocean: hsl(208 100% 45%);
  --logo-yellow: hsl(47 100% 51%);
  --composer: #f2eee4;

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-move: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.16, 1.2, 0.3, 1);

  --sans: 'Inter Variable', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--zinc-1);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}

a {
  color: inherit;
}

/* ---------------------------------------------------------------- player */

.player {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  padding: 16px min(3vw, 40px) 20px;
  gap: 12px;
}

.player-head {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.player-head .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.player-head .brand img {
  height: 20px;
}

.player-head .sep {
  width: 1px;
  height: 16px;
  background: var(--border);
}

.player-head .title {
  color: var(--ink);
  font-weight: 500;
}

.player-head .spacer {
  flex: 1;
}

.player-head .next {
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.player-head .next:hover {
  background: var(--hover);
}

.viewport {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
}

.frame {
  position: relative;
  width: var(--frame-w);
  height: var(--frame-h);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
}

.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  transform: scale(var(--stage-scale, 1));
  overflow: hidden;
  background: var(--bg);
}

.play-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 0.35);
  border: 0;
  cursor: pointer;
  transition: opacity 300ms var(--ease-move);
}

.play-cover span {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: var(--zinc-5);
  color: var(--zinc-1);
  box-shadow: var(--shadow-xl);
  transition: transform 200ms var(--ease-spring);
}

.play-cover .play-cover-icon {
  font-size: 40px;
  margin-left: 6px;
  fill: currentColor;
}

.play-cover:hover span {
  transform: scale(1.06);
}

.render .play-cover,
.player[data-started='true'] .play-cover {
  opacity: 0;
  pointer-events: none;
}

.controls {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  width: var(--frame-w);
  margin: 0 auto;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.controls .scrub {
  flex: 1;
  min-width: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.icon-btn:hover {
  background: var(--hover);
}

.icon-btn[hidden] {
  display: none;
}

.icon-btn[aria-pressed='true'] {
  background: var(--zinc-5);
  border-color: var(--zinc-5);
  color: var(--zinc-1);
}

.icon-btn.play {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--zinc-5);
  border-color: var(--zinc-5);
  color: var(--zinc-1);
}

.speed {
  position: relative;
}

/* Same size as the other buttons; the smaller type fits the widest rate,
   0.25x. */
.speed-btn {
  padding: 0;
  font-size: 11px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.speed-menu {
  position: absolute;
  right: 0;
  bottom: 44px;
  z-index: 10;
  display: none;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.speed-menu.open {
  display: grid;
}

.speed-menu p {
  margin: 4px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.speed-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.speed-menu button:hover {
  background: var(--hover);
}

.speed-menu button[aria-checked='true'] {
  font-weight: 600;
}

.speed-menu button[aria-checked='true']::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ocean);
}

.scrub {
  position: relative;
  height: 28px;
  cursor: pointer;
}

.scrub-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 4px;
  border-radius: 999px;
  background: var(--zinc-2);
  overflow: hidden;
}

.scrub-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: var(--zinc-5);
}

.scrub-tick {
  position: absolute;
  top: 9px;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--zinc-3);
}

/* Preview over the timeline: the frame at that moment, its section and time. */
.scrub-tip {
  position: absolute;
  bottom: 34px;
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: 6px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms;
}

.tip-img {
  width: 176px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background-color: var(--white);
  background-repeat: no-repeat;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
}

.tip-img:not([style*='background-image']) {
  display: none;
}

.tip-text {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--zinc-5);
  color: var(--zinc-1);
  white-space: nowrap;
  font-size: 12px;
}

.scrub:hover .scrub-tip,
.scrub.scrubbing .scrub-tip {
  opacity: 1;
}

.scrub {
  touch-action: none;
}

/* Volume: the slider opens beside the button on hover or keyboard focus. */
.volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 0;
  opacity: 0;
  margin: 0;
  accent-color: var(--zinc-5);
  transition:
    width 200ms var(--ease-move),
    opacity 200ms var(--ease-move);
}

.volume:hover .volume-slider,
.volume:focus-within .volume-slider {
  width: 80px;
  opacity: 1;
}

/* Captions sit on the video, sized to the frame. */
.caption {
  position: absolute;
  left: 50%;
  bottom: 5%;
  z-index: 3;
  max-width: min(72%, 1000px);
  margin: 0;
  padding: 0.3em 0.75em;
  border-radius: 8px;
  background: rgb(39 39 42 / 0.82);
  color: var(--white);
  font-size: clamp(13px, calc(var(--frame-w) * 0.0145), 24px);
  line-height: 1.45;
  text-align: center;
  text-wrap: pretty;
  transform: translateX(-50%);
  transition: bottom 250ms var(--ease-move);
  pointer-events: none;
}

.caption:empty,
.player[data-captions='false'] .caption {
  display: none;
}

.vo {
  display: none;
}

.error {
  position: absolute;
  inset: 24px;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 12px;
  background: var(--red-1);
  color: var(--red-5);
  font-size: 16px;
}

/* ------------------------------------------------------------ scenes */

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.015);
  transition:
    opacity 700ms var(--ease-move),
    transform 900ms var(--ease-enter),
    visibility 0s linear 700ms;
}

.scene.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 700ms var(--ease-move) 150ms,
    transform 900ms var(--ease-enter) 150ms,
    visibility 0s;
}

.scene.past {
  transform: scale(0.985);
}

.stage.instant *,
.stage.instant *::before,
.stage.instant *::after {
  transition: none !important;
  animation: none !important;
}

.dots {
  background-color: var(--white);
  background-image: radial-gradient(color-mix(in oklch, var(--zinc-2) 85%, var(--zinc-3)) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
}

.warm {
  background: var(--rail);
}

/* Engine states. `[data-in]` elements wait hidden until their beat. */
[data-in] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 600ms var(--ease-move),
    transform 800ms var(--ease-enter),
    filter 600ms var(--ease-move);
}

[data-in].from-left {
  transform: translateX(-48px);
}

[data-in].from-right {
  transform: translateX(48px);
}

[data-in].pop {
  transform: scale(0.88);
  transition:
    opacity 400ms var(--ease-move),
    transform 600ms var(--ease-spring);
}

[data-in].fade {
  transform: none;
}

[data-in].blur {
  filter: blur(12px);
  transform: none;
}

[data-in].on {
  opacity: 1;
  transform: none;
  filter: none;
}

.out,
[data-in].on.out {
  opacity: 0;
  transform: translateY(-20px) scale(0.98);
  pointer-events: none;
}

.dim {
  opacity: 0.28 !important;
  filter: saturate(0.3);
  transition:
    opacity 500ms var(--ease-move),
    filter 500ms var(--ease-move);
}

/* Camera: a box that shows its .cam layer moved and scaled by data-camera.
   --cam-top clips the top, so a zoomed canvas never runs under the headline. */
.camera {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(var(--cam-top, 0) 0 0 0);
}

.cam {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

/* The canvas dots reach past the box, so a zoom never shows their edge. */
.cam > .rc-canvas {
  inset: calc(-1200 * var(--u)) !important;
}

[data-move] {
  transition: transform 1100ms var(--ease-move);
}

/* ------------------------------------------------------------ type */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ocean);
}

.display {
  margin: 0;
  font-size: 104px;
  line-height: 1.02;
  font-weight: 650;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.h1 {
  margin: 0;
  font-size: 76px;
  line-height: 1.06;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.h2 {
  margin: 0;
  font-size: 52px;
  line-height: 1.12;
  font-weight: 620;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.lead {
  margin: 0;
  font-size: 36px;
  line-height: 1.4;
  color: var(--muted);
  text-wrap: pretty;
}

.body {
  margin: 0;
  font-size: 28px;
  line-height: 1.45;
  color: var(--muted);
}

.small {
  font-size: 22px;
  line-height: 1.4;
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

.ink {
  color: var(--ink);
}

.muted {
  color: var(--muted);
}

/* Highlighted words in headings: a soft marker sweeps in behind the text. */
.mark {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.mark::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: -0.08em;
  right: -0.08em;
  bottom: 0.04em;
  height: 0.34em;
  border-radius: 0.12em;
  background: var(--mark, var(--blue-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 900ms var(--ease-enter);
}

.mark.lit::before {
  transform: scaleX(1);
}

.mark.amber {
  --mark: var(--amber-2);
}

.mark.green {
  --mark: var(--green-2);
}

.mark.purple {
  --mark: var(--purple-2);
}

.mark.red {
  --mark: var(--red-2);
}

/* ------------------------------------------------------------ layout */

.abs {
  position: absolute;
}

.center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.pad {
  position: absolute;
  inset: 96px 120px;
}

.row {
  display: flex;
  align-items: center;
}

.col {
  display: flex;
  flex-direction: column;
}

.gap-8 {
  gap: 8px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}
.gap-24 {
  gap: 24px;
}
.gap-32 {
  gap: 32px;
}
.gap-48 {
  gap: 48px;
}

/* ------------------------------------------------------------ components */

.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

.card.flat {
  box-shadow: var(--shadow-sm);
}

.card.raised {
  box-shadow: var(--shadow-xl);
}

.panel {
  background: var(--secondary);
  border-radius: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--secondary);
  color: var(--ink);
}

.badge.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 15px;
}

.badge.info {
  background: var(--blue-1);
  color: var(--blue-5);
  box-shadow: inset 0 0 0 1.5px var(--blue-2);
}

.badge.ai {
  background: var(--purple-1);
  color: var(--purple-5);
  box-shadow: inset 0 0 0 1.5px var(--purple-2);
}

.badge.success {
  background: var(--green-1);
  color: var(--green-5);
  box-shadow: inset 0 0 0 1.5px var(--green-2);
}

.badge.warning,
.badge.knowledge {
  background: var(--amber-1);
  color: var(--amber-5);
  box-shadow: inset 0 0 0 1.5px var(--amber-2);
}

.badge.danger {
  background: var(--red-1);
  color: var(--red-4);
  box-shadow: inset 0 0 0 1.5px var(--red-2);
}

.badge.solid {
  background: var(--zinc-5);
  color: var(--zinc-1);
}

.badge.new {
  background: var(--ocean);
  color: var(--white);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 22px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--zinc-5);
  color: var(--zinc-1);
  transition:
    transform 160ms var(--ease-move),
    box-shadow 300ms var(--ease-move),
    background 300ms var(--ease-move);
}

.btn.outline {
  background: var(--white);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--border);
}

.btn.pressed {
  animation: press 420ms var(--ease-move);
}

@keyframes press {
  40% {
    transform: scale(0.94);
  }
}

.btn.glow {
  box-shadow:
    0 0 0 6px color-mix(in oklch, var(--ocean) 22%, transparent),
    var(--shadow-md);
}

/* The icon's wrapper is a box, not a line of text, so no baseline gap lifts the icon. */
i[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  flex: none;
}

/* Square tile with an icon, used for actions and concepts. */
.tile {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 32px;
  background: var(--secondary);
  color: var(--ink);
  flex: none;
}

.tile.info {
  background: var(--blue-1);
  color: var(--blue-4);
}
.tile.ai {
  background: var(--purple-1);
  color: var(--purple-4);
}
.tile.success {
  background: var(--green-1);
  color: var(--green-4);
}
.tile.knowledge,
.tile.warning {
  background: var(--amber-1);
  color: var(--amber-4);
}
.tile.danger {
  background: var(--red-1);
  color: var(--red-4);
}

/* Chat, drawn like the app's: the person's messages sit in grey bubbles with
   the time and a copy icon under them; OAIZ answers in plain text, activity
   lines and expandable results, with no avatar. */

.chat {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.msg-user {
  align-self: flex-end;
  max-width: 84%;
  padding: 14px 20px;
  border-radius: 16px;
  background: var(--secondary);
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink);
}

.msg-meta {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: -12px;
  font-size: 17px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.msg-ai {
  font-size: 24px;
  line-height: 1.5;
  color: var(--ink);
}

/* "Thinking", "Working..", "Completed · 5 steps" */
.chat-act {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
}

.chat-act .icon {
  font-size: 18px;
}

.chat-act .shimmer {
  background: linear-gradient(90deg, var(--muted) 30%, var(--faint) 50%, var(--muted) 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rc-shimmer 1.6s linear infinite;
}

/* A result such as "Workflow generated successfully.", with its fields on a rail. */
.chat-art-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
}

.chat-art-title .icon {
  font-size: 18px;
  color: var(--muted);
}

.chat-art-body {
  display: grid;
  gap: 14px;
  margin: 12px 0 0 8px;
  padding-left: 22px;
  border-left: 1.5px solid var(--border);
}

.chat-field .k {
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 500;
  color: var(--muted);
}

.chat-field .v {
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink);
}

.chat-field .v.name {
  font-weight: 500;
}

.chat-change {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

.chat-change > .icon,
.chat-change > i .icon {
  color: var(--muted);
}

.chat-change .tag {
  margin-left: auto;
  padding: 2px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
}

/* Composer: text with a microphone and a round send button, tools below.
   The send button shows a stop square while OAIZ works (.working). */
.composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 12px 20px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: var(--white);
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
}

.composer-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.composer-row .ctext {
  flex: 1;
  min-width: 0;
}

.composer .placeholder {
  color: var(--muted);
}

.composer .mic {
  margin-top: 11px;
  font-size: 20px;
  color: var(--muted);
}

.composer .send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  background: var(--zinc-5);
  color: var(--white);
  font-size: 20px;
}

.composer .send .stop,
.composer .send.working .up {
  display: none;
}

.composer .send.working .stop {
  display: inline-flex;
}

.composer .send .stop .icon {
  fill: currentColor;
  stroke: none;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 18px;
  color: var(--ink);
}

.composer-tools .sel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
}

.composer-tools .sel.bare {
  padding: 0;
  border: 0;
}

.composer-tools .sel .icon:last-child {
  font-size: 15px;
  color: var(--muted);
}

/* The workflow the chat is about, above the composer in the builder. */
.ctx-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.ctx-chip .icon {
  color: var(--muted);
}

/* Chat headers: "Chat" with new-chat and history on the page; the workflow
   name with a menu and new-chat in the builder. */
.chat-top {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 68px;
  padding: 0 24px 0 28px;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.chat-top .icon {
  font-size: 20px;
}

.chat-top .grow {
  flex: 1;
}

.chat-top .menu {
  color: var(--muted);
}

.caret::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--ink);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.activity {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  color: var(--muted);
}

/* The app's loading flower (OrbSpinner in @oaiz/ui), turning at its speed. */
.spinner {
  flex: none;
  width: 22px;
  height: 22px;
  background: url(../assets/icons/orb.svg) center / contain no-repeat;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Canvas job node */

.node {
  position: absolute;
  width: 360px;
  padding: 20px 22px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  transition:
    border-color 400ms var(--ease-move),
    box-shadow 400ms var(--ease-move),
    opacity 600ms var(--ease-move),
    transform 800ms var(--ease-enter);
}

.node-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.node-head .tile {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 24px;
}

.node-kind {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.node-name {
  font-size: 23px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.node-text {
  margin-top: 12px;
  font-size: 19px;
  line-height: 1.45;
  color: var(--muted);
}

.node .state {
  position: absolute;
  top: -16px;
  right: 16px;
}

.node.running {
  border-color: var(--ocean);
  box-shadow:
    0 0 0 8px color-mix(in oklch, var(--ocean) 16%, transparent),
    var(--shadow-lg);
}

.node.done {
  border-color: var(--green-3);
}

.node.failed {
  border-color: var(--red-3);
  box-shadow:
    0 0 0 8px color-mix(in oklch, var(--red-3) 14%, transparent),
    var(--shadow-md);
}

.node.skipped {
  border-style: dashed;
  box-shadow: none;
  opacity: 0.55;
}

.node.focus {
  border-color: var(--ink);
  box-shadow:
    0 0 0 8px color-mix(in oklch, var(--zinc-3) 22%, transparent),
    var(--shadow-xl);
}

/* Show one of several state badges with `data-at="k:done"` on the node. */
.node .when-running,
.node .when-done,
.node .when-failed,
.node .when-skipped,
.node .when-new {
  display: none;
}

.node.running .when-running,
.node.done:not(.running) .when-done,
.node.failed .when-failed,
.node.skipped .when-skipped,
.node.new:not(.done):not(.running) .when-new {
  display: inline-flex;
}

/* Edges are SVG paths with pathLength="1"; `.on` draws them. */
.edges {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  overflow: visible;
  pointer-events: none;
}

.edge {
  fill: none;
  stroke: var(--zinc-3);
  stroke-width: 3;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition:
    stroke-dashoffset 1000ms var(--ease-move),
    stroke 400ms;
}

.edge.on {
  stroke-dashoffset: 0;
}

.edge.lit {
  stroke: var(--ocean);
}

.edge.dashed {
  stroke-dasharray: none;
}

/* A dot that travels along `offset-path` when `.go` is added, centred on the path. */
.token {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--ocean);
  box-shadow:
    0 0 0 7px color-mix(in oklch, var(--ocean) 22%, transparent),
    var(--shadow-md);
  offset-rotate: 0deg;
  offset-distance: 0%;
  opacity: 0;
  transition:
    offset-distance 1600ms var(--ease-move),
    opacity 300ms;
}

.token.go {
  offset-distance: 100%;
  opacity: 1;
}

.token.go.arrived {
  opacity: 0;
}

/* Event card: a type and its properties. */
.event {
  width: 520px;
  padding: 24px 26px;
}

.event-type {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 600;
}

.props {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--zinc-1);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
}

.props .k {
  color: var(--red-4);
}

.props .s {
  color: var(--green-4);
}

.props .p {
  color: var(--blue-4);
}

.prop-row {
  transition:
    background 400ms var(--ease-move),
    box-shadow 400ms var(--ease-move);
  border-radius: 8px;
  margin: 0 -8px;
  padding: 0 8px;
}

.prop-row.lit {
  background: var(--blue-1);
  box-shadow: inset 0 0 0 1.5px var(--blue-2);
}

/* Knowledge document */

.doc {
  width: 420px;
  padding: 26px 28px;
}

.doc-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 24px;
  font-weight: 600;
}

.doc-lines {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.doc-lines i {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: var(--zinc-2);
}

.doc-lines i:nth-child(3n) {
  width: 72%;
}
.doc-lines i:nth-child(3n + 2) {
  width: 90%;
}

/* Toggle switch. `.checked` turns it on. */
.switch {
  position: relative;
  width: 64px;
  height: 36px;
  border-radius: 999px;
  background: var(--zinc-2);
  transition: background 300ms var(--ease-move);
  flex: none;
}

.switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform 350ms var(--ease-spring);
}

.switch.checked {
  background: var(--green-4);
}

.switch.checked::after {
  transform: translateX(28px);
}

/* List rows, used for run logs, settings and checklists. */
.list {
  display: grid;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--white);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 26px;
  font-size: 23px;
  border-top: 1.5px solid var(--border);
  transition: background 400ms var(--ease-move);
}

.list-row:first-child {
  border-top: 0;
}

.list-row.lit {
  background: var(--hover);
}

/* Mouse pointer. Move it with data-move, click with data-at="k:click". */
.pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  z-index: 50;
  filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.2));
  opacity: 0;
  transition:
    transform 1100ms var(--ease-move),
    opacity 400ms;
}

.pointer.on {
  opacity: 1;
}

.pointer::after {
  content: '';
  position: absolute;
  left: -14px;
  top: -14px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 3px solid var(--ocean);
  opacity: 0;
  transform: scale(0.4);
}

.pointer.click::after {
  animation: ripple 700ms var(--ease-enter);
}

@keyframes ripple {
  0% {
    opacity: 0.9;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

/* Soft pulse to draw the eye to something already on screen. */
.pulse {
  animation: pulse 1600ms var(--ease-move) 2;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in oklch, var(--ocean) 0%, transparent);
  }
  40% {
    box-shadow: 0 0 0 12px color-mix(in oklch, var(--ocean) 22%, transparent);
  }
}

.float {
  animation: float 3.2s var(--ease-move) infinite;
}

@keyframes float {
  50% {
    transform: translateY(-10px);
  }
}

/* End card links to the next video and deeper topics. */
.end-link {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  border-radius: 18px;
  background: var(--white);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 24px;
  color: var(--ink);
  text-decoration: none;
}

.end-link .small {
  display: block;
  font-size: 18px;
}

.end-link:hover {
  background: var(--hover);
}

[data-out]:not([data-in]) {
  transition:
    opacity 500ms var(--ease-move),
    transform 600ms var(--ease-enter);
}

/* Capture mode (`?render`): the stage fills the window, without player chrome. */
.render .player {
  padding: 0;
  gap: 0;
  grid-template-rows: 1fr;
}

.render .player-head,
.render .controls,
.render .caption {
  display: none;
}

.render .frame {
  border-radius: 0;
  box-shadow: none;
}

/* Embedded on the website (`#embed=…`): the page around the iframe carries the title. */
/* The player stays a few pixels inside the iframe and never scrolls, so a taller
   caption shrinks the stage instead of adding a scrollbar that hides controls. */
.embed,
.embed body {
  overflow: hidden;
}

.embed .player {
  padding: 2px 4px 6px;
  gap: 12px;
  grid-template-rows: 1fr auto;
}

.embed .player-head {
  display: none;
}

.embed body,
.embed {
  background: transparent;
}

@media (max-width: 640px) {
  .controls {
    gap: 10px;
  }

  .controls .volume,
  .controls [data-act='share'] {
    display: none;
  }

  .tip-img {
    width: 144px;
  }
}

/* Full screen (`.fs` on the root, set by the player): the stage fills the
   display and the controls float over its
   bottom edge, shown while the pointer is near it or a control has keyboard
   focus or an open menu. */
.fs,
.fs body {
  background: var(--white);
}

.fs .player {
  grid-template-rows: 1fr;
  padding: 0;
  gap: 0;
  background: var(--white);
}

.fs .player .player-head {
  display: none;
}

.fs .player .frame {
  border-radius: 0;
  box-shadow: none;
}

.fs .player .controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  width: auto;
  max-width: none;
  padding: 56px 32px 22px;
  background: linear-gradient(to top, rgb(255 255 255 / 0.96) 40%, rgb(255 255 255 / 0));
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 250ms var(--ease-move),
    transform 300ms var(--ease-enter);
}

.fs .player.reveal .controls,
.fs .player .controls:has(:focus-visible),
.fs .player .controls:has(.speed-menu.open) {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.fs .player.reveal .caption {
  bottom: calc(5% + 84px);
}

/* Above the controls' 140px reveal zone, so reaching for the card never
   brings the controls up over it. */
.fs .player .upnext {
  bottom: 160px;
  z-index: 6;
}

/* Clicking the video plays or pauses it; a short flash shows which. */
.frame {
  cursor: pointer;
}

.frame a {
  cursor: pointer;
}

.flash {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 999px;
  background: rgb(39 39 42 / 0.72);
  color: var(--white);
  font-size: 34px;
  opacity: 0;
  pointer-events: none;
}

.flash .icon {
  fill: currentColor;
}

.flash.text {
  width: auto;
  min-width: 84px;
  margin-left: 0;
  padding: 0 20px;
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}

.flash.show {
  animation: flash 650ms var(--ease-enter);
}

@keyframes flash {
  0% {
    opacity: 1;
    transform: scale(0.85);
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

/* Up next card, bottom right of the video at the end. */
.upnext {
  position: absolute;
  right: 3%;
  bottom: 5%;
  z-index: 4;
  display: flex;
  gap: 14px;
  width: min(440px, 46%);
  padding: 12px;
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  cursor: default;
  transition:
    opacity 300ms var(--ease-move),
    transform 450ms var(--ease-enter);
}

.upnext.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.upnext-poster {
  width: 42%;
  aspect-ratio: 16 / 9;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
}

.upnext-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-right: 18px;
}

.upnext-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.upnext-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.upnext-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  margin-top: auto;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--zinc-5);
  color: var(--zinc-1);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.upnext-play .icon {
  fill: currentColor;
  font-size: 11px;
}

.upnext-close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.upnext-close:hover {
  background: var(--hover);
  color: var(--ink);
}

/* Shrinks as the countdown to the next video runs out. */
.upnext-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--zinc-5);
  transform: scaleX(var(--upnext-left, 1));
  transform-origin: left;
}

@media (max-width: 640px) {
  .upnext {
    width: 70%;
  }

  .upnext-poster {
    display: none;
  }
}

/* ============================================================================
   Real-canvas kit (`rc-`): the builder canvas as the web app draws it, for
   scenes about the canvas itself. Sizes are the app's pixels times --u
   (1.5px by default, so a 180px job card is 270px on the 1920px stage).
   Sources: apps/web-app/src/features/builder/components (job-node card,
   custom edge, event node, version controls, run button, review dock).
   ============================================================================ */

.rc {
  --u: 1.5px;
  --rc-edge: var(--zinc-3);
  --rc-ocean: var(--ocean);
  --rc-info-solid: var(--blue-4);
  --rc-info-text: var(--blue-5);
  --rc-info-bg: var(--blue-1);
}

.rc-canvas {
  position: absolute;
  background-color: var(--white);
  background-image: radial-gradient(color-mix(in oklch, var(--zinc-3) 55%, transparent) calc(0.75 * var(--u)), transparent calc(0.75 * var(--u)));
  background-size: calc(12 * var(--u)) calc(12 * var(--u));
}

/* Job card: 180×212, 12px radius, icon row, three-line description, footer. */
.rc-job {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: calc(180 * var(--u));
  height: calc(212 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(12 * var(--u));
  background: var(--white);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  overflow: hidden;
  transition:
    border-color 300ms var(--ease-move),
    box-shadow 300ms var(--ease-move),
    opacity 600ms var(--ease-move),
    transform 800ms var(--ease-enter);
}

.rc-job-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: calc(12 * var(--u));
  padding: calc(14 * var(--u));
  min-height: 0;
}

.rc-job-head {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  min-height: calc(24 * var(--u));
}

.rc-job-icon {
  display: grid;
  place-items: center;
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  color: var(--muted);
  font-size: calc(20 * var(--u));
}

.rc-job-icon img {
  width: calc(20.25 * var(--u));
  height: calc(20.25 * var(--u));
  border-radius: calc(6 * var(--u));
  object-fit: contain;
}

.rc-job-icon .icon {
  stroke-width: 1.75;
}

.rc-job-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: calc(14 * var(--u));
  line-height: calc(20 * var(--u));
  color: var(--ink);
}

.rc-job-foot {
  display: flex;
  align-items: center;
  height: calc(36 * var(--u));
  margin: 0 calc(2 * var(--u));
  padding: calc(6 * var(--u)) calc(12 * var(--u)) calc(8 * var(--u));
  border-top: 1px solid var(--border);
  font-size: calc(12 * var(--u));
  line-height: 1.5;
  color: var(--ink);
  white-space: nowrap;
}

.rc-st {
  display: none;
  align-items: center;
  gap: calc(8 * var(--u));
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-st .icon {
  flex: none;
  font-size: calc(16 * var(--u));
}

.rc-st-idle {
  display: block;
}

.rc-job:is(.queued, .running, .success, .filtered, .failed, .didnotrun) .rc-st-idle {
  display: none;
}

.rc-job.queued .rc-st-queued,
.rc-job.running .rc-st-running,
.rc-job.success:not(.running) .rc-st-success,
.rc-job.filtered .rc-st-filtered,
.rc-job.failed .rc-st-failed,
.rc-job.didnotrun .rc-st-didnotrun {
  display: inline-flex;
  font-weight: 500;
}

.rc-job.running .rc-st-queued,
.rc-job:is(.success, .filtered, .failed, .didnotrun) .rc-st-queued {
  display: none;
}

.rc-st-queued,
.rc-st-didnotrun {
  color: var(--muted);
}

.rc-st-success .icon {
  color: var(--rc-info-text);
}

.rc-st-filtered .icon {
  color: var(--amber-4);
}

.rc-st-failed .icon {
  color: var(--red-4);
}

.rc-job.queued .rc-job-desc,
.rc-job.didnotrun .rc-job-desc {
  color: var(--muted);
  font-weight: 500;
}

.rc-job.didnotrun .rc-job-icon {
  opacity: 0.5;
}

.rc-job:is(.running, .success, .filtered, .failed) .rc-job-desc {
  font-weight: 500;
}

/* Review: "New" (added) and "Changed". */
.rc-new-badge,
.rc-changed-badge {
  display: none;
  padding: calc(3 * var(--u)) calc(8 * var(--u));
  border-radius: 999px;
  font-size: calc(12 * var(--u));
  font-weight: 500;
  line-height: calc(18 * var(--u));
  letter-spacing: -0.015em;
}

.rc-new-badge {
  background: var(--rc-ocean);
  color: var(--white);
}

.rc-changed-badge {
  background: color-mix(in oklch, var(--rc-ocean) 10%, transparent);
  color: var(--rc-ocean);
}

.rc-job.new .rc-new-badge,
.rc-job.changed .rc-changed-badge {
  display: inline-block;
}

.rc-job.new,
.rc-job.changed {
  border-color: color-mix(in oklch, var(--rc-ocean) 50%, transparent);
}

.rc-job.changed .rc-job-foot {
  border-top-color: color-mix(in oklch, var(--rc-ocean) 50%, transparent);
}

.rc-job.selected {
  box-shadow: inset 0 0 0 2px var(--muted);
}

/* Running: 2px ocean border with a rotating light outline. */
.rc-job.running {
  border: 2px solid var(--rc-ocean);
  box-shadow: var(--shadow-md);
}

.rc-job.running::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--rc-spin, 0deg), #0068c9, #a8d8ff, #0068c9);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rc-spin 3.15s linear infinite;
  pointer-events: none;
}

@property --rc-spin {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rc-spin {
  to {
    --rc-spin: 360deg;
  }
}

.rc-job:is(.failed) {
  border: 2px solid var(--red-4);
}

.rc-shimmer {
  background: linear-gradient(90deg, var(--ink) 30%, var(--faint) 50%, var(--ink) 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rc-shimmer 1.6s linear infinite;
}

@keyframes rc-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

/* The flower spinner on the canvas: the same OrbSpinner as .spinner. */
.rc-orb {
  position: relative;
  display: inline-block;
  flex: none;
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
  background: url(../assets/icons/orb.svg) center / contain no-repeat;
  animation: spin 2s linear infinite;
}

/* Trigger: black pill with the event name; ocean while a run passes it. */
.rc-trigger {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: calc(8.2 * var(--u));
  height: calc(32.6 * var(--u));
  max-width: calc(165.4 * var(--u));
  padding: 0 calc(9.8 * var(--u));
  border-radius: calc(12 * var(--u));
  background: #000;
  color: var(--white);
  font-size: calc(12 * var(--u));
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 300ms var(--ease-move),
    box-shadow 300ms var(--ease-move),
    opacity 600ms var(--ease-move),
    transform 800ms var(--ease-enter);
}

.rc-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-trigger img,
.rc-trigger .icon {
  flex: none;
  width: calc(14.7 * var(--u));
  height: calc(14.7 * var(--u));
  border-radius: calc(3 * var(--u));
  object-fit: contain;
}

.rc-trigger .icon {
  stroke: var(--white);
}

.rc-trigger.running {
  background: var(--rc-ocean);
  box-shadow: var(--shadow-lg);
}

/* Terminal output event: 60×60 card with "Event", its name underneath. */
.rc-event {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(80 * var(--u));
  gap: calc(6 * var(--u));
  font-size: calc(12 * var(--u));
  font-weight: 500;
  text-align: center;
  color: var(--ink);
}

.rc-event-box {
  display: grid;
  place-items: center;
  align-content: center;
  gap: calc(2 * var(--u));
  width: calc(60 * var(--u));
  height: calc(60 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(12 * var(--u));
  background: var(--white);
  font-size: calc(12 * var(--u));
  transition:
    background 300ms var(--ease-move),
    box-shadow 300ms var(--ease-move);
}

.rc-event-box .icon {
  font-size: calc(20 * var(--u));
}

.rc-event.updated .rc-event-box {
  background: var(--green-1);
  box-shadow: 0 0 0 2px var(--green-5);
}

/* Edges: 1.5px lines with round end markers, ocean when added or run through. */
.rc-edge {
  fill: none;
  stroke: var(--rc-edge);
  stroke-width: calc(1.5 * var(--u));
  transition: stroke 300ms var(--ease-move);
}

.rc-edge.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition:
    stroke-dashoffset 900ms var(--ease-move),
    stroke 300ms var(--ease-move);
}

.rc-edge.draw.on {
  stroke-dashoffset: 0;
}

.rc-port {
  fill: var(--white);
  stroke: var(--rc-edge);
  stroke-width: calc(1.5 * var(--u));
  transition:
    stroke 300ms var(--ease-move),
    opacity 300ms var(--ease-move);
}

.rc-edge.ocean,
.rc-port.ocean {
  stroke: var(--rc-ocean);
}

/* Builder chrome. */
.rc-version {
  position: absolute;
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: calc(8 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(12 * var(--u));
  background: var(--white);
}

.rc-version-btn,
.rc-btn {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  height: calc(44 * var(--u));
  padding: 0 calc(16 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(8 * var(--u));
  background: var(--white);
  color: var(--ink);
  font-size: calc(14 * var(--u));
  font-weight: 500;
  white-space: nowrap;
  transition:
    transform 160ms var(--ease-move),
    background 300ms var(--ease-move);
}

.rc-version-btn {
  width: calc(320 * var(--u));
}

.rc-version-btn .rc-branch {
  flex: 1;
}

.rc-btn .icon,
.rc-version-btn .icon {
  font-size: calc(16 * var(--u));
}

.rc-btn.primary {
  border-color: var(--zinc-5);
  background: var(--zinc-5);
  color: var(--zinc-1);
}

.rc-btn.primary .icon {
  fill: currentColor;
}

.rc-btn.pressed,
.rc-run-split.pressed {
  animation: press 420ms var(--ease-move);
}

.rc-dot {
  width: calc(8 * var(--u));
  height: calc(8 * var(--u));
  border-radius: 999px;
  background: var(--zinc-5);
}

.rc-status {
  display: inline-flex;
  align-items: center;
  height: calc(20 * var(--u));
  padding: 0 calc(8 * var(--u));
  border-radius: 999px;
  font-size: calc(12 * var(--u));
  font-weight: 500;
}

.rc-status.draft {
  background: var(--zinc-5);
  color: var(--zinc-1);
}

.rc-status.live {
  background: var(--green-1);
  color: var(--green-5);
}

.rc-status.paused {
  background: var(--amber-1);
  color: var(--amber-5);
}

/* Show one of several children by the container's state class:
   <span class="rc-swap is-draft"><span class="when-draft">…</span><span class="when-live">…</span></span> */
.rc-swap > [class*='when-'] {
  display: none;
}

.rc-swap.is-draft > .when-draft,
.rc-swap.is-live > .when-live,
.rc-swap.is-paused > .when-paused,
.rc-swap.is-idle > .when-idle,
.rc-swap.is-running > .when-running,
.rc-swap.is-done > .when-done {
  display: inline-flex;
}

/* Run toolbar, bottom centre of the canvas. */
.rc-runbar {
  position: absolute;
  display: flex;
  align-items: center;
  gap: calc(4 * var(--u));
  padding: calc(4 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(12 * var(--u));
  background: var(--white);
  box-shadow: var(--shadow-md);
  font-size: calc(14 * var(--u));
  font-weight: 500;
  white-space: nowrap;
}

.rc-run-split {
  display: inline-flex;
  align-items: stretch;
  height: calc(40 * var(--u));
  border-radius: calc(12 * var(--u));
  background: var(--rc-info-solid);
  color: var(--white);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.rc-run-split > span {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: 0 calc(12 * var(--u));
}

.rc-run-split > span + span {
  padding: 0 calc(8 * var(--u));
  border-left: 1px solid rgb(255 255 255 / 0.2);
}

.rc-run-split .icon {
  font-size: calc(16 * var(--u));
}

.rc-run-split > span:first-child .icon {
  fill: currentColor;
}

.rc-ghost {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  height: calc(40 * var(--u));
  padding: 0 calc(12 * var(--u));
  border-radius: calc(8 * var(--u));
  color: var(--ink);
}

.rc-ghost .icon {
  font-size: calc(16 * var(--u));
}

.rc-running {
  display: inline-flex;
  align-items: center;
  gap: calc(12 * var(--u));
  padding: calc(8 * var(--u)) calc(12 * var(--u));
}

.rc-running .rc-orb {
  width: calc(42 * var(--u));
  height: calc(42 * var(--u));
}

.rc-running b {
  display: block;
  font-size: calc(16 * var(--u));
  font-weight: 500;
  letter-spacing: -0.01em;
}

.rc-running small {
  display: block;
  font-size: calc(12 * var(--u));
  font-weight: 400;
  color: var(--muted);
}

/* While a test runs: "Stop watching" with an outlined square after it. */
.rc-stop {
  display: inline-flex;
  align-items: center;
  gap: calc(10 * var(--u));
  height: calc(32 * var(--u));
  padding: 0 calc(12 * var(--u));
  border-radius: calc(8 * var(--u));
  background: #000;
  color: var(--white);
  font-size: calc(16 * var(--u));
  font-weight: 500;
}

.rc-stop::after {
  content: '';
  width: calc(12 * var(--u));
  height: calc(12 * var(--u));
  border: calc(2 * var(--u)) solid var(--white);
}

/* After the run: a ghost X button closes and dismisses the results. */
.rc-close {
  display: inline-grid;
  place-items: center;
  width: calc(32 * var(--u));
  height: calc(32 * var(--u));
  border-radius: calc(8 * var(--u));
  color: var(--ink);
  font-size: calc(16 * var(--u));
}

/* Canvas box (`cv`): a framed canvas on the stage. Place children with `.at` and --x, --y. */
.cv {
  position: absolute;
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}
.cv .at {
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
}
.cv-svg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}
.cv-svg .rc-edge,
.cv-svg .rc-port {
  stroke-width: 1.5;
}
.cv-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(40 * var(--u));
  display: flex;
  justify-content: center;
  z-index: 2;
}
.cv-bar {
  transition:
    right 600ms var(--ease-move),
    bottom 800ms var(--ease-move);
}
.cv-bar .rc-runbar {
  position: relative;
}
.cv-bar .rc-runbar > [class*='when-'] {
  align-items: center;
  gap: calc(4 * var(--u));
}
.cv-bar .rc-runbar.is-running,
.cv-bar .rc-runbar.is-done {
  padding: calc(4 * var(--u)) calc(8 * var(--u)) calc(4 * var(--u)) calc(4 * var(--u));
}
.cv-bar .rc-runbar .when-done .rc-orb {
  animation: none;
  background-image: url(../assets/icons/orb-still.svg);
}

/* Run permissions popover (480 app px wide), as the run button's chevron opens it. */
.pp {
  width: calc(480 * var(--u));
  padding: calc(12 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(8 * var(--u));
  background: var(--white);
  box-shadow: var(--shadow-lg);
  font-size: calc(12 * var(--u));
  line-height: calc(16 * var(--u));
  color: var(--ink);
}
.pp-lead {
  margin: 0 calc(-4 * var(--u)) calc(8 * var(--u));
  padding: 0 calc(4 * var(--u));
  border-radius: calc(4 * var(--u));
  color: var(--muted);
  transition: background 400ms var(--ease-move);
}
.pp-lead.lit {
  background: var(--rc-info-bg);
  color: var(--rc-info-text);
}
.pp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: calc(8 * var(--u));
  margin-bottom: calc(8 * var(--u));
}
.pp-title,
.pp-name {
  display: block;
  font-size: calc(14 * var(--u));
  line-height: calc(20 * var(--u));
  font-weight: 500;
}
.pp-desc,
.pp-note {
  color: var(--muted);
}
.pp-change {
  flex: none;
  padding: calc(4 * var(--u)) calc(8 * var(--u));
  border-radius: calc(8 * var(--u));
  color: var(--muted);
  white-space: nowrap;
  transition: background 300ms var(--ease-move);
}
.pp-change.lit {
  background: var(--secondary);
  color: var(--ink);
}
.pp-cards {
  display: flex;
  flex-direction: column;
  gap: calc(8 * var(--u));
}
.pp-card {
  display: flex;
  align-items: flex-start;
  gap: calc(10 * var(--u));
  padding: calc(12 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(8 * var(--u));
  background: var(--white);
  transition:
    background 300ms var(--ease-move),
    box-shadow 400ms var(--ease-move);
}
.pp-card.checked {
  border-color: var(--rc-info-text);
  background: var(--rc-info-bg);
}
.pp-card.hover {
  background: var(--secondary);
}
.pp-card.lit {
  box-shadow: 0 0 0 calc(4 * var(--u)) color-mix(in oklch, var(--ocean) 22%, transparent);
}
.pp-box {
  display: grid;
  place-items: center;
  flex: none;
  width: calc(16 * var(--u));
  height: calc(16 * var(--u));
  margin-top: calc(2 * var(--u));
  border: 1px solid var(--faint);
  border-radius: calc(4 * var(--u));
  background: var(--white);
  color: var(--white);
  font-size: calc(12 * var(--u));
}
.pp-card.checked .pp-box {
  border-color: var(--ocean);
  background: var(--ocean);
}
.pp-box .icon {
  stroke-width: 3;
}
.pp-card > span:last-child {
  flex: 1;
  min-width: 0;
}
.pp-entries {
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
  margin-top: calc(8 * var(--u));
}
.pp-entries span {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
}
.pp-entries img {
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
  border-radius: calc(2 * var(--u));
  object-fit: contain;
}
.pp-note {
  display: block;
  margin-top: calc(8 * var(--u));
}

/* Job panel (`jp-`), the simplified side panel a job card opens. Set --u on the
   panel to size it: 2px makes 13 app px of text 26px on the stage. */
.jp {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: calc(340 * var(--u));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(10 * var(--u));
  background: var(--white);
  box-shadow: var(--shadow-xl);
  font-size: calc(13 * var(--u));
  line-height: calc(19 * var(--u));
  color: var(--ink);
}

.jp-head {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: calc(12 * var(--u)) calc(16 * var(--u));
}

.jp-head img {
  flex: none;
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  border-radius: calc(5 * var(--u));
  object-fit: contain;
}

.jp-name {
  flex: 1;
  min-width: 0;
  font-size: calc(15 * var(--u));
  font-weight: 500;
}

.jp-head .icon {
  flex: none;
  color: var(--muted);
}

.jp-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(2 * var(--u));
  margin: 0 calc(16 * var(--u)) calc(10 * var(--u));
  padding: calc(3 * var(--u));
  border-radius: calc(9 * var(--u));
  background: var(--zinc-1);
}

.jp-tabs span {
  padding: calc(3 * var(--u));
  border-radius: calc(6 * var(--u));
  color: var(--muted);
  text-align: center;
  transition:
    background 300ms var(--ease-move),
    color 300ms var(--ease-move);
}

.jp-tabs span.on {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.jp-sec {
  padding: calc(10 * var(--u)) calc(16 * var(--u));
  border-top: 1px solid var(--border);
}

.jp-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(3 * var(--u));
  font-size: calc(12 * var(--u));
  font-weight: 500;
  color: var(--muted);
}

.jp-prompt {
  padding: calc(10 * var(--u));
  border-radius: calc(8 * var(--u));
  background: var(--secondary);
}

.jp-line {
  display: block;
  margin: 0 calc(-4 * var(--u));
  padding: 0 calc(4 * var(--u));
  border-radius: calc(4 * var(--u));
  transition: background 300ms var(--ease-move);
}

.jp-line.lit {
  background: var(--blue-1);
}

.jp-btn {
  display: block;
  margin-top: calc(10 * var(--u));
  padding: calc(5 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(8 * var(--u));
  background: var(--white);
  font-weight: 500;
  text-align: center;
  transition: box-shadow 400ms var(--ease-move);
}

.jp-btn.lit,
.jp-select.lit,
.jp-add.lit {
  box-shadow: 0 0 0 calc(3 * var(--u)) color-mix(in oklch, var(--ocean) 28%, transparent);
}

.jp-select {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: calc(6 * var(--u)) calc(10 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(8 * var(--u));
  background: var(--white);
  transition: box-shadow 400ms var(--ease-move);
}

.jp-select img,
.jp-opt img {
  flex: none;
  width: calc(16 * var(--u));
  height: calc(16 * var(--u));
  object-fit: contain;
}

.jp-select .icon:last-child {
  flex: none;
  margin-left: auto;
  color: var(--muted);
}

.jp-muted {
  color: var(--muted);
}

.jp-menu {
  margin-top: calc(4 * var(--u));
  padding: calc(4 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(8 * var(--u));
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.jp-opt {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: calc(5 * var(--u)) calc(8 * var(--u));
  border-radius: calc(6 * var(--u));
  transition: background 300ms var(--ease-move);
}

.jp-opt.sel {
  background: var(--hover);
}

.jp-add {
  display: grid;
  place-items: center;
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(6 * var(--u));
  color: var(--ink);
  transition: box-shadow 400ms var(--ease-move);
}

.jp-doc {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--u));
  padding: calc(2 * var(--u)) calc(8 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(6 * var(--u));
  background: var(--white);
  font-weight: 500;
}

/* Preview card (`rc-preview`, 360×180), attached to the right of an integration
   job. Its badge names the planned action until writes really ran. */
.rc-preview {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
  width: calc(360 * var(--u));
  height: calc(180 * var(--u));
  padding: calc(12 * var(--u));
  overflow: hidden;
  border: 1px solid var(--rc-edge);
  border-left: 0;
  border-radius: 0 calc(8 * var(--u)) calc(8 * var(--u)) 0;
  background: color-mix(in oklch, var(--secondary) 70%, var(--white));
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  font-size: calc(12 * var(--u));
  line-height: calc(16 * var(--u));
  color: var(--ink);
}

.rc-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.rc-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: calc(4 * var(--u));
  padding: calc(1 * var(--u)) calc(7 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(6 * var(--u));
  background: var(--white);
  font-weight: 500;
  color: var(--ink);
}

.rc-preview-subject {
  overflow: hidden;
  font-size: calc(14 * var(--u));
  line-height: calc(20 * var(--u));
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-preview-from {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  min-width: 0;
}

.rc-preview-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: calc(32 * var(--u));
  height: calc(32 * var(--u));
  border-radius: 50%;
  background: var(--ink);
  font-weight: 500;
  color: var(--white);
}

.rc-preview-from b {
  font-weight: 500;
}

.rc-preview-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
}

.rc-preview-expand {
  position: absolute;
  right: calc(6 * var(--u));
  bottom: calc(6 * var(--u));
  display: inline-flex;
  align-items: center;
  gap: calc(4 * var(--u));
  padding: calc(2 * var(--u)) calc(6 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(6 * var(--u));
  background: var(--white);
}

/* Review dock above the chat composer after Chat proposes changes. */
.rc-dock {
  padding: calc(12 * var(--u));
  border: 1px solid color-mix(in oklch, var(--rc-ocean) 50%, transparent);
  border-radius: calc(12 * var(--u));
  background: var(--rc-info-bg);
  font-size: calc(14 * var(--u));
}

.rc-dock-title {
  font-weight: 500;
  color: var(--rc-info-text);
}

.rc-dock-actions {
  display: flex;
  gap: calc(8 * var(--u));
  margin-top: calc(12 * var(--u));
}

.rc-dock-actions span {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  height: calc(36 * var(--u));
  padding: 0 calc(12 * var(--u));
  border-radius: calc(8 * var(--u));
  color: var(--muted);
  font-weight: 500;
  transition: transform 160ms var(--ease-move);
}

.rc-dock-actions .keep {
  background: var(--rc-info-solid);
  color: var(--white);
}

.rc-dock-actions .pressed {
  animation: press 420ms var(--ease-move);
}

/* Zoom controls, bottom right of the canvas. */
.rc-zoom {
  position: absolute;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: calc(8 * var(--u));
  background: var(--white);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.rc-zoom span {
  display: grid;
  place-items: center;
  width: calc(26 * var(--u));
  height: calc(26 * var(--u));
  border-top: 1px solid var(--border);
  font-size: calc(14 * var(--u));
  color: var(--ink);
}

.rc-zoom span:first-child {
  border-top: 0;
}

/* ============================================================================
   Logs kit (`lg-`): the builder's Logs panel as the web app draws it, for
   scenes about runs. Sizes are the app's pixels times --u, like the `rc-` kit.
   Sources: apps/web-app/src/features/builder/components/execution-inspector
   (execution history and run results) and features/log (status dot, badges).
     <div class="lg-panel" style="--u: 1.8px">
       <div class="lg-head">…</div> <div class="lg-filters">…</div>
       <div class="lg-table lg-cols-full">  rows of .lg-row  </div>
     </div>
   Run results: .lg-head.lg-run-head, then .lg-body with .lg-steps and .lg-main.
   ============================================================================ */

.lg-panel {
  --u: 1.8px;
  position: absolute;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: calc(12 * var(--u));
  background: var(--white);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  font-size: calc(14 * var(--u));
  line-height: 1.3;
  overflow: hidden;
  transition:
    opacity 600ms var(--ease-move),
    transform 800ms var(--ease-enter);
}

.lg-head {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  min-height: calc(52 * var(--u));
  padding: 0 calc(18 * var(--u));
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lg-title {
  font-size: calc(16 * var(--u));
  font-weight: 600;
}

.lg-grow {
  flex: 1;
}

.lg-muted {
  color: var(--muted);
  font-size: calc(13 * var(--u));
}

.lg-live {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-size: calc(14 * var(--u));
}

/* Live Feed switch, on. */
.lg-toggle {
  position: relative;
  width: calc(36 * var(--u));
  height: calc(20 * var(--u));
  border-radius: 999px;
  background: var(--ink);
}

.lg-toggle::after {
  content: '';
  position: absolute;
  top: calc(2 * var(--u));
  right: calc(2 * var(--u));
  width: calc(16 * var(--u));
  height: calc(16 * var(--u));
  border-radius: 999px;
  background: var(--white);
}

.lg-btn {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--u));
  height: calc(32 * var(--u));
  padding: 0 calc(11 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(8 * var(--u));
  background: var(--white);
  font-size: calc(14 * var(--u));
  font-weight: 500;
  white-space: nowrap;
}

.lg-btn .icon {
  font-size: calc(15 * var(--u));
}

.lg-filters {
  display: flex;
  gap: calc(8 * var(--u));
  padding: calc(14 * var(--u)) calc(18 * var(--u));
}

.lg-select {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(10 * var(--u));
  min-width: calc(140 * var(--u));
  height: calc(34 * var(--u));
  padding: 0 calc(11 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(8 * var(--u));
  font-size: calc(14 * var(--u));
}

.lg-select .icon {
  color: var(--muted);
}

/* Run table. Column sets: full (Started, Type, Status, Summary, Duration, Cost)
   and compact (Started, Status, Summary). */
.lg-table {
  position: relative;
  padding: 0 calc(18 * var(--u));
}

.lg-row {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: center;
  min-height: calc(62 * var(--u));
  padding: 0 calc(10 * var(--u));
  border-top: 1px solid var(--border);
  transition:
    background 400ms var(--ease-move),
    box-shadow 400ms var(--ease-move),
    opacity 600ms var(--ease-move),
    transform 800ms var(--ease-enter);
}

.lg-cols-full .lg-row {
  grid-template-columns:
    calc(190 * var(--u)) calc(64 * var(--u)) calc(106 * var(--u))
    1fr calc(92 * var(--u)) calc(84 * var(--u));
}

.lg-cols-compact .lg-row {
  grid-template-columns: calc(176 * var(--u)) calc(96 * var(--u)) 1fr;
}

.lg-row.lg-th {
  min-height: calc(40 * var(--u));
  border-top: 0;
  font-size: calc(13 * var(--u));
  font-weight: 500;
  color: var(--muted);
}

.lg-th span {
  transition: color 300ms var(--ease-move);
}

.lg-th span.lit {
  color: var(--blue-4);
}

.lg-row > * {
  min-width: 0;
  padding-right: calc(10 * var(--u));
}

.lg-num {
  font-size: calc(13 * var(--u));
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.lg-time {
  font-size: calc(13.5 * var(--u));
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lg-sum b {
  display: block;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lg-sum small {
  display: block;
  margin-top: calc(2 * var(--u));
  font-size: calc(12 * var(--u));
  color: var(--muted);
}

.lg-row.picked {
  border-radius: calc(8 * var(--u));
  box-shadow: inset 0 0 0 calc(2 * var(--u)) var(--ocean);
}

.lg-row.lit {
  background: var(--hover);
}

.lg-row.fail.lit {
  background: var(--red-1);
}

.lg-row.new.lit {
  background: var(--green-1);
}

.lg-row.dim {
  opacity: 0.5;
}

/* Logs as it opens in the builder: a bottom split across the canvas column. */
.lg-panel.lg-dock {
  --u: 1.5px;
  left: 0;
  right: 0;
  bottom: 0;
  height: 65%;
  border-width: 1px 0 0;
  border-radius: 0;
  box-shadow: 0 -8px 24px -12px rgb(0 0 0 / 0.15);
  z-index: 5;
}

.lg-dock[data-in]:not(.on) {
  transform: translateY(40%);
}

/* The app's columns: Started (date, then run type), Status, Summary, Duration, Cost. */
.lg-cols-logs .lg-row {
  grid-template-columns: calc(210 * var(--u)) calc(106 * var(--u)) 1fr calc(92 * var(--u)) calc(84 * var(--u));
}

.lg-time small {
  display: block;
  font-size: calc(12 * var(--u));
  font-weight: 400;
  color: var(--muted);
}

.cv-bar.lifted {
  bottom: calc(66% + 12px);
}

/* Column highlight behind a table column; place with left/width in app px. */
.lg-col-hl {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: calc(6 * var(--u));
  border-radius: calc(8 * var(--u));
  background: var(--blue-1);
  box-shadow: inset 0 0 0 calc(1.5 * var(--u)) var(--blue-2);
  opacity: 0;
  transition: opacity 400ms var(--ease-move);
}

.lg-col-hl.lit {
  opacity: 1;
}

/* Status badge: solid, small, white text. */
.lg-badge {
  display: inline-flex;
  align-items: center;
  height: calc(20 * var(--u));
  padding: 0 calc(7 * var(--u));
  border-radius: calc(6 * var(--u));
  font-size: calc(11.5 * var(--u));
  font-weight: 600;
  color: var(--zinc-1);
  white-space: nowrap;
}

.lg-badge.ok {
  background: var(--green-4);
}

.lg-badge.fail {
  background: var(--red-4);
}

/* Run results: steps on the left, the selected job on the right. */
.lg-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.lg-steps {
  flex: none;
  width: calc(250 * var(--u));
  border-right: 1px solid var(--border);
  background: color-mix(in oklch, var(--zinc-1) 60%, var(--white));
}

.lg-steps-label {
  padding: calc(16 * var(--u)) calc(18 * var(--u)) calc(12 * var(--u));
  font-size: calc(13 * var(--u));
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.lg-step {
  display: flex;
  align-items: center;
  gap: calc(9 * var(--u));
  min-height: calc(56 * var(--u));
  padding: 0 calc(14 * var(--u)) 0 calc(18 * var(--u));
  border-bottom: 1px solid var(--border);
  border-left: calc(2 * var(--u)) solid transparent;
  transition:
    background 400ms var(--ease-move),
    border-color 400ms var(--ease-move),
    opacity 600ms var(--ease-move),
    transform 800ms var(--ease-enter);
}

.lg-step.selected {
  border-left-color: var(--ink);
  background: var(--white);
}

.lg-step b {
  display: block;
  font-size: calc(13 * var(--u));
  font-weight: 400;
  white-space: nowrap;
}

.lg-step small {
  display: flex;
  gap: calc(8 * var(--u));
  margin-top: calc(2 * var(--u));
  font-size: calc(12 * var(--u));
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lg-dot {
  flex: none;
  width: calc(8 * var(--u));
  height: calc(8 * var(--u));
  border-radius: 999px;
  background: var(--zinc-3);
  transition: background 300ms var(--ease-move);
}

.ok > .lg-dot {
  background: var(--green-4);
}

.fail > .lg-dot {
  background: var(--red-4);
}

.lg-step-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
  font-size: calc(16 * var(--u));
  color: var(--muted);
}

.lg-step-icon img {
  width: 100%;
  height: 100%;
}

.lg-main {
  flex: 1;
  min-width: 0;
  padding: calc(16 * var(--u)) calc(18 * var(--u));
}

.lg-job-title {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-size: calc(17 * var(--u));
  font-weight: 600;
}

.lg-job-title img,
.lg-job-title .icon {
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
}

.lg-tabs {
  display: flex;
  gap: calc(4 * var(--u));
  margin: calc(14 * var(--u)) calc(-18 * var(--u)) 0;
  padding: 0 calc(10 * var(--u));
  border-bottom: 1px solid var(--border);
}

.lg-tabs span {
  padding: calc(10 * var(--u)) calc(10 * var(--u));
  color: var(--muted);
}

.lg-tabs span.on {
  color: var(--ink);
  box-shadow: inset 0 calc(-2 * var(--u)) 0 var(--ink);
}

.lg-h {
  margin-top: calc(18 * var(--u));
  font-size: calc(16 * var(--u));
  font-weight: 600;
}

.lg-kv {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: calc(10 * var(--u));
}

.lg-kv small {
  display: block;
  font-size: calc(12 * var(--u));
  color: var(--muted);
}

.lg-kv b {
  display: block;
  margin-top: calc(4 * var(--u));
  font-weight: 500;
}

.lg-kv b.ok {
  color: var(--green-4);
  font-weight: 600;
}

.lg-kv b.fail {
  color: var(--red-4);
  font-weight: 600;
}

/* A failed job's error, with the button that asks Chat about it. */
.lg-error {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  margin-top: calc(14 * var(--u));
  padding: calc(12 * var(--u)) calc(12 * var(--u)) calc(12 * var(--u)) calc(14 * var(--u));
  border: 1px solid var(--red-2);
  border-radius: calc(8 * var(--u));
  background: var(--red-1);
}

.lg-error b {
  flex: 1;
  font-weight: 600;
}

/* Execution logs: time, then chips and the message. */
.lg-log {
  display: grid;
  grid-template-columns: calc(100 * var(--u)) 1fr;
  gap: calc(12 * var(--u));
  margin-top: calc(10 * var(--u));
  padding-top: calc(10 * var(--u));
  border-top: 1px solid var(--border);
  font-size: calc(13 * var(--u));
}

.lg-log time {
  font-variant-numeric: tabular-nums;
}

.lg-chips {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
}

.lg-chip {
  padding: calc(1 * var(--u)) calc(7 * var(--u));
  border-radius: 999px;
  background: var(--zinc-1);
  box-shadow: inset 0 0 0 1px var(--zinc-2);
  font-size: calc(12 * var(--u));
  font-weight: 500;
  color: var(--muted);
}

.lg-chip.info {
  background: var(--blue-1);
  box-shadow: inset 0 0 0 1px var(--blue-2);
  color: var(--blue-4);
}

.lg-chip.ai {
  background: var(--purple-1);
  box-shadow: inset 0 0 0 1px var(--purple-2);
  color: var(--purple-4);
}

/* Input & output: one labelled value per row. */
.lg-io {
  display: grid;
  grid-template-columns: calc(110 * var(--u)) 1fr;
  gap: calc(12 * var(--u));
  padding: calc(10 * var(--u)) 0;
  border-bottom: 1px solid var(--border);
}

.lg-io small {
  font-size: calc(12 * var(--u));
  color: var(--muted);
  padding-top: calc(2 * var(--u));
}

.flash.text.show {
  animation: flash-text 650ms var(--ease-enter);
}

@keyframes flash-text {
  0% {
    opacity: 1;
    transform: translateX(-50%) scale(0.9);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.1);
  }
}

/* ============================================================================
   App shell kit (`app-`): the web app's window and main menu, for scenes about
   where things live. Sizes are the app's pixels times --u, like `rc-` and `lg-`.
   Sources: apps/web-app/src/features/main-navigation (Chat, Library, Activity,
   Integrations) and app/layouts/activity-layout.tsx (the Runs and Events tabs).
     <div class="app-window" style="--u: 1.6px; left: …">
       <nav class="app-side"> .app-brand, .app-nav of .app-item (.active), .app-user </nav>
       <div class="app-page"> .app-view (one per page shown) with .app-page-head </div>
     </div>
   ============================================================================ */

.app-window {
  --u: 1.6px;
  position: absolute;
  display: flex;
  border: 1px solid var(--border);
  border-radius: calc(12 * var(--u));
  background: var(--white);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  font-size: calc(14 * var(--u));
  line-height: 1.3;
  overflow: hidden;
  transition:
    opacity 600ms var(--ease-move),
    transform 800ms var(--ease-enter);
}

.app-side {
  flex: none;
  display: flex;
  flex-direction: column;
  width: calc(200 * var(--u));
  padding: calc(12 * var(--u)) calc(8 * var(--u));
  border-right: 1px solid var(--border);
}

.app-brand {
  display: flex;
  align-items: center;
  height: calc(30 * var(--u));
  padding: 0 calc(8 * var(--u));
  margin-bottom: calc(14 * var(--u));
}

.app-brand img {
  height: calc(20 * var(--u));
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: calc(2 * var(--u));
  border-radius: calc(10 * var(--u));
  transition: box-shadow 400ms var(--ease-move);
}

.app-nav.ring {
  box-shadow: 0 0 0 calc(4 * var(--u)) var(--white), 0 0 0 calc(6 * var(--u)) var(--ocean);
}

.app-item {
  display: flex;
  align-items: center;
  gap: calc(9 * var(--u));
  height: calc(30 * var(--u));
  padding: 0 calc(8 * var(--u));
  border-radius: calc(8 * var(--u));
  white-space: nowrap;
  transition:
    background 400ms var(--ease-move),
    box-shadow 400ms var(--ease-move);
}

.app-item.ring {
  box-shadow: 0 0 0 calc(2 * var(--u)) var(--ocean);
}

.app-item .icon {
  font-size: calc(15 * var(--u));
  color: var(--muted);
}

.app-item.active {
  background: var(--hover);
  font-weight: 500;
}

.app-item.active .icon {
  color: var(--ink);
}

.app-user {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  margin-top: auto;
  padding: calc(6 * var(--u));
}

.app-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: calc(28 * var(--u));
  height: calc(28 * var(--u));
  border-radius: 999px;
  background: var(--zinc-1);
  color: var(--muted);
  font-size: calc(14 * var(--u));
}

.app-user b {
  display: block;
  font-size: calc(13 * var(--u));
  font-weight: 600;
}

.app-user small {
  display: block;
  font-size: calc(12 * var(--u));
  color: var(--muted);
}

.app-page {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* One page in the window. Several can share .app-page and swap on beats. */
.app-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(14 * var(--u)) calc(22 * var(--u));
}

.app-page-head {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  min-height: calc(40 * var(--u));
  margin-bottom: calc(12 * var(--u));
}

.app-title {
  font-size: calc(22 * var(--u));
  font-weight: 500;
  letter-spacing: -0.01em;
}

.app-title.lit {
  color: var(--blue-4);
}

.app-crumb {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  font-size: calc(14 * var(--u));
  color: var(--muted);
}

.app-crumb b {
  font-weight: 500;
  color: var(--ink);
}

.app-tabs {
  display: inline-flex;
  gap: calc(2 * var(--u));
  margin-left: auto;
  padding: calc(3 * var(--u));
  border-radius: calc(9 * var(--u));
  background: var(--zinc-1);
}

.app-tab {
  padding: calc(4 * var(--u)) calc(12 * var(--u));
  border-radius: calc(7 * var(--u));
  font-weight: 500;
  color: var(--muted);
  transition:
    background 300ms var(--ease-move),
    color 300ms var(--ease-move),
    box-shadow 300ms var(--ease-move);
}

.app-tab.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.app-tab.ring {
  box-shadow: 0 0 0 calc(2 * var(--u)) var(--ocean);
}

/* List and table rows on a page. Set grid columns inline for tables. */
.app-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: calc(10 * var(--u));
  min-height: calc(46 * var(--u));
  padding: 0 calc(8 * var(--u));
  border-top: 1px solid var(--border);
  white-space: nowrap;
  transition:
    background 400ms var(--ease-move),
    opacity 600ms var(--ease-move),
    transform 800ms var(--ease-enter);
}

.app-row > * {
  min-width: 0;
}

.app-row.app-th {
  min-height: calc(34 * var(--u));
  border-top: 0;
  font-size: calc(13 * var(--u));
  font-weight: 500;
  color: var(--muted);
}

.app-row.lit {
  border-radius: calc(8 * var(--u));
  background: var(--hover);
}

.app-row small {
  font-size: calc(13 * var(--u));
  color: var(--muted);
}

.app-cell {
  display: flex;
  align-items: center;
  gap: calc(9 * var(--u));
}

.app-ic {
  display: grid;
  flex: none;
  place-items: center;
  width: calc(28 * var(--u));
  height: calc(28 * var(--u));
  border-radius: calc(7 * var(--u));
  background: var(--zinc-1);
  color: var(--muted);
  font-size: calc(15 * var(--u));
}

img.app-ic {
  background: none;
}

.app-ic.knowledge {
  background: var(--amber-1);
  color: var(--amber-4);
}

.app-ic.workflow {
  background: var(--blue-1);
  color: var(--blue-4);
}

/* The run toolbar's Logs button, marked while the narration names it. */
.rc-ghost.lit {
  background: var(--blue-1);
  box-shadow: inset 0 0 0 calc(1.5 * var(--u)) var(--blue-2);
}


.scene .flex-fill {
  flex: 1;
}

.scene .self-center {
  align-self: center;
}

.scene.canvas-unit-120,
.scene .canvas-unit-120 {
  --u: 1.2px;
}

.scene .canvas-unit-130 {
  --u: 1.3px;
}

.scene .relative-position {
  position: relative;
}

.scene .layout-fill {
  inset: 0;
}

.scene .canvas-unit-110 {
  --u: 1.1px;
}

/* A recording of the app, played silently on the narration clock
   (`<video class="recording-video" data-sync="…">`). */
.scene.recording {
  background: #fff;
}
.recording-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
