/* Understudy v2: Replay's layout and materials 1:1 (agent-arena-proto/app-site/site.css), cut down to one flow. */

:root {
  --ink-0: #07090c;
  --ink-1: #0d1014;
  --ink-2: #14181e;
  --term: #06080a;
  --white: 240, 236, 228;
  --text: rgb(var(--white));
  --text-2: rgba(var(--white), 0.62);
  --text-3: rgba(var(--white), 0.4);
  --hair: rgba(255, 255, 255, 0.1);
  --amber: 222, 172, 82;
  --accent: rgb(var(--amber));
  --accent-hi: #f1cf8a;
  --ok: #8fd3a6;
  --no: #ec8a7e;
  --material: rgba(16, 19, 24, 0.66);
  --frost: blur(28px) saturate(150%);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --inset: 24px;
  --r-panel: 24px; --r-card: 16px; --r-ctl: 12px;
  --serif: "Hedvig Letters Serif", "Iowan Old Style", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink-0); color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.55 var(--sans); color: var(--text); background: var(--ink-0);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}
.page { flex: 1 0 auto; width: 100%; padding-top: var(--inset); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; margin: 0 var(--inset); min-height: 86vh;
  display: flex; flex-direction: column; align-items: center;
  padding: var(--s5) var(--s5) var(--s7); border-radius: var(--r-panel) var(--r-panel) 0 0; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid var(--hair); border-bottom: 0;
  border-radius: inherit; pointer-events: none; mask-image: linear-gradient(to bottom, #000 40%, transparent 92%);
}
.hero-media { position: absolute; inset: 0; z-index: -3; overflow: hidden; background: var(--ink-1); }
.hero-img {
  position: absolute; inset: 0;
  background: url("media/hero-cine.jpg") 50% 45% / cover no-repeat;
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.035); } }
.hero-scrim {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(80% 55% at 50% 38%, rgba(7, 9, 12, 0.74), rgba(7, 9, 12, 0.12) 78%),
    linear-gradient(to bottom, rgba(7, 9, 12, 0.35), rgba(7, 9, 12, 0.1) 40%, rgba(7, 9, 12, 0.45) 78%, var(--ink-0) 100%);
}
.hero-bar { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); padding: 0 var(--s2); }
.wordmark { font: 400 20px/24px var(--serif); letter-spacing: -0.01em; }
.hero-tag { font-size: 13px; color: var(--text-2); }
.hero-copy { margin-top: clamp(var(--s7), 11vh, var(--s9)); text-align: center; }
.title {
  margin: 0 auto; max-width: 15.5em; font: 400 clamp(2rem, 0.9rem + 3.4vw, 3.75rem)/1.2 var(--serif);
  letter-spacing: -0.02em; color: #fff; text-shadow: 0 1px 24px rgba(7, 9, 12, 0.7);
}
.title em { font-style: normal; color: var(--accent-hi); }

.composer { position: relative; width: min(760px, 100%); margin-top: var(--s7); }
.bar {
  display: flex; align-items: center; gap: var(--s2); padding: var(--s2);
  border-radius: 999px; background: var(--material); -webkit-backdrop-filter: var(--frost); backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--hair), 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}
.bar:focus-within { box-shadow: inset 0 0 0 1px rgba(var(--amber), 0.55), 0 24px 60px -24px rgba(0, 0, 0, 0.8); }

/* read-only: the app picks the router from the sentence */
.route-pill {
  flex: none; display: flex; align-items: center; gap: var(--s2); min-height: 44px; min-width: 96px; padding: 0 var(--s4);
  border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--text); font: 500 14px/1 var(--sans); user-select: none;
}
.route-pill small { font: 500 10px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.route-pill.flash { animation: flash 600ms var(--ease-out); }
@keyframes flash { 0% { background: rgba(var(--amber), 0.28); } 100% { background: rgba(255, 255, 255, 0.06); } }
.robot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(var(--amber), 0.9); flex: none; }
.prompt {
  flex: 1; min-width: 0; min-height: 44px; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 400 17px/1.3 var(--sans); padding: 0 var(--s2);
}
.prompt::placeholder { color: rgba(var(--white), 0.4); }
.cta {
  flex: none; min-height: 44px; padding: 0 var(--s5); font: 600 15px/1 var(--sans); color: var(--ink-0); border: 0; border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 10px 30px -10px rgba(var(--amber), 0.6);
  cursor: pointer; transition: transform 180ms var(--ease-out), filter 180ms ease;
}
.cta:active { transform: scale(0.97); filter: brightness(0.94); }
.cta:disabled { cursor: progress; filter: saturate(0.6) brightness(0.8); }
.route-line {
  margin: var(--s3) 0 0; min-height: 18px; text-align: center; font: 400 12.5px/1.45 var(--mono); color: var(--text-2);
  text-shadow: 0 1px 12px rgba(7, 9, 12, 0.9);
}
.route-line b { font-weight: 500; color: var(--accent-hi); }
.route-line.is-no { color: var(--no); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin-top: var(--s4); }
.chip {
  min-height: 34px; padding: 0 var(--s4); border-radius: 999px; border: 0; cursor: pointer;
  font: 500 13px/1 var(--sans); color: var(--text-2); background: rgba(16, 19, 24, 0.5); box-shadow: inset 0 0 0 1px var(--hair);
}
.chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--amber), 0.5); }

/* ---------- Run ---------- */
.fleet { margin: var(--s4) var(--inset) 0; padding: var(--s7) clamp(var(--s4), 3vw, var(--s7)) var(--s8); border-radius: var(--r-panel); background: var(--ink-1); box-shadow: inset 0 0 0 1px var(--hair); }
.fleet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); max-width: 1280px; margin: 0 auto; flex-wrap: wrap; }
.fleet-head h2 { margin: 0; font: 400 26px/1.2 var(--serif); letter-spacing: -0.015em; }

/* run time: the one stat card left, compact */
.stats { display: flex; margin-left: var(--s2); }
.stats div { display: flex; align-items: baseline; gap: 8px; background: var(--ink-2); border-radius: 12px; padding: 7px 12px; box-shadow: inset 0 0 0 1px var(--hair); }
.stats b { font: 400 20px/1 var(--serif); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 3.2ch; }
.stats span { font: 500 12px/1 var(--sans); color: var(--text-3); }

/* scenario tiles */
.grid { max-width: 1280px; margin: var(--s4) auto 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); }
.tile {
  position: relative; aspect-ratio: 1; border-radius: var(--r-card); overflow: hidden; background: var(--term);
  box-shadow: inset 0 0 0 1px var(--hair); animation: rise 450ms var(--ease-out); transition: box-shadow 200ms ease, transform 200ms var(--ease-out);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 600ms ease; }
.tile.is-film { cursor: pointer; }
.tile.is-film video { opacity: 1; }
.tile.is-film:hover { box-shadow: inset 0 0 0 1px rgba(var(--amber), 0.55); transform: translateY(-2px); }
.tile.is-no { opacity: 0.6; }
.tile-state { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; padding: var(--s3); text-align: center; transition: opacity 400ms ease; }
.tile.is-film .tile-state { opacity: 0; pointer-events: none; }
.tile-state small { font: 400 11px/1.35 var(--mono); color: var(--text-3); max-width: 90%; }
.tile-id { position: absolute; left: 12px; top: 10px; font: 500 11px/16px var(--mono); color: var(--text-3); letter-spacing: 0.04em; z-index: 1; }
.tile.is-film .tile-id { color: rgba(var(--white), 0.75); text-shadow: 0 1px 2px #000; }
.tile-cap {
  position: absolute; left: 10px; bottom: 10px; display: none; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 9px;
  background: rgba(7, 9, 12, 0.78); font: 500 11px/1 var(--mono); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(143, 211, 166, 0.35);
}
.tile-cap.miss { color: var(--no); box-shadow: inset 0 0 0 1px rgba(236, 138, 126, 0.35); }
.tile.is-film .tile-cap { display: inline-flex; }
/* instant MuJoCo preview (scripted motion): neutral caption, and the run's status pill stays visible top right */
.tile.is-preview .tile-cap { color: var(--text-2); box-shadow: inset 0 0 0 1px var(--hair); }
.tile canvas.tile-sim { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tile.is-film.is-preview .tile-state { opacity: 1; inset: 8px 8px auto auto; padding: 0; display: block; }
.tile.is-preview .tile-state small { display: none; }
.tile.is-preview .tile-state .status { background: rgba(7, 9, 12, 0.72); }
.tile.is-film.is-preview { cursor: default; }
.tile.is-film.is-preview:hover { transform: none; box-shadow: inset 0 0 0 1px var(--hair); }

.status {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font: 600 11px/16px var(--sans); color: var(--accent-hi); background: rgba(var(--amber), 0.12); white-space: nowrap;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
.status.ok { color: var(--ok); background: rgba(143, 211, 166, 0.12); }
.status.ok i, .status.no i { animation: none; }
.status.no { color: var(--no); background: rgba(236, 138, 126, 0.12); }
.status.wait { color: var(--text-2); background: rgba(255, 255, 255, 0.06); }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---------- One animation, full size ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--s5); }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 5, 7, 0.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 250ms ease; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel { position: relative; width: min(1200px, 100%); animation: rise 350ms var(--ease-out); }
.sheet-panel video { display: block; width: 100%; max-height: calc(100vh - 96px); object-fit: contain; border-radius: var(--r-panel); background: #000; box-shadow: inset 0 0 0 1px var(--hair), 0 40px 120px -30px #000; }
.close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(7, 9, 12, 0.7); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.close svg { width: 14px; height: 14px; }

.foot { padding: var(--s6) var(--inset); text-align: center; font-size: 12px; color: var(--text-3); }
.foot p { margin: 0; }

@media (max-width: 560px) {
  :root { --inset: 12px; }
  .hero { padding: var(--s4) var(--s4) var(--s7); }
  .bar { border-radius: var(--r-card); flex-wrap: wrap; }
  .prompt { flex-basis: 100%; order: 3; }
  .cta { margin-left: auto; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
  .fleet { padding: var(--s5) var(--s3) var(--s6); }
  .fleet-head h2 { font-size: 22px; }
  .sheet { padding: var(--s3); }
}
@media (prefers-reduced-motion: reduce) { .hero-img { animation: none; } * { animation-duration: 1ms !important; } }

/* Live toggle (Fast router) and the per-router VLA row */
.route-row { display: flex; align-items: center; justify-content: center; gap: var(--s3); margin-top: var(--s3); flex-wrap: wrap; }
.route-row .route-line { margin: 0; }
.live {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  font: 500 10.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
  background: rgba(16, 19, 24, 0.5); box-shadow: inset 0 0 0 1px var(--hair);
}
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.live[aria-pressed="true"] { color: var(--accent-hi); box-shadow: inset 0 0 0 1px rgba(var(--amber), 0.55); }
.live[aria-pressed="true"]::before { background: var(--accent); box-shadow: 0 0 8px rgba(var(--amber), 0.9); }
/* one row per prompt (data/three-prompts.json): prompt, its auto-route, cost, SmolVLA score, films */
.run-title { display: flex; align-items: center; gap: var(--s3); min-width: 0; flex-wrap: wrap; }
.route-pill.sm { height: 22px; min-height: 0; min-width: 0; padding: 0 9px 0 7px; font: 500 11px/1 var(--sans); gap: 6px; }
.route-pill.sm .robot-dot { width: 6px; height: 6px; }
.prow { max-width: 1280px; margin: var(--s7) auto 0; padding-top: var(--s5); border-top: 1px solid var(--hair); }
.prow-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.prow-head h3 { margin: 0; font: 400 20px/1.25 var(--serif); letter-spacing: -0.01em; }
.prow-meta { margin: 0; font: 400 12.5px/1.4 var(--mono); color: var(--text-2); }
.prow-meta b { font-weight: 500; color: var(--accent-hi); }
.prow .grid { margin-top: var(--s3); }
.prow-empty { margin: var(--s3) 0 0; font: 400 12px/1.4 var(--mono); color: var(--text-3); }

/* one prompt, one result: rejected clips and extra films stay out of sight */
.tile.is-no { display: none; }

/* library like Replay: every prompt keeps its tile; tiles sit side by side and wrap */
#grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
#grid .tile { aspect-ratio: 16 / 10; }
.tile .tile-id { display: flex; align-items: center; gap: 8px; max-width: calc(100% - 20px); z-index: 2; }
.tile .tile-title { font: 500 13px/20px Inter, system-ui, sans-serif; color: var(--text); text-shadow: 0 1px 8px rgba(0,0,0,.7);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; text-transform: none; }
.route-pill.xs { height: 20px; min-height: 0; min-width: 0; padding: 0 8px 0 6px; font: 500 11px/1 var(--sans); gap: 5px; flex: none; }
.route-pill.xs .robot-dot { width: 6px; height: 6px; }

/* GPU for SmolVLA training (replaces the run status line) */
.gpu { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gpu-label { font: 500 10.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.gpu-seg { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); }
.gpu-seg button {
  height: 24px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  font: 500 11.5px/1 var(--sans); color: var(--text-2); background: transparent; transition: background 150ms ease, color 150ms ease;
}
.gpu-seg button:hover { color: var(--text); }
.gpu-seg button[aria-checked="true"] { color: var(--ink-0); background: linear-gradient(180deg, var(--accent-hi), var(--accent)); }
.gpu-hint { font: 400 11.5px/1 var(--mono); color: var(--text-2); white-space: nowrap; }

/* running-job label, only while a job runs */
.tile-run {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; max-width: calc(100% - 20px); padding: 4px 8px; border-radius: 8px;
  background: rgba(7, 9, 12, 0.72); font: 400 10.5px/1.2 var(--mono); color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* overview sheet: film left, the VLA's training timeline right */
.sheet-panel.ov {
  width: min(1320px, 100%); max-height: calc(100vh - 48px); display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  border-radius: var(--r-panel); overflow: hidden; background: var(--ink-1); box-shadow: inset 0 0 0 1px var(--hair), 0 40px 120px -30px #000;
}
.ov-film { background: #000; display: grid; place-items: center; min-height: 0; }
.sheet-panel.ov video { width: 100%; height: 100%; max-height: calc(100vh - 48px); border-radius: 0; box-shadow: none; object-fit: contain; }
.ov-side { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: var(--s6) var(--s5) var(--s5); }
.ov-h { margin: 0 0 var(--s5); font: 400 20px/1.25 var(--serif); letter-spacing: -0.01em; padding-right: 40px; }
.ov-steps { list-style: none; margin: 0; padding: 0; }
.ov-steps li { position: relative; padding: 0 0 var(--s4) 22px; }
.ov-steps li::before { content: ""; position: absolute; left: 0; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(var(--amber), 0.6); }
.ov-steps li::after { content: ""; position: absolute; left: 3.5px; top: 16px; bottom: 2px; width: 1px; background: var(--hair); }
.ov-steps li:last-child { padding-bottom: 0; }
.ov-steps li:last-child::after { display: none; }
.ov-k { display: block; font: 500 10.5px/16px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.ov-v { margin: 2px 0 0; font: 400 14px/1.45 var(--sans); color: var(--text); }
.ov-v b { font-weight: 600; color: var(--accent-hi); }
.ov-v q { font: 400 16px/1.35 var(--serif); quotes: "\201C" "\201D"; }
.ov-s { margin: 2px 0 0; font: 400 11.5px/1.45 var(--mono); color: var(--text-2); }
.ov-score { font: 400 26px/1.1 var(--serif) !important; }
.ov-pending { color: var(--text-2); }
.ov-dl { margin-top: var(--s5); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; align-self: stretch; }
.ov-dl small { font: 500 11px/1 var(--mono); opacity: 0.7; }
.ov-dl[aria-disabled="true"] { cursor: not-allowed; filter: saturate(0.3) brightness(0.6); box-shadow: none; }
/* gallery of every Runway clip for the task, full width under the film and timeline; the panel scrolls to it */
.sheet-panel.ov:has(.ov-gallery:not([hidden])) { overflow-y: auto; overscroll-behavior: contain; grid-template-rows: auto auto; }
.sheet-panel.ov:has(.ov-gallery:not([hidden])) .ov-film { max-height: calc(100vh - 48px); }
.ov-jump { margin-top: var(--s3); align-self: center; font: 500 11.5px/1.4 var(--mono); color: var(--text-2); text-decoration: none; }
.ov-jump:hover { color: var(--accent-hi); }
.ov-gallery { grid-column: 1 / -1; padding: var(--s6) var(--s5) var(--s5); border-top: 1px solid var(--hair); }
.ov-gh { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.ov-gh .ov-h { margin: 0; padding-right: 0; }
.ov-gsum { margin: 0; font: 400 11.5px/1.45 var(--mono); color: var(--text-2); }
.ov-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.ov-clip { min-width: 0; }
.sheet-panel.ov .ov-clip video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-ctl); background: var(--term); box-shadow: inset 0 0 0 1px var(--hair); max-height: none; }
.ov-clip p { margin: 6px 0 0; font: 400 11px/1.4 var(--mono); color: var(--text-2); overflow-wrap: anywhere; }
.ov-clip p b { font-weight: 500; color: var(--text); }
.ov-clip .ov-vd { display: inline-block; margin-right: 6px; font-weight: 500; }
.ov-vd.is-ok { color: var(--ok); }
.ov-vd.is-no { color: var(--no); }
.ov-clip .ov-why { color: var(--text-3); }
@media (max-width: 860px) {
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .ov-gallery { padding: var(--s5) var(--s4); }
  .sheet-panel.ov:has(.ov-gallery:not([hidden])) { overflow: visible; }
  .sheet-panel.ov:has(.ov-gallery:not([hidden])) .ov-film { max-height: none; }
}
@media (max-width: 860px) {
  .sheet { padding: var(--s3); align-items: start; overflow-y: auto; }
  .sheet-panel.ov { grid-template-columns: 1fr; max-height: none; overflow: visible; }
  .sheet-panel.ov video { max-height: 56vh; }
  .ov-side { overflow: visible; padding: var(--s5) var(--s4); }
  .ov-h { padding-right: 0; }
  .sheet-backdrop { position: fixed; }
}

/* route pill appears only once the user types; GPU picker lives in the prompt section */
.route-pill.is-empty { width: 0; padding: 0; margin: 0; border-width: 0; opacity: 0; overflow: hidden; }
.route-pill { transition: opacity .2s ease, width .2s ease, padding .2s ease; }
.route-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.route-row .route-line { flex: 1 1 260px; min-height: 1.2em; }
.route-row .gpu { display: flex; align-items: center; gap: 8px; }

/* bring-your-own Runway key (hosted site only) */
.key-row { display: flex; align-items: center; justify-content: center; gap: var(--s3); margin-top: var(--s3); flex-wrap: wrap; }
.key-row[hidden] { display: none; }
.key-input { width: min(320px, 100%); background: var(--ink-2); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-ctl);
  padding: 8px 12px; font: 400 13px/1.2 var(--mono); outline: none; }
.key-input:focus { border-color: rgba(var(--amber), 0.6); }
.key-row.need .key-input { border-color: var(--no); box-shadow: 0 0 0 3px rgba(236, 138, 126, 0.18); }
.key-need { display: none; }
.key-row.need .key-need { display: block; width: 100%; text-align: center; font: 500 12px/1.4 var(--sans); color: var(--no); }
.key-hint { font-size: 12px; color: var(--text-3); max-width: 46em; text-align: center; }
.key-hint a { color: var(--accent-hi); }

.stats[hidden], .route-pill[hidden] { display: none; }

/* each tile's own run time, top right */
.tile-time { position: absolute; bottom: 10px; right: 10px; z-index: 2; font: 500 12px/1 var(--mono); color: var(--text);
  background: rgba(7, 9, 12, 0.66); border: 1px solid var(--hair); border-radius: 999px; padding: 6px 10px; backdrop-filter: blur(8px); }
.tile-time::after { content: " Time"; color: var(--text-3); }
.tile-time[hidden] { display: none; }

/* a new prompt's one tile: its Runway clips play in turn with the status pill top right, then the MuJoCo preview */
.tile.is-film.is-clips .tile-state { opacity: 1; inset: 8px 8px auto auto; padding: 0; display: block; }
.tile.is-clips .tile-state small { display: none; }
.tile.is-clips .tile-state .status { background: rgba(7, 9, 12, 0.72); }
.tile.is-film.is-preview.has-clips { cursor: pointer; }
.tile-cap { max-width: calc(100% - 20px); line-height: 1.3; }
.tile:has(.tile-time:not([hidden])) .tile-cap { max-width: calc(100% - 108px); }
.tile.is-preview .tile-id, .tile.is-clips .tile-id { max-width: calc(100% - 170px); }
.tile.is-preview .tile-title, .tile.is-clips .tile-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
