/* eightball control plane.
   Palette roles follow the house data-viz reference: status colours are
   reserved and always ship with an icon + label, meter tracks are a lighter
   step of the fill's own ramp, and text never wears a data colour. */

:root {
  color-scheme: light;

  --page:        #f9f9f7;
  --surface:     #fcfcfb;
  --surface-2:   #f2f1ed;
  --ink:         #0b0b0b;
  --ink-2:       #52514e;
  --muted:       #898781;
  --grid:        #e1e0d9;
  --border:      rgba(11, 11, 11, 0.10);

  --accent:      #2a78d6;
  --accent-soft: #cde2fb;   /* meter track: lighter step, same ramp */
  --accent-ink:  #ffffff;

  --good:        #0ca30c;
  --warning:     #fab219;
  --serious:     #ec835a;
  --critical:    #d03b3b;

  --radius:      12px;
  --radius-sm:   8px;
  --gap:         20px;
  --shadow:      0 1px 2px rgba(11,11,11,.05), 0 8px 24px rgba(11,11,11,.04);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page:        #0d0d0d;
    --surface:     #1a1a19;
    --surface-2:   #232322;
    --ink:         #ffffff;
    --ink-2:       #c3c2b7;
    --muted:       #898781;
    --grid:        #2c2c2a;
    --border:      rgba(255, 255, 255, 0.10);
    --accent:      #3987e5;
    --accent-soft: #184f95;
    --accent-ink:  #ffffff;
    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page:        #0d0d0d;
  --surface:     #1a1a19;
  --surface-2:   #232322;
  --ink:         #ffffff;
  --ink-2:       #c3c2b7;
  --muted:       #898781;
  --grid:        #2c2c2a;
  --border:      rgba(255, 255, 255, 0.10);
  --accent:      #3987e5;
  --accent-soft: #184f95;
  --accent-ink:  #ffffff;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}

.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }

.mark {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--page);
  font-size: 14px; font-weight: 700;
  align-self: center;
}

.name { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.sub  { font-size: 13px; color: var(--muted); white-space: nowrap; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-2); width: 32px; height: 32px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 15px; line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); }

/* Status chips always pair a glyph with a word — colour never carries meaning alone. */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 550; white-space: nowrap;
  border: 1px solid var(--border); color: var(--ink-2);
  background: var(--surface-2);
}
.chip-icon { font-size: 10px; line-height: 1; }
.chip-good     .chip-icon, .chip-good     { color: var(--good); }
.chip-warning  .chip-icon, .chip-warning  { color: var(--warning); }
.chip-critical .chip-icon, .chip-critical { color: var(--critical); }
.chip-accent   .chip-icon, .chip-accent   { color: var(--accent); }
.chip-muted    { color: var(--muted); }

/* ------------------------------------------------------------------ kpis */

.kpis {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: var(--gap) 24px 0;
}

.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}

.tile-label { font-size: 12px; color: var(--muted); }
.tile-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
/* Hero figure: exactly one per view. Proportional figures, not tabular. */
.tile-hero .tile-value.hero { font-size: 50px; line-height: 1.05; font-weight: 620; }
.tile-hero { grid-row: span 1; justify-content: space-between; }

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

.layout {
  display: grid; gap: var(--gap);
  grid-template-columns: 360px minmax(0, 1fr);
  padding: var(--gap) 24px 40px;
  align-items: start;
}
.column { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.panel-title { margin-bottom: 14px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; }
.panel-meta { font-size: 12px; color: var(--muted); }
.composer { position: sticky; top: 76px; }

/* ----------------------------------------------------------------- form */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 12px; }

.field-label {
  font-size: 12px; font-weight: 550; color: var(--ink-2);
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.field-value { font-size: 12px; color: var(--muted); font-weight: 450; }
.field-hint { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

textarea, input[type="number"], select {
  width: 100%; font: inherit; font-size: 14px;
  color: var(--ink); background: var(--page);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; resize: vertical;
}
textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent;
}

.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }

.ghost-btn {
  border: 1px solid var(--border); background: var(--page); color: var(--ink-2);
  border-radius: var(--radius-sm); padding: 0 12px; font: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.ghost-btn:hover { background: var(--surface-2); }

input[type="range"] { width: 100%; accent-color: var(--accent); }

.primary-btn {
  width: 100%; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 11px; cursor: pointer;
}
.primary-btn:hover { filter: brightness(1.07); }
.primary-btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }

.form-error {
  margin: 10px 0 0; font-size: 12.5px; color: var(--critical);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow: auto;
}

/* ------------------------------------------------------------------ gpus */

.gpu-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.gpu-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 14px; background: var(--page);
  display: flex; flex-direction: column; gap: 10px;
}
.gpu-card.offline { opacity: .62; }

.gpu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gpu-id { font-size: 13px; font-weight: 620; }
.gpu-model { font-size: 11.5px; color: var(--muted); }

.meter { display: flex; flex-direction: column; gap: 4px; }
.meter-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11.5px; color: var(--ink-2);
}
.meter-val { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Track is a lighter step of the fill's own ramp; fill takes severity. */
.meter-track {
  height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden;
}
.meter-fill {
  height: 100%; background: var(--accent);
  border-radius: 0 4px 4px 0;      /* rounded data-end, square at the baseline */
  transition: width .45s ease;
  min-width: 2px;
}
.meter-fill.warning  { background: var(--warning); }
.meter-fill.critical { background: var(--critical); }

.gpu-foot {
  display: flex; gap: 12px; font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.gpu-job {
  border-top: 1px solid var(--grid); padding-top: 9px;
  display: flex; flex-direction: column; gap: 6px;
}
.gpu-job-prompt {
  font-size: 12px; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------------------ jobs */

.job-list { display: flex; flex-direction: column; gap: 12px; }

.job {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; background: var(--page);
}
@media (max-width: 620px) { .job { grid-template-columns: minmax(0, 1fr); } }

.job-media {
  background: var(--surface-2); border-radius: var(--radius-sm);
  aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden;
}
.job-media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.job-media-empty { font-size: 11.5px; color: var(--muted); }

.job-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.job-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.job-prompt { font-size: 13px; color: var(--ink); line-height: 1.45; }

.job-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

.empty {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 28px 0;
}

/* ----------------------------------------------------------------- agent */

.agent-log {
  max-height: 420px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 12px;
}

.agent-turn { display: flex; flex-direction: column; gap: 6px; }
.agent-turn.user { align-items: flex-end; }

.agent-bubble {
  max-width: 88%; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.agent-turn.user .agent-bubble { background: var(--accent); color: var(--accent-ink); }
.agent-turn.assistant .agent-bubble {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink);
}

/* Thinking is context, not the answer — recede it. */
.agent-think {
  font-size: 12px; color: var(--muted); font-style: italic;
  border-left: 2px solid var(--grid); padding-left: 10px;
  white-space: pre-wrap; max-height: 130px; overflow-y: auto;
}

.agent-tool {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--ink-2);
  background: var(--page); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 9px; align-self: flex-start;
}
.agent-tool .chip-icon { font-size: 10px; }
.agent-tool.ok   .chip-icon { color: var(--good); }
.agent-tool.err  .chip-icon { color: var(--critical); }
.agent-tool.run  .chip-icon { color: var(--accent); }
.agent-tool code { font-size: 11px; color: var(--ink); }

.agent-input { display: flex; gap: 8px; align-items: flex-end; }
.agent-input textarea { flex: 1; }
.agent-input .primary-btn { width: auto; padding: 9px 18px; }

/* ---------------------------------------------------------------- editor */

.tl-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.tl-fade {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-2);
}
.tl-fade input[type="range"] { width: 110px; }
.primary-btn.tl-render { width: auto; padding: 8px 16px; margin-left: auto; }

.tl-status {
  margin: 0 0 12px; font-size: 12.5px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto;
}
.tl-status.err { color: var(--critical); }

.tl-output { margin-bottom: 14px; }
.tl-output video {
  width: 100%; border-radius: var(--radius-sm); background: #000; display: block;
}

.tl-list { display: flex; flex-direction: column; gap: 6px; }

.tl-clip {
  display: grid; grid-template-columns: 30px minmax(0,1fr) auto auto;
  align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 10px; background: var(--page);
}
.tl-idx {
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
  text-align: right;
}
.tl-label {
  font-size: 12.5px; color: var(--ink); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.tl-times {
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tl-actions { display: flex; gap: 4px; }
.tl-btn {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-2); border-radius: 6px; width: 24px; height: 24px;
  font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}
.tl-btn:hover { background: var(--surface-2); }
.tl-btn.danger:hover { color: var(--critical); }

/* ------------------------------------------------------------- production */

.panel-select {
  font: inherit; font-size: 12px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 8px; max-width: 260px;
}

.prod-start { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.prod-start textarea {
  font: inherit; font-size: 13px; line-height: 1.5; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; resize: vertical;
}
.prod-start-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.prod-start-row .primary-btn { margin-left: auto; }

.inline-field {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.inline-field input[type="number"] { width: 68px; }
.inline-field input[type="range"] { width: 96px; }
.inline-field input, .inline-field select {
  font: inherit; font-size: 12px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 8px;
}
.inline-field .unit { color: var(--muted); }
.inline-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}

.prod-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.prod-head-right { display: flex; align-items: center; gap: 8px; flex: none; }
.prod-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.prod-logline { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-top: 3px; }

/* Stage rail: a horizontal spine so the eye lands on where the film is now. */
.prod-rail {
  display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none;
  margin: 0 0 14px; padding: 0;
}
.prod-step {
  display: flex; align-items: center; gap: 6px; flex: 1 1 auto;
  font-size: 11px; color: var(--muted); white-space: nowrap; padding-right: 10px;
  position: relative;
}
.prod-step .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--grid); box-shadow: 0 0 0 3px var(--surface);
}
.prod-step::after {
  content: ""; position: absolute; left: 8px; right: 0; top: 4px; height: 1px;
  background: var(--grid); z-index: -1;
}
.prod-step:last-child::after { display: none; }
.prod-step.done { color: var(--ink-2); }
.prod-step.done .dot { background: var(--good); }
.prod-step.active { color: var(--accent); font-weight: 600; }
.prod-step.active .dot {
  background: var(--accent);
  animation: prod-pulse 1.4s ease-in-out infinite;
}
@keyframes prod-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--surface); }
  50%      { box-shadow: 0 0 0 5px var(--accent-soft); }
}
@media (prefers-reduced-motion: reduce) { .prod-step.active .dot { animation: none; } }

/* Cast strip: the film's fixed identities, which is what the operator checks
   first when a character looks wrong three shots in. */
.prod-cast {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.prod-cast:empty { display: none; }
.asset {
  margin: 0; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.asset img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.asset-empty {
  width: 100%; aspect-ratio: 16/9; display: grid; place-items: center;
  color: var(--muted); font-size: 18px; background: var(--grid);
}
.asset figcaption {
  padding: 7px 9px; display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; color: var(--ink);
}
.asset-sub { color: var(--muted); font-size: 11px; }
.asset audio { width: 100%; height: 28px; }

.prod-shots {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.prod-shots:empty { display: none; }
.shot {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px; align-items: start;
}
.shot.running { border-color: var(--accent); }
.shot.error   { border-color: var(--critical); }
.shot-thumb { position: relative; border-radius: 6px; overflow: hidden; }
.shot-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.shot-n {
  position: absolute; left: 4px; top: 4px; font-size: 10px; font-weight: 600;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(11,11,11,.68); color: #fff;
}
.shot-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.shot-beat { font-size: 12px; font-weight: 550; color: var(--ink); line-height: 1.35; }
.shot-line {
  font-size: 11.5px; color: var(--ink-2); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.shot-foot { display: flex; flex-wrap: wrap; gap: 5px; }
.meter-track.sm { height: 3px; }
.form-error.sm { font-size: 11px; }

.prod-log-wrap { font-size: 12px; color: var(--muted); }
.prod-log-wrap summary { cursor: pointer; }
.prod-log {
  margin-top: 8px; max-height: 220px; overflow: auto;
  font-size: 11px; line-height: 1.55; color: var(--ink-2);
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px;
  white-space: pre-wrap; word-break: break-word;
}

/* ---------------------------------------------------------------- the mix */

.tl-mix {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tl-clip.muted .tl-label { color: var(--muted); text-decoration: line-through; }

/* ------------------------------------------------------- phone / portrait

   The desktop layout is two columns with a sticky composer rail. On a phone
   that rail is most of the screen, so below 760px everything becomes one
   column, sticky positioning is dropped (a sticky header plus a sticky rail
   leaves almost no room to read), and the media-heavy grids collapse.

   Safe-area insets keep content clear of a notch and the home indicator when
   the page is opened from a phone home screen. */

@media (max-width: 760px) {
  .topbar {
    position: static;
    padding: 11px max(14px, env(safe-area-inset-left)) 11px max(14px, env(safe-area-inset-right));
    gap: 10px;
  }
  .brand .sub { display: none; }          /* the wordmark alone identifies it */

  .kpis, .layout {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px; padding-top: 14px;
  }
  /* The headline number keeps a full row; the rest pair up. */
  .tile-hero { grid-column: 1 / -1; }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px; padding-top: 14px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  .composer { position: static; }
  .panel { padding: 14px; }

  .gpu-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .prod-cast  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod-shots { grid-template-columns: minmax(0, 1fr); }
  .job        { grid-template-columns: minmax(0, 1fr); }

  /* Full-width controls: a 44px-tall target is the minimum that reliably
     survives a thumb. */
  .prod-start-row { gap: 10px; }
  .prod-start-row .inline-field { flex: 1 1 auto; }
  .prod-start-row .primary-btn { margin-left: 0; width: 100%; order: 99; }
  .primary-btn, .ghost-btn, .tl-btn { min-height: 40px; }
  .tl-btn { min-width: 40px; }
  .primary-btn.tl-render { width: 100%; margin-left: 0; }

  .tl-bar, .tl-mix { flex-direction: column; align-items: stretch; gap: 10px; }
  .tl-fade, .inline-field { justify-content: space-between; }
  .tl-fade input[type="range"], .inline-field input[type="range"] { flex: 1; width: auto; }

  .tl-clip { flex-wrap: wrap; }
  .agent-log { max-height: 300px; }
  .agent-input { flex-direction: column; align-items: stretch; }
  .agent-input .primary-btn { width: 100%; }

  .prod-rail { gap: 6px 0; }
  .prod-step { flex: 0 0 auto; padding-right: 12px; }
  .prod-step::after { display: none; }   /* the spine reads as noise when wrapped */
}

/* Below ~420px even two KPI columns are cramped, and a 16:9 thumbnail beside
   text leaves neither enough room. */
@media (max-width: 420px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gpu-grid { grid-template-columns: minmax(0, 1fr); }
  .shot { grid-template-columns: 68px minmax(0, 1fr); }
  .tile-value.hero { font-size: 34px; }
}

/* Portrait, at any width: media is the thing that has to fit. A 16:9 player on
   a tall narrow screen should keep its shape rather than crop or overflow. */
@media (orientation: portrait) {
  .tl-output video, .prod-cast video, #prod-video, #tl-video {
    width: 100%; height: auto; max-height: 60vh; object-fit: contain;
  }
  .job-media { max-height: 46vh; }
}

/* A rendered vertical clip drives the players portrait-shaped, so a Shorts cut
   is previewed as a Short rather than letterboxed into a 16:9 box. */
:root[data-aspect="portrait"] .tl-output video,
:root[data-aspect="portrait"] #prod-video {
  aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto; display: block;
}

video, img, audio { max-width: 100%; }
