.production-view,
.production-view > * { min-width: 0; max-width: 100%; }

.production-header-actions { display: flex; align-items: end; gap: 8px; }
.production-header-actions label { width: 220px; margin: 0; color: var(--muted); font-size: 11px; }
.production-header-actions select { margin-top: 5px; }
.production-view { gap: 12px; }
.production-view .section-bar { align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.production-view .section-bar h2 { display: none; }
.production-view .section-bar p { margin: 0; font-size: 12px; }

.production-mode-nav {
  display: flex;
  gap: 20px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
}

.production-mode-nav button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 2px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.production-mode-nav button:hover { color: var(--text); }
.production-mode-nav button.active { border-bottom-color: var(--accent); color: var(--text); }
.production-overview-panel { display: grid; gap: 14px; }
.production-subhead h2 { margin: 0 0 4px; font-size: 18px; }

.production-workflow { min-width: 0; }
.production-workspace-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #0b1118;
}

.production-workspace-switch button {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.production-workspace-switch button:last-child { border-right: 0; }
.production-workspace-switch button:hover { background: #111a25; color: var(--text); }
.production-workspace-switch button.active { background: #142236; color: var(--text); box-shadow: inset 0 -2px var(--accent); }
.production-workspace-switch strong { font-size: 12px; white-space: nowrap; }
.production-workspace-switch small { overflow: hidden; color: var(--muted); font-size: 11px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
[data-production-workspace-panel] { min-width: 0; }

.production-flow-guide {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 320px) auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid #2a394a;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #0d141d;
}

.production-flow-copy { min-width: 0; display: grid; gap: 3px; }
.production-flow-copy .eyebrow { margin: 0; }
.production-flow-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.production-flow-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.production-flow-meter { height: 5px; overflow: hidden; border-radius: 3px; background: #202b38; }
.production-flow-meter span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s ease; }
.production-flow-count { min-width: 38px; color: var(--soft); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
.production-flow-guide button { min-width: 118px; white-space: nowrap; }
.production-flow-guide .primary { width: auto; min-height: 34px; padding: 0 14px; box-shadow: none; }

.v5-editor {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  border-top: 1px solid var(--line-strong);
  background: #090d13;
  color: var(--text);
}

.v5-topbar,
.v5-player-toolbar,
.v5-timeline-head,
.v5-render-dock,
.v5-pane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.v5-topbar { padding: 24px 0 18px; }
.v5-topbar h2 { margin-bottom: 5px; font-size: 24px; }
.v5-top-actions { display: flex; align-items: center; gap: 8px; }
.v5-top-actions select { width: 190px; }
.v5-top-actions button,
.v5-player-toolbar button,
.v5-pane-title button { min-width: max-content; white-space: nowrap; }

.v5-stage-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 54px;
  border-block: 1px solid var(--line);
  background: #0c121a;
}

.v5-stage {
  position: relative;
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
}

.v5-stage:last-child { border-right: 0; }
.v5-stage strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.v5-stage small { color: var(--muted); font-size: 10px; }
.v5-stage::after { position: absolute; inset: auto 0 -1px; height: 2px; content: ""; background: transparent; }
.v5-stage.completed::after { background: var(--success); }
.v5-stage.running::after { background: var(--accent); }
.v5-stage.running { background: rgb(76 154 255 / 7%); }

.v5-edit-grid {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(420px, 1fr) minmax(250px, 310px);
  min-height: 650px;
  border-bottom: 1px solid var(--line);
}

.v5-shot-bin,
.v5-inspector { min-width: 0; background: #0d131b; }
.v5-shot-bin { border-right: 1px solid var(--line); }
.v5-inspector { border-left: 1px solid var(--line); }
.v5-pane-title { min-height: 54px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.v5-pane-title > div { display: grid; gap: 2px; }
.v5-pane-title small { color: var(--muted); }
.v5-generate-controls { display: flex !important; align-items: center; gap: 6px !important; }
.v5-generate-controls label { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; }
.v5-generate-controls select { width: 58px; padding: 6px 5px; font-size: 11px; }

.v5-shot-list { max-height: 690px; overflow: auto; padding: 6px; }
.v5-shot {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.v5-shot:hover { background: #121b27; }
.v5-shot.active { border-color: #3b6ea8; background: #122033; }
.v5-shot-index { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #1b2735; color: var(--soft); font-size: 11px; }
.v5-shot-copy { min-width: 0; display: grid; gap: 4px; }
.v5-shot-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.v5-shot-copy small { color: var(--muted); font-size: 10px; }
.v5-shot-progress { color: #9fc2ff; font-size: 11px; text-align: right; }

.v5-canvas-area { min-width: 0; display: grid; grid-template-rows: minmax(360px, 1fr) 52px 220px; background: #070a0f; }
.v5-player { position: relative; display: grid; place-items: center; min-height: 360px; overflow: hidden; background: #020305; }
.v5-player video { width: 100%; height: 100%; max-height: 510px; object-fit: contain; background: #000; }
.v5-player-empty { position: absolute; display: grid; gap: 6px; color: var(--soft); text-align: center; }
.v5-player-empty small { color: var(--muted); }
.v5-player-toolbar { min-width: 0; padding: 8px 14px; border-block: 1px solid var(--line); background: #0d131b; }
.v5-player-toolbar > div { display: flex; gap: 8px; }
.v5-player-toolbar > div { flex: none; }
.v5-player-toolbar button { padding: 8px 11px; font-size: 12px; }
.v5-player-toolbar .v5-frame-controls { align-items: center; }
.v5-frame-controls button { width: 32px; min-width: 32px; padding-inline: 0; font-size: 20px; line-height: 1; }
.v5-player-toolbar span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

.v5-timeline-wrap { min-width: 0; overflow: hidden; background: #0b1017; }
.v5-timeline-head { min-height: 48px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.v5-timeline-head > div:first-child { display: grid; gap: 2px; }
.v5-timeline-head small { color: var(--muted); font-size: 10px; }
.v5-timeline-head select { width: 92px; padding: 7px 9px; }
.v5-segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.v5-segmented button { min-width: 46px; padding: 7px 8px; border: 0; border-right: 1px solid var(--line); background: #101720; color: var(--muted); font-size: 11px; }
.v5-segmented button:last-child { border-right: 0; }
.v5-segmented button.active { background: var(--accent); color: #fff; }
.v5-timeline { display: flex; align-items: stretch; gap: 3px; min-height: 158px; padding: 18px 12px; overflow-x: auto; }
.v5-clip { flex: 0 0 max(90px, calc(var(--duration, 3) * 24px)); min-width: 90px; max-width: 280px; display: grid; align-content: space-between; padding: 10px; border: 1px solid #2b3b4e; border-radius: 5px; background: #172332; color: var(--text); }
.v5-clip.active { border-color: var(--accent); background: #19304d; }
.v5-clip strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.v5-clip small { color: #9fb0c5; font-size: 10px; }

.v5-inspector-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.v5-inspector-tabs button { height: 52px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 12px; }
.v5-inspector-tabs button.active { border-bottom-color: var(--accent); color: var(--text); background: rgb(76 154 255 / 5%); }
.v5-inspector-panel { display: none; max-height: 690px; padding: 14px; overflow: auto; }
.v5-inspector-panel.active { display: block; }
.v5-inspector-panel textarea { min-height: 180px; }
.v5-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.v5-check { display: flex; align-items: center; gap: 8px; }
.v5-check input { width: auto; }

.v5-takes { display: grid; gap: 8px; }
.v5-take { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #101720; }
.v5-take-preview { display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 4px; background: #06090d; color: var(--muted); font-size: 10px; }
.v5-take-copy { min-width: 0; display: grid; gap: 3px; }
.v5-take-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.v5-take-copy small { color: var(--muted); font-size: 10px; }
.v5-take-score { display: grid; gap: 4px; justify-items: end; color: var(--success); font-size: 11px; }
.v5-take-score button { padding: 5px 7px; font-size: 10px; }

.v5-qc { display: grid; gap: 7px; margin-bottom: 14px; }
.v5-qc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.v5-qc-score { color: var(--success); font-size: 30px; font-weight: 700; }
.v5-qc-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--soft); font-size: 12px; }
.v5-qc-row span:last-child { color: var(--muted); }

.v5-render-dock { min-height: 74px; padding: 12px 0; }
.v5-render-dock > div:first-child { display: grid; flex: none; gap: 3px; }
.v5-render-dock small { color: var(--muted); }
.v5-render-jobs { min-width: 0; display: flex; justify-content: flex-end; gap: 8px; overflow-x: auto; }
.v5-render-job { min-width: 190px; max-width: 240px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; padding: 8px 10px; border-left: 2px solid var(--line-strong); background: #0f161f; }
.v5-render-job.running { border-left-color: var(--accent); }
.v5-render-job.succeeded { border-left-color: var(--success); }
.v5-render-job.failed { border-left-color: var(--danger); }
.v5-render-job strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.v5-render-job small { color: var(--muted); font-size: 10px; }
.v5-render-job a { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 11px; }

.v5-empty { display: grid; place-items: center; min-height: 130px; padding: 20px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 1180px) {
  .v5-edit-grid { grid-template-columns: 190px minmax(380px, 1fr) 260px; }
  .v5-stage-strip { grid-template-columns: repeat(4, 1fr); }
  .v5-stage:nth-child(4) { border-right: 0; }
}

@media (max-width: 820px) {
  .production-header-actions { width: 100%; }
  .production-header-actions label { min-width: 0; flex: 1; width: auto; }
  .production-mode-nav { gap: 14px; overflow-x: auto; }
  .production-mode-nav button { flex: none; }
  .production-workspace-switch button { grid-template-columns: 1fr; gap: 2px; }
  .production-workspace-switch small { text-align: left; }
  .production-flow-guide { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .production-flow-meter { grid-column: 1 / -1; grid-row: 2; }
  .production-flow-count { grid-column: 2; grid-row: 1; }
  .production-flow-guide button { grid-column: 1 / -1; width: 100%; }
  .v5-topbar,
  .v5-render-dock { align-items: stretch; flex-direction: column; }
  .v5-top-actions { display: grid; grid-template-columns: 1fr auto auto; }
  .v5-top-actions select { width: 100%; }
  .v5-stage-strip { grid-template-columns: repeat(2, 1fr); }
  .v5-stage { border-bottom: 1px solid var(--line); }
  .v5-edit-grid { display: flex; flex-direction: column; }
  .v5-shot-bin { border-right: 0; border-bottom: 1px solid var(--line); }
  .v5-shot-list { display: flex; max-height: none; overflow-x: auto; }
  .v5-shot { flex: 0 0 190px; }
  .v5-canvas-area { grid-template-rows: minmax(300px, 56vh) auto 240px; }
  .v5-inspector { border-left: 0; border-top: 1px solid var(--line); }
  .v5-inspector-panel { max-height: none; }
  .v5-render-jobs { justify-content: flex-start; }
}

@media (max-width: 480px) {
  .production-header-actions { align-items: stretch; flex-direction: column; }
  .production-header-actions button { width: 100%; }
  .production-workspace-switch { grid-template-columns: 1fr; }
  .production-workspace-switch button { border-right: 0; border-bottom: 1px solid var(--line); }
  .production-workspace-switch button:last-child { border-bottom: 0; }
  .production-flow-guide { padding: 14px; }
  .production-flow-copy strong { white-space: normal; }
  .v5-top-actions { grid-template-columns: 1fr 1fr; }
  .v5-top-actions select { grid-column: 1 / -1; }
  .v5-stage-strip { grid-template-columns: 1fr 1fr; }
  .v5-player-toolbar { align-items: stretch; flex-direction: column; }
  .v5-player-toolbar > div { display: grid; grid-template-columns: 1fr 1fr; }
  .v5-timeline-head { align-items: flex-start; flex-wrap: wrap; }
  .v5-segmented { order: 3; width: 100%; }
  .v5-segmented button { flex: 1; }
  .v5-two { grid-template-columns: 1fr; }
}
