/* Full production workspace */
.production-setup { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #f2f5f1; }
.production-setup h3 { margin: 0; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.production-setup > p { margin: 7px 0 0; color: var(--muted); line-height: 1.55; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.host-settings { display: grid; gap: 11px; margin-top: 16px; }
.host-row { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(190px, 1fr) auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.host-row label { margin: 0 !important; }
.voice-audition { min-height: 46px; padding: 10px 13px; border: 1px solid #9aaa9f; border-radius: 10px; background: #edf4ef; color: var(--green); font-weight: 800; cursor: pointer; }
.creative-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.creative-grid label { min-width: 0; }

.script-workbench { margin-top: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 23px; background: var(--card); box-shadow: 0 18px 55px rgba(25, 43, 35, .08); }
.workbench-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; padding: 25px 28px; border-bottom: 1px solid var(--line); background: #f8f6f0; }
.workbench-header > div:first-child { flex: 1; min-width: 0; }
.workbench-header .editor-title { width: 100%; margin-top: 4px; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.045em; }
.workbench-header p { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 9px; color: var(--muted); font-size: .78rem; }
[data-script-version] { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: var(--mint); color: var(--green); font-size: .72rem; font-weight: 850; }
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: start; }
.script-editor-panel { min-width: 0; padding: 26px 28px 32px; }
.pronunciation-panel { position: sticky; top: 82px; display: grid; gap: 18px; padding: 24px; border-left: 1px solid var(--line); background: #faf8f2; }
.pronunciation-panel h3, .script-editor-panel h3 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.pronunciation-panel p, .script-editor-panel .section-note { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.performance-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.performance-toolbar button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--green); font-size: .74rem; font-weight: 800; cursor: pointer; }
.performance-toolbar button:hover { border-color: var(--green); background: var(--mint); }
.outline-editor { display: grid; gap: 7px; margin: 13px 0 25px; padding: 14px; border-radius: 13px; background: #f8f6f0; }
.outline-editor label { display: block; }
.outline-editor input { width: 100%; border: 0; border-bottom: 1px solid transparent; padding: 7px 4px; background: transparent; color: var(--ink); }
.outline-editor input:focus { outline: 0; border-bottom-color: var(--green); }
[data-script-segments] { list-style: none; display: grid; gap: 12px; margin: 14px 0 0; padding: 0; }
.script-segment { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fffefa; }
.script-segment:focus-within { border-color: #7ba08d; box-shadow: 0 0 0 3px rgba(46, 112, 84, .08); }
.segment-header { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 9px; }
.segment-header select { min-width: 140px; padding: 8px 10px; border: 0; border-radius: 8px; background: var(--mint); color: var(--green); font-weight: 850; }
.segment-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.editor-icon-button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--muted); font-size: .68rem; font-weight: 750; cursor: pointer; }
.editor-icon-button:hover { color: var(--green); border-color: #93a99c; }
.script-segment textarea { width: 100%; border: 0; outline: 0; resize: vertical; padding: 7px 3px; background: transparent; color: var(--ink); font: inherit; line-height: 1.65; }
.citation-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.citation-list span { padding: 4px 7px; border-radius: 999px; background: #edf1ec; color: #64736a; font-size: .63rem; font-weight: 750; }
.editor-add-button { width: 100%; margin-top: 12px; padding: 11px; border: 1px dashed #91a69a; border-radius: 11px; background: #f8fbf8; color: var(--green); font-weight: 850; cursor: pointer; }
[data-pronunciation-list] { display: grid; gap: 8px; margin-top: 12px; }
.pronunciation-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; }
.pronunciation-row input { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.pronunciation-row button { border: 0; background: transparent; color: #9b4336; font-size: .7rem; font-weight: 800; cursor: pointer; }
.workbench-actions { display: grid; gap: 8px; }
.workbench-actions .button { width: 100%; margin: 0; }
.workbench-actions .button.secondary { border-color: #90a497; background: white; color: var(--green); }
[data-workspace-status] { min-height: 1.3em; margin: 0; color: var(--green); font-size: .78rem; font-weight: 750; line-height: 1.45; }
[data-workspace-status][data-error] { color: #a33c2d; }
.audio-production { padding: 18px; border-radius: 14px; background: var(--green-dark); color: white; }
.audio-production h3 { color: white; }
.audio-production p { color: #c9d7ce; }
.audio-production audio { width: 100%; margin-top: 13px; }
.audio-production .button { width: 100%; margin-top: 12px; }
[data-audio-download] { display: block; margin-top: 11px; color: #c6efd5; font-size: .78rem; font-weight: 800; text-align: center; }
.private-gate-note { padding: 10px; border-radius: 9px; background: rgba(255, 255, 255, .08); font-size: .7rem !important; }
.workspace-divider { height: 1px; margin: 2px 0; background: var(--line); }
[data-start-another] { color: var(--green); font-size: .78rem; font-weight: 800; text-align: center; }

@media (max-width: 1040px) {
  .creative-grid { grid-template-columns: 1fr 1fr; }
  .workbench-grid { grid-template-columns: 1fr; }
  .pronunciation-panel { position: static; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 0; }
  .workbench-actions, .audio-production { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .settings-grid, .creative-grid, .pronunciation-panel { grid-template-columns: 1fr; }
  .host-row { grid-template-columns: 1fr; }
  .workbench-header { padding: 20px; }
  .script-editor-panel { padding: 20px 16px 25px; }
  .pronunciation-panel { padding: 20px 16px; }
  .segment-header { align-items: stretch; flex-direction: column; }
  .segment-controls { justify-content: flex-start; }
  .pronunciation-row { grid-template-columns: 1fr; }
}

/* Markup-specific refinements for the source-to-audio workbench. */
.studio-main { min-width: 0; }
.section-heading-compact { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 14px; }
.section-heading-compact p { max-width: 34rem; margin: 0; color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.host-settings { display: grid; gap: 11px; margin-top: 16px; }
.host-count { max-width: 260px; }
.host-row { grid-template-columns: auto minmax(140px, .7fr) minmax(220px, 1.3fr) auto; }
.host-number { display: grid; width: 30px; height: 30px; place-items: center; align-self: center; border-radius: 50%; background: var(--mint); color: var(--green); font-weight: 900; }
.build-script-button { margin-top: 18px; }
.script-workbench { margin-top: 26px; }
.workbench-header p { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; color: var(--muted); font-size: .8rem; }
.workbench-header p span + span::before { content: "·"; margin-right: 10px; }
.workbench-actions { display: flex; gap: 8px; }
.performance-toolbar { padding: 14px 28px; margin-top: 0; border-bottom: 1px solid var(--line); background: #f3f8f4; }
.performance-toolbar strong { align-self: center; margin-right: 5px; }
.performance-toolbar small { flex-basis: 100%; color: var(--muted); }
.workbench-grid { grid-template-columns: minmax(0, 1fr) 300px; }
.outline-editor { grid-template-columns: minmax(120px, .25fr) 1fr; }
.outline-editor > div:last-child { display: grid; gap: 5px; }
.dialogue-heading { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.dialogue-heading p { margin: 0; color: var(--muted); }
[data-script-segments] { list-style: none; display: grid; gap: 12px; margin: 14px 0 0; padding: 0; }
.pronunciation-panel { position: sticky; top: 82px; padding: 24px; border-left: 1px solid var(--line); background: #faf8f2; }
.pronunciation-panel h3 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.pronunciation-panel p { margin: 0 0 12px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.workbench-footer { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 18px 28px; border-top: 1px solid var(--line); background: #f8f6f0; }
.audio-production { display: grid; gap: 14px; margin: 0 28px 22px; padding: 20px; border-radius: 14px; background: var(--green-dark); color: white; }
.audio-production h3 { margin: 0; color: white; }
.audio-production p { color: #c9d7ce; }
.audio-production audio { width: 100%; }
.audio-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.audio-actions .button { margin: 0; }
[data-audio-download] { display: inline-flex; }
[data-start-another] { display: inline-block; margin: 0 28px 24px; }
.private-gate-note { margin-top: 22px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8f6f0; }
.private-gate-note p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.studio-signin { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }

@media (max-width: 1040px) {
  .workbench-grid { grid-template-columns: 1fr; }
  .pronunciation-panel { position: static; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 720px) {
  .settings-grid { grid-template-columns: 1fr; }
  .host-row { grid-template-columns: 1fr; }
  .host-number { display: none; }
  .section-heading-compact, .workbench-header, .workbench-footer, .dialogue-heading { align-items: stretch; flex-direction: column; }
  .workbench-actions, .audio-actions { display: grid; }
  .outline-editor { grid-template-columns: 1fr; }
}