/* Shared functional surfaces. Video, theater and feature pages use these tokens. */
:root{--ui-danger:#b42318;--ui-danger-surface:#fef3f2;--ui-tab-selected-surface:#fff;--ui-tab-selected-text:#205c4f;--ui-workspace:#fff;--ui-field:#fff;--ui-subtle:#f1f3ed;--ui-border:#dde1d9;--ui-field-border:#d4dad2;--ui-text:#182a2a;--ui-secondary:#727975;--ui-selected:#e7f0e2;--ui-accent:#205c4f;--ui-radius:9px}
html[data-theme=dark]{--ui-canvas:#171d1c;--ui-danger:#ff9c96;--ui-danger-surface:#3f2927;--ui-workspace:#202724;--ui-field:#1b221e;--ui-subtle:#29332c;--ui-border:#3b4740;--ui-field-border:#435149;--ui-text:#e6eae6;--ui-secondary:#a4afa7;--ui-selected:#304c39;--ui-accent:#9BCEA9}
html[data-theme] #studio[data-mode=script],html[data-theme] #studio[data-mode=video] #studio-video-panel{--studio-workspace-surface:var(--ui-workspace);--video-workspace-surface:var(--ui-workspace);--studio-workspace-outline:var(--ui-border);--video-workspace-outline:var(--ui-border);--theater-field-border:var(--ui-field-border);--theater-label:var(--ui-secondary)}
html[data-theme] #studio[data-mode=script]>.studiotools,html[data-theme] #studio[data-mode=script]>.studioinner,html[data-theme] #studio[data-mode=video] #studio-video-panel{background:var(--ui-workspace)!important;border-color:var(--ui-border)!important;color:var(--ui-text)!important}
html[data-theme] :is(.clone-create,.clone-library,.library-voice-card,.pricecard,.dub-card){background:var(--ui-workspace)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme] #studio :is(#script-input,#project-name,.editrow textarea,.dub-director-content textarea,#dub-text,.ui-select-trigger,.studio-voice-trigger),html[data-theme] .clone-field :is(input,.ui-select-trigger){background:var(--ui-field)!important;color:var(--ui-text)!important;border-color:var(--ui-field-border)!important;border-radius:var(--ui-radius)}
html[data-theme] #studio :where(.inputpanel,.editpanel,#editor,.dub-role-settings){background:transparent!important}
html[data-theme] .voice-library-search{background:var(--ui-field)!important;color:var(--ui-secondary)!important;border-color:var(--ui-field-border)!important}
html[data-theme] .voice-library-search input{background:transparent!important;color:var(--ui-text)!important;border:0!important;border-radius:0!important;box-shadow:none!important}
html[data-theme] .voice-library-search input::placeholder{color:var(--ui-secondary)!important;opacity:1}
html[data-theme] .studio-voice-menu{background:var(--ui-workspace)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
html[data-theme] #studio .studio-voice-entry .studio-voice-option{background:var(--ui-field)!important;border-color:var(--ui-field-border)!important;color:var(--ui-text)!important}
html[data-theme] #studio .studio-voice-entry .studio-voice-option:is(:hover,.is-selected){background:var(--ui-selected)!important;border-color:var(--ui-accent)!important}
html[data-theme] .studio-voice-section-empty{background:var(--ui-subtle)!important;color:var(--ui-secondary)!important}
html[data-theme] #studio[data-mode=script] .studiotools>.studio-project-field.video-project-name{flex:1;max-width:none!important;justify-content:flex-start!important;margin-right:auto!important;text-align:left!important}
html[data-theme] #studio[data-mode=script] .studio-project-field.video-project-name .video-project-name-text{margin:0!important;text-align:left!important}

/* Read-only video content is typography, not a form field. */
#studio-video-panel #dub-text[hidden]{display:none!important}
#studio-video-panel .dub-speaker-text{font-size:16px;font-weight:650;color:var(--ui-text);min-width:0;overflow-wrap:anywhere}
#studio-video-panel .dub-dialogue-text{margin:8px 0 4px;padding:0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8;color:var(--ui-text);font-size:15px}
#studio-video-panel .dub-transcript-text{margin:0;padding:16px 18px;white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:14px;line-height:1.9;color:var(--ui-secondary);background:transparent;border:0;max-height:360px;overflow:auto}

/* Consistent video direction controls and readable transcript spacing. */
#studio-video-panel .dub-director-row{padding:22px 16px 24px;box-sizing:border-box}
#studio-video-panel .dub-director-controls{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}
#studio-video-panel .dub-director-field{min-width:0}
html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){width:100%;height:48px!important;min-height:48px!important;box-sizing:border-box;padding:8px 12px!important;font-size:14px!important;font-weight:500}
#studio-video-panel .dub-director-field .studio-voice-trigger img{width:30px;height:32px;object-fit:cover}
#studio-video-panel .dub-director-field>span:first-child,#studio-video-panel .dub-director-content>span{font-size:12px;font-weight:400;line-height:1.5;margin-bottom:8px}
#studio-video-panel .dub-speaker-text{font-size:15px;font-weight:600}
#studio-video-panel .dub-director-content{padding:0 8px}
#studio-video-panel .dub-dialogue-text{font-size:15px;font-weight:400;line-height:1.95;margin:8px 0 0;padding:2px 0 4px;min-height:36px}
#studio-video-panel .dub-director-top .dub-director-timing{font-size:11px;font-weight:400}
#studio-video-panel .dub-transcript-text{padding:20px 24px;line-height:2}
@media(max-width:600px){#studio-video-panel .dub-director-row{padding:18px 10px}#studio-video-panel .dub-director-controls{gap:8px}}

/* Match Theater selector dimensions instead of filling the video column. */
#studio-video-panel .dub-director-controls{grid-template-columns:repeat(3,124px);justify-content:start;gap:10px}
html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){width:124px!important;min-width:0!important;padding:5px 8px!important;font-size:12px!important}
#studio-video-panel .dub-director-field .studio-voice-trigger img{width:32px;height:36px}
@media(max-width:700px){#studio-video-panel .dub-director-controls{grid-template-columns:repeat(3,minmax(0,104px));gap:8px}html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){width:100%!important}}

#studio-video-panel .dub-source-options{margin:18px 20px;padding:18px 0 0;border-top:1px solid var(--ui-border)}
#studio-video-panel .dub-source-options .dub-check{margin:0 0 18px;padding:0;border:0;display:flex;align-items:flex-start;gap:10px}
#studio-video-panel .dub-source-options .dub-left-status{margin:0;padding:14px 0 0;border:0;border-top:1px solid var(--ui-border);background:transparent}
#studio-video-panel .dub-source-options #dub-status{font-size:12px;line-height:1.8;margin:8px 0 0}

/* Give the three video columns breathing room without enlarging controls. */
#studio-video-panel .dub-director-list{padding:12px 20px;scrollbar-width:thin;scrollbar-gutter:stable}
#studio-video-panel .dub-director-row{padding:24px 4px 28px;margin-bottom:12px}
#studio-video-panel .dub-director-top{gap:10px;row-gap:8px}
#studio-video-panel .dub-director-controls{margin:22px 0 20px}
#studio-video-panel .dub-director-content{padding:0 10px}
#studio-video-panel .dub-dialogue-text{margin-top:12px;line-height:2;font-weight:400}
#studio-video-panel .dub-transcript-text{max-height:230px;padding:18px 20px;font-size:12px;line-height:2;scrollbar-width:thin}
#studio-video-panel .dub-editor-card>.small,#studio-video-panel .dub-editor-foot{display:none!important}
#studio-video-panel .dub-subtitle-actions{display:flex;flex-wrap:wrap;gap:8px!important;padding:14px!important}
#studio-video-panel .dub-panel-scroll{scrollbar-width:thin;scrollbar-gutter:stable}
#studio-video-panel .dub-source-options{margin-top:24px;padding-top:20px}
#studio-video-panel .dub-source-options .dub-check{border:0!important;margin-bottom:20px;line-height:1.7}
#studio-video-panel .dub-source-options .dub-check small{display:block;margin-top:6px}
#studio-video-panel .dub-settings .srt-role-list{max-height:none!important;overflow:visible!important;padding:0}
#studio-video-panel .dub-settings .srt-role-row{padding:16px 0;margin:0;border-bottom:1px solid var(--ui-border);gap:12px}
#studio-video-panel .dub-settings .srt-role-row:last-child{border-bottom:0}
#studio-video-panel .dub-settings .srt-role-hint{line-height:1.9;margin:18px 0}
#studio-video-panel .dub-settings-card .dub-settings{overflow:auto;scrollbar-width:thin;padding:18px!important}
#studio-video-panel .dub-settings-card>.dub-command-actions{gap:14px!important;padding:20px 18px!important}
@media(max-width:600px){#studio-video-panel .dub-director-list{padding:8px 12px}}

#studio-video-panel .dub-transcript-text[hidden]{display:none!important}
#studio-video-panel textarea.dub-dialogue-text{width:100%;box-sizing:border-box;min-height:90px;padding:12px;border:1px solid var(--ui-field-border);border-radius:8px;background:var(--ui-field);color:var(--ui-text);resize:vertical}

#studio-video-panel .dub-command-actions>.dub-check{display:flex;align-items:flex-start;gap:10px;margin:0 0 8px!important;padding:0 0 18px!important;border:0!important;border-bottom:1px solid var(--ui-border)!important;line-height:1.7}
#studio-video-panel .dub-command-actions>.dub-check small{display:block;margin-top:6px;font-size:11px;line-height:1.8}
#studio-video-panel .dub-source-options{padding-top:0;border-top:0}

#studio-video-panel .dub-source-options{margin:18px 20px 20px;padding:14px 0;border:0;border-bottom:1px solid var(--ui-border)}
#studio-video-panel .dub-source-options .dub-left-status{padding:0;border:0}
#studio-video-panel .dub-source-options .dub-recognition-help{margin:14px 0 0;padding:0;border:0}

#studio .studio-guide-link{display:inline-flex;align-items:center;margin-top:16px;color:var(--ui-accent);font-size:14px;font-weight:600;text-decoration:none;line-height:1.6}#studio .studio-guide-link:hover{text-decoration:underline;text-underline-offset:4px}#studio .studio-guide-link:focus-visible{outline:2px solid var(--ui-accent);outline-offset:5px;border-radius:3px}

#studio-video-panel .dub-source-options .dub-recognition-help{margin:0 0 16px}#studio-video-panel .dub-source-options .dub-left-status{padding-top:14px;border-top:1px solid var(--ui-border)}

#studio-video-panel .dub-source-options,#studio-video-panel .dub-source-options .dub-left-status{border:0!important}

#studio[data-mode=video]{padding-bottom:48px!important}@media(max-width:700px){#studio[data-mode=video]{padding-bottom:32px!important}}

#studio-video-panel .dub-cue-preview{margin-top:16px;padding:6px 12px;min-height:32px;font-size:12px;border:1px solid var(--ui-field-border);border-radius:7px;background:var(--ui-subtle);color:var(--ui-accent)}
#studio-video-panel .dub-director-row.is-previewing{background:var(--ui-selected);border-radius:8px}

#studio-video-panel .dub-director-controls{grid-template-columns:repeat(3,110px)}
html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){width:110px!important;height:42px!important;min-height:42px!important}
#studio-video-panel .dub-director-field .studio-voice-trigger img{width:28px;height:30px}
@media(max-width:600px){#studio-video-panel .dub-director-controls{grid-template-columns:repeat(3,minmax(0,1fr));max-width:350px}html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){width:100%!important}}

#studio-video-panel .dub-subtitle-body[hidden]{display:none!important}
#studio-video-panel .dub-subtitle-toggle{margin:14px 16px;min-height:36px;padding:8px 16px;font-size:12px;color:var(--ui-accent);background:var(--ui-subtle);border:1px solid var(--ui-field-border);border-radius:8px}
#studio-video-panel .dub-subtitle-body .dub-subtitle-actions{padding-top:0!important}
#studio-video-panel .dub-subtitle-body #dub-text:not([hidden]){display:block;width:100%;box-sizing:border-box;min-height:210px;padding:16px;background:var(--ui-field);color:var(--ui-text);border:1px solid var(--ui-field-border);border-radius:8px;font:inherit;font-size:12px;line-height:1.9;resize:vertical}

#studio #studio-video-panel .dub-panel-scroll>.dub-editor-card.dub-subtitle-tools{border:0!important;background:transparent!important;box-shadow:none!important;margin:16px 20px!important;overflow:visible!important}
#studio-video-panel .dub-subtitle-tools>.dub-card-head{display:none!important}
#studio-video-panel .dub-subtitle-tools>.dub-subtitle-actions{padding:0!important;display:flex;flex-wrap:wrap;gap:8px!important;justify-content:flex-start}
#studio-video-panel .dub-subtitle-actions .dub-subtitle-toggle{margin:0;min-height:32px}
#studio-video-panel .dub-subtitle-dialog{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:min(760px,calc(100vw - 40px));max-width:760px;max-height:80vh;padding:0;border:1px solid var(--ui-border);border-radius:14px;background:var(--ui-workspace);color:var(--ui-text);box-shadow:0 24px 80px #0005;overflow:hidden}
#studio-video-panel .dub-subtitle-dialog::backdrop{background:#09151299}
#studio-video-panel .dub-subtitle-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 24px;border-bottom:1px solid var(--ui-border)}
#studio-video-panel .dub-subtitle-dialog-head h2{font-size:18px;margin:0;font-weight:600}
#studio-video-panel .dub-subtitle-close{width:32px;height:32px;min-height:32px;padding:0;border:0;background:transparent;color:var(--ui-text);font-size:24px;box-shadow:none}
#studio-video-panel .dub-subtitle-dialog .dub-subtitle-body{max-height:calc(80vh - 80px);overflow:auto;padding:8px 12px 18px;box-sizing:border-box}
#studio-video-panel .dub-subtitle-dialog .dub-transcript-text{max-height:none;padding:16px 20px;font-size:14px;line-height:2}
#studio-video-panel .dub-subtitle-dialog #dub-text:not([hidden]){height:48vh!important;max-height:none!important;min-height:240px!important}

#studio-video-panel .dub-director-top span.dub-director-timing{cursor:default;display:inline-flex;align-items:center;min-height:28px}

/* Compact inline direction options: text and chevrons only. */
#studio-video-panel .dub-director-controls{display:flex;justify-content:flex-end;align-items:center;gap:18px;margin:16px 0 18px}
#studio-video-panel .dub-director-field>span:first-child{display:none}
#studio-video-panel .dub-director-field{flex:0 0 auto}
html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){width:auto!important;min-width:70px!important;height:32px!important;min-height:32px!important;padding:4px 2px!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0;font-size:12px!important;gap:10px}
#studio-video-panel .dub-director-field :is(.studio-voice-picker,.ui-select){width:auto!important;min-width:0!important}
#studio-video-panel .dub-director-field .studio-voice-trigger img{display:block!important;width:26px;height:30px;object-fit:cover;border-radius:5px;flex:none}
#studio-video-panel .dub-director-field .studio-voice-trigger strong{font-size:12px;font-weight:500}
#studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger):hover{color:var(--ui-accent)!important}
#studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger):focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px;border-radius:4px}
@media(max-width:600px){#studio-video-panel .dub-director-controls{gap:12px;flex-wrap:wrap;max-width:none}}

/* Theater and video direction controls share the same inline presentation. */
#studio[data-mode=script] .rowtools{align-items:center;justify-content:flex-end;gap:18px}
#studio[data-mode=script] .rowtools>b{margin-right:auto;padding-bottom:0}
#studio[data-mode=script] .rowtools>.ui-select::before,#studio[data-mode=script] .rowtools .studio-voice-picker::before{display:none!important;content:none!important}
#studio[data-mode=script] .rowtools :is(.studio-voice-picker,.ui-select){width:auto!important;min-width:0!important;flex:0 0 auto}
html[data-theme] #studio[data-mode=script] .rowtools :is(.ui-select-trigger,.studio-voice-trigger),html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){width:auto!important;min-width:70px!important;height:32px!important;min-height:32px!important;padding:4px 2px!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0;font-size:12px!important;gap:10px}
#studio[data-mode=script] .rowtools .studio-voice-trigger img,#studio-video-panel .dub-director-field .studio-voice-trigger img{display:block!important;width:26px;height:30px;object-fit:cover;border-radius:5px;flex:none}
#studio[data-mode=script] .rowtools .studio-voice-trigger strong{font-size:12px;font-weight:500}
#studio[data-mode=script] .rowtools :is(.ui-select-trigger,.studio-voice-trigger):focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px;border-radius:4px}
@media(max-width:600px){#studio[data-mode=script] .rowtools{gap:12px}#studio[data-mode=script] .rowtools>b{flex-basis:100%;text-align:left}}

/* Shared framed direction selectors for Theater and video. */
html[data-theme] #studio[data-mode=script] .rowtools :is(.ui-select-trigger,.studio-voice-trigger),html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){width:110px!important;min-width:0!important;height:42px!important;min-height:42px!important;padding:5px 8px!important;box-sizing:border-box;background:var(--ui-field)!important;border:1px solid var(--ui-field-border)!important;border-radius:8px;box-shadow:none!important;gap:8px}
html[data-theme] #studio[data-mode=script] .rowtools :is(.ui-select-trigger,.studio-voice-trigger):hover,html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger):hover{border-color:var(--ui-accent)!important}

/* Separate Theater sentences into quiet, readable groups. */
html[data-theme] #studio[data-mode=script] #editor{padding:8px 12px 12px 0}
html[data-theme] #studio[data-mode=script] #editor .editrow{margin:0 0 16px;padding:18px 16px 16px;border:1px solid var(--ui-border)!important;border-radius:12px;background:var(--ui-subtle)!important;box-shadow:none}
html[data-theme] #studio[data-mode=script].studio-compact #editor .editrow{padding:14px 14px 12px;margin-bottom:12px}
html[data-theme] #studio[data-mode=script] #editor .editrow:last-child{margin-bottom:0;border-bottom:1px solid var(--ui-border)!important}
html[data-theme] #studio[data-mode=script] #editor .editrow .rowtools{margin-bottom:14px}
html[data-theme] #studio[data-mode=script] #editor .editrow .studio-line-footer{padding-top:12px;margin-top:4px;border-top:1px solid var(--ui-border)}
html[data-theme] #studio[data-mode=script] #editor .editrow.active{background:var(--ui-selected)!important;border-color:transparent!important}
html[data-theme] #studio[data-mode=script] #editor .editrow.active::before{display:none!important}
@media(max-width:600px){html[data-theme] #studio[data-mode=script] #editor .editrow{padding:14px 12px;margin-bottom:12px}}

#studio[data-mode=video] #studio-video-panel .dub-source-card>.dub-command-actions{display:flex;flex-direction:column;align-items:stretch;flex:none;gap:12px;margin-top:auto;padding:20px;border-top:1px solid var(--ui-border);box-sizing:border-box;background:var(--ui-workspace)}
#studio-video-panel .dub-source-card>.dub-command-actions .dub-note{margin:0;font-size:12px;line-height:1.8;text-align:left}
#studio-video-panel .dub-source-card>.dub-command-actions #dub-start{width:100%;margin:0;min-height:44px}
#studio-video-panel .dub-source-card>.dub-command-actions>.dub-check{padding:0 0 14px!important;margin:0!important}

/* Compact, grouped source-column controls. */
#studio-video-panel .dub-source-options{margin:16px 20px 12px;padding:0}
#studio-video-panel .dub-source-options .dub-recognition-help{margin:0 0 12px;padding:0;font-size:12px}
#studio-video-panel .dub-source-options .dub-left-status{padding:0;margin:0}
#studio-video-panel .dub-source-options .dub-status-label{margin:0;line-height:1.6}
#studio-video-panel .dub-source-options #dub-status{margin:6px 0 0;line-height:1.7;font-size:11px}
#studio #studio-video-panel .dub-panel-scroll>.dub-editor-card.dub-subtitle-tools{margin:14px 20px 12px!important}
#studio-video-panel .dub-subtitle-tools>.dub-subtitle-actions{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px!important}
#studio-video-panel .dub-subtitle-actions :is(button,.dub-import){box-sizing:border-box;width:100%;min-height:34px!important;margin:0!important;padding:7px 8px!important;justify-content:center;text-align:center;font-size:11px;white-space:nowrap}
#studio-video-panel .dub-subtitle-actions .dub-recognize{grid-column:1/4;grid-row:1}
#studio-video-panel .dub-subtitle-actions .dub-subtitle-toggle{grid-column:4/7;grid-row:1}
#studio-video-panel .dub-subtitle-actions #dub-reset-srt{grid-column:1/3;grid-row:2}
#studio-video-panel .dub-subtitle-actions #dub-clear-srt{grid-column:3/5;grid-row:2}
#studio-video-panel .dub-subtitle-actions .dub-import{grid-column:5/7;grid-row:2;display:flex;align-items:center}
#studio-video-panel .dub-panel-scroll>.dub-project-note{margin:10px 20px 14px!important;padding:0!important;font-size:10px!important;line-height:1.75!important}
#studio[data-mode=video] #studio-video-panel .dub-source-card>.dub-command-actions{padding:16px 20px;gap:10px}
#studio-video-panel .dub-source-card>.dub-command-actions>.dub-check{padding:0 0 12px!important;line-height:1.5}
#studio-video-panel .dub-command-actions>.dub-check small{margin-top:4px;font-size:10px;line-height:1.6}
#studio-video-panel .dub-source-card>.dub-command-actions .dub-note{font-size:11px;line-height:1.6}
#studio-video-panel .dub-source-card>.dub-command-actions #dub-start{height:42px;min-height:42px;font-size:13px;padding:10px 14px}

/* Daylight: neutral canvas, crisp surfaces, restrained teal emphasis. */
html:not([data-theme=dark]){--ui-canvas:#f7f7f8;--ui-footer:#eff0f2;--ui-workspace:#fff;--ui-field:#fff;--ui-subtle:#f4f5f6;--ui-border:#e2e5e9;--ui-field-border:#cfd5db;--ui-text:#24292f;--ui-secondary:#68717b;--ui-selected:#edf4f1;--ui-accent:#205c4f}

/* Use the workspace separator token rather than inherited text colors. */
html[data-theme] #studio[data-mode=script] :is(.studio-edit-toolbar,.studio-smart-dubbing,.studio-player,.studio-audio-actions){border-color:var(--ui-border)!important}
html[data-theme] #studio[data-mode=script] .studio-edit-toolbar{padding-bottom:16px;margin-bottom:12px;border-bottom:1px solid var(--ui-border)}
html[data-theme] #studio[data-mode=script] .studio-smart-dubbing{margin-top:20px;padding-top:18px;border-top:1px solid var(--ui-border)}

html[data-theme] #studio[data-mode=video] #studio-video-panel .studio-video-toolbar{position:relative;margin-bottom:16px;padding-bottom:20px}
html[data-theme] #studio[data-mode=video] #studio-video-panel .studio-video-toolbar::after{content:'';position:absolute;left:8px;right:8px;bottom:0;height:1px;background:var(--ui-border);pointer-events:none}

#studio-video-panel .dub-subtitle-methods{margin:12px 20px 16px;padding:12px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-subtle)}
#studio-video-panel .dub-subtitle-methods[hidden]{display:none!important}
#studio-video-panel .dub-subtitle-methods p{font-size:12px;line-height:1.7;margin:0 0 10px;color:var(--ui-secondary)}
#studio-video-panel .dub-subtitle-methods>div{display:flex;flex-wrap:wrap;gap:8px}
#studio-video-panel .dub-subtitle-methods button{flex:1;min-height:34px;padding:7px 9px;font-size:11px;white-space:nowrap}

/* Compact, distinct video dialogue cards. */
html[data-theme] #studio-video-panel .dub-director-list{padding:12px 16px}
html[data-theme] #studio-video-panel .dub-director-row{box-sizing:border-box;padding:14px 14px 12px;margin:0 0 12px;border:1px solid var(--ui-border)!important;border-radius:10px;background:var(--ui-subtle);box-shadow:none}
html[data-theme] #studio-video-panel .dub-director-row:last-child{margin-bottom:0;border-bottom:1px solid var(--ui-border)!important}
#studio-video-panel .dub-director-row .dub-director-top{gap:8px;min-height:28px}
#studio-video-panel .dub-director-row .dub-director-controls{margin:10px 0 12px;gap:12px}
#studio-video-panel .dub-director-row .dub-director-content{padding:0 4px}
#studio-video-panel .dub-director-row .dub-director-content>span{margin-bottom:6px;font-size:11px}
#studio-video-panel .dub-director-row .dub-dialogue-text{margin:0;padding:2px 0;min-height:0;line-height:1.8;font-size:14px}
#studio-video-panel .dub-director-row .dub-cue-preview{margin-top:12px;min-height:30px;padding:5px 10px}
html[data-theme] #studio-video-panel .dub-director-row:is(.is-current,.is-previewing){background:var(--ui-selected)!important;border-color:var(--ui-border)!important;border-radius:10px}
@media(max-width:600px){html[data-theme] #studio-video-panel .dub-director-list{padding:10px}html[data-theme] #studio-video-panel .dub-director-row{padding:12px}}

/* Two subtitle entry points, with occasional actions inside the dialog. */
#studio-video-panel .dub-subtitle-tools>.dub-subtitle-actions{display:flex!important;gap:10px!important;align-items:flex-start}
#studio-video-panel .dub-subtitle-actions>.dub-subtitle-source-menu,#studio-video-panel .dub-subtitle-actions>.dub-subtitle-toggle{flex:1;min-width:0;width:auto!important}
#studio-video-panel .dub-subtitle-source-menu:has(.dub-subtitle-methods[hidden]){display:none}
#studio-video-panel .dub-subtitle-source-menu summary{display:flex;justify-content:center;align-items:center;gap:12px;box-sizing:border-box;min-height:36px;padding:8px 12px;border:1px solid var(--ui-field-border);border-radius:8px;background:var(--ui-subtle);color:var(--ui-text);font-size:12px;cursor:pointer;list-style:none}
#studio-video-panel .dub-subtitle-source-menu summary::-webkit-details-marker{display:none}
#studio-video-panel .dub-subtitle-source-menu summary::after{content:'';width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin-top:-4px}
#studio-video-panel .dub-subtitle-source-menu[open] summary::after{transform:rotate(225deg);margin-top:4px}
#studio-video-panel .dub-subtitle-source-menu .dub-subtitle-methods{margin:8px 0 0;padding:6px;border-radius:8px;background:var(--ui-field)}
#studio-video-panel .dub-subtitle-source-menu .dub-subtitle-methods>p{display:none}
#studio-video-panel .dub-subtitle-source-menu .dub-subtitle-methods>div{display:flex;flex-direction:column;gap:4px}
#studio-video-panel .dub-subtitle-source-menu :is(button,.dub-import){display:flex;align-items:center;justify-content:flex-start!important;border:0;background:transparent;text-align:left!important;padding:8px 10px!important;min-height:34px!important;width:100%;font-size:12px}
#studio-video-panel .dub-subtitle-source-menu :is(button,.dub-import):hover{background:var(--ui-selected)}
#studio-video-panel .dub-subtitle-manage{display:flex;justify-content:flex-end;gap:8px;padding:10px 12px 4px}
#studio-video-panel .dub-subtitle-manage button{padding:6px 10px;min-height:32px;font-size:12px}
#studio-video-panel .dub-subtitle-actions>.dub-subtitle-toggle{min-height:36px!important}

#studio-video-panel .dub-subtitle-tools>.dub-subtitle-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important}
#studio-video-panel .dub-subtitle-actions>.dub-subtitle-inline-methods{display:contents!important}
#studio-video-panel .dub-subtitle-inline-methods[hidden]{display:none!important}
#studio-video-panel .dub-subtitle-inline-methods>p{display:none}
#studio-video-panel .dub-subtitle-inline-methods>div{display:contents}
#studio-video-panel .dub-subtitle-actions :is(.dub-recognize,.dub-import,.dub-subtitle-toggle){grid-column:auto!important;grid-row:auto!important}
#studio-video-panel .dub-subtitle-actions :is(button,.dub-import){width:100%!important;min-height:36px!important;margin:0!important;padding:8px 10px!important;font-size:12px;box-sizing:border-box;justify-content:center;text-align:center}

/* Sentence preview feedback shared by Theater and video. */
#studio :is(.studio-line-play,.dub-cue-preview)[data-preview-state]{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:70px}
#studio :is(.studio-line-play,.dub-cue-preview)[data-preview-state]::before{content:'';display:inline-block;flex:none;width:12px;height:12px;background:currentColor;clip-path:polygon(15% 0,100% 50%,15% 100%)}
#studio :is(.studio-line-play,.dub-cue-preview)[data-preview-state=loading]::before{box-sizing:border-box;background:none;clip-path:none;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:vc-preview-spin .8s linear infinite}
#studio :is(.studio-line-play,.dub-cue-preview)[data-preview-state=playing]::before{clip-path:none;background:linear-gradient(to right,currentColor 0 32%,transparent 32% 68%,currentColor 68% 100%)}
#studio .dub-cue-preview[data-preview-state=playing]::before{background:currentColor;clip-path:inset(1px)}
@keyframes vc-preview-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#studio :is(.studio-line-play,.dub-cue-preview)[data-preview-state=loading]::before{animation:none}}

/* Shared-theme subtitle export settings and source-coordinate masking. */
.dub-subtitle-output{border-top:1px solid var(--ui-border);padding-top:16px;margin-top:16px}
.dub-subtitle-output h4{margin:0 0 8px;font-size:13px}.dub-subtitle-output p{font-size:12px;color:var(--ui-secondary);margin:8px 0 12px}.dub-subtitle-output>button{width:100%}
.dub-subtitle-output-dialog{width:min(680px,calc(100vw - 40px));max-height:85vh;overflow:auto;padding:24px;border:1px solid var(--ui-border);border-radius:14px;background:var(--ui-workspace);color:var(--ui-text)}
.dub-subtitle-output-dialog::backdrop{background:#0008}.dub-subtitle-output-dialog header{display:flex;align-items:center;justify-content:space-between;gap:16px}.dub-subtitle-output-dialog h3{margin:0}.dub-subtitle-output-dialog p{font-size:13px;line-height:1.8;color:var(--ui-secondary)}
.dub-output-modes,.dub-cover-actions{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.dub-output-modes button{padding:10px 12px;border:1px solid var(--ui-field-border);border-radius:8px;background:var(--ui-field);color:var(--ui-text)}.dub-output-modes button[aria-pressed=true]{background:var(--ui-selected);border-color:var(--ui-accent)}
.dub-subtitle-output-dialog label{display:block;margin:12px 0 8px;font-size:13px}.dub-subtitle-output-dialog textarea{width:100%;box-sizing:border-box;min-height:180px;padding:12px;border:1px solid var(--ui-field-border);border-radius:8px;background:var(--ui-field);color:var(--ui-text);font:13px/1.8 monospace;resize:vertical}
.dub-cover-layer{position:absolute;z-index:3;pointer-events:none}.dub-cover-layer.is-drawing{pointer-events:auto;cursor:crosshair;outline:1px dashed var(--ui-accent)}.dub-cover-rectangle{position:absolute;background:transparent;outline:2px solid var(--ui-accent);pointer-events:none}.dub-cover-layer.is-drawing .dub-cover-rectangle{outline:2px solid var(--ui-accent)}

#studio-video-panel .dub-panel-scroll>.dub-subtitle-output{margin:14px 20px 18px;padding:16px 0 0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 16px;align-items:center}
#studio-video-panel .dub-panel-scroll>.dub-subtitle-output h4{margin:0}#studio-video-panel .dub-panel-scroll>.dub-subtitle-output p{grid-column:1;margin:0;font-size:12px}#studio-video-panel .dub-panel-scroll>.dub-subtitle-output>button{grid-column:2;grid-row:1/3;width:auto;min-height:38px;padding:8px 12px;font-size:12px}
@media(max-width:480px){#studio-video-panel .dub-panel-scroll>.dub-subtitle-output{grid-template-columns:1fr}#studio-video-panel .dub-panel-scroll>.dub-subtitle-output>button{grid-column:1;grid-row:auto;width:100%;margin-top:6px}}

/* Apply the same daylight hierarchy to marketing, editors, cards and menus. */
html:not([data-theme=dark]) :is(.global-scene,.global-solution,.library-voice-card,.home-voice-card,.pricecard,.voice-clone-card,.voice-clone-form){background:var(--ui-workspace)!important;border-color:var(--ui-border)!important;color:var(--ui-text)}
html:not([data-theme=dark]) :is(.global-scene-bar,.global-scene-footer,.global-final,.global-guide pre,.voice-filter-pills,.voice-category-pills,.dub-upload,.dub-recognition-help p){background:var(--ui-subtle)!important;border-color:var(--ui-border)!important}
html:not([data-theme=dark]) #site-footer.resource-footer{background:var(--ui-footer)!important;border-color:var(--ui-border)!important}
html:not([data-theme=dark]) :is(.studio-intro,.library-hero,.feature-page-header){background:transparent!important}
html:not([data-theme=dark]) #studio :is(.editrow,.dub-director-row){box-shadow:0 1px 2px #18232c04}
html:not([data-theme=dark]) #site-header .account-button.is-signed-in{background:var(--ui-workspace)!important;border-color:var(--ui-border)!important;color:var(--ui-text)!important}
html:not([data-theme=dark]) #site-header .account-trigger-credits{background:var(--ui-selected)!important;color:var(--ui-accent)!important}

.dub-subtitle-output-dialog [hidden]{display:none!important}
.dub-subtitle-output-dialog label.dub-output-choice{display:flex;align-items:center;gap:10px;margin:0;padding:10px 0;cursor:pointer;font-size:13px;color:var(--ui-text)}
.dub-subtitle-output-dialog .dub-output-modes{flex-direction:column;gap:0;padding:10px 14px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-subtle)}
.dub-output-choice input[type=checkbox]{margin:0;flex:none;background:var(--ui-field);border-color:var(--ui-field-border)}.dub-output-choice input[type=checkbox]:checked{background:var(--ui-accent);border-color:var(--ui-accent)}

/* Two working columns; retained hidden role defaults keep existing project settings intact. */
#studio #studio-video-panel .dub-settings-card{display:none!important}
#studio #studio-video-panel .dub-workspace{grid-template-columns:minmax(280px,.9fr) minmax(340px,1.1fr);grid-template-rows:minmax(0,1fr)}
#studio-video-panel .dub-director-card{grid-column:2;grid-row:1}
#studio-video-panel .dub-source-card{grid-column:1;grid-row:1}
#studio-video-panel .dub-director-row textarea.dub-dialogue-text{padding:14px 16px;min-height:108px;margin:8px 0 0;line-height:1.85;letter-spacing:normal;font-family:inherit;font-size:14px;box-sizing:border-box}
@media(max-width:800px){#studio #studio-video-panel .dub-workspace{display:flex;flex-direction:column}#studio-video-panel .dub-director-row textarea.dub-dialogue-text{padding:12px 14px}}

/* Unified subtitle replacement, with actions exposed only after opting in. */
#studio-video-panel .dub-panel-scroll>.dub-replace-output{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px}
.dub-replace-choice{display:inline-flex;align-items:center;gap:9px;font-size:13px;font-weight:600;cursor:pointer;margin:0}
.dub-replace-actions{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}.dub-replace-actions[hidden]{display:none!important}
.dub-replace-actions>button{min-height:36px;padding:7px 11px;font-size:12px}
#studio-video-panel .dub-replace-output>p{flex-basis:100%;line-height:1.8;margin:0}
.dub-subtitle-compare{width:min(1000px,calc(100vw - 48px));height:min(960px,92dvh);max-height:92dvh;box-sizing:border-box;overflow:hidden}
.dub-subtitle-compare[open]{display:flex;flex-direction:column;gap:0}
#studio-video-panel .dub-subtitle-compare>header{padding:0 0 14px;margin:0;flex-shrink:0;min-height:0;border-bottom:1px solid var(--ui-border)}
#studio-video-panel .dub-subtitle-compare>header button{min-height:38px;padding:8px 18px;font-size:13px}
#studio-video-panel .dub-subtitle-compare>p{margin:10px 0 14px;font-size:12px;line-height:1.6;flex-shrink:0}
#studio-video-panel .dub-subtitle-compare>p:last-child{margin:8px 0 0;font-size:11px}
.dub-compare-footer{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding-top:12px;flex-shrink:0}
.dub-compare-footer p{margin:0;font-size:12px}.dub-compare-footer .dub-compare-sync{display:flex;align-items:center;gap:8px;margin:0 0 0 auto;font-size:12px;cursor:pointer;color:var(--ui-secondary)}
.dub-compare-footer>button{min-height:32px;padding:6px 10px;font-size:12px}
.dub-compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.dub-compare-grid>section{min-width:0}.dub-compare-grid h4{font-size:13px;margin:12px 0}
.dub-compare-grid pre,.dub-compare-grid textarea{box-sizing:border-box;width:100%;height:340px;min-height:220px;overflow:auto;margin:0;padding:16px;border:1px solid var(--ui-field-border);border-radius:8px;background:var(--ui-field);color:var(--ui-text);font:13px/1.8 inherit;white-space:pre-wrap;overflow-wrap:anywhere}.dub-compare-grid pre{background:var(--ui-subtle)}
@media(max-width:650px){.dub-compare-grid{grid-template-columns:1fr}.dub-compare-grid pre,.dub-compare-grid textarea{height:240px}.dub-replace-actions{margin-left:0}}

/* Keep public section spacing and editor grids out of the comparison dialog. */
#studio-video-panel .dub-subtitle-compare .dub-compare-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:20px;width:100%;padding:0;margin:0;max-width:none;flex:1;min-height:0}
#studio-video-panel .dub-subtitle-compare .dub-compare-grid>section{width:auto!important;max-width:none!important;min-width:0;padding:0!important;margin:0!important;min-height:0;display:flex;flex-direction:column}
#studio-video-panel .dub-subtitle-compare .dub-compare-grid :is(pre,textarea){display:block;width:100%!important;max-width:none!important;font-family:inherit;font-size:14px;line-height:1.85;letter-spacing:normal;padding:18px 20px;flex:1;height:auto;min-height:0;resize:none;scrollbar-width:thin;scrollbar-gutter:stable}
@media(max-width:650px){#studio-video-panel .dub-subtitle-compare{width:calc(100vw - 20px);height:94dvh;max-height:94dvh;padding:16px}#studio-video-panel .dub-subtitle-compare .dub-compare-grid{grid-template-columns:minmax(0,1fr)!important;overflow:auto}#studio-video-panel .dub-subtitle-compare .dub-compare-grid>section{min-height:240px}#studio-video-panel .dub-subtitle-compare .dub-compare-grid :is(pre,textarea){min-height:200px;font-size:13px;padding:14px}}

/* Compact comparison chrome; reserve space for subtitle text. */
#studio-video-panel .dub-subtitle-compare{padding:20px 24px}
#studio-video-panel .dub-subtitle-compare>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 0 10px}
#studio-video-panel .dub-subtitle-compare>header h3{margin:0;font-size:18px;line-height:1.4}
#studio-video-panel .dub-subtitle-compare>p{padding:0;margin:8px 0;font-size:12px}
#studio-video-panel .dub-subtitle-compare .dub-compare-grid h4{margin:6px 0 8px;line-height:1.4}
.dub-compare-footer .dub-compare-diff{display:flex;align-items:center;gap:8px;margin-left:auto;font-size:12px;color:var(--ui-secondary);cursor:pointer}
.dub-compare-footer .dub-compare-sync{margin-left:0}
#studio-video-panel .dub-subtitle-compare .dub-compare-grid [hidden]{display:none!important}

#studio-video-panel .dub-subtitle-compare>header{height:auto;position:static;flex:none;width:100%;max-width:none;box-sizing:border-box}
#studio-video-panel .dub-subtitle-compare>header button{width:32px;height:32px;min-height:32px;flex:none;padding:0;margin-left:auto}
/* Video directing follows Theater's compact, single-open dialogue list. */
html[data-theme] #studio-video-panel .dub-director-row{padding:0 12px;margin:0 0 8px;border-radius:9px;background:var(--ui-subtle)}
html[data-theme] #studio-video-panel .dub-director-row.is-expanded{padding-bottom:12px;border-color:var(--ui-accent)!important;background:var(--ui-workspace)!important}
#studio-video-panel .dub-line-summary{display:flex;align-items:center;gap:12px;width:100%;min-height:58px;padding:12px 0;border:0;background:transparent!important;color:var(--ui-text);text-align:left;box-shadow:none;transform:none;font-size:13px}
#studio-video-panel .dub-summary-role{flex:0 0 85px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#studio-video-panel .dub-summary-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400}
#studio-video-panel .dub-summary-meta{display:flex;align-items:center;gap:7px;flex:none;font-size:11px;font-weight:400;color:var(--ui-secondary)}
#studio-video-panel .dub-summary-avatar{width:28px;height:30px;object-fit:cover;border-radius:6px;flex:none}
#studio-video-panel .dub-summary-voice{max-width:78px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ui-accent)}
#studio-video-panel :is(.dub-summary-emotion,.dub-summary-speed){padding:3px 6px;border:1px solid var(--ui-border);border-radius:5px;white-space:nowrap}
#studio-video-panel .dub-summary-arrow{margin-left:auto;color:var(--ui-secondary)}
#studio-video-panel .is-expanded .dub-summary-arrow{transform:rotate(180deg)}
#studio-video-panel .dub-director-row:not(.is-expanded)>:not(.dub-line-summary){display:none!important}
#studio-video-panel .is-expanded :is(.dub-summary-text,.dub-summary-meta){display:none}
#studio-video-panel .is-expanded .dub-director-top>:not(.dub-director-timing){display:none}
#studio-video-panel .dub-director-row .dub-director-top{min-height:0}
#studio-video-panel .dub-director-row .dub-director-controls{margin:10px 0 12px;align-items:flex-end}
#studio-video-panel .dub-director-field>span:first-child{display:block;margin-bottom:6px;color:var(--ui-secondary)}
#studio-video-panel .dub-line-summary:focus-visible{outline:2px solid var(--ui-accent);outline-offset:2px;border-radius:6px}
@media(max-width:1100px){#studio-video-panel .dub-line-summary{flex-wrap:wrap;gap:8px 12px}#studio-video-panel .dub-summary-text{flex-basis:calc(100% - 120px)}#studio-video-panel .dub-summary-meta{flex:1 0 auto}}
html[data-theme] #studio-video-panel .dub-line-summary,html[data-theme] #studio-video-panel .dub-line-summary :is(.dub-summary-role,.dub-summary-text){color:var(--ui-text)!important}
/* Keep cue identity and timing visible without a separate empty header row. */
#studio-video-panel .dub-line-summary{flex-wrap:wrap;gap:6px 12px;min-height:0;padding:10px 0}
#studio-video-panel .dub-summary-context{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1 0 100%;min-width:0;font-size:10px;font-weight:400;color:var(--ui-secondary);line-height:1.5}
#studio-video-panel .dub-summary-context .studio-line-number{font-size:10px;padding:2px 6px;white-space:nowrap}
#studio-video-panel .dub-summary-context .dub-director-timing{font-size:10px;white-space:nowrap;font-variant-numeric:tabular-nums}
#studio-video-panel .dub-director-row.is-expanded .dub-line-summary{padding-bottom:4px}
#studio-video-panel .dub-director-row.is-expanded .dub-director-controls{margin:4px 0 8px;gap:10px}
#studio-video-panel .dub-director-row .dub-director-content{padding:0}
#studio-video-panel .dub-director-row textarea.dub-dialogue-text{height:68px;min-height:68px;padding:9px 12px;margin:0;line-height:1.65}
#studio-video-panel .dub-director-row .dub-cue-preview{margin-top:8px}
/* Cue number and speaker form one heading, matching the reference. */
#studio-video-panel .dub-summary-context .dub-summary-role{flex:1;min-width:0;font-size:13px;font-weight:650;line-height:1.5;color:var(--ui-text)}
#studio-video-panel .dub-summary-text{flex-basis:0}
#studio-video-panel .dub-director-row.is-expanded .dub-summary-arrow{position:absolute;right:12px;top:34px}
#studio-video-panel .dub-director-row{position:relative}
@media(max-width:1100px){#studio-video-panel .dub-summary-text{flex-basis:100%}}

/* Expanded dialogue shares the Theater editing surface in both workspaces. */
html[data-theme] #studio[data-mode=script] #editor .editrow.is-expanded{background:var(--ui-workspace)!important}
/* Longer localized labels wrap without widening shared layouts. */
html:is([lang=es],[lang=ja],[lang=ko]) .studio-intro-flow{flex-wrap:wrap}
html:is([lang=es],[lang=ja],[lang=ko]) .library-voice-actions button{white-space:normal;overflow-wrap:anywhere}
.resource-footer-bottom>nav{flex-wrap:wrap}
/* Playback highlights remain visible while transport buttons keep keyboard focus. */
#studio[data-mode=script] .studio-script-frame{position:relative;flex:1 1 0;min-height:100px;min-width:0;background:var(--ui-field);border-radius:var(--ui-radius);overflow:hidden}
#studio[data-mode=script] .studio-script-frame #script-input{position:absolute;inset:0;box-sizing:border-box;width:100%;height:100%;margin:0;z-index:1;background:transparent!important}
#studio[data-mode=script] .studio-script-highlight{position:absolute;box-sizing:border-box;overflow:hidden;white-space:pre-wrap;overflow-wrap:break-word;color:transparent;pointer-events:none;user-select:none}
#studio[data-mode=script] .studio-script-current{background:var(--ui-selected);color:transparent;box-decoration-break:clone;-webkit-box-decoration-break:clone;border-radius:3px;outline:1px solid var(--ui-accent)}
@media(max-width:600px){#studio[data-mode=script] .studio-script-frame{min-height:40px}}
/* Dialogue summaries grow with the full text instead of truncating it. */
#studio[data-mode=script] .studio-summary-text,#studio-video-panel .dub-summary-text{white-space:pre-wrap;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.7}
/* Completed video occupies the director preview; the source stays on the left. */
#studio-video-panel .dub-director-list[hidden],#studio-video-panel .dub-director-pager[hidden],#studio-video-panel .dub-preview-switch[hidden]{display:none!important}
#studio #studio-video-panel .dub-director-card>.dub-output-slot{flex:1;min-height:0;aspect-ratio:auto;margin:12px 14px;width:auto;overflow:hidden;background:var(--ui-field)}
#studio-video-panel .dub-director-card>.dub-output-slot .dub-output-preview{height:100%;width:100%;margin:0;position:relative;display:flex;align-items:center;justify-content:center}
#studio-video-panel .dub-director-card>.dub-output-slot video{width:100%;height:100%;max-height:100%;object-fit:contain}
#studio-video-panel .dub-director-card .dub-card-head{flex-wrap:wrap;gap:8px}
#studio-video-panel .dub-director-card .dub-preview-switch{margin-left:auto;background:var(--ui-subtle)}
/* Left preview can show the source video or its current subtitle text. */
#studio-video-panel .dub-source-view-switch{margin-left:auto;background:var(--ui-subtle)}
#studio-video-panel .dub-source-subtitle-view{box-sizing:border-box;min-height:220px;max-height:420px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 14px;padding:16px;background:var(--ui-field);color:var(--ui-text);border:0;border-radius:var(--ui-radius);font:13px/1.8 inherit}
#studio-video-panel .dub-source-subtitle-view[hidden],#studio-video-panel .dub-preview-top.source-view-hidden{display:none!important}
#studio-video-panel .dub-source-result{position:relative;aspect-ratio:16/9;margin:0 14px;overflow:hidden;border-radius:var(--ui-radius);background:var(--ui-field)}
#studio-video-panel .dub-source-result[hidden]{display:none!important}
#studio-video-panel .dub-source-result video{display:block;width:100%;height:100%;object-fit:contain}
#studio-video-panel .dub-source-view-switch button:disabled{opacity:.4;cursor:not-allowed;color:var(--ui-secondary)}
#studio-video-panel .dub-source-card>.dub-card-head{flex-wrap:wrap;gap:8px}

html[data-theme] #studio[data-mode=script] #editor .editrow.is-expanded.is-role-highlighted{background:var(--ui-selected)!important;border-color:var(--ui-accent)!important}
/* The subtitle dialog's existing editor and actions now live in the subtitle tab. */
#studio-video-panel .dub-source-subtitle-view.dub-subtitle-inline-editor{padding:0;max-height:none;overflow:visible;white-space:normal;background:transparent;font-family:inherit}
#studio-video-panel .dub-subtitle-inline-editor>.dub-subtitle-dialog-head{height:auto;min-height:0;flex-wrap:wrap;gap:12px;padding:12px 0;border:0}
#studio-video-panel .dub-subtitle-inline-editor .dub-subtitle-dialog-head h2{margin:0;font-size:16px;color:var(--ui-text)}
#studio-video-panel .dub-subtitle-inline-editor .dub-subtitle-close[hidden]{display:none!important}
#studio-video-panel .dub-subtitle-inline-editor .dub-subtitle-editor-tools{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-left:auto}
#studio-video-panel .dub-subtitle-inline-editor .dub-subtitle-editor-tools .dub-replace-actions,#studio-video-panel .dub-subtitle-inline-editor .dub-subtitle-manage{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin:0;padding:0}
#studio-video-panel .dub-subtitle-inline-editor .dub-subtitle-editor-tools button{min-height:34px;padding:7px 12px;font-size:12px;line-height:1.4;margin:0}
#studio-video-panel .dub-subtitle-inline-editor .small{font-size:11px;line-height:1.8;color:var(--ui-secondary);margin:8px 0 12px}
html[data-theme] #studio #studio-video-panel .dub-subtitle-inline-editor #dub-text{display:block;width:100%;box-sizing:border-box;height:420px;min-height:260px;max-height:none;resize:vertical;padding:16px;border:1px solid var(--ui-field-border);border-radius:var(--ui-radius);background:var(--ui-field);color:var(--ui-text);font-family:inherit;font-size:13px;line-height:1.9}
#studio-video-panel .dub-subtitle-inline-editor .dub-editor-foot{font-size:10px;color:var(--ui-secondary);margin-top:8px}
@media(max-width:600px){html[data-theme] #studio #studio-video-panel .dub-subtitle-inline-editor #dub-text{height:340px;padding:12px}}
/* Compact tabs retain tab semantics with the original white selected surface. */
html[data-theme] #studio-video-panel .ui-tabs{display:flex;align-items:center;gap:2px;padding:3px;margin-left:auto;background:var(--ui-subtle);border:0;border-radius:8px;max-width:100%;min-width:0}
html[data-theme] #studio-video-panel .ui-tabs>[role=tab]{display:flex;align-items:center;justify-content:center;min-height:30px;min-width:0;padding:5px 10px;margin:0;border:0;border-radius:6px;background:transparent;color:var(--ui-secondary);box-shadow:none;font-size:12px;font-weight:500;line-height:1.5;white-space:nowrap;transform:none}
html[data-theme] #studio-video-panel .ui-tabs>[role=tab][aria-selected=true]{background:var(--ui-tab-selected-surface);color:var(--ui-tab-selected-text);font-weight:600}
#studio-video-panel .ui-tabs>[role=tab][aria-selected=true]::after{content:none}
html[data-theme] #studio-video-panel .ui-tabs>[role=tab]:hover:not(:disabled):not([aria-selected=true]){color:var(--ui-text)}
html[data-theme] #studio-video-panel .ui-tabs>[role=tab]:disabled{opacity:.4;cursor:not-allowed}
#studio-video-panel .ui-tabs>[role=tab]:focus-visible{outline:2px solid var(--ui-accent);outline-offset:1px}
@media(max-width:600px){html[data-theme] #studio-video-panel .ui-tabs>[role=tab]{padding:5px 8px;font-size:11px}}
/* Compact voice, mood and speed selectors shared by Theater and video. */
html[data-theme] #studio[data-mode=script] .rowtools :is(.ui-select-trigger,.studio-voice-trigger),html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){width:96px!important;min-width:0!important;height:36px!important;min-height:36px!important;padding:4px 7px!important;font-size:11px!important;gap:6px}
#studio[data-mode=script] .rowtools .studio-voice-trigger img,#studio-video-panel .dub-director-field .studio-voice-trigger img{width:24px;height:26px}
#studio[data-mode=script] .rowtools,#studio-video-panel .dub-director-controls{gap:8px}
/* Fill available source-column space while editing subtitles. */
#studio-video-panel .dub-panel-scroll:has(>.dub-subtitle-inline-editor:not([hidden])){display:flex;flex-direction:column;min-height:0}
#studio-video-panel .dub-panel-scroll>.dub-subtitle-inline-editor:not([hidden]){display:flex;flex-direction:column;flex:1 1 0;min-height:0;max-height:none;overflow:hidden}
#studio-video-panel .dub-subtitle-inline-editor>.dub-subtitle-dialog-head{flex:none}
#studio-video-panel .dub-subtitle-inline-editor>.dub-subtitle-body{display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:hidden}
#studio-video-panel .dub-subtitle-inline-editor .dub-subtitle-body>.small,#studio-video-panel .dub-subtitle-inline-editor .dub-editor-foot{flex:none}
html[data-theme] #studio #studio-video-panel .dub-subtitle-inline-editor #dub-text{flex:1 1 0;height:auto!important;min-height:180px!important;max-height:none!important;resize:none;overflow:auto}
@media(max-width:800px){#studio-video-panel .dub-panel-scroll>.dub-subtitle-inline-editor:not([hidden]){flex:auto;min-height:520px}}

/* Single-line audition actions use the same dimensions and surfaces in both editors. */
html[data-theme] #studio :is(.studio-line-play,.dub-cue-preview){display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:78px;min-height:34px;padding:6px 12px;font-size:12px;font-weight:600;line-height:1.5;border:1px solid var(--ui-field-border);border-radius:6px;background:var(--ui-selected)!important;color:var(--ui-accent)!important;box-shadow:none}
html[data-theme] #studio :is(.studio-line-play,.dub-cue-preview):hover:not(:disabled){border-color:var(--ui-accent)}
html[data-theme] #studio :is(.studio-line-play,.dub-cue-preview)::before{width:16px!important;height:16px!important;flex-basis:16px!important}

/* One icon definition prevents the video outline and Theater triangle from diverging. */
html[data-theme] #studio :is(.studio-line-play,.dub-cue-preview):not([data-preview-state=loading]):not([data-preview-state=playing])::before{content:''!important;display:block!important;width:16px!important;height:16px!important;flex:0 0 16px!important;background:currentColor!important;clip-path:none!important;border:0!important;border-radius:0!important;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4v16l13-8Z'/%3E%3C/svg%3E") center/contain no-repeat!important;animation:none!important}

/* Overlapping cues stay editable; only conflicting timestamps receive error emphasis. */
html[data-theme] #studio #studio-video-panel .dub-director-row>.dub-director-timing.is-overlapping{color:var(--ui-danger)!important;background:var(--ui-danger-surface)!important;border-radius:4px;padding:2px 6px;font-weight:650}
:root{--ui-success:#27834b}html[data-theme=dark]{--ui-success:#9fd4af}
/* Destructive line actions use the shared error color in every workspace. */
html[data-theme] .studio-line-menu>button.is-destructive{color:var(--ui-danger)!important}
html[data-theme] .studio-line-menu>button.is-destructive:is(:hover,:focus-visible){color:var(--ui-danger)!important;background:var(--ui-danger-surface)!important}
/* Loading must clear the play mask before drawing its circular spinner. */
html[data-theme] #studio :is(.studio-line-play,.dub-cue-preview)[data-preview-state=loading]::before{content:'';display:block;box-sizing:border-box;mask:none!important;clip-path:none!important;background:transparent!important;border:2px solid currentColor!important;border-right-color:transparent!important;border-radius:50%!important;animation:vc-preview-spin .8s linear infinite!important}
html[data-theme] #studio :is(.studio-line-play,.dub-cue-preview)[data-preview-state=playing]::before{mask:none!important;clip-path:none!important;border:0!important;border-radius:0!important;animation:none!important;background:linear-gradient(to right,currentColor 0 32%,transparent 32% 68%,currentColor 68% 100%)!important}
html[data-theme] #studio .dub-cue-preview[data-preview-state=playing]::before{background:currentColor!important;clip-path:inset(2px)!important}
@media(prefers-reduced-motion:reduce){html[data-theme] #studio :is(.studio-line-play,.dub-cue-preview)[data-preview-state=loading]::before{animation:none!important}}

/* A compact stop glyph shared by Theater and video lines. */
html[data-theme] #studio :is(.studio-line-play,.dub-cue-preview)[data-preview-state=playing]::before{width:12px!important;height:12px!important;flex-basis:12px!important;background:currentColor!important;clip-path:inset(2px)!important;mask:none!important;border:0!important;border-radius:0!important;animation:none!important}
html[data-theme] #studio #studio-video-panel .dub-recognition-help,html[data-theme] #studio #studio-video-panel .dub-recognition-help>p{background:transparent!important;border:0!important;border-radius:0;box-shadow:none;padding:0;color:var(--ui-secondary)!important;font-family:inherit;font-size:11px!important;font-weight:400!important;line-height:1.7}
html[data-theme] #studio #studio-video-panel .dub-recognition-help>p{margin:8px 0 0}

/* Shared selectable palettes. Forest preserves the existing night appearance. */
html[data-palette=midnight]{--ui-workspace:#202a38;--ui-field:#182331;--ui-subtle:#29364a;--ui-border:#394b62;--ui-field-border:#47607b;--ui-text:#e2eaf4;--ui-secondary:#a3b4ca;--ui-selected:#304b68;--ui-accent:#a3c9ed;--palette-page:#141d29}
html[data-palette=charcoal]{--ui-workspace:#262729;--ui-field:#1d1e20;--ui-subtle:#323336;--ui-border:#46484d;--ui-field-border:#55585e;--ui-text:#ededee;--ui-secondary:#b0b1b6;--ui-selected:#42464b;--ui-accent:#c1cbd2;--palette-page:#191a1c}
html[data-palette=plum]{--ui-workspace:#2c2533;--ui-field:#241e2c;--ui-subtle:#393041;--ui-border:#51445c;--ui-field-border:#635271;--ui-text:#eee6f2;--ui-secondary:#bdadc7;--ui-selected:#51405f;--ui-accent:#d6b4e6;--palette-page:#201a26}
html[data-palette]:not([data-palette=forest]):not([data-palette=paper]){--paper:var(--palette-page);--bg:var(--palette-page);--ink:var(--ui-text);--muted:var(--ui-secondary);--line:var(--ui-border);--brand:var(--ui-accent);--green:var(--ui-accent);--soft:var(--ui-subtle)}
html[data-palette]:not([data-palette=forest]):not([data-palette=paper]) body{background:var(--palette-page)!important;color:var(--ui-text)}
html[data-palette]:not([data-palette=forest]):not([data-palette=paper]) :is(#site-header,#site-footer,.global-header){background:var(--palette-page)!important;border-color:var(--ui-border)!important}
html[data-palette]:not([data-palette=forest]):not([data-palette=paper]) :is(.global-scene,.global-solution,.global-final,.global-guide pre,.global-scene-bar,.global-scene-footer){background:var(--ui-workspace)!important;border-color:var(--ui-border)!important;color:var(--ui-text)}
html[data-palette]:not([data-palette=forest]):not([data-palette=paper]) .global-button.primary{background:var(--ui-accent)!important;border-color:var(--ui-accent)!important;color:var(--palette-page)!important}
.theme-settings-menu{position:fixed;inset:auto;margin:0;padding:8px;width:210px;max-width:calc(100vw - 24px);border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-workspace);color:var(--ui-text);box-shadow:0 12px 36px #0003}
.theme-settings-menu::backdrop{background:transparent}
.theme-settings-option{display:flex;align-items:center;gap:11px;width:100%;min-height:44px;padding:9px 11px;border:0;border-radius:7px;background:transparent;color:var(--ui-text);font:inherit;font-size:13px;text-align:left;cursor:pointer}
.theme-settings-option:hover,.theme-settings-option:focus-visible,.theme-settings-option[aria-checked=true]{background:var(--ui-selected);outline:none}
.theme-settings-option:focus-visible{box-shadow:inset 0 0 0 2px var(--ui-accent)}
.theme-settings-check{margin-left:auto;color:var(--ui-accent)}.theme-settings-swatch{width:23px;height:23px;border-radius:50%;border:1px solid var(--ui-field-border);flex:none}
[data-palette-choice=forest] .theme-settings-swatch{background:#171d1c;box-shadow:inset 0 -7px #9bcea9}
[data-palette-choice=midnight] .theme-settings-swatch{background:#141d29;box-shadow:inset 0 -7px #a3c9ed}
[data-palette-choice=charcoal] .theme-settings-swatch{background:#191a1c;box-shadow:inset 0 -7px #c1cbd2}
[data-palette-choice=plum] .theme-settings-swatch{background:#201a26;box-shadow:inset 0 -7px #d6b4e6}
[data-palette-choice=paper] .theme-settings-swatch{background:#faf9f6;box-shadow:inset 0 -7px #265e50}
.theme-settings-trigger{gap:6px}.theme-settings-trigger:before{content:'◐';font-size:16px;line-height:1}.theme-settings-trigger:focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px}

/* Legacy color roles resolve to the selected palette across public and studio UI. */
html[data-palette]:not([data-palette=forest]):not([data-palette=paper]){--ui-canvas:var(--palette-page);--night-surface:var(--ui-workspace);--night-field:var(--ui-field);--night-soft:var(--ui-subtle);--field-surface:var(--ui-field);--field-line:var(--ui-field-border);--field-ink:var(--ui-text);--field-muted:var(--ui-secondary);--field-accent:var(--ui-accent);--ui-surface:var(--ui-workspace);--ui-ink:var(--ui-text);--ui-muted:var(--ui-secondary);--ui-line:var(--ui-border);--studio-workspace-surface:var(--ui-workspace);--video-workspace-surface:var(--ui-workspace)}
html[data-theme] .voice-library-search input{background:transparent!important}

html[data-theme] #voices .voice-library-search input{background:transparent!important}
html[data-palette]:not([data-palette=forest]):not([data-palette=paper]){--ui-tab-selected-surface:var(--ui-selected);--ui-tab-selected-text:var(--ui-accent)}

html[data-theme] #studio button.studio-project-delete{color:var(--ui-danger)!important}html[data-theme] #studio button.studio-project-delete:not(:disabled):is(:hover,:focus-visible){background:var(--ui-danger-surface)!important}

/* Auto-height source columns must not collapse the subtitle editor's zero-basis flex children. */
#studio-video-panel .dub-panel-scroll>.dub-subtitle-inline-editor:not([hidden]){flex:0 0 auto;min-height:520px;overflow:visible}
#studio-video-panel .dub-subtitle-inline-editor>.dub-subtitle-body{flex:0 0 auto;overflow:visible}
html[data-theme] #studio #studio-video-panel .dub-subtitle-inline-editor #dub-text{flex:none;height:420px!important;min-height:300px!important;resize:vertical}
@media(max-width:600px){html[data-theme] #studio #studio-video-panel .dub-subtitle-inline-editor #dub-text{height:340px!important;min-height:260px!important}}

/* Fill the source card when the subtitle tab is active, without collapsing empty editors. */
html[data-theme] #studio #studio-video-panel .dub-panel-scroll:has(>.dub-subtitle-inline-editor:not([hidden])){display:flex;flex-direction:column;flex:1 1 auto;min-height:520px}
#studio-video-panel .dub-panel-scroll>.dub-subtitle-inline-editor:not([hidden]){flex:1 1 auto;min-height:520px;display:flex;flex-direction:column}
#studio-video-panel .dub-subtitle-inline-editor>.dub-subtitle-body{flex:1 1 auto;display:flex;flex-direction:column;min-height:0}
html[data-theme] #studio #studio-video-panel .dub-subtitle-inline-editor #dub-text{flex:1 1 auto;height:auto!important;min-height:340px!important;resize:none}

html[data-theme] #support-dialog{background:var(--ui-workspace);color:var(--ui-text);border-color:var(--ui-border)}html[data-theme] #support-dialog .support-tabs{background:transparent;border-color:var(--ui-border)}html[data-theme] #support-dialog .support-tabs button{background:transparent;color:var(--ui-secondary)}html[data-theme] #support-dialog .support-tabs button[aria-pressed=true]{color:var(--ui-accent);border-color:var(--ui-accent)}html[data-theme] #support-dialog .support-faq{background:var(--ui-subtle);color:var(--ui-text);border-color:var(--ui-border)}html[data-theme] #support-dialog :is(.support-head p,.support-form label,.support-note,.support-awaiting){color:var(--ui-secondary)}html[data-theme] #support-dialog :is(.support-ticket,.support-reply,.support-empty){background:var(--ui-subtle);color:var(--ui-text);border-color:var(--ui-border)}

.studio-task-dialog{width:min(640px,calc(100vw - 32px));max-height:80dvh;background:var(--ui-workspace);color:var(--ui-text);border:1px solid var(--ui-border)}
.studio-task-dialog>div{display:grid;gap:12px;margin:20px 0;max-height:55dvh;overflow:auto}
.studio-task-row{padding:16px;border:1px solid var(--ui-border);border-radius:var(--ui-radius);background:var(--ui-field)}
.studio-task-row p{font-size:13px;color:var(--ui-secondary);overflow-wrap:anywhere;margin:8px 0}
.studio-task-row a{display:inline-block;text-decoration:none;padding:8px 14px;color:var(--ui-accent);border:1px solid var(--ui-field-border);border-radius:var(--ui-radius)}

/* Compact shared selectors inside both workspaces. */
html[data-theme] #studio :is(select,.ui-select-trigger,.studio-voice-trigger),html[data-theme] #studio #studio-video-panel :is(select,.ui-select-trigger,.studio-voice-trigger){box-sizing:border-box;height:36px!important;min-height:36px!important;padding:5px 10px!important;font-size:12px!important;line-height:1.4;max-width:100%}
html[data-theme] #studio :is(.studio-audio-format,.dub-custom-field) :is(select,.ui-select-trigger){width:160px!important;min-width:0!important}
html[data-theme] #studio .studio-voice-trigger img,html[data-theme] #studio #studio-video-panel .studio-voice-trigger img{width:24px;height:26px}
html[data-theme] #studio #studio-video-panel .dub-director-field :is(.ui-select-trigger,.studio-voice-trigger){height:32px!important;min-height:32px!important;padding:4px 6px!important}
/* Shared spacing and interaction hierarchy for public and studio surfaces. */
html[data-theme=dark]{--ui-secondary:#b7c2bb}
.site-menu-toggle{display:none}
#site-footer .footer-disclosure summary{list-style:none;font-size:13px;font-weight:650;color:var(--ui-text);margin-bottom:18px}
#site-footer .footer-disclosure summary::-webkit-details-marker{display:none}
@media(min-width:651px){#site-footer .footer-disclosure summary{pointer-events:none}}
html .pricecard{min-height:0!important;padding:24px!important;display:flex;flex-direction:column}
html .pricecard h3{font-family:inherit!important;font-size:20px!important}
html .pricecard ul{margin:20px 0!important;padding-top:18px!important;flex:1}
html .pricecard li{line-height:1.65!important;margin-bottom:10px!important}
html .pricecard>button{min-height:44px;margin-top:20px!important}
html .pricecard .price{margin:14px 0!important}
html .library-voice-card{overflow:hidden}
html .library-voice-card button{min-height:40px}
html .library-voice-card p{line-height:1.6}
html .voice-category-pills button{min-height:36px;padding:7px 14px}
html .voice-library-search{min-height:48px}
.global-lead,.feature-lead{line-height:1.7!important;max-width:65ch}
.global-section-label{letter-spacing:.14em!important}
@media(max-width:900px){
 html #site-header{height:72px!important;min-height:72px!important;grid-template-columns:auto 1fr auto!important;padding:12px 16px!important;gap:12px!important}
 html #site-header>.global-header-actions{justify-self:end;gap:8px!important;min-width:0}
 html #site-header>.site-menu-toggle{display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--ui-border);border-radius:var(--ui-radius);background:var(--ui-field);color:var(--ui-text)}
 html #site-header>nav{display:none!important}
 html #site-header.menu-open>nav{display:flex!important;position:absolute;top:72px;left:0;right:0;flex-wrap:wrap;justify-content:flex-start!important;gap:4px!important;padding:12px 16px!important;background:var(--ui-workspace);border-bottom:1px solid var(--ui-border)}
 html #site-header.menu-open>nav>a{min-height:44px!important;padding:8px 14px!important}
 html #site-header .global-brand{font-size:18px!important}
 html #site-header .global-brand img{width:30px!important;height:30px!important}
 html #site-header .theme-toggle{font-size:0!important}
}
@media(max-width:650px){
 html #site-header .global-brand{font-size:0!important;gap:0!important}
 html #site-header .account-button{max-width:140px;min-height:40px!important}
 html #site-header button{min-height:40px}
 #site-footer .resource-footer-main{grid-template-columns:1fr!important;gap:0!important}
 #site-footer .resource-footer-brand{margin-bottom:24px}
 #site-footer .footer-disclosure{border-top:1px solid var(--ui-border);padding:14px 0}
 #site-footer .footer-disclosure summary{cursor:pointer;min-height:30px;display:flex;align-items:center;justify-content:space-between;margin:0}
 #site-footer .footer-disclosure summary:after{content:'+';font-size:20px}
 #site-footer .footer-disclosure[open] summary:after{content:'−'}
 #site-footer .footer-disclosure ul{padding-top:12px}
 #site-footer .footer-disclosure a{min-height:36px;display:inline-flex;align-items:center}
 html .auth-brand-panel{display:none!important}
 html .auth-layout{grid-template-columns:1fr!important}
 html .voice-category-pills button{min-height:40px}
}
html .library-voice-portrait-card{position:relative}
html .library-voice-actions>button{width:100%}
@media(max-width:900px){html #site-header>.global-header-actions{grid-row:1!important;grid-column:2!important}html #site-header>.site-menu-toggle{grid-row:1!important;grid-column:3!important}html #site-header>.global-brand{grid-row:1!important;grid-column:1!important}}
@media(max-width:650px){html dialog.auth-layout{display:block!important;width:min(440px,calc(100vw - 24px))!important;max-height:calc(100dvh - 24px)!important}html dialog.auth-layout .auth-scene{padding:24px!important}}
@media(max-width:900px){
 html body #site-header>.global-header-actions{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;gap:6px!important;grid-row:1!important;grid-column:2!important}
 html body #site-header>.global-header-actions>*{margin:0!important;flex-shrink:0}
 html body #site-header.menu-open>nav{top:72px!important;left:0!important;right:0!important;width:100%!important;max-width:none!important;margin:0!important;transform:none!important}
}
@media(max-width:650px){
 html body #site-header .site-theme-toggle,html body #site-header [data-theme-toggle]{width:36px!important;min-width:36px!important;font-size:0!important;padding:6px!important}
 html body #account-dialog.auth-layout[open]{width:calc(100vw - 24px)!important;max-width:440px!important;box-sizing:border-box!important;min-width:0!important;margin:auto!important}
 html body #account-dialog.auth-layout .auth-form-panel{padding:24px!important;min-width:0!important;box-sizing:border-box}
 html body #account-dialog .auth-google-note{min-height:0!important}
 html .voice-library-hero h1{font-size:34px!important;line-height:1.15!important}
}
html .voice-category-pills button,html .voice-library-controls button{background:var(--ui-field)!important;color:var(--ui-text)!important;border-color:var(--ui-field-border)!important}
html .voice-category-pills button[aria-pressed=true],html .voice-library-controls button[aria-pressed=true]{background:var(--ui-selected)!important;color:var(--ui-text)!important;border-color:var(--ui-accent)!important}
/* Final shared responsive controls; use surface tokens in both themes. */
html[data-theme] body .voice-category-pills button,html[data-theme] body .voice-library-controls button,html[data-theme] body .voice-filter-pills button{background:var(--ui-field)!important;color:var(--ui-text)!important;border:1px solid var(--ui-field-border)!important;min-height:40px}
html[data-theme] body :is(.voice-category-pills,.voice-library-controls,.voice-filter-pills) button[aria-pressed=true]{background:var(--ui-selected)!important;border-color:var(--ui-accent)!important;color:var(--ui-text)!important}
@media(max-width:650px){html[data-theme] body #voice-library-title{font-size:34px!important;line-height:1.15!important}html[data-theme] body #site-header .theme-toggle{font-size:0!important;gap:0!important;width:34px!important;padding:7px!important}html[data-theme] body #site-header .theme-toggle svg{width:18px!important;height:18px!important}html[data-theme] body .voice-filter-pills{display:flex;flex-wrap:wrap;gap:5px}html[data-theme] body .voice-library-head{gap:16px}html[data-theme] body .voice-library-total{font-size:26px!important}}
html[data-theme] body #page-voices :is(.voice-category-pills,.voice-filter-pills,.voice-library-controls) button{background:var(--ui-field)!important;color:var(--ui-text)!important;border-color:var(--ui-field-border)!important}
html[data-theme] body #page-voices :is(.voice-category-pills,.voice-filter-pills,.voice-library-controls) button[aria-pressed=true]{background:var(--ui-selected)!important;color:var(--ui-text)!important;border-color:var(--ui-accent)!important}
@media(max-width:650px){html[data-theme] body #page-voices .voice-filter-pills{flex-wrap:wrap!important;overflow:visible!important;height:auto!important}html[data-theme] body #site-header .global-theme-toggle{width:32px!important;min-width:32px!important;font-size:0!important;padding:6px!important}html[data-theme] body #site-header .global-theme-toggle:before{font-size:18px!important}}

:root{--ui-subtitle-compare-surface:#9BCEA9;--ui-subtitle-compare-text:#182a2a}

/* Accessible primary actions: green surfaces always use dark foregrounds. */
:root{--ui-action-surface:#9bcea9;--ui-action-text:#182a2a}
html[data-theme] body :is(button.primary,a.primary,.global-button.primary,button.ui-accept,.studio-save-primary,.auth-submit){background:var(--ui-action-surface)!important;border-color:var(--ui-action-surface)!important;color:var(--ui-action-text)!important}
html[data-theme] body :is(button.primary,a.primary,.global-button.primary,button.ui-accept,.studio-save-primary,.auth-submit):hover:not(:disabled){color:var(--ui-action-text)!important}
html[data-theme] body :is(button.primary,a.primary,.global-button.primary,button.ui-accept,.studio-save-primary,.auth-submit)>:is(span,svg){color:inherit!important}

html[data-theme] #studio :is(#studio-delete-project,#dub-delete-project){display:inline-flex;align-items:center;justify-content:center;color:var(--ui-danger)!important;border-color:var(--ui-border);background:var(--ui-danger-surface)}
.studio-storage-note,.studio-script-capacity{color:var(--ui-secondary);font-size:12px;line-height:1.7}.studio-storage-note{margin:0;padding:8px 24px;border-bottom:1px solid var(--ui-border)}.studio-script-capacity{display:block;margin-top:10px}#studio-split-dialogue{margin-inline-start:8px}

html[data-theme] .plan-v2 .plan-audio-estimate{margin:8px 0 5px;color:var(--ui-accent);font-size:14px;font-weight:600;line-height:1.5}html[data-theme] .plan-v2 .plan-audio-estimate-note{display:block;color:var(--ui-secondary);font-size:11px;line-height:1.6;margin-bottom:16px}

html[data-theme] .plan-v2 .plan-inherits{font-size:11px;color:var(--ui-secondary);line-height:1.6;margin:10px 0}
/* Dialog sizing by task: stable shells, no scale or dimension animation. */
html[data-theme] body dialog{box-sizing:border-box;animation:none!important;transition:opacity .12s ease!important;transform:none!important;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}
html[data-theme] body dialog::backdrop{animation:none!important;transition:none!important}
html[data-theme] body #account-dialog:is([data-view=ledger],[data-view=orders]){min-height:min(460px,calc(100dvh - 32px))}
html[data-theme] body #support-dialog{width:min(720px,calc(100vw - 32px));height:min(760px,calc(100dvh - 32px));min-height:min(560px,calc(100dvh - 32px));padding:0;overflow:hidden}
html[data-theme] body #support-dialog[open]{display:flex;flex-direction:column}
html[data-theme] body #support-dialog :is(.support-head,.support-tabs){flex:none}
html[data-theme] body #support-dialog .support-body{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable}
html[data-theme] body :is(.studio-saved-dialog,.studio-task-dialog,.studio-roles-dialog){width:min(760px,calc(100vw - 32px));min-height:min(420px,calc(100dvh - 32px))}
html[data-theme] body :is(.dub-subtitle-dialog,.dub-subtitle-output-dialog){min-height:min(520px,calc(100dvh - 32px))}
@media(max-width:600px){html[data-theme] body dialog{max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}html[data-theme] body #support-dialog{width:calc(100vw - 20px);height:calc(100dvh - 20px);min-height:0}}
/* Compact task shells: reserve useful content space rather than empty viewport space. */
html[data-theme] body #support-dialog{height:min(620px,calc(100dvh - 32px));min-height:0}
html[data-theme] body #support-dialog .support-head{padding:18px 24px 12px}
html[data-theme] body #support-dialog .support-body{padding:14px 24px 18px}
html[data-theme] body #support-dialog .support-faq{padding:9px 12px;margin-bottom:10px}
html[data-theme] body #support-dialog .support-form label{margin:10px 0}
html[data-theme] body #support-dialog .support-form textarea{min-height:100px;height:110px;max-height:180px}
html[data-theme] body dialog.ui-dialog{min-height:0}
html[data-theme] body dialog.ui-dialog:has(form){min-height:0}
html[data-theme] body #account-dialog:is([data-view=profile],[data-view=password]){min-height:0}
html[data-theme] body :is(.studio-saved-dialog,.studio-task-dialog,.studio-roles-dialog){min-height:min(300px,calc(100dvh - 32px))}
@media(max-width:600px){html[data-theme] body #support-dialog{height:min(620px,calc(100dvh - 20px))}}

/* Shared support controls across public and studio pages. */
html[data-theme] body .support-launch{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:11px 18px;border:1px solid var(--ui-field-border);border-radius:28px;background:var(--ui-selected);color:var(--ui-text);font-family:inherit;font-size:13px;font-weight:600;line-height:1.5;box-shadow:0 4px 16px #0001;transition:background .16s ease,border-color .16s ease,box-shadow .16s ease;transform:none}
html[data-theme] body .support-launch:hover{background:var(--ui-subtle);color:var(--ui-accent);border-color:var(--ui-accent);box-shadow:0 5px 18px #0002;transform:none}
html[data-theme] body .support-launch:focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px}
html[data-theme] body #support-dialog{background:var(--ui-workspace);color:var(--ui-text);border:1px solid var(--ui-border);border-radius:16px}
html[data-theme] body #support-dialog .support-close{display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--ui-secondary)}
html[data-theme] body #support-dialog .support-close:hover{background:var(--ui-subtle);color:var(--ui-text)}
html[data-theme] body #support-dialog .support-tabs button{background:transparent;color:var(--ui-secondary);border:0;border-bottom:2px solid transparent;padding:10px 0;border-radius:0;box-shadow:none}
html[data-theme] body #support-dialog .support-tabs button:hover,html[data-theme] body #support-dialog .support-tabs button[aria-pressed=true]{color:var(--ui-accent);border-bottom-color:var(--ui-accent)}
html[data-theme] body #support-dialog .support-form label{color:var(--ui-secondary)}
html[data-theme] body #support-dialog .support-form :is(input,textarea,select){background:var(--ui-field);border:1px solid var(--ui-field-border);color:var(--ui-text);border-radius:8px;font-family:inherit}
html[data-theme] body #support-dialog .support-form :is(input,textarea)::placeholder{color:var(--ui-secondary);opacity:1}
html[data-theme] body #support-dialog .support-faq{background:var(--ui-subtle);color:var(--ui-secondary)}
html[data-theme] body #support-dialog .support-faq summary{color:var(--ui-text)}
html[data-theme] body #support-dialog :is(.support-note,.support-head p){color:var(--ui-secondary)}
html[data-theme] body #support-dialog .support-submit{min-height:42px;border:1px solid var(--ui-action-surface);border-radius:8px;background:var(--ui-action-surface);color:var(--ui-action-text);padding:10px 16px;box-shadow:none;transition:filter .16s ease;transform:none}
html[data-theme] body #support-dialog .support-submit:hover{filter:brightness(.95);transform:none}
@media(prefers-reduced-motion:reduce){html[data-theme] body .support-launch,html[data-theme] body #support-dialog .support-submit{transition:none}}
/* One list-item presentation for shared dropdowns, including future role-based menus. */
html[data-theme] body :is(.ui-select-menu,.global-header-menu,.theme-settings-menu,[popover][role=listbox],[popover][role=menu]){padding:6px;background:var(--ui-surface)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)!important;border-radius:12px;gap:2px}
html[data-theme] body :is(.ui-select-menu,.global-header-menu,.theme-settings-menu,[popover][role=listbox],[popover][role=menu]) :is(button,[role=option],[role=menuitem],[role=menuitemradio]){background:transparent!important;color:var(--ui-text)!important;border:0!important;box-shadow:none!important;transform:none!important;border-radius:6px;min-height:40px;padding:10px 12px;margin:0;cursor:pointer;text-align:start}
html[data-theme] body :is(.ui-select-menu,.global-header-menu,.theme-settings-menu,[popover][role=listbox],[popover][role=menu]) :is(button,[role=option]):hover:not(:disabled){background:var(--ui-subtle)!important}
html[data-theme] body :is(.ui-select-menu,.global-header-menu,.theme-settings-menu,[popover][role=listbox],[popover][role=menu]) :is([aria-selected=true],[aria-checked=true],[aria-current=true]){background:var(--ui-selected)!important;color:var(--ui-accent)!important}
html[data-theme] body :is(.ui-select-menu,.global-header-menu,.theme-settings-menu,[popover][role=listbox],[popover][role=menu]) button:focus-visible{outline:2px solid var(--ui-accent);outline-offset:-2px}

/* Support modal: a flat surface over a translucent, unblurred backdrop. */
html[data-theme] body #support-dialog::backdrop{background:rgba(0,0,0,.42)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html[data-theme] body .global-header-menu a.language-menu-option{display:flex;align-items:center;justify-content:space-between;gap:24px;width:100%;box-sizing:border-box;padding:10px 12px;border-radius:6px;background:transparent!important;color:var(--ui-text)!important;text-decoration:none}
html[data-theme] body .global-header-menu a.language-menu-option:hover{background:var(--ui-subtle)!important;color:var(--ui-accent)!important}
html[data-theme] body .global-header-menu a.language-menu-option[aria-checked=true]{color:var(--ui-accent)!important}
html[data-theme] body .global-header-menu .language-menu-check{flex:0 0 20px;text-align:center;margin-inline-start:auto;color:var(--ui-accent)}

html[data-theme] body #support-dialog{box-shadow:none!important;filter:none!important}
/* Consistent pointer feedback for interactive surfaces across public and studio pages. */
html body :is(button,a[href],summary,select,label[for],input[type=button],input[type=submit],input[type=reset],input[type=checkbox],input[type=radio],input[type=range],input[type=file],[role=button],[role=link],[role=tab],[role=option],[role=menuitem],[role=menuitemradio],[role=menuitemcheckbox],[role=switch],[role=checkbox],[role=radio],[onclick],[data-action],[tabindex="0"]):not(input[type=text]):not(input[type=email]):not(input[type=password]):not(input[type=search]):not(input[type=number]):not(textarea):not([contenteditable=true]){cursor:pointer!important}
html body label:has(input:is([type=checkbox],[type=radio])){cursor:pointer!important}
html body :is(button,input,select,textarea):disabled,html body [aria-disabled=true],html body [inert]{cursor:not-allowed!important}
/* Feedback history uses the same surfaces and readable text as the form. */
html[data-theme] body #support-dialog .support-ticket{padding:18px;margin:0 0 12px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-field);color:var(--ui-text)}
html[data-theme] body #support-dialog .support-ticket:last-child{margin-bottom:0}
html[data-theme] body #support-dialog .support-ticket-top{display:flex;align-items:center;justify-content:space-between;gap:16px}
html[data-theme] body #support-dialog .support-ticket h3{font-size:15px;line-height:1.5;margin:0;color:var(--ui-text)}
html[data-theme] body #support-dialog .support-ticket small{color:var(--ui-secondary);font-size:12px;line-height:1.6;margin-top:6px}
html[data-theme] body #support-dialog .support-ticket>p{font-size:14px;line-height:1.7;margin:16px 0;color:var(--ui-text)}
html[data-theme] body #support-dialog .support-state{flex-shrink:0;background:var(--ui-subtle);color:var(--ui-secondary);font-size:12px;line-height:1.5;padding:4px 9px;border-radius:6px}
html[data-theme] body #support-dialog .support-state.replied{background:var(--ui-selected);color:var(--ui-accent)}
html[data-theme] body #support-dialog .support-reply{padding:12px 14px;background:var(--ui-subtle);border-left:2px solid var(--ui-accent);border-radius:0 8px 8px 0}
html[data-theme] body #support-dialog .support-reply b{font-size:12px;color:var(--ui-accent)}
html[data-theme] body #support-dialog .support-reply p{font-size:14px;line-height:1.7;color:var(--ui-text);margin:6px 0 0}
html[data-theme] body #support-dialog :is(.support-awaiting,.support-empty){color:var(--ui-secondary)}
html[data-theme] body #support-dialog .support-form .ui-select{display:block;width:100%;margin-top:7px}
html[data-theme] body #support-dialog .support-form .ui-select-trigger{width:100%;min-height:44px;background:var(--ui-field);border:1px solid var(--ui-field-border);color:var(--ui-text);border-radius:8px;padding:10px 12px}

html[data-theme] body dialog.ui-dialog{width:440px}
html[data-theme] body dialog.ui-dialog:has(form){width:520px}
/* Phone editors use page scrolling; desktop pane heights must not clip actions. */
@media(max-width:760px){
 html[data-page=studio] body #studio[data-mode=script]{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}
 html[data-page=studio] body #studio[data-mode=script]>.studioinner{display:flex!important;flex-direction:column!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;gap:20px}
 html[data-page=studio] body #studio[data-mode=script] :is(.inputpanel,.editpanel){display:flex!important;flex-direction:column;flex:none!important;width:100%;min-width:0;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;padding:14px!important}
 html[data-page=studio] body #studio[data-mode=script] .inputpanel{border-right:0!important;border-bottom:1px solid var(--ui-border);padding-bottom:20px!important}
 html[data-page=studio] body #studio[data-mode=script] .studio-script-frame{flex:none!important;height:260px!important;min-height:220px!important}
 html[data-page=studio] body #studio[data-mode=script] #script-input{font-size:16px!important;line-height:1.75!important;padding:14px!important}
 html[data-page=studio] body #studio[data-mode=script] #editor{flex:none!important;height:auto!important;max-height:none!important;overflow:visible!important;min-height:0!important}
 html[data-page=studio] body #studio[data-mode=script] :is(.studio-role-strip,.studio-edit-toolbar,.sectiontop,.studio-action-footer){position:static!important;flex:none;min-width:0;flex-wrap:wrap}
 html[data-page=studio] body #studio[data-mode=script] .inputpanel>.actions{flex-wrap:wrap;gap:8px;margin-top:16px}
 html[data-page=studio] body #studio[data-mode=script] .studiotools{flex-wrap:wrap;gap:12px;height:auto}
 html[data-page=studio] body #studio[data-mode=script] .studio-project-name{max-width:100%;min-width:0;flex-wrap:wrap}
 html[data-page=studio] body #studio[data-mode=script] .studio-split-handle{display:none!important}
}
/* Compact help entry on touch screens; desktop retains its text label. */
@media(max-width:700px){
 html[data-theme] body .support-launch{width:44px;height:44px;min-height:44px;min-width:44px;box-sizing:border-box;padding:0;gap:0;border-radius:50%;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px) + var(--support-bottom-offset,0px))}
 html[data-theme] body .support-launch>span{display:none}
 html[data-theme] body .support-launch>svg{display:block;width:20px;height:20px;flex:none}
 html[data-theme] body:has(#support-dialog[open]) .support-launch{visibility:hidden;pointer-events:none}
}
@media(max-width:900px){
 html[data-theme] body #site-header>.site-menu-toggle{box-sizing:border-box;display:grid;place-items:center;width:40px;height:40px;min-width:40px;min-height:40px;padding:0;line-height:1;flex:none}
 html[data-theme] body #site-header>.site-menu-toggle>svg{display:block;width:20px;height:20px;margin:0;flex:none;transform:none}
}
/* A download action and its format picker share one row in every studio. */
html[data-theme] body .studio-export-menu{width:min(390px,calc(100vw - 24px))}
html[data-theme] body .studio-export-menu .studio-audio-export,
html[data-theme] body #studio #studio-video-panel .dub-export-menu :is(.dub-footer-audio-export,.dub-download-controls){display:grid!important;grid-template-columns:minmax(130px,1fr) minmax(130px,1fr)!important;flex-direction:row!important;align-items:center!important;gap:8px!important;width:100%!important}
html[data-theme] body .studio-export-menu .studio-audio-export>button,
html[data-theme] body #studio #studio-video-panel .dub-export-menu :is(.dub-footer-audio-export,.dub-download-controls)>button{grid-column:1!important;grid-row:1!important;order:0!important;width:100%!important}
html[data-theme] body .studio-export-menu .studio-audio-export>.studio-audio-format,
html[data-theme] body #studio #studio-video-panel .dub-export-menu :is(.dub-footer-audio-export,.dub-download-controls)>.studio-audio-format,
html[data-theme] body #studio #studio-video-panel .dub-export-menu .dub-download-controls>.ui-select{grid-column:2!important;grid-row:1!important;order:0!important;min-width:0!important;width:100%!important;display:block!important}
html[data-theme] body .studio-export-menu .studio-audio-format>span{display:none}
html[data-theme] body #studio #studio-video-panel .dub-export-menu .studio-audio-format .ui-select,
html[data-theme] body .studio-export-menu .studio-audio-export .ui-select{width:100%!important;min-width:0!important}
html[data-theme] body #studio #studio-video-panel .dub-export-menu .dub-export-bar .studio-audio-format>span.ui-select{display:inline-flex!important;width:100%!important;min-width:0!important}
/* Workspace messages stay in one persistent status region. */
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status){display:block!important;visibility:visible;min-height:68px}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)>h4{margin:0 0 8px}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status) :is(.studio-quote,.dub-audio-estimate,.workspace-status-idle){position:static;display:block;margin:6px 0!important;font-size:12px;line-height:1.65;color:var(--ui-secondary)}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status) :is(.studio-quote,.dub-audio-estimate,.workspace-status-idle)[hidden]{display:none!important}
html[data-theme] body #studio .dub-processing-idle-hint{display:none!important}
/* Shared save status at the bottom right of each workspace card. */
html[data-theme] body #studio .studio-save-footer{display:flex;justify-content:flex-end;align-items:center;gap:8px;grid-column:1/-1;flex:0 0 auto;order:1000;min-height:24px;padding:8px 24px 12px;margin:0;width:100%;box-sizing:border-box;color:var(--ui-secondary);font-size:12px}
html[data-theme] body #studio .studio-save-footer :is(.studio-toolbar-save-info,.dub-project-save-info){position:static!important;display:inline-flex;align-items:center;gap:7px;margin:0!important;padding:0!important;width:auto!important;white-space:normal;line-height:1.5;color:var(--ui-secondary)}
html[data-theme] body #studio .studio-save-footer [data-saved=true]{color:var(--ui-accent)}
html[data-theme] body #studio .studio-save-footer svg{width:17px;height:17px;flex:none}
html[data-theme] body #studio[data-mode=video]>.studio-script-save-footer{display:none}
@media(max-width:600px){html[data-theme] body #studio .studio-save-footer{padding:8px 14px 12px}}
html[data-theme] body #studio,html[data-theme] body #studio #studio-video-panel{position:relative}
html[data-theme] body #studio>.studio-save-footer,html[data-theme] body #studio #studio-video-panel>.studio-save-footer{position:absolute;inset:auto 0 0;z-index:1;pointer-events:none}
html[data-theme] body #studio[data-mode=script],html[data-theme] body #studio #studio-video-panel{padding-bottom:38px!important}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)>h4{display:flex;align-items:center;gap:8px;width:100%}
html[data-theme] body #studio .workspace-status-save{position:static!important;display:inline-flex!important;align-items:center;gap:6px;flex:0 0 auto;margin:0 0 0 auto!important;padding:0!important;border:0!important;background:transparent!important;font-size:12px;font-weight:400;line-height:1.5;color:var(--ui-secondary);white-space:nowrap}
html[data-theme] body #studio .workspace-status-save svg{width:16px;height:16px;flex:none}
html[data-theme] body #studio :is(.studio-toolbar-save-info.is-saved,.dub-project-save-info[data-saved="true"]):not(.is-error){color:var(--ui-accent)!important}

html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status){--feedback-color:var(--ui-secondary)}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-state=success]{--feedback-color:var(--ui-success)}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-state=error]{--feedback-color:var(--ui-danger)}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-state=running]{--feedback-color:var(--ui-accent)}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status) :is(#dub-status,#generation-status,.studio-quote,.dub-audio-estimate,.workspace-status-idle){color:var(--feedback-color)!important}
html[data-theme] body #studio .studio-processing-status .studio-processing-dot,html[data-theme] body #studio .dub-processing-status>h4::before{background:var(--feedback-color)!important}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status) [hidden]{display:none!important}

html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true] :is(#dub-status,#generation-status,.studio-quote,.dub-audio-estimate,.workspace-status-idle,.dub-processing-idle-hint,.dub-processing-description){display:none!important}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>.workspace-status-summary{display:block!important;margin:8px 0 0!important;font-size:12px;line-height:1.65;color:var(--feedback-color)!important}

/* Status and save information share the message baseline. */
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;column-gap:20px;row-gap:8px;border-top:0!important;padding-top:12px!important}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>h4{grid-column:1/-1;grid-row:1;margin:0!important}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>.workspace-status-summary{grid-column:1;grid-row:2;margin:0!important;min-width:0}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>.workspace-status-save{grid-column:2;grid-row:2;align-self:baseline;margin:0!important;white-space:nowrap;font-size:12px;line-height:1.65}

html[data-theme] body #studio #studio-video-panel .dub-audio-footer>.dub-processing-status[data-unified=true],html[data-theme] body #studio .studio-action-footer>.studio-processing-status[data-unified=true]{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;column-gap:20px!important;row-gap:8px!important;border-top:0!important}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>.workspace-status-save{justify-self:end!important;margin-left:auto!important;text-align:right!important;width:max-content!important;grid-column:2!important;grid-row:2!important}

/* Compact workspace footer spacing. */
html[data-theme] body #studio #studio-video-panel{padding-bottom:18px!important}
html[data-theme] body #studio #studio-video-panel .dub-audio-footer{margin:12px 14px 0!important;padding:12px 0 0!important;gap:10px!important;min-height:0!important}
html[data-theme] body #studio #studio-video-panel .dub-audio-footer>.dub-audio-actions{padding:0!important;margin:0!important;min-height:0!important;gap:10px!important}
html[data-theme] body #studio #studio-video-panel .dub-audio-footer>.dub-processing-status[data-unified=true]{margin:0!important;padding:2px 0 0!important;row-gap:4px!important;min-height:0!important}
html[data-theme] body #studio #studio-video-panel .dub-audio-footer .dub-footer-generation>button{height:38px!important;min-height:38px!important;padding:8px 16px!important}
/* Align the saved indicator with the status heading, inside the panel bounds. */
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]{box-sizing:border-box;width:100%;max-width:100%;min-width:0;align-items:center}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>h4{grid-column:1!important;grid-row:1!important;width:auto;min-width:0}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>.workspace-status-summary{grid-column:1/-1!important;grid-row:2!important;overflow-wrap:anywhere}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>.workspace-status-save{grid-column:2!important;grid-row:1!important;align-self:center;max-width:none!important;overflow:visible!important;text-overflow:clip;white-space:nowrap!important}

html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>.workspace-status-save{position:static!important;inset:auto!important;transform:none!important;align-self:center!important;grid-row:2!important;grid-column:2!important;justify-self:end!important;float:none!important}
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>.workspace-status-summary{align-self:center!important;grid-row:2!important;grid-column:1!important}

/* Compact project headers in both workspaces. */
html[data-theme] body #studio :is(.studio-video-toolbar,.studiotools){padding-top:12px!important;padding-bottom:14px!important;row-gap:12px!important;margin-bottom:12px!important;min-height:0!important}
html[data-theme] body #studio :is(.studio-video-toolbar,.studiotools) .studio-back-projects{margin:0 0 8px!important;padding:0!important;line-height:1.5}
html[data-theme] body #studio #studio-video-panel .rv-header,html[data-theme] body #studio #studio-video-panel .rv-head{min-height:54px!important;height:auto!important;padding-top:10px!important;padding-bottom:10px!important;margin-top:0!important}
html[data-theme] body #studio #studio-video-panel .dub-director-card>.dub-card-head{min-height:54px!important;height:auto!important;padding-top:10px!important;padding-bottom:10px!important}
/* Icons scale with the action label, including compact controls. */
html[data-theme] body #studio :is(button,a,label)[data-ui-icon]::before{width:1em!important;height:1em!important;flex:0 0 1em!important}
html[data-theme] body #studio :is(button,a,label)[data-ui-icon]:has(svg)::before{display:none!important}
html[data-theme] body #studio button:not(.studio-voice-trigger):not(.studio-voice-option):not(.studio-line-summary):not(.dub-line-summary)>svg{width:1em;height:1em;flex:0 0 1em;vertical-align:middle}

html[data-theme] body #studio :is(.studio-video-toolbar,.studiotools){padding-top:8px!important;padding-bottom:8px!important;row-gap:8px!important;margin-bottom:8px!important}
html[data-theme] body #studio :is(.studio-video-toolbar,.studiotools) .studio-back-projects{padding:4px 0!important;margin:0!important;min-height:0!important;height:auto!important;line-height:20px!important}
html[data-theme] body #studio :is(button,a,label)[data-ui-icon][data-ui-icon][data-ui-icon]::before{width:1em!important;height:1em!important;flex:0 0 1em!important}
/* Blocking notices remain prominent even when supplied by a quote response. */
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-feedback-tone=error]{--feedback-color:var(--ui-danger)!important}
/* The Theater toolbar and editor form one continuous workspace surface. */
html[data-theme] body #studio[data-mode=script]>.studiotools{margin-bottom:0!important}
html[data-theme] body #studio[data-mode=script]>.studioinner{margin-top:0!important}
/* Back navigation sits above, rather than inside, each workspace card. */
html[data-theme] body #studio>.studio-back-projects{display:block;grid-column:1/-1;width:fit-content;max-width:100%;box-sizing:border-box;margin:16px 0 12px!important;padding:0!important;font-size:13px;line-height:1.6;color:var(--ui-accent)}
html[data-theme] body #studio[data-mode=script]>.studio-back-projects[data-project-list-kind=video],html[data-theme] body #studio[data-mode=video]>.studio-back-projects[data-project-list-kind=theater]{display:none!important}
html[data-theme] body #studio[data-mode=script]>.studio-back-projects+.studiotools{margin-top:0!important}
/* One default control size for both workspace toolbars and routine actions. */
html[data-theme] body #studio[data-mode]{--workspace-button-height:38px}
html[data-theme] body #studio[data-mode] :is(.studiotools>div,.dub-project-tools,.studio-edit-toolbar,.dub-edit-toolbar,.inputpanel>.actions,.dub-subtitle-actions)>button,
html[data-theme] body #studio[data-mode] :is(#save,#dub-save-project,#studio-task-history,#studio-delete-project,#dub-delete-project,#parse,#example,#dub-add-line,#dub-undo,#dub-redo){box-sizing:border-box!important;display:inline-flex;align-items:center;justify-content:center;gap:8px!important;height:var(--workspace-button-height)!important;min-height:var(--workspace-button-height)!important;max-height:var(--workspace-button-height)!important;width:auto;min-width:0;padding:8px 14px!important;border-radius:8px!important;font-size:13px!important;font-weight:500;line-height:20px!important;white-space:nowrap}
html[data-theme] body #studio[data-mode] :is(.studiotools>div,.dub-project-tools,.studio-edit-toolbar,.dub-edit-toolbar,.inputpanel>.actions,.dub-subtitle-actions)>button>svg{width:16px!important;height:16px!important;flex:0 0 16px!important}
html[data-theme] body #studio[data-mode] :is(.studiotools>div,.dub-project-tools,.studio-edit-toolbar,.dub-edit-toolbar,.inputpanel>.actions,.dub-subtitle-actions)>button[data-ui-icon]::before{width:16px!important;height:16px!important;flex:0 0 16px!important}
@media(max-width:600px){html[data-theme] body #studio[data-mode]{--workspace-button-height:38px}}

html[data-theme] body #studio #studio-video-panel .studio-video-toolbar{padding-top:12px!important;padding-bottom:12px!important;margin-bottom:12px!important;align-items:center!important}
html[data-theme] body #studio[data-mode=video] #studio-video-panel :is(#dub-save-project,#dub-undo,#dub-redo,#dub-add-line),html[data-theme] body #studio[data-mode=video] #studio-video-panel :is(.dub-project-tools,.dub-edit-toolbar,.dub-subtitle-actions)>button{box-sizing:border-box!important;height:38px!important;min-height:38px!important;max-height:38px!important;padding:8px 14px!important;font-size:13px!important;line-height:20px!important;border-radius:8px!important}
/* Compact the Theater footer without changing editor or player behavior. */
html[data-theme] body #studio[data-mode=script] .studio-action-footer{gap:8px!important;margin-top:8px!important;padding-top:10px!important;padding-bottom:0!important}
html[data-theme] body #studio[data-mode=script] .studio-action-footer>.studio-processing-status[data-unified=true]{margin:0!important;padding:6px 0 0!important;min-height:0!important;row-gap:4px!important;align-content:start}
html[data-theme] body #studio[data-mode=script] .studio-action-footer>.studio-audio-actions{margin:0!important;padding:0!important;min-height:0!important}
html[data-theme] body #studio[data-mode=script] .studio-action-footer .studio-generation-group{margin:0!important;min-height:0!important;padding:0!important}
html[data-theme] body #studio[data-mode=script] .studio-smart-dubbing{margin:10px 0 0!important;padding:10px 0 0!important}
html[data-theme] body #studio[data-mode=script] .inputpanel>.actions{margin-top:12px!important;margin-bottom:0!important}
html[data-theme] body #studio[data-mode=script]>.studioinner{padding-bottom:8px!important}
html[data-theme] body #studio[data-mode=script]>.studioinner>:is(.inputpanel,.editpanel){padding-bottom:10px!important}

html[data-theme] body #studio #studio-video-panel .studio-video-toolbar{margin-bottom:0!important}
/* Balanced breathing room around the project toolbar actions. */
html[data-theme] body #studio[data-mode=script]>.studiotools,
html[data-theme] body #studio[data-mode=video] #studio-video-panel .studio-video-toolbar{padding-top:16px!important;padding-bottom:16px!important;align-items:center!important}

html[data-theme] body #studio[data-mode=video] #studio-video-panel .dub-edit-toolbar>button:is(#dub-undo,#dub-redo,#dub-add-line){height:32px!important;min-height:32px!important;max-height:32px!important;padding:5px 10px!important;font-size:12px!important;line-height:20px!important;gap:6px!important;border-radius:7px!important}html[data-theme] body #studio[data-mode=video] #studio-video-panel .dub-edit-toolbar>button[data-ui-icon]::before,html[data-theme] body #studio[data-mode=video] #studio-video-panel .dub-edit-toolbar>button>svg{width:12px!important;height:12px!important;flex:0 0 12px!important}
/* Compact dialogue actions override the shared 38px workspace default. */
html[data-theme] body #studio[data-mode=script] .editpanel .studio-edit-toolbar{--workspace-button-height:32px}
html[data-theme] body #studio[data-mode=script] .editpanel .studio-edit-toolbar>button{box-sizing:border-box!important;height:32px!important;min-height:32px!important;max-height:32px!important;padding:6px 10px!important;font-size:12px!important;line-height:18px!important;border-radius:6px!important}
html[data-theme] body #studio[data-mode=script] .editpanel .studio-edit-toolbar>button[data-ui-icon]::before{width:14px!important;height:14px!important;flex:0 0 14px!important}

/* Status text remains readable as the workspace narrows. */
html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]{height:auto!important;max-height:none!important;overflow:visible!important;min-width:0;flex-shrink:0!important}
html[data-theme] body #studio .workspace-status-summary{white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere!important;text-overflow:clip!important;max-height:none!important;min-width:0}
html[data-theme] body #studio [data-feedback-error=true]>.workspace-status-summary{color:var(--ui-danger)!important}
html[data-theme] body #studio .workspace-status-recovery{grid-column:1/-1;display:flex;gap:8px;margin-top:4px}
html[data-theme] body #studio .workspace-status-recovery[hidden]{display:none!important}
html[data-theme] body #studio .workspace-status-recovery button{min-height:30px;padding:4px 10px;font-size:12px;border:1px solid var(--ui-field-border);border-radius:6px;background:var(--ui-field);color:var(--ui-text)}
@media(max-width:700px){html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]{grid-template-columns:minmax(0,1fr)!important}html[data-theme] body #studio :is(.studio-processing-status,.dub-processing-status)[data-unified=true]>.workspace-status-save{grid-column:1!important;grid-row:3!important;justify-self:start!important;margin-left:0!important}html[data-theme] body #studio .workspace-status-recovery{grid-row:4}html[data-page=studio] body #studio{height:auto!important;max-height:none!important;overflow:visible!important}}

/* One seek control and sentence-marker interaction for both workspaces. */
html[data-theme] body #studio .studio-player-seek{appearance:none;-webkit-appearance:none;height:5px;min-height:0;padding:0;border:0;border-radius:8px;box-shadow:none;background:linear-gradient(to right,var(--ui-accent) var(--progress,0%),var(--ui-subtle) var(--progress,0%));cursor:pointer;outline-offset:4px}
html[data-theme] body #studio .studio-player-seek::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;box-sizing:border-box;width:12px;height:12px;border:2px solid var(--ui-workspace);border-radius:50%;background:var(--ui-accent);box-shadow:0 0 0 1px var(--ui-border);transition:transform .16s ease,box-shadow .16s ease}
html[data-theme] body #studio .studio-player-seek::-moz-range-thumb{box-sizing:border-box;width:12px;height:12px;border:2px solid var(--ui-workspace);border-radius:50%;background:var(--ui-accent);box-shadow:0 0 0 1px var(--ui-border);transition:transform .16s ease,box-shadow .16s ease}
html[data-theme] body #studio .studio-player-seek:enabled:is(:hover,:focus-visible)::-webkit-slider-thumb{transform:scale(1.25);box-shadow:0 0 0 4px color-mix(in srgb,var(--ui-accent) 20%,transparent)}
html[data-theme] body #studio .studio-player-seek:enabled:is(:hover,:focus-visible)::-moz-range-thumb{transform:scale(1.25);box-shadow:0 0 0 4px color-mix(in srgb,var(--ui-accent) 20%,transparent)}
html[data-theme] body #studio :is(.studio-player-marker,.dub-cue-marker){position:absolute;top:50%;width:16px;min-width:0;height:24px;min-height:0;padding:0;margin:0;border:0;border-radius:0;background:transparent;box-shadow:none;transform:translate(-50%,-50%);pointer-events:auto;cursor:pointer}
html[data-theme] body #studio :is(.studio-player-marker,.dub-cue-marker)::after{content:'';position:absolute;left:50%;top:50%;box-sizing:border-box;width:5px;height:5px;border:1px solid var(--ui-workspace);border-radius:50%;background:var(--ui-accent);transform:translate(-50%,-50%);transition:width .16s ease,height .16s ease}
html[data-theme] body #studio :is(.studio-player-marker,.dub-cue-marker):is(:hover,:focus-visible)::after{width:9px;height:9px}
html[data-theme] body #studio :is(.studio-player-marker,.dub-cue-marker):focus-visible{outline:2px solid var(--ui-accent);outline-offset:1px;border-radius:4px}
@media(prefers-reduced-motion:reduce){html[data-theme] body #studio :is(.studio-player-marker,.dub-cue-marker)::after{transition:none}html[data-theme] body #studio .studio-player-seek::-webkit-slider-thumb{transition:none}html[data-theme] body #studio .studio-player-seek::-moz-range-thumb{transition:none}}

html[data-theme] body dialog>.ui-dialog-close-unified:hover{color:var(--ui-text)!important}html[data-theme] body dialog>.ui-dialog-close-unified:focus-visible{outline:2px solid var(--ui-accent);outline-offset:2px}html[data-theme] body dialog>.ui-dialog-close-unified svg{width:20px;height:20px;pointer-events:none}html[data-theme] body dialog:has(>.ui-dialog-close-unified)>:is(h2,h3){padding-right:38px}

html[data-theme] body dialog>.ui-dialog-close-unified{transition:background-color .16s ease,color .16s ease,opacity .16s ease}
html[data-theme] body dialog>.ui-dialog-close-unified:hover{--dialog-close-bg:var(--ui-subtle);--dialog-close-color:var(--ui-text);cursor:pointer}
html[data-theme] body dialog>.ui-dialog-close-unified:active{--dialog-close-bg:var(--ui-selected)}
@media(prefers-reduced-motion:reduce){html[data-theme] body dialog>.ui-dialog-close-unified{transition:none}}

/* Save state belongs to the project identity in both workspaces. */
html[data-theme] body #studio .workspace-project-save-anchor{display:flex!important;flex-wrap:wrap!important;align-items:center;column-gap:10px;row-gap:4px}
html[data-theme] body #studio .workspace-project-save-anchor>.workspace-status-save{flex:0 0 100%!important;width:100%!important;justify-content:flex-end!important;grid-column:auto!important;grid-row:auto!important;margin:0!important;line-height:18px!important}

/* Compact project identity and rename field, shared by both studios. */
html[data-theme] body #studio .video-project-name.workspace-project-save-anchor{flex:0 1 420px!important;width:420px!important;max-width:100%!important;min-width:0!important;margin-right:auto!important}
html[data-theme] body #studio .video-project-name.workspace-project-save-anchor>input{flex:1 1 240px!important;width:280px!important;max-width:100%!important;min-width:0!important;height:36px!important;min-height:36px!important;padding:6px 10px!important;font-size:16px!important}
html[data-theme] body #studio .video-project-name.workspace-project-save-anchor>.video-project-name-text{min-width:0;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:600px){html[data-theme] body #studio .video-project-name.workspace-project-save-anchor{flex-basis:100%!important;width:100%!important}}

/* Keep project identity and save state on one shared baseline. */
html[data-theme] body #studio .video-project-name.workspace-project-save-anchor{flex:1 1 auto!important;width:auto!important;max-width:none!important;flex-wrap:nowrap!important;align-items:baseline!important;gap:10px!important}
html[data-theme] body #studio .video-project-name.workspace-project-save-anchor>.workspace-status-save{flex:0 0 auto!important;width:auto!important;margin:0 0 0 auto!important;align-self:flex-end!important;justify-content:flex-end!important;white-space:nowrap!important}
html[data-theme] body #studio .video-project-name.workspace-project-save-anchor>input{flex:0 1 280px!important;width:280px!important}
@media(max-width:600px){html[data-theme] body #studio .video-project-name.workspace-project-save-anchor{flex-basis:100%!important;gap:8px!important}html[data-theme] body #studio .video-project-name.workspace-project-save-anchor>.video-project-name-text{max-width:40vw!important}}

.pricing-beta-notice{padding:16px 20px;margin:20px 0;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-workspace);color:var(--ui-secondary);line-height:1.7}.pricing-beta-notice strong{color:var(--ui-text)}.pricing-beta-notice p{margin:6px 0 0;font-size:14px}

.global-site main>.public-beta-notice{box-sizing:border-box;max-width:1200px;margin:24px auto;padding:16px 20px}@media(max-width:1240px){.global-site main>.public-beta-notice{margin:20px}}

#studio>.studio-beta-notice{flex:none;margin:0 0 12px;padding:10px 14px;font-size:13px}#studio>.studio-beta-notice summary{cursor:pointer;color:var(--ui-secondary);font-weight:600}#studio>.studio-beta-notice summary:hover{color:var(--ui-accent)}#studio>.studio-beta-notice p{font-size:13px;margin-top:8px}

.auth-layout .auth-beta-notice{margin:16px 0 0;padding:12px 14px;line-height:1.6;font-size:13px}.auth-layout .auth-beta-notice p{font-size:12px}

.global-site main>.public-beta-notice{width:calc(100% - 64px);max-width:1216px;margin:0 auto 32px;box-sizing:border-box}#page-voice-cloning>#public-beta-notice{width:100%;max-width:1280px;margin:0 auto 32px;box-sizing:border-box}@media(max-width:600px){.global-site main>.public-beta-notice{width:calc(100% - 40px);margin:0 auto 24px}}

.creation-site main>#public-beta-notice{width:100%;max-width:none;margin:0 0 32px;box-sizing:border-box}

#studio .studio-intro>.studio-beta-notice{grid-column:1/-1;flex-basis:100%;width:100%;box-sizing:border-box;margin:16px 0 0;padding:10px 14px;font-size:13px}#studio .studio-intro:has(>.studio-beta-notice){flex-wrap:wrap}#studio .studio-intro>.studio-beta-notice summary{cursor:pointer;font-weight:600;color:var(--ui-secondary)}#studio .studio-intro>.studio-beta-notice p{font-size:13px}

/* Shared modal scrim follows the palette without becoming white in dark mode. */
html[data-theme]{--ui-modal-scrim:color-mix(in srgb,color-mix(in srgb,var(--ui-accent) 24%,#071b17) 68%,transparent)}
html[data-theme] body dialog:modal::backdrop{background:var(--ui-modal-scrim)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
