/* Ciniura Operator Dashboard — shared styles
   Dark theme, monospace-friendly, single column on mobile.
   Tailwind via CDN handles the rest of the layout. */

:root {
  --bg: #0e0f12;
  --bg-elev: #16181d;
  --bg-elev-2: #1d2026;
  --border: #2a2e36;
  --text: #e6e8ec;
  --text-dim: #8a909a;
  --text-mute: #5e6470;
  --accent: #d97706;          /* warm orange — matches the chalk.cyan/yellow CLI vibe */
  --accent-soft: #d9770633;
  --good: #22c55e;
  --warn: #eab308;
  --bad: #ef4444;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }

.topbar {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.topbar .crumb {
  color: var(--text-dim);
  font-size: 13px;
}

.topbar .crumb a { color: var(--text-dim); }
.topbar .crumb a:hover { color: var(--text); }

.operator-pill {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.show-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.show-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  display: block;
  color: inherit;
}

.show-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}

.show-thumb {
  width: 100%;
  /* 9:16 was too tall for a grid view — multi-character compositions got
     their heads cropped out, and a row of 5 cards was 565px tall, making
     the page feel huge. 3:4 keeps faces visible and roughly halves card
     height. The full-portrait 9:16 still lives on the show DETAIL header. */
  aspect-ratio: 3 / 4;
  background: var(--bg-elev-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 32px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  overflow: hidden;
}

.show-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.show-meta {
  padding: 12px 14px;
}

.show-meta .name {
  font-weight: 600;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.show-meta .row {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.genre-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.genre-Romance { background: #be185d33; color: #f9a8d4; }
.genre-Thriller { background: #7c2d1233; color: #fca5a5; }
.genre-Crime { background: #44403c33; color: #d6d3d1; }
.genre-Comedy { background: #15803d33; color: #86efac; }
.genre-Sci-Fi { background: #1d4ed833; color: #93c5fd; }
.genre-Drama { background: #6d28d933; color: #c4b5fd; }
.genre-Mystery { background: #57534e33; color: #d6d3d1; }
.genre-Fantasy { background: #14532d33; color: #6ee7b7; }
.genre-Melodrama { background: #99174433; color: #f9a8d4; }

.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}

.empty h2 {
  margin: 0 0 8px;
  font-weight: 500;
  color: var(--text);
}

/* Show detail */

.show-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.show-header .thumb {
  width: 200px;
  aspect-ratio: 9 / 16;
  background: var(--bg-elev-2);
  border-radius: 8px;
  overflow: hidden;
}

.show-header .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.show-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
}

.show-header .logline {
  color: var(--text-dim);
  margin: 8px 0;
  max-width: 720px;
  font-style: italic;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab {
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  font-family: inherit;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Episode list */

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.episode-row {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.episode-row:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.episode-row .thumb {
  width: 80px;
  aspect-ratio: 9 / 16;
  background: var(--bg-elev-2);
  border-radius: 4px;
  overflow: hidden;
}

.episode-row .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-row .num {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 12px;
}

.episode-row .title {
  font-weight: 500;
  margin: 4px 0;
}

.status-pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-complete { background: #15803d55; color: var(--good); }
.status-scored { background: #ca8a0433; color: var(--warn); }
.status-raw { background: #ca8a0433; color: var(--warn); }
.status-generating { background: #1d4ed855; color: #60a5fa; }
.status-planned { background: var(--bg-elev-2); color: var(--text-mute); }

/* Character grid */

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.char-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.char-card .img {
  width: 100%;
  /* Source character ref images are 9:16 portraits. A square box with
     object-fit:cover was cropping faces at the top. 3/4 keeps the cards
     compact in the grid while showing full face + shoulders. */
  aspect-ratio: 3 / 4;
  background: var(--bg-elev-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 11px;
}

.char-card .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.char-card .meta {
  padding: 8px 10px;
}

.char-card .name {
  font-weight: 500;
  font-size: 13px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-card .ref-count {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  font-family: var(--mono);
}

.char-card .ref-count.warn { color: var(--warn); }
.char-card .ref-count.bad { color: var(--bad); }

/* Bible viewer */

.bible-pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 600px;
  overflow: auto;
}

/* Episode page */

.episode-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1100px) {
  .episode-layout { grid-template-columns: 1fr; }
}

.video-wrap {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  /* Match the script panel's max-height so the layout is symmetric and
     fits in one screen without scrolling. The video itself preserves its
     intrinsic aspect ratio inside this box and is centered. */
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-wrap video {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  background: #000;
}

.script-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  max-height: 80vh;
  overflow: auto;
}

.script-panel h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scene-block {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.scene-block:last-child { border-bottom: none; }

.scene-block .scene-heading {
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.scene-block .scene-desc {
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 12px;
  font-size: 12px;
}

.clip-block {
  margin-bottom: 12px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
}

.clip-block:first-of-type { border-top: none; }

.clip-block .clip-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  margin-bottom: 6px;
}

.beat-line {
  margin: 4px 0;
  font-size: 13px;
}

.beat-line .speaker {
  font-weight: 600;
  color: var(--text);
  margin-right: 6px;
}

.beat-line .dialogue {
  color: var(--text);
}

.beat-line .action {
  color: var(--text-mute);
  font-style: italic;
  font-size: 12px;
  margin-left: 0;
  display: block;
  padding-left: 12px;
}

/* Clip strip */

.clip-strip {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.clip-strip h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clip-strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.clip-cell {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.clip-cell video {
  width: 100%;
  display: block;
  aspect-ratio: 9 / 16;
  background: #000;
}

.clip-cell .label {
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Loading + error */

.loading, .error {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 13px;
}

.error { color: var(--bad); }

/* Skeleton loaders — animated shimmer placeholder while data loads.
   Use .skeleton-grid for card grids, .skel-line for short text rows.
   Pages render the skeleton synchronously, then swap to real content
   when the fetch resolves. */

@keyframes ciniura-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skel,
.skel-line,
.skel-card,
.skel-img,
.skel-video {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 800px 100%;
  animation: ciniura-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}

.skel-line { height: 12px; margin: 6px 0; }
.skel-line.short { width: 35%; }
.skel-line.med   { width: 60%; }
.skel-line.long  { width: 88%; }

.skel-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  padding: 14px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skel-img { aspect-ratio: 2 / 3; width: 100%; }
.skel-video { aspect-ratio: 9 / 16; width: 100%; }

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.loading-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-bottom: 14px;
}

.loading-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: ciniura-pulse 1.2s ease-in-out infinite;
}

@keyframes ciniura-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.1); }
}

/* Misc */

.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #b15806;
  border-color: #b15806;
}

.btn[disabled], .btn-primary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Wizard / form pages */

.wizard {
  max-width: 880px;
  margin: 0 auto;
}

.wizard h1 {
  font-size: 22px;
  margin: 0 0 8px;
}

.wizard .step-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input[type="text"], .field textarea, .field select {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.genre-pick {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.genre-pick:hover { border-color: var(--accent); }

.genre-pick.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.candidate-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.candidate-card:hover { border-color: var(--accent); }

.candidate-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.candidate-card .head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.candidate-card .head .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
}

.candidate-card .head .title {
  font-weight: 600;
  font-size: 15px;
}

.candidate-card .slots {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin: 6px 0;
}

.candidate-card .premise {
  font-style: italic;
  font-size: 13px;
  color: var(--text);
  margin-top: 8px;
}

.candidate-card .overlap {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-mute);
  margin-top: 6px;
}

.actions-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Live log viewer */

.job-header {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.job-header .label {
  font-weight: 600;
  font-size: 16px;
}

.job-header .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.job-status {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.job-status.queued { background: var(--bg-elev-2); color: var(--text-mute); }
.job-status.running { background: #1d4ed833; color: #93c5fd; }
.job-status.done { background: #15803d33; color: var(--good); }
.job-status.failed { background: #7c2d1233; color: var(--bad); }
.job-status.cancelled { background: rgba(120, 113, 108, 0.25); color: #d6d3d1; }
.job-status.stalled { background: rgba(217, 119, 6, 0.20); color: var(--accent); }
.jobs-widget .job-cancel-btn { padding: 4px 9px; font-size: 11px; color: var(--bad); border-color: rgba(239, 68, 68, 0.3); }
.jobs-widget .job-cancel-btn:hover { background: #7c2d1244; border-color: var(--bad); }
.jobs-widget .trial-dismiss-btn { padding: 4px 9px; font-size: 11px; color: var(--text-dim); border-color: rgba(120, 113, 108, 0.4); }
.jobs-widget .trial-dismiss-btn:hover { background: rgba(120, 113, 108, 0.18); border-color: #a8a29e; color: var(--text); }

/* Unified-memory pressure meter.
   Color-coded by data-pressure: green (low) / amber (medium) / red (high).
   Width tracks used%, tooltip lists per-ComfyUI RSS for diagnostics. */
.memory-meter { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-elev); font-size: 11px; }
.memory-meter .mm-label { color: var(--dim); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.memory-meter .mm-bar { width: 120px; height: 6px; background: rgba(255, 255, 255, 0.05); border-radius: 999px; overflow: hidden; }
.memory-meter .mm-fill { height: 100%; transition: width 0.3s ease, background-color 0.3s; }
.memory-meter[data-pressure="low"] .mm-fill { background: var(--good, #4ade80); }
.memory-meter[data-pressure="medium"] .mm-fill { background: var(--accent, #f59e0b); }
.memory-meter[data-pressure="high"] .mm-fill { background: var(--bad, #ef4444); }
.memory-meter .mm-text { font-size: 11px; min-width: 130px; }

.log-panel {
  background: #0a0b0e;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.log-line { color: var(--text); }
.log-line.success { color: var(--good); }
.log-line.error { color: var(--bad); }
.log-line.warn { color: var(--warn); }
.log-line .ts { color: var(--text-mute); margin-right: 8px; }

.connection-pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

.connection-pill.live { background: #15803d33; color: var(--good); }
.connection-pill.disconnected { background: #7c2d1233; color: var(--bad); }
.connection-pill.reconnecting { background: #ca8a0433; color: var(--warn); }

/* Active jobs widget on the index page */

.jobs-widget {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
}

.jobs-widget h3 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.jobs-widget .job-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 13px;
}

.jobs-widget .job-row .grow { flex: 1; min-width: 12px; }
.jobs-widget .job-row:first-of-type { border-top: none; }
.jobs-widget .job-row a { color: var(--text); }

.jobs-section { margin-top: 8px; }
.jobs-section:first-child { margin-top: 0; }
.jobs-section-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 8px 0 4px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.jobs-section.alerts .jobs-section-head { color: var(--accent); }
.jobs-section.alerts .job-row {
  background: rgba(217, 119, 6, 0.06);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-top: none;
  border-left: 3px solid var(--accent);
}

.job-alert {
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.job-alert a { color: var(--accent); text-decoration: underline; }

.job-ok { color: #86efac; font-size: 12px; }
.job-ok a { color: #bbf7d0; text-decoration: underline; }

.job-bad {
  color: #fca5a5;
  font-size: 12px;
  max-width: 540px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-running { color: #93c5fd; font-size: 12px; font-style: italic; }

/* ---------- Interactive review cards (job.html) ---------- */
/*
 * Review cards render at the top of a job page when phasedGenerator
 * blocks on an interactive checkpoint (clip review, anchor frame review,
 * advisor decision). The card stays put until the operator submits a
 * decision; the request_review event from JobManager carries the payload
 * and a refresh replays it via the SSE replay event.
 */

.review-cards { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.review-card {
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--accent-soft);
  /* Cap the card to viewport height so buttons stay visible without
   * scrolling the page. Header + footer are fixed; the body flexes
   * to fill, and the info pane within scrolls internally. */
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

.review-card .card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--bg-elev-2) 0%, var(--bg-elev) 100%);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.review-card .card-head .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}
.review-card .card-head .meta { color: var(--text-dim); font-weight: 400; font-size: 12px; }
.review-card .card-head .pip {
  margin-left: auto;
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; background: var(--accent-soft); color: var(--accent);
}

.review-card .card-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 0;       /* let the inner overflow:auto take effect */
  overflow: hidden;
}
.review-card .card-body.single { grid-template-columns: 1fr; }
.review-card .media-pane,
.review-card .info-pane { padding: 16px; min-width: 0; min-height: 0; }
.review-card .media-pane {
  background: #000; display: flex; flex-direction: column;
  gap: 12px; align-items: stretch; justify-content: center;
  overflow: hidden;
}
.review-card .info-pane { overflow-y: auto; }
.review-card .media-pane video,
.review-card .media-pane img {
  width: 100%; max-height: calc(100vh - 200px); background: #000; border-radius: 4px; object-fit: contain;
}
.review-card .paired-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review-card .paired-pair > figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.review-card .paired-pair figcaption { color: var(--text-dim); font-size: 11px; text-align: center; letter-spacing: 0.05em; }

.review-card .info-pane h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); }
.review-card .beat-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.review-card .beat-list li {
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 10px;
  font-size: 13px; line-height: 1.45;
}
.review-card .beat-list li.kicker { border-left-color: var(--accent); }
.review-card .beat-list .ts { color: var(--text-mute); font-family: ui-monospace, monospace; font-size: 11px; margin-right: 6px; }
.review-card .beat-list .speaker { color: var(--accent); font-weight: 600; }
.review-card .beat-list .dialogue { display: block; font-style: italic; color: var(--text); margin-top: 2px; }
.review-card .beat-list .action { display: block; color: var(--text-dim); font-size: 12px; margin-top: 2px; }

.review-card .ref-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.review-card .ref-thumbs .ref { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; }
.review-card .ref-thumbs img { width: 64px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.review-card .ref-thumbs .name { font-size: 10px; color: var(--text-dim); text-align: center; }

/* Paired character refs nested inside the first checklist row so the
 * operator can identity-check without scrolling. Each character is two
 * stacked-horizontally images: ref_image_1 (full body) + ref_image_2
 * (face close-up). Sized so up to 3 characters fit per row in the
 * info pane; the row wraps for ensembles of 4+. */
.review-card .char-ref-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}
.review-card .char-ref-card {
  display: flex; flex-direction: column; gap: 3px;
  flex: 0 0 auto;
}
.review-card .char-ref-name {
  font-size: 10px; color: var(--text-dim);
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600;
}
.review-card .char-ref-pair {
  display: flex; gap: 3px;
}
.review-card .char-ref-pair img,
.review-card .char-ref-pair .char-ref-missing {
  width: 56px; height: 80px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
}
.review-card .char-ref-pair .char-ref-missing {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute); font-size: 9px; text-align: center;
  padding: 4px;
}

/* Approval checklist: 6 rows × N attempts (A or A+B). Operator clicks
 * each pill to mark "✓ pass" for that attempt. Approve A/B is gated
 * on all six pills being green for that column; the bundle of failed
 * checks is forwarded to the advisor verbatim on Reject. */
.review-card .hint-inline { color: var(--text-mute); font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.review-card table.checklist {
  width: 100%; margin-bottom: 16px;
  border-collapse: collapse; font-size: 12px;
}
.review-card table.checklist th {
  text-align: center; color: var(--text-dim);
  font-size: 11px; letter-spacing: 0.05em; font-weight: 600;
  padding: 4px 8px; border-bottom: 1px solid var(--border);
}
.review-card table.checklist td.check-label {
  padding: 8px 6px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.review-card table.checklist td.check-label strong { color: var(--text); font-size: 13px; font-weight: 600; }
.review-card table.checklist td.check-label .hint { color: var(--text-mute); font-size: 11px; line-height: 1.4; }
.review-card table.checklist td.check-cell {
  padding: 8px 6px; border-bottom: 1px solid var(--border);
  text-align: center; vertical-align: middle; width: 56px;
}
.review-card .check-pill {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--bg-elev-2);
  color: var(--text-mute); font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all 0.12s ease-out;
  display: inline-flex; align-items: center; justify-content: center;
}
.review-card .check-pill:hover { border-color: var(--accent); color: var(--text); }
.review-card .check-pill.on {
  background: #1f2f24; border-color: #2f5f3a; color: #5fbf5f;
}
.review-card .card-foot .btn-primary:disabled {
  opacity: 0.4; cursor: not-allowed; background: var(--bg-elev-2); border-color: var(--border); color: var(--text-mute);
}
.review-card .card-foot .btn-primary:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }

.review-card details.advanced { margin-top: 12px; }
.review-card details.advanced summary { cursor: pointer; color: var(--text-dim); font-size: 12px; }
.review-card details.advanced .main-prompt {
  margin-top: 8px;
  padding: 8px 10px; background: var(--bg-elev-2); border-radius: 4px;
  font-family: ui-monospace, monospace; font-size: 11px;
  color: var(--text-dim); line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}

.review-card .card-foot {
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--bg-elev-2);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.review-card .card-foot .notes-row { width: 100%; display: flex; gap: 8px; align-items: stretch; }
.review-card .card-foot textarea {
  flex: 1; min-height: 40px; resize: vertical;
  padding: 8px 10px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font: inherit; font-size: 13px;
}
.review-card .card-foot .btn { white-space: nowrap; }
.review-card .card-foot .btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.review-card .card-foot .btn-quit { color: #e25555; border-color: #4a2a2a; }
.review-card .card-foot .btn-quit:hover { background: #2a1a1a; }
.review-card .card-foot .spacer { flex: 1; }

.review-card .prior-list {
  width: 100%;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.review-card .prior-list .prior {
  border: 1px solid var(--border); border-radius: 4px; padding: 6px;
  cursor: pointer; transition: border-color 0.1s;
}
.review-card .prior-list .prior:hover { border-color: var(--accent); }
.review-card .prior-list .prior video { width: 100%; height: 100px; object-fit: cover; border-radius: 2px; background: #000; }
.review-card .prior-list .prior .label { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.review-card .anchor-meta { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.review-card .anchor-meta .row { display: flex; gap: 8px; }
.review-card .anchor-meta .row .key { color: var(--text-dim); min-width: 110px; }
.review-card .anchor-meta .below-floor { color: #d97706; font-size: 11px; margin-top: 4px; }

.review-card .advisor-diff { font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.5; }
.review-card .advisor-diff .before { color: #e25555; }
.review-card .advisor-diff .after  { color: #5fbf5f; }

/* Inline dialogue editing — surgical UI shown only during rejection flow.
 * Pre-filled from expected_lines; operator can tweak text before submitting. */
.review-card .dialogue-edit-section {
  width: 100%; margin-bottom: 8px;
  padding: 10px 12px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 4px;
}
.review-card .dialogue-edit-section .dialogue-edit-rows {
  display: flex; flex-direction: column; gap: 4px;
}
.review-card .dialogue-edit-section .dialogue-edit-input {
  transition: border-color 0.12s;
}
.review-card .dialogue-edit-section .dialogue-edit-input:focus {
  outline: none; border-color: var(--accent);
}

.review-empty { color: var(--text-mute); font-style: italic; padding: 8px 0; }

/* ---------- Pipeline timeline (job.html) ---------- */
/*
 * Visual progress UI above the raw log. The job's log lines are parsed
 * client-side into structured stage state — the running job needs no
 * server-side support, just the existing SSE stream. Refresh-safe by
 * replaying the entire log buffer through the parser on reconnect.
 */

.pipeline-panel { margin: 0 0 24px; }

.pipeline-header {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 16px;
}
.pipeline-header .clock { font-family: ui-monospace, monospace; font-size: 14px; }
.pipeline-header .clock .label { color: var(--text-dim); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; display: block; }
.pipeline-header .clock .value { color: var(--text); font-weight: 600; }
.pipeline-header .clock .eta { color: var(--accent); }
.pipeline-header .progress-bar-wrap { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.pipeline-header .progress-bar { height: 8px; background: var(--bg-elev-2); border-radius: 4px; overflow: hidden; }
.pipeline-header .progress-bar .fill {
  height: 100%; background: linear-gradient(90deg, var(--accent) 0%, #f0a23c 100%);
  transition: width 0.4s ease-out;
}
.pipeline-header .progress-pct {
  font-size: 11px; color: var(--text-dim); font-family: ui-monospace, monospace;
  letter-spacing: 0.04em; text-align: right;
}

.stage-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 24px; }
.stage-pip {
  position: relative;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 64px;
}
.stage-pip .stage-num { color: var(--text-mute); font-size: 11px; letter-spacing: 0.05em; }
.stage-pip .stage-name { color: var(--text); font-weight: 600; font-size: 13px; }
.stage-pip .stage-meta { color: var(--text-dim); font-size: 11px; font-family: ui-monospace, monospace; }
.stage-pip.queued    { opacity: 0.55; }
.stage-pip.skipped   { opacity: 0.55; border-style: dashed; }
.stage-pip.running   { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft) inset; }
.stage-pip.running::before {
  content: ''; position: absolute; top: 8px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.stage-pip.done      { border-color: #2f5f3a; background: linear-gradient(180deg, #1e2820 0%, var(--bg-elev) 100%); }
.stage-pip.done::before {
  content: '✓'; position: absolute; top: 8px; right: 10px;
  color: #5fbf5f; font-size: 14px; line-height: 1;
}
.stage-pip.failed    { border-color: #5a2a2a; }
.stage-pip.failed::before { content: '✗'; position: absolute; top: 8px; right: 10px; color: #e25555; font-size: 14px; }

.clips-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .clips-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .clips-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.clip-cell {
  position: relative;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 110px;
}
.clip-cell .clip-num { color: var(--text-dim); font-size: 11px; letter-spacing: 0.05em; }
.clip-cell .clip-state { color: var(--text); font-size: 12px; font-weight: 600; }
.clip-cell .clip-attempts { color: var(--text-dim); font-size: 11px; font-family: ui-monospace, monospace; }
.clip-cell .clip-anchor { color: var(--accent); font-size: 10px; font-style: italic; }
.clip-cell .clip-thumb { background: #000; border-radius: 3px; flex: 1; min-height: 90px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.clip-cell .clip-thumb video { width: 100%; height: 100%; object-fit: cover; }
.clip-cell .clip-thumb .placeholder { color: var(--text-mute); font-size: 10px; text-align: center; padding: 8px; }
.clip-cell.queued       { opacity: 0.55; }
.clip-cell.in-progress  { border-color: var(--accent); }
.clip-cell.in-progress::before {
  content: ''; position: absolute; top: 6px; right: 8px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.clip-cell.in-review    { border-color: var(--accent); background: linear-gradient(180deg, #2a201a 0%, var(--bg-elev) 100%); }
.clip-cell.done         { border-color: #2f5f3a; }
.clip-cell.done::before { content: '✓'; position: absolute; top: 4px; right: 8px; color: #5fbf5f; font-size: 12px; }
.clip-cell.skipped::before { content: '⤴'; position: absolute; top: 4px; right: 8px; color: var(--text-mute); font-size: 12px; }

.section-title {
  display: flex; align-items: baseline; gap: 8px;
  margin: 12px 0 8px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim);
}
.section-title .count { color: var(--text-mute); font-family: ui-monospace, monospace; font-weight: normal; }

details.raw-log-wrap { margin-top: 24px; }
details.raw-log-wrap > summary {
  cursor: pointer; padding: 8px 12px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); font-size: 13px;
  user-select: none;
}
details.raw-log-wrap > summary:hover { color: var(--text); }
details.raw-log-wrap[open] > summary { border-radius: 6px 6px 0 0; border-bottom: none; }
details.raw-log-wrap > .log-panel { border-top-left-radius: 0; border-top-right-radius: 0; }

.final-preview {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px;
  margin-bottom: 16px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.final-preview video { width: 100%; max-height: 60vh; background: #000; }
.final-preview .summary { padding: 16px; }
.final-preview .summary h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); }
.final-preview .summary .row { display: flex; gap: 8px; padding: 4px 0; font-size: 13px; }
.final-preview .summary .row .key { color: var(--text-dim); min-width: 110px; }

/* ============================================================
 * Mobile responsive overrides (≤ 768 px and ≤ 480 px).
 * Desktop layout (>768px) is intentionally untouched.
 * ============================================================ */

@media (max-width: 768px) {
  /* container: less side padding on phones */
  .container { padding: 12px; }

  /* topbar: stack the breadcrumb under the brand on narrow widths */
  .topbar { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
  .topbar .crumb { font-size: 11px; }

  /* show grid on the homepage */
  .show-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 10px; }

  /* job page header — wrap the elapsed/eta clocks under the title */
  .job-header { flex-wrap: wrap; gap: 6px; padding: 10px 12px; font-size: 12px; }
  .job-header .label { font-size: 13px; }
  .comfy-queue { font-size: 10px; padding: 1px 6px; }

  /* pipeline panel: pipeline strip becomes 2-column grid, clip grid 3-col */
  .stage-strip { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px; }
  .stage-pip { padding: 8px 10px; min-height: 52px; }
  .stage-pip .stage-num { font-size: 9px; }
  .stage-pip .stage-name { font-size: 12px; }
  .stage-pip .stage-meta { font-size: 10px; }

  .clips-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px; }
  .clip-cell { padding: 6px; min-height: 92px; }
  .clip-cell .clip-num { font-size: 9px; }
  .clip-cell .clip-state { font-size: 11px; }
  .clip-cell .clip-attempts { font-size: 10px; }
  .clip-cell .clip-thumb { min-height: 68px; }

  /* pipeline header: stack on phone — clock / progress / ETA each get their own row */
  .pipeline-header { flex-wrap: wrap; padding: 10px 12px; }
  .pipeline-header .progress-bar-wrap { flex-basis: 100%; order: 99; }
  .pipeline-header .clock { font-size: 12px; }

  /* review card: switch from side-by-side video+info to stacked */
  .review-card { max-height: none; }
  .review-card .card-body { grid-template-columns: 1fr !important; }
  .review-card .card-body.single { grid-template-columns: 1fr; }
  .review-card .media-pane { padding: 12px; }
  .review-card .media-pane video,
  .review-card .media-pane img { max-height: 50vh; }
  .review-card .info-pane { padding: 12px; max-height: none; }

  /* paired A|B videos stack on phones (or stay side-by-side at smaller? leave side-by-side
     because A/B compare is the whole point; use a tiny gap and shrink controls) */
  .review-card .paired-pair { gap: 4px; }
  .review-card .paired-pair video { max-height: 40vh; }

  /* checklist: compact rows + smaller pills */
  .review-card table.checklist td.check-label { padding: 6px 4px; }
  .review-card table.checklist td.check-label strong { font-size: 12px; }
  .review-card table.checklist td.check-label .hint { font-size: 10px; }
  .review-card table.checklist td.check-cell { width: 44px; padding: 6px 4px; }
  .review-card .check-pill { width: 28px; height: 28px; font-size: 14px; }

  /* character refs grid — stay 2 per row on phone */
  .review-card .char-ref-pair img,
  .review-card .char-ref-pair .char-ref-missing { width: 48px; height: 64px; }

  /* card footer buttons: full-width buttons on phone, stacked */
  .review-card .card-foot { padding: 10px 12px; }
  .review-card .card-foot .btns { gap: 6px; }
  .review-card .card-foot .btn { font-size: 13px; padding: 8px 10px; flex: 1 1 auto; min-width: 0; }
  .review-card .card-foot .spacer { display: none; }
  .review-card .card-foot textarea { font-size: 13px; }

  /* clip overlay (large preview) caps to viewport */
  .clip-overlay-inner { width: 96vw; max-height: 92vh; }
  .clip-overlay video { max-height: 70vh; }

  /* env banner + queue banner + phase0 banner — single column */
  .env-banner, .queue-banner, .phase0-banner { font-size: 12px; padding: 8px 10px; }
  .queue-banner, .phase0-banner { flex-wrap: wrap; }

  /* generate-bar on show page */
  .generate-bar { flex-direction: column; align-items: stretch !important; }
  .generate-bar .btn { width: 100%; }

  /* episode rows compress */
  .episode-row { gap: 8px; padding: 8px; }
  .episode-row .thumb { width: 64px; height: 96px; }

  /* show-page tab strip wraps */
  .tabs { flex-wrap: wrap; gap: 4px; }
  .tab { font-size: 12px; padding: 6px 10px; }
}

@media (max-width: 480px) {
  /* tighter still on small phones */
  .container { padding: 8px; }
  .show-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .clips-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .stage-strip { grid-template-columns: 1fr !important; }
  .review-card .paired-pair { grid-template-columns: 1fr; }
  .review-card .paired-pair video { max-height: 32vh; }
  .review-card .char-ref-grid { gap: 6px; }
  .review-card .card-foot .btn { flex-basis: 100%; }
}

/* Environment-warning banner (rendered above the show grid when a
 * required binary like ffmpeg is missing on the dashboard's PATH). */
.env-banner {
  margin: 12px 0 16px;
  padding: 10px 14px;
  background: #2a201a;
  border: 1px solid #d97706;
  border-radius: 6px;
  color: #f0a23c;
  font-size: 13px;
  line-height: 1.5;
}
.env-banner strong { color: #ffb14d; margin-right: 4px; }
.env-banner code {
  background: #1a1410; color: #ffb14d;
  padding: 1px 6px; border-radius: 3px;
  font-family: ui-monospace, monospace; font-size: 12px;
}

/* Queue banner: surfaced on the job page when a generate-episode job
 * is sitting in the dashboard's concurrency-cap waitlist. Also
 * compact comfy-queue indicator next to the job-status pill. */
.queue-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--bg-elev-2) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
}
.queue-banner .queue-num {
  font-family: ui-monospace, monospace;
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 8px; border-radius: 999px; font-weight: 600;
}
.comfy-queue {
  font-family: ui-monospace, monospace; font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 999px;
}

/* Phase 0 banner: shown on the job page once LLM planning completes,
 * letting the operator start the next episode in parallel while
 * clip generation is still running. Same layout as queue-banner but
 * uses --good color to signal "ready to proceed". */
.phase0-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #142016 0%, var(--bg-elev) 100%);
  border: 1px solid var(--good);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
}
.phase0-banner a { color: var(--good); }

/* Click-to-zoom overlay for clip thumbnails — opens a large playable
 * preview so the operator can scrub a locked clip while later clips
 * are still generating, without losing place on the job page. */
.clip-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex; align-items: center; justify-content: center;
  animation: overlay-fade 0.15s ease-out;
}
@keyframes overlay-fade { from { opacity: 0; } to { opacity: 1; } }
.clip-overlay-inner {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px;
  width: min(90vw, 1100px); max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.clip-overlay-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
  font-weight: 600; letter-spacing: 0.05em;
}
.clip-overlay-head .btn { margin-left: auto; }
.clip-overlay video { width: 100%; max-height: 80vh; background: #000; display: block; }


