.production-switch {
  display: flex;
  gap: 6px;
  margin: 18px 0;
}
.full-video-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-block: 1px solid #2e3946;
  padding: 18px 0;
  margin: 12px 0 20px;
}
.full-video-bar p {
  max-width: 78ch;
  margin: 5px 0;
  font-size: 13px;
}
.full-video-bar > button {
  flex-shrink: 0;
}
#fullVideoStatus {
  color: #b5d8c8;
  font-size: 13px;
}
.video-result-button {
  margin-left: 12px;
}
@media (max-width: 650px) {
  .full-video-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
.production-switch button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #151a24;
  color: #b9c4d3;
  padding: 10px 15px;
  font: inherit;
  cursor: pointer;
}
.production-switch button[aria-pressed="true"] {
  background: #dce5ed;
  color: #14202d;
  border-color: #dce5ed;
}
.production-mode .hero,
.production-mode #pipeline,
.production-mode .workspace,
.production-mode .footer {
  display: none;
}
.production-mode .topbar {
  position: static;
  background: transparent;
  backdrop-filter: none;
}
.production-mode .logo {
  background: transparent;
}
.production {
  --ink: #e7edf2;
  --sub: #98a6b7;
  --edge: #2e3946;
  --accent: #b5d8c8;
  color: var(--ink);
  font:
    14px/1.55 Arial,
    sans-serif;
  padding-bottom: 40px;
}
.production button,
.production input,
.production select,
.production textarea {
  font: inherit;
}
.production button {
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: #222d39;
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  min-height: 36px;
}
.production button:hover {
  background: #304151;
}
.production button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.production button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #14271e;
  font-weight: 600;
}
.production button.danger {
  color: #f9aaaa;
  border-color: #68474e;
}
.production a {
  color: #bfdccc;
}
.production input,
.production textarea,
.production select {
  color: var(--ink);
  background: #111923;
  border: 1px solid var(--edge);
  border-radius: 5px;
  padding: 9px;
  width: 100%;
  min-height: 38px;
}
.production textarea {
  resize: vertical;
  line-height: 1.7;
}
.production h1 {
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.6px;
  margin: 0;
}
.production h2 {
  font-size: 18px;
  margin: 0 0 12px;
  letter-spacing: -0.3px;
}
.production h3 {
  font-size: 15px;
  margin: 0 0 7px;
}
.production p {
  margin: 8px 0;
}
.production label {
  display: block;
  font-size: 12px;
  color: var(--sub);
  margin: 8px 0;
}
.production label > input,
.production label > select,
.production label > textarea {
  display: block;
  margin-top: 5px;
}
.production label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.production label.inline input {
  width: 16px;
  min-height: 16px;
}
.production .toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.production .toolbar select {
  width: auto;
  max-width: 260px;
}
.production .project-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 0 22px;
  border-bottom: 1px solid var(--edge);
}
.production .kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--accent);
  margin-bottom: 5px;
}
.production .connection-line {
  color: var(--sub);
  font-size: 12px;
  max-width: 490px;
}
.production .studio-grid {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 28px;
  margin-top: 24px;
}
.production .chapter-rail {
  border-right: 1px solid var(--edge);
  padding-right: 20px;
  align-self: start;
  position: sticky;
  top: 15px;
}
.production .chapter-button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  margin-bottom: 5px;
  padding: 10px;
  border-color: transparent;
}
.production .chapter-button.selected {
  background: #21332f;
  border-color: #46685c;
}
.production .chapter-button strong,
.production .chapter-button small {
  display: block;
}
.production .chapter-button small {
  color: var(--sub);
  font-size: 11px;
  margin-top: 3px;
}
.production .chapter-button span {
  float: right;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.production .chapter-add {
  width: 100%;
  margin-top: 12px;
}
.production .workspace-tabs {
  display: flex;
  border-bottom: 1px solid var(--edge);
  gap: 16px;
  overflow: auto;
  margin: 20px 0;
}
.production .workspace-tabs button {
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--sub);
  white-space: nowrap;
}
.production .workspace-tabs button[aria-selected="true"] {
  border-color: var(--accent);
  color: var(--ink);
}
.production .chapter-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.production .chapter-heading .subtitle {
  color: var(--sub);
  font-size: 12px;
  margin-top: 6px;
}
.production .story-editor {
  min-height: 310px;
  margin-top: 8px;
}
.production .narration-editor {
  min-height: 200px;
}
.production .steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
  color: var(--sub);
  font-size: 12px;
}
.production .steps span {
  padding: 5px 8px;
  background: #1c2631;
  border-radius: 4px;
}
.production .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 15px 0;
  margin: 16px 0;
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
}
.production .stats strong {
  font-size: 20px;
  display: block;
  font-variant-numeric: tabular-nums;
}
.production .stats small {
  color: var(--sub);
  font-size: 11px;
}
.production .notice {
  border-left: 3px solid #699883;
  padding: 10px 14px;
  background: #192923;
  margin: 14px 0;
  color: #bed5ca;
}
.production .error {
  border-color: #ba7474;
  background: #302125;
  color: #edbec1;
  white-space: pre-wrap;
}
.production .muted {
  color: var(--sub);
  font-size: 12px;
}
.production .two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.production .section-box {
  border-top: 1px solid var(--edge);
  padding: 20px 0;
  margin-top: 12px;
}
.production .person-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--edge);
  display: flex;
  gap: 16px;
  align-items: start;
}
.production .person-row .person-info {
  flex: 1;
}
.production .reference-strip {
  display: flex;
  gap: 6px;
  overflow: auto;
  margin: 10px 0;
}
.production .reference-strip img {
  width: 60px;
  height: 75px;
  object-fit: cover;
  border-radius: 4px;
}
.production .type-tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  color: var(--accent);
  margin-left: 6px;
}
.production .scene-item {
  border-top: 1px solid var(--edge);
  padding: 22px 0;
}
.production .scene-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.production .scene-time {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--accent);
}
.production .narration-excerpt {
  color: #acb7c3;
  font-size: 13px;
  margin: 12px 0;
  padding-left: 12px;
  border-left: 2px solid var(--edge);
}
.production .shot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.production .shot-card {
  background: #17212c;
  padding: 9px;
  border-radius: 5px;
  min-width: 0;
}
.production .shot-card img,
.production .shot-empty {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: contain;
  background: #101720;
  border-radius: 3px;
}
.production .shot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  font-size: 12px;
}
.production .shot-card h4 {
  font-size: 12px;
  margin: 9px 0 4px;
}
.production .shot-card p {
  font-size: 11px;
  color: var(--sub);
  max-height: 48px;
  overflow: auto;
}
.production .shot-card .toolbar button {
  padding: 5px 7px;
  font-size: 11px;
  min-height: 30px;
}
.production .shot-cast {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.production .shot-cast label {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 11px;
  background: #202c37;
  border-radius: 4px;
  padding: 4px 6px;
  margin: 0;
}
.production .shot-cast input {
  width: 13px;
  min-height: 13px;
  margin: 0;
}
.production .queue-panel {
  padding: 15px 0;
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
  margin-top: 16px;
}
.production .queue-panel progress {
  width: 100%;
  accent-color: var(--accent);
  height: 6px;
}
.production .queue-jobs {
  max-height: 200px;
  overflow: auto;
  margin-top: 10px;
}
.production .queue-job {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #293442;
  font-size: 11px;
}
.production .queue-job span {
  overflow-wrap: anywhere;
}
.production .queue-job button {
  font-size: 11px;
  min-height: 28px;
  padding: 3px 7px;
}
.production .timeline {
  display: flex;
  overflow: auto;
  gap: 3px;
  padding: 18px 0;
  min-height: 100px;
}
.production .timeline button {
  min-width: 70px;
  flex-shrink: 0;
  border-radius: 3px;
  background: #234136;
  font-variant-numeric: tabular-nums;
  padding: 8px;
}
.production .timeline small {
  display: block;
  color: #b3c7bd;
  font-size: 10px;
}
.production audio,
.production video {
  width: 100%;
  margin-top: 12px;
  background: #080e15;
  border-radius: 4px;
  max-height: 470px;
}
.production details {
  border-top: 1px solid var(--edge);
  padding: 15px 0;
}
.production summary {
  cursor: pointer;
  font-weight: 600;
}
.production .dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.production .dialog-content {
  background: #17212c;
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 22px;
  width: min(800px, 100%);
  max-height: 90vh;
  overflow: auto;
}
.production .dialog-content textarea.json-editor {
  font:
    12px/1.6 Consolas,
    monospace;
  min-height: 400px;
}
.production .page-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
}
.production .save-state {
  font-size: 11px;
  color: var(--sub);
}
.production [hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  .production .studio-grid {
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 18px;
  }
  .production .shot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .production .project-bar {
    align-items: start;
    flex-direction: column;
  }
}
@media (max-width: 650px) {
  .production .studio-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .production .chapter-rail {
    position: static;
    border: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    overflow: auto;
  }
  .production .chapter-button {
    min-width: 130px;
  }
  .production .chapter-add {
    min-width: 130px;
    margin-top: 0;
  }
  .production .two-col {
    grid-template-columns: 1fr;
  }
  .production .chapter-heading {
    flex-direction: column;
  }
  .production .shot-grid {
    grid-template-columns: 1fr;
  }
  .production .workspace-tabs {
    gap: 13px;
  }
  .production .stats {
    gap: 15px;
  }
}

/* Native modal: stable across background workspace updates, keyboard-contained. */
dialog.studio-form-dialog {
  width: min(800px, calc(100% - 24px)); max-width: none;
  padding: 0; border: 0; border-radius: 16px; background: var(--panel);
  max-height: calc(100dvh - 24px); overflow: auto;
}
dialog.studio-form-dialog::backdrop { background: #000b; }
dialog.studio-form-dialog .dialog-content { width: 100%; max-height: none; }
@media (max-width: 650px) {
  dialog.studio-form-dialog .dialog-content { padding: 16px; }
  dialog.studio-form-dialog textarea.json-editor { min-height: 45dvh; }
}
