/* Bounded extension of the desktop studio vocabulary. */
body[data-studio-page="script"] .art-direction { display:grid; gap:8px; margin-top:18px; padding:16px; border:1px solid var(--studio-line-strong); border-radius:10px; background:var(--studio-field); }
.script-workflow-switch { display:flex; gap:16px; justify-content:space-between; align-items:center; margin:0 0 16px; color:var(--studio-muted); font-size:13px; }
.script-workflow-switch button { min-height:44px; padding:0 15px; font-size:13px; }
.extension-frame-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; padding-bottom:16px; border-bottom:1px solid var(--studio-line); }
.extension-frame-heading h2 { margin:0; font-size:20px; }
.extension-frame-heading p { margin:7px 0 0; color:var(--studio-muted); font-size:13px; }
#extensionFrame { display:block; width:100%; height:1150px; border:0; color-scheme:dark; }
body[data-studio-page="script"] .workspace.extension-frame-open { grid-template-columns:1fr; }
.extension-frame-open > .input-panel { display:none; }
.art-direction h3 { margin:0 0 2px; font-size:15px; }
.art-direction label, .dialog-fields label { color:var(--studio-text); font-size:13px; font-weight:650; }
.art-direction :where(select, textarea), .dialog-fields :where(select, input, textarea) { width:100%; min-width:0; padding:10px 12px; border:1px solid var(--studio-line-strong); border-radius:8px; background:var(--studio-field); color:var(--studio-text); font:inherit; }
.art-direction select, .dialog-fields select, .dialog-fields input { min-height:44px; }
.art-direction textarea { min-height:74px; resize:vertical; }
.art-direction details { padding-top:8px; border-top:1px solid var(--studio-line); }
.art-direction summary { cursor:pointer; font-size:12px; color:var(--studio-accent-bright); }
.art-direction .director-help { margin:0; line-height:1.65; }
.reference-upload { display:flex; min-height:44px; align-items:center; margin-top:10px; cursor:pointer; }
.reference-upload input { width:1px; height:1px; opacity:0; position:absolute; }
.style-reference-preview { display:grid; grid-template-columns:64px 1fr auto; gap:10px; align-items:center; margin-top:10px; font-size:12px; }
.style-reference-preview img { width:64px; height:64px; object-fit:contain; background:var(--studio-bg); border-radius:6px; }
.style-reference-preview button { padding:0 10px; }
body[data-studio-page="script"] :where(.thumb, .reference-thumb) img { object-fit:contain; }
.scene-prompts { padding:16px; border:1px solid var(--studio-line); border-radius:10px; background:var(--studio-field); }
#scenePromptList { display:grid; gap:10px; margin-top:12px; }
.scene-prompt-card { display:flex; gap:16px; align-items:center; justify-content:space-between; padding:13px; border:1px solid var(--studio-line); border-radius:8px; }
.scene-prompt-card h4 { margin:0; font-size:14px; }
.scene-prompt-card p { margin:5px 0 0; max-width:420px; color:var(--studio-muted); font-size:12px; overflow-wrap:anywhere; }
.scene-prompt-actions { display:flex; flex-wrap:wrap; gap:6px; flex:none; }
.scene-prompt-actions button { min-height:40px; padding:0 10px; font-size:12px; }
.scene-prompt-actions { flex-shrink:1; justify-content:flex-end; }
.prompt-result-head .prompt-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.storyboard-dialog { width:min(1120px,calc(100vw - 64px)); }
.storyboard-canvas { margin:20px 0 16px; border:1px solid var(--studio-line-strong); border-radius:10px; overflow:hidden; background:var(--studio-field); }
.storyboard-canvas img { display:block; width:100%; max-height:560px; object-fit:contain; background:#faf9f5; }
.storyboard-canvas img[hidden], .storyboard-empty[hidden] { display:none; }
.storyboard-empty { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; padding:16px; }
.storyboard-empty span { display:grid; min-height:112px; aspect-ratio:16/9; place-items:center; border:1px dashed var(--studio-line-strong); border-radius:6px; font-size:13px; color:var(--studio-muted); background:var(--studio-bg); }
.storyboard-panels { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:0; margin:0 0 16px; list-style:none; }
.storyboard-panels li { border:1px solid var(--studio-line); border-radius:8px; padding:12px; }
.storyboard-panels span { color:var(--studio-accent-bright); font-size:12px; font-weight:650; }
.storyboard-panels p { margin:7px 0 0; font-size:13px; line-height:1.65; color:var(--studio-muted); }
.storyboard-download { display:inline-flex; min-height:44px; align-items:center; padding:0 16px; border:1px solid var(--studio-line-strong); border-radius:8px; text-decoration:none; }
.storyboard-download[hidden] { display:none; }
.storyboard-dialog :disabled { cursor:wait; opacity:.6; }
.storyboard-dialog .dialog-status { line-height:1.65; }
.studio-dialog { width:min(1000px,calc(100vw - 64px)); max-height:calc(100dvh - 72px); margin:auto; padding:24px; border:1px solid var(--studio-line-strong); border-radius:14px; background:var(--studio-surface); color:var(--studio-text); box-shadow:0 24px 100px #0008; overflow:auto; font-family:var(--studio-font); }
.studio-dialog::backdrop { background:rgba(5,8,11,.78); }
.studio-dialog-head { display:flex; justify-content:space-between; align-items:start; gap:20px; margin-bottom:20px; }
.studio-dialog h2 { margin:0; font-size:22px; letter-spacing:-.02em; }
.studio-dialog-head p { margin:7px 0 0; color:var(--studio-muted); font-size:13px; line-height:1.6; }
.studio-dialog .quiet { color:var(--studio-text); border-color:var(--studio-line-strong); background:var(--studio-surface-raised); }
.studio-dialog .primary { color:#201913; background:var(--studio-accent); box-shadow:none; margin:0; width:auto; }
.extension-layout { display:grid; grid-template-columns:minmax(220px,.7fr) minmax(0,1.2fr); gap:24px; }
.extension-source img { display:block; width:100%; max-height:320px; object-fit:contain; background:var(--studio-bg); border-radius:8px; }
.extension-source b { display:block; margin-top:12px; }
.extension-source p { color:var(--studio-muted); font-size:13px; }
.dialog-fields { display:grid; gap:8px; align-content:start; }
.dialog-fields textarea { line-height:1.7; resize:vertical; }
.dialog-fields textarea[readonly] { color:var(--studio-muted); }
.revision-layout { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.version-controls { display:flex; gap:8px; }
.version-controls button { white-space:nowrap; }
.dialog-actions { display:flex; gap:10px; justify-content:flex-end; padding-top:16px; border-top:1px solid var(--studio-line); }
.dialog-status { min-height:24px; font-size:13px; color:var(--studio-muted); }
.dialog-status.error { color:#ff9eac; }
.dialog-status.ok { color:var(--mint); }
.studio-dialog p { text-wrap:pretty; }
@media(max-width:900px) { .studio-dialog { width:calc(100vw - 32px); padding:18px; } .extension-layout,.revision-layout { grid-template-columns:1fr; } .extension-source img { max-height:180px; } .scene-prompt-card { align-items:start; flex-direction:column; } }
