*{box-sizing:border-box}
body{margin:0;background:var(--bg-base);color:var(--text-primary);font-family:Inter,system-ui,sans-serif;font-size:14px;letter-spacing:0}
[hidden],#mobile-menu.hidden{display:none!important}
a{color:var(--brand-600);text-decoration:none}
a:hover{text-decoration:underline}
button,input,textarea,select{font:inherit;color:inherit}
button,a,input,select,summary,textarea{outline-offset:3px}
:focus-visible{outline:2px solid var(--brand-500)}
.studio-sidebar{position:fixed;inset:0 auto 0 0;width:224px;padding:18px 12px;background:var(--bg-surface);border-right:1px solid var(--border-subtle);overflow:auto}
.studio-sidebar>a{display:block;padding:0 9px 16px}
.studio-sidebar img,.studio-mobile img{display:block;height:auto}
.sidebar-link{display:flex;min-height:42px;align-items:center;gap:10px;padding:8px 10px;color:var(--text-secondary);border-radius:6px;font-weight:550}
.sidebar-link.active,.sidebar-link:hover{color:var(--brand-600);background:var(--bg-elevated);text-decoration:none}
.rc-app-navigation>.sidebar-link.hero-link,.rc-app-navigation>.sidebar-link.hero-link.active{background:var(--brand-600);color:white;margin:7px 0}
.rc-app-navigation>.sidebar-link.hero-link:hover{background:var(--brand-500);color:white}
.sidebar-link.mt-3{margin-top:16px;border-top:1px solid var(--border-subtle)}
.studio-mobile,#mobile-menu{display:none}
.studio-main{margin-left:224px;padding:36px clamp(20px,5vw,60px);max-width:1190px}
.studio-heading{display:flex;align-items:center;gap:14px;margin:0 0 27px}
.studio-heading p{margin:4px 0;color:var(--text-secondary)}
.page-icon{width:44px;height:44px;flex:0 0 44px;display:grid;place-items:center;color:var(--brand-600);background:#e8efff;border-radius:8px}
h1{font-size:26px;line-height:1.2;margin:0;font-weight:750}
h2{font-size:17px;margin:0 0 14px}
form{display:grid;gap:13px}
label{font-weight:600;min-width:0}
input:not([type=checkbox]):not([type=radio]),textarea,select{width:100%;min-height:42px;display:block;padding:9px 10px;border:1px solid var(--border-default);border-radius:6px;background:var(--bg-surface);margin-top:5px}
textarea{resize:vertical;line-height:1.55}
fieldset{margin:0;border:0;padding:0}
legend{font-weight:600;margin-bottom:7px}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.profile-fields{margin-top:4px}
.voice-field{min-width:0;display:grid;gap:7px}
.voice-field audio{width:100%;height:42px}
.voice-field p:empty,.performance-list:empty{display:none}
.performance-list{display:grid;gap:6px;margin-top:6px}
.performance-row{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px;padding-block:6px;border-top:1px solid var(--border-subtle)}
.studio-item>button{justify-self:start}
.mode-switch,.days,.actions,.tabs{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.mode-switch label,.days label{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;min-height:38px;border:1px solid var(--border-default);border-radius:6px;background:var(--bg-surface);cursor:pointer}
.mode-switch label:has(:checked),.days label:has(:checked){color:var(--brand-600);border-color:var(--brand-500);background:#f2f6ff}
input[type=checkbox],input[type=radio]{accent-color:var(--brand-600)}
.check{display:flex;align-items:flex-start;gap:8px;font-weight:500}
.check input{flex:0 0 auto;margin-top:3px}
button,.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:8px 12px;background:var(--bg-surface);border:1px solid var(--border-default);border-radius:6px;cursor:pointer;text-decoration:none;font-weight:650}
button:hover,.button:hover{background:var(--bg-elevated);text-decoration:none}
button:disabled{opacity:.55;cursor:wait}
button.primary{justify-self:start;background:var(--brand-600);color:white;border-color:var(--brand-600)}
button.primary:hover{background:var(--brand-500)}
.icon-btn{width:42px;padding:0}
.actions a:not(.button){display:inline-flex;align-items:center;gap:6px;padding:8px 4px}
svg{width:17px;height:17px;flex:0 0 auto}
.page-icon svg{width:22px;height:22px}
.muted{color:var(--text-secondary);font-size:13px;margin:0;overflow-wrap:anywhere}
details{border:1px solid var(--border-subtle);border-radius:8px;padding:12px;background:var(--bg-surface);min-width:0}
summary{cursor:pointer;font-weight:650}
details[open]>form,details[open]>.field-grid{margin-top:14px}
.studio-section{margin-top:26px;padding-top:18px;border-top:1px solid var(--border-subtle)}
.tabs{margin-bottom:18px}
.tabs [aria-pressed=true]{color:var(--brand-600);border-color:var(--brand-500);background:#f2f6ff}
.item-list{display:grid;gap:8px;margin-bottom:13px}
.studio-item{background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:8px;padding:12px;display:grid;gap:5px;overflow-wrap:anywhere}
.studio-item .actions{margin-top:4px}
.status-text{color:var(--brand-600);font-weight:650;font-size:12px}
.episode-list{margin:5px 0 0;padding-left:20px;display:grid;gap:10px}
#error,#notice{margin-bottom:16px;border:1px solid;border-radius:6px;padding:10px 12px}
#error{background:#fff1f2;color:#9f1239}
#notice{background:#ecfdf5;color:#065f46}
@media(max-width:767px){
  .studio-sidebar{display:none}
  .studio-mobile{display:flex;justify-content:space-between;align-items:center;padding:10px 15px;background:var(--bg-surface);border-bottom:1px solid var(--border-subtle)}
  #mobile-menu:not([hidden]):not(.hidden){display:grid;padding:10px 15px;background:var(--bg-surface)}
  .studio-main{margin:0;padding:23px 15px}
}
@media(max-width:390px){.field-grid{grid-template-columns:1fr}.mode-switch label{padding-inline:7px}}

/* Creation and review share a quiet editing workspace. */
.studio-main{max-width:1460px;padding:32px 40px 40px}
.studio-heading{margin-bottom:24px}
.studio-heading .page-icon{background:transparent;width:30px;flex-basis:30px}
.creation-steps{display:flex;list-style:none;padding:0 0 24px;margin:0 0 28px;border-bottom:1px solid var(--border-default);gap:32px;color:var(--text-secondary)}
.creation-steps li{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600}
.creation-steps li>span{display:grid;place-items:center;width:25px;height:25px;border:1px solid var(--border-default);border-radius:50%;font-size:12px;flex-shrink:0}
.creation-steps [aria-current]{color:var(--brand-600)}
.creation-steps [aria-current]>span{background:var(--brand-600);border-color:var(--brand-600);color:white}
.creation-steps .complete{color:#15724c}
.creation-layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:36px;align-items:start}
.creation-content{min-width:0;display:flex;flex-direction:column;gap:12px}
.creation-content>.mode-switch{margin-bottom:13px;gap:4px;border-bottom:1px solid var(--border-default);flex-wrap:nowrap}
.creation-content>.mode-switch legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.creation-content>.mode-switch label{position:relative;border:0;border-bottom:2px solid transparent;border-radius:0;min-height:45px;padding:9px 12px;background:transparent;font-size:14px;flex:1;justify-content:center}
.creation-content>.mode-switch label:has(:checked){border-bottom-color:var(--brand-600);background:transparent;color:var(--brand-600)}
.mode-switch input{position:absolute;opacity:0;width:1px;height:1px}
.mode-switch label:has(input:focus-visible){outline:2px solid var(--brand-500);outline-offset:-2px}
#input-label{font-size:19px;font-weight:700;margin:7px 0}
#video-input{font-size:16px;line-height:1.75;min-height:210px;padding:18px;margin:0;background:white;border-radius:8px}
#create-view[data-source=idea] #video-input{height:190px;min-height:190px}
.niche-suggestion{display:block;margin-top:7px;font-size:11px;font-weight:400}
.input-meta{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--text-secondary)}
#input-status{color:#15724c}
.example-topics{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:15px}
.example-topics>span{flex-basis:100%;font-size:12px;color:var(--text-secondary)}
.example-topics button{font-weight:500;font-size:12px;min-height:34px;padding:5px 9px}
.example-topics button svg{width:15px;height:15px}
.creation-settings{border-left:1px solid var(--border-default);padding-left:28px;display:flex;flex-direction:column;gap:18px;min-width:0}
.creation-settings h2{font-size:15px;margin:0}
.creation-settings .profile-fields{grid-template-columns:1fr;margin:0}
.field-label{display:block;font-weight:600;margin-bottom:6px}
.format-choice{display:grid;gap:8px}
.format-choice legend{font-size:12px;color:var(--text-secondary)}
.format-choice button{justify-content:flex-start;padding:12px;gap:10px;text-align:left;width:100%;height:64px;font-size:14px;font-weight:650}
.format-choice button>svg:first-child{height:24px;width:24px;color:var(--text-secondary)}
.format-choice button small{display:block;font-size:11px;font-weight:400;color:var(--text-secondary);margin-top:3px}
.format-choice button[aria-pressed=true]{background:#eff5ff;border-color:var(--brand-500);color:var(--brand-600)}
.format-choice .choice-check{margin-left:auto;width:16px;visibility:hidden}
.format-choice [aria-pressed=true] .choice-check{visibility:visible}
.format-choice button:disabled{cursor:not-allowed;opacity:.55}
.style-choice{width:100%;justify-content:start;padding:6px;font-size:13px}
.style-choice img{border-radius:4px;object-fit:cover}
#style-auto-icon{width:58px;height:28px;margin:10px 0;color:var(--brand-600)}
.style-auto-preview{display:grid;place-items:center;aspect-ratio:16/10;background:#f0f4f8;color:var(--brand-600)}
.style-auto-preview svg{width:30px;height:30px}
.style-choice>svg{margin-left:auto;margin-right:5px}
.channel-options{padding:12px 0 0;border-width:1px 0 0;border-radius:0;background:transparent}
.channel-options summary{font-size:13px}
.channel-options[open]>div{margin-top:10px}
.creation-actions{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid var(--border-default);background:var(--bg-base);padding:18px 0;margin-top:20px}
.creation-actions p{margin:0 0 4px;font-weight:600;font-size:13px}
.creation-actions .primary{min-height:46px;min-width:160px;justify-content:space-between;padding:11px 16px}
.creation-actions .actions{justify-content:flex-end}
#advanced-link{font-size:12px;color:var(--text-secondary)}
.primary[aria-busy=true]{cursor:wait}
.primary[aria-busy=true] svg{animation:working 1s linear infinite}
@keyframes working{50%{opacity:.3}}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.section-heading h2{margin:0;font-size:19px}
.draft-editor{display:flex;flex-direction:column;gap:12px;min-width:0}
.draft-editor input,.draft-editor textarea{margin:0;padding:14px;font-size:15px;background:white;line-height:1.7}
.draft-editor textarea{min-height:300px}
.draft-editor>label{font-size:12px;color:var(--text-secondary)}
.reviewing .creation-content>.mode-switch,.reviewing #video-input,.reviewing #input-label,.reviewing .input-meta{display:none}
.text-button{align-self:start;color:var(--brand-600);border:0;background:transparent;padding-left:0;font-size:13px}
.inline-warning{padding:12px;border-left:3px solid #ad6a14;background:#fff8e9;color:#79500e;font-size:13px;line-height:1.5;margin:0}
dialog{border:1px solid var(--border-default);border-radius:8px;padding:24px;width:min(790px,calc(100% - 32px));max-height:85dvh;background:var(--bg-surface);color:var(--text-primary);box-shadow:0 20px 65px #10182822}
dialog::backdrop{background:#10182866}
dialog>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;gap:12px}
dialog h2{margin:0}
.style-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.style-tile{display:flex;flex-direction:column;padding:0;overflow:hidden;align-items:stretch;text-align:left;border-radius:6px}
.style-tile img{width:100%;height:auto;aspect-ratio:16/10;object-fit:cover}
.style-tile span{padding:12px;font-size:13px}
.style-tile[aria-pressed=true]{border-color:var(--brand-600);background:#eff5ff;color:var(--brand-600)}
.review-main{max-width:1460px}
.review-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.review-heading h1{font-size:24px;overflow-wrap:anywhere}
.review-heading p{margin:8px 0 0;color:var(--text-secondary)}
.review-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:32px;align-items:start}
.review-summary{border-left:1px solid var(--border-default);padding-left:24px;position:sticky;top:25px;display:grid;gap:22px}
.review-summary dl{margin:0;display:grid;gap:12px}
.review-summary dl>div{display:flex;justify-content:space-between;gap:12px}
.review-summary dt{color:var(--text-secondary)}
.review-summary dd{margin:0;font-weight:600}
.review-summary h2{margin:0;font-size:15px}
.render-options{display:grid;gap:15px;border-top:1px solid var(--border-default);padding-top:20px}
.render-options input[type=color]{width:42px;height:32px;padding:3px;min-height:32px;margin:0;border:1px solid var(--border-default)}
.render-options .frame-color{display:flex;align-items:center;justify-content:space-between}
.scene-list{display:grid;gap:16px}
.scene-editor{border:1px solid var(--border-default);border-radius:8px;padding:18px;background:white;min-width:0}
.scene-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:15px}
.scene-heading h2{font-size:14px;margin:0;display:flex;align-items:center;gap:8px}
.scene-number{display:grid;place-items:center;width:25px;height:25px;background:#f0f3f8;color:var(--text-secondary);border-radius:4px;font-size:12px}
.scene-route{display:flex;align-items:center;gap:5px;color:var(--text-secondary);font-size:12px}
.scene-editor>label{font-size:12px;color:var(--text-secondary)}
.scene-editor textarea{background:var(--bg-base);line-height:1.7;min-height:90px;font-size:15px;resize:vertical}
.scene-editor details{border:0;border-top:1px solid var(--border-subtle);border-radius:0;padding:12px 0 0;margin-top:16px;background:transparent}
.scene-editor details summary{font-size:12px;font-weight:550;color:var(--text-secondary)}
.scene-editor details[open]>div{display:grid;gap:12px;margin-top:12px}
.scene-editor details p{margin:0;line-height:1.6;font-size:13px;color:var(--text-secondary)}
.scene-editor details label{font-size:12px}
.scene-editor details input[type=text]{font-size:13px}
.scene-editor .check{color:var(--text-secondary)}
.review-status{display:flex;align-items:center;gap:8px;color:#15724c;font-size:12px}
.review-status[data-dirty=true]{color:#986116}
.waiting-content{padding:60px 0;max-width:570px;line-height:1.6}
.waiting-content h1{font-size:25px;margin-top:20px}
.waiting-content p{color:var(--text-secondary)}
.waiting-icon{color:var(--brand-600);height:36px;width:36px;animation:working 1.5s infinite}
.waiting-content .actions{margin-top:25px}
.review-action-note{max-width:520px;line-height:1.5}
.review-only-note{font-size:12px;color:var(--text-secondary);line-height:1.6}
@media(min-width:1400px){.studio-main{padding-inline:56px}.creation-layout{grid-template-columns:minmax(0,1fr) 310px;gap:48px}}
@media(max-width:1100px){.studio-main{padding:28px 24px}.creation-layout{grid-template-columns:minmax(0,1fr) 250px;gap:22px}.creation-settings{padding-left:20px}.creation-actions{align-items:start;flex-wrap:wrap}.review-layout{grid-template-columns:minmax(0,1fr) 230px;gap:22px}}
@media(max-width:920px){.creation-layout,.review-layout{grid-template-columns:1fr}.creation-settings{border-left:0;border-top:1px solid var(--border-default);padding:22px 0 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.creation-settings h2,.creation-settings .format-choice,.creation-settings .profile-fields,.creation-settings #format-plan-note{grid-column:1/-1}.format-choice{grid-template-columns:1fr 1fr}.review-summary{border-left:0;border-top:1px solid var(--border-default);padding:20px 0 0;position:static}.review-summary dl{grid-template-columns:1fr 1fr}.review-summary dl>div{display:grid;gap:4px}.render-options{grid-template-columns:1fr 1fr}.creation-actions{position:static}}
@media(max-width:767px){.studio-main{padding:22px 18px}.creation-steps{gap:15px;margin-bottom:22px;padding-bottom:20px}.creation-steps li{font-size:11px;gap:5px}.creation-steps li>span{width:22px;height:22px;font-size:11px}.creation-actions{padding:14px 0;gap:12px}.creation-actions .actions{width:100%;justify-content:space-between}.creation-actions .primary{min-width:175px}.style-grid{grid-template-columns:1fr 1fr}#video-input{min-height:170px}.scene-editor{padding:14px}.review-heading h1{font-size:21px}.scene-route{font-size:11px}}
@media(max-width:390px){.studio-main{padding-inline:14px}.creation-steps{gap:9px}.creation-steps li{font-size:11px}.creation-content>.mode-switch label{padding:8px 5px;font-size:12px;gap:5px}.mode-switch svg{width:15px;height:15px}.format-choice button{padding:9px;gap:7px}.format-choice button small{font-size:10px}.format-choice button>svg:first-child{width:20px;height:20px}.format-choice .choice-check{display:none}.creation-actions .actions{flex-wrap:wrap}.creation-actions .primary{flex:1}.style-grid{gap:8px}.style-tile span{font-size:12px;padding:9px}.section-heading{flex-wrap:wrap}.scene-heading{align-items:start;flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important}}
@media(max-width:767px){input:not([type=checkbox]):not([type=radio]),textarea,select{font-size:16px}.creation-settings #create-voice{min-width:0}.voice-field audio{min-width:0}}
.draft-conflict{display:flex;align-items:center;gap:10px 16px;flex-wrap:wrap;padding:12px 16px;margin-bottom:16px;border:1px solid #9ab5e5;background:#eef4ff;color:#183b75;border-radius:6px;font-size:13px}.draft-conflict[hidden]{display:none}.draft-conflict button{font-size:13px;min-height:34px;padding:5px 10px}

#busy-dialog{width:min(360px,calc(100vw - 40px));padding:28px 24px;border:1px solid var(--border-subtle);border-radius:12px;background:var(--bg-surface);text-align:center;box-shadow:0 24px 60px rgba(15,23,42,.25)}
#busy-dialog::backdrop{background:rgba(15,23,42,.45)}
#busy-dialog h2{margin:16px 0 6px;font-size:18px}
.busy-spinner{width:42px;height:42px;margin:0 auto;border:4px solid var(--border-subtle);border-top-color:var(--brand-600);border-radius:50%;animation:busy-spin .9s linear infinite}
@keyframes busy-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.busy-spinner{animation-duration:2.5s}}

/* Phones and small tablets: every setting gets a full row with one look, instead of half-width leftovers. */
@media(max-width:920px){
  .creation-settings #style-control,.creation-settings .channel-options{grid-column:1/-1}
  .creation-settings .style-choice{min-height:48px;padding:6px 10px;font-size:15px}
  .creation-settings .channel-options{border:1px solid var(--border-subtle);border-radius:8px;padding:12px 14px;background:var(--bg-surface)}
  .creation-settings .channel-options summary{font-size:15px;font-weight:600;cursor:pointer}
}
@media(max-width:767px){
  .creation-settings{gap:16px 12px}
  .creation-settings select,.creation-settings .style-choice{min-height:48px}
  .creation-actions{flex-direction:column;align-items:stretch;position:sticky;bottom:0}
  .creation-actions .actions{flex-direction:column-reverse;gap:8px}
  .creation-actions .primary{width:100%;min-height:50px;justify-content:center}
  .creation-actions #advanced-link{align-self:center;font-size:13px}
  .creation-actions #credit-note{display:none}
}
@media(max-width:480px){
  .creation-settings{grid-template-columns:1fr}
  .creation-settings>*{grid-column:1/-1}
}
.creation-actions .estimate-warning{color:var(--danger,#b42318)}.creation-actions #credit-note{display:block;font-size:13px;line-height:1.5}.creation-actions #credit-note strong{color:var(--text-primary);font-weight:650}.creation-actions #credit-note a{font-weight:650;margin-left:4px}

.creation-steps .new-video-step{margin-left:auto}.creation-steps .new-video-step .text-button{display:inline-flex;align-items:center;gap:4px;padding:0;font-weight:600}.creation-steps .new-video-step svg{width:15px;height:15px}
.creation-steps{flex-wrap:wrap;row-gap:10px}
