:root{font-family:Arial,'Microsoft YaHei',sans-serif;color:#242b30;background:#f2f4f6;letter-spacing:0;font-synthesis:none;--accent:#16836f;--border:#e0e5e8;--muted:#7e898f}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none}button:disabled{opacity:.43;cursor:not-allowed}button,a,input,select,textarea,summary{-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}[hidden]{display:none!important}svg{width:17px;height:17px;flex-shrink:0;stroke-width:1.7}h1,h2,h3,p{margin:0}h1,h2{font-size:14px;font-weight:600}h3{font-size:12px;font-weight:600}a{color:inherit;text-decoration:none}.topbar{height:76px;display:flex;align-items:center;gap:35px;padding:0 25px;background:#fff;border-bottom:1px solid var(--border)}.brand{display:flex;align-items:center;gap:12px;min-width:180px}.brand>b{font-size:29px;font-weight:800}.brand>b span{color:var(--accent)}.brand strong{display:block;font-size:17px}.brand small{display:block;font-size:10px;color:var(--muted);margin-top:5px}.workspace-tabs{display:flex;align-self:stretch;gap:25px}.workspace-tabs button{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);border-bottom:2px solid transparent;padding:0 2px}.workspace-tabs button.active{color:var(--accent);border-color:var(--accent)}.top-actions{margin-left:auto;display:flex;gap:9px}.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:5px;min-height:35px;padding:8px 12px;font-size:12px;white-space:nowrap}.primary{background:var(--accent);color:white;border:1px solid var(--accent)}.primary:hover{background:#096d5b}.secondary{border:1px solid var(--border);background:#fff}.secondary:hover{border-color:#b5c9c1;background:#f5faf7}.full{width:100%}.icon-button{width:31px;height:31px;display:inline-grid;place-items:center;color:#7c8990;border-radius:4px;padding:0}.icon-button:hover{background:#eaf3ef;color:var(--accent)}.status-dot{width:6px;height:6px;border-radius:50%;background:#a6afb3;display:inline-block}.connected .status-dot{background:#16836f}.status-strip{display:grid;grid-template-columns:1.4fr 1.1fr 1fr 1fr;margin:0 24px;padding:18px 0;border-bottom:1px solid var(--border)}.status-strip>div{padding:0 24px;border-right:1px solid var(--border);min-width:0}.status-strip>div:first-child{padding-left:0}.status-strip>div:last-child{border-right:0}.status-strip span{display:block;font-size:10px;color:var(--muted);margin-bottom:7px}.status-strip strong{display:block;font-weight:500;font-size:12px;overflow-wrap:anywhere}.workbench{display:grid;grid-template-columns:330px minmax(0,1fr);max-width:1920px;margin:auto;padding:18px 24px 24px;gap:18px;align-items:start}.controls{background:#fff;border:1px solid var(--border);border-radius:6px;position:sticky;top:16px;max-height:calc(100dvh - 34px);overflow:auto;scrollbar-width:thin;scrollbar-color:#c8d1d5 transparent}.section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:52px}.controls>.section-head{padding:0 16px;border-bottom:1px solid var(--border);position:sticky;top:0;background:white;z-index:3}fieldset{border:0;margin:0;padding:17px 16px 0;min-width:0}label{font-size:11px;display:block;font-weight:500;margin-bottom:8px}input,select,textarea{border:1px solid #dce3e7;background:white;border-radius:5px;font-size:12px;width:100%;min-width:0}input,select{height:37px;padding:0 10px}textarea{padding:11px;line-height:1.8;resize:vertical;min-height:124px;max-height:350px}input::placeholder,textarea::placeholder{color:#a0a9af}input[type=checkbox]{width:14px;height:14px;accent-color:var(--accent);margin:0}input[type=range]{accent-color:var(--accent);height:20px;padding:0;margin:1px 0 9px;border:0;cursor:pointer}output{font-size:10px;color:var(--accent)}.field{margin-top:17px}.field-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.segmented{display:flex;border:1px solid var(--border);padding:3px;border-radius:5px;background:#f1f4f5}.segmented button{flex:1;height:31px;border-radius:3px;font-size:12px;color:#7c8790}.segmented button.active{background:#fff;color:#1c6352;box-shadow:0 1px 4px #24352c10;font-weight:500}.drawer{border-top:1px solid var(--border);margin-top:17px}.drawer summary{list-style:none;display:flex;align-items:center;justify-content:space-between;height:43px;font-size:12px;font-weight:600;cursor:pointer}.drawer summary::-webkit-details-marker{display:none}.drawer summary svg{width:14px;color:#89958e;transition:transform .2s}.drawer[open] summary svg{transform:rotate(180deg)}.drawer-body{padding:0 0 5px}.drawer-body>.full{margin-top:9px}.label-row{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:7px;min-height:22px}.label-row>label{margin:0}.label-row label span{font-size:10px;color:#97a19e;margin-left:7px}.inline-icons{display:flex}.ratio-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.ratio-grid button{border:1px solid var(--border);border-radius:4px;height:32px;font-size:11px;color:#6f7c84;background:#fff}.ratio-grid button.selected{color:#12745e;border-color:#58a792;background:#ecf7f1}.dimension-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-top:15px}.dimension-grid input[type=number]{font-size:11px}.size-summary{display:flex;align-items:center;gap:7px;padding-top:11px;color:#82918c;font-size:10px;min-height:25px}.size-summary svg{width:13px;height:13px}.text-meta{display:flex;justify-content:space-between;font-size:10px;color:#97a09e;margin:7px 0}.generation-footer{background:white;position:sticky;bottom:0;padding:10px 16px 13px;border-top:1px solid var(--border);z-index:2;margin-top:15px}.generation-footer p{font-size:10px;color:#97a19e;text-align:center;margin:0 0 9px}.generation-footer .primary{height:41px;font-size:12px}.generation-footer .primary svg:last-child{margin-left:auto}.generation-footer .primary svg:first-child{margin-right:auto}#stop-batch{margin-top:8px}#service-note{color:#a27436;margin:9px 0 0}.results-workspace{min-width:0}.stage-panel,.library,.queue-panel{background:white;border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:0 15px 15px}.stage-head{height:66px}.stage-head p{color:#8b979e;font-size:10px;margin-top:6px;overflow-wrap:anywhere}.stage-head>div:first-child{min-width:0}.stage-actions{display:flex;gap:5px;flex-shrink:0}.preview-layout{display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:13px}.canvas-shell{min-width:0;border:1px solid #d9e1e4;background:#edf1f3;border-radius:5px;overflow:hidden}.result-stage{height:460px;position:relative;display:grid;place-items:center;overflow:hidden;background-image:linear-gradient(#869ba00a 1px,transparent 1px),linear-gradient(90deg,#869ba00a 1px,transparent 1px);background-size:24px 24px}.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;color:#78928c;gap:13px}.empty-state>svg{width:33px;height:33px;color:#a5b6b0}.empty-state h2{font-size:15px;color:#607570}.empty-state p{color:#98a6a3;font-size:11px}#media{width:100%;height:100%;min-height:0;padding:18px}#media img,#media video{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 6px 12px #23382c15)}.result-bottom{height:32px;background:#e5ebed;display:flex;justify-content:space-between;align-items:center;padding:0 12px;font-size:10px;color:#697b80;gap:8px}.preview-navigation{display:flex;align-items:center;gap:6px;position:absolute;bottom:12px;left:50%;transform:translateX(-50%);background:#fff;border:1px solid var(--border);border-radius:5px;box-shadow:0 2px 8px #263a2912}.preview-navigation>span{font-size:10px;min-width:33px;text-align:center}.batch-panel{border-left:1px solid var(--border);padding-left:13px;min-width:0}.batch-panel .section-head{height:29px;min-height:29px;margin-bottom:10px}.count{display:inline-grid;place-items:center;min-width:21px;height:21px;padding:0 5px;border-radius:4px;background:#edf3f0;color:#577b6d;font-size:10px}.batch-list{max-height:454px;overflow:auto;scrollbar-width:thin}.batch-item{border:1px solid var(--border);border-radius:5px;padding:10px;margin-bottom:8px;cursor:pointer;display:block;width:100%;text-align:left}.batch-item.active{border-color:#94bfaf;background:#f5faf7}.batch-item strong{font-size:11px;font-weight:500;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.batch-item small{display:block;font-size:9px;color:#8b9794;margin:7px 0}.batch-item .batch-summary{font-size:10px;color:#278269;display:block}.batch-item.error .batch-summary{color:#a56549}.batch-item progress{display:block;width:100%;height:4px;accent-color:var(--accent);border:0;margin-top:9px}.empty-note{font-size:11px;color:#a0aaa8;text-align:center;padding:30px 0}.library{margin-top:15px}.heading-with-count{display:flex;align-items:center;gap:9px}.library-actions{display:flex;align-items:center;gap:7px}.selection-label{display:flex;align-items:center;gap:5px;margin:0;font-size:10px;color:#7d8b85}.library-filter{display:flex;align-items:center;gap:9px;border:1px solid var(--border);border-radius:5px;margin-bottom:12px;padding-left:10px;color:#8d9a95}.library-filter input{border:0;height:34px;flex:1;background:transparent}.library-filter select{width:105px;border:0;border-left:1px solid var(--border);border-radius:0;height:27px;font-size:10px}.history-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:11px}.asset{border:1px solid var(--border);border-radius:5px;overflow:hidden;min-width:0;position:relative;background:white}.asset.selected{border-color:var(--accent)}.asset .asset-preview{display:block;width:100%;padding:0;height:114px;background:#f2f5f4}.asset img,.asset video{display:block;width:100%;height:100%;object-fit:cover}.asset-info{padding:8px}.asset-info strong{font-size:10px;font-weight:400;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.asset-info small{font-size:9px;display:block;color:#96a099;margin-top:5px}.asset-check{position:absolute;top:7px;left:7px;padding:4px;background:#ffffffd9;border-radius:3px;margin:0;display:flex}.asset-tools{display:flex;justify-content:flex-end;border-top:1px solid #eef1ef;padding:2px 4px}.asset-tools .icon-button{height:26px;width:27px}.asset-tools svg{width:13px;height:13px}.queue-panel{margin-top:15px}.queue-actions{display:flex;gap:5px;align-items:center}.queue-row{display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:10px;border-top:1px solid #edf0ef;padding:11px 0}.queue-row strong{font-size:11px;font-weight:400;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.queue-row p{font-size:10px;color:#91a096;margin-top:4px;overflow-wrap:anywhere}.queue-row svg{color:#84a493;width:15px}.queue-row.failed svg,.queue-row.uncertain svg{color:#b67f50}.queue-row.running svg{animation:spin 1.5s linear infinite}.queue-row .state{font-size:10px;white-space:nowrap;color:#85948b}.queue-row button{font-size:10px}.upload{border:1px dashed #b9cfc5;background:#f6faf7;border-radius:5px;min-height:94px;position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;overflow:hidden}.upload.dragging{background:#e4f4eb;border-color:var(--accent)}.upload>svg{color:#659585}.upload strong{font-size:11px;font-weight:400;color:#54866e}.upload small{color:#9aa79e;font-size:9px}.upload input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.reference-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:8px 0}.reference-thumbnail{position:relative;height:58px;border:1px solid var(--border);border-radius:4px;overflow:hidden}.reference-thumbnail img{width:100%;height:100%;object-fit:cover}.reference-thumbnail button{position:absolute;right:0;top:0;width:20px;height:20px;background:white;display:grid;place-items:center}.reference-thumbnail svg{width:12px}.inline-row{display:flex;gap:7px}.inline-row>input{flex:1}.inline-row .secondary{width:37px;padding:0}.dialog-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.dialog-heading h2{font-size:17px}dialog{padding:24px;border:1px solid var(--border);border-radius:7px;width:400px;max-width:calc(100% - 28px);max-height:90dvh;box-shadow:0 20px 80px #243b362b}dialog::backdrop{background:#1a2e3266}.dialog-note{font-size:11px;color:#8d9991;line-height:1.8;margin:12px 0 17px}#disconnect{margin-top:9px}#account-error,#models-error{font-size:12px;color:#ab6145;margin:12px 0;line-height:1.7}#models-dialog{width:800px}.model-row{display:grid;grid-template-columns:1.5fr 1fr 80px 60px 30px;gap:8px;align-items:center;margin:12px 0}.model-row label{display:flex;align-items:center;gap:5px;margin:0;font-size:10px}.admin-actions{display:flex;gap:10px;margin:12px 0}#admin-login>.secondary{margin-top:12px}#preview-dialog{width:1100px}#large-preview{height:70dvh}#large-preview img,#large-preview video{width:100%;height:100%;object-fit:contain}#confirm-dialog h2{font-size:16px}#confirm-description{font-size:12px;line-height:1.9;color:#7d8984;margin:15px 0 22px}.confirm-actions{display:flex;justify-content:flex-end;gap:9px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);max-width:min(600px,90%);padding:12px 19px;background:#253e35;color:white;border-radius:5px;font-size:12px;line-height:1.8;z-index:99;box-shadow:0 4px 25px #0002}@keyframes spin{to{transform:rotate(360deg)}}
@media(min-width:1600px){.workbench{grid-template-columns:350px minmax(0,1fr)}.preview-layout{grid-template-columns:minmax(0,1fr) 230px}.result-stage{height:540px}.batch-list{max-height:534px}}
@media(max-width:1150px){.topbar{padding:0 18px;gap:20px}.workspace-tabs{gap:18px}.workbench{grid-template-columns:300px minmax(0,1fr);padding:15px 16px;gap:13px}.status-strip{margin:0 16px}.preview-layout{grid-template-columns:minmax(0,1fr)}.batch-panel{border-left:0;border-top:1px solid var(--border);padding:10px 0 0}.batch-list{display:flex;gap:8px;max-height:130px;overflow:auto}.batch-item{min-width:170px;max-width:200px;margin:0}.batch-list>.empty-note{padding:9px 0;width:100%}.result-stage{height:395px}.stage-actions{gap:2px}.stage-actions .secondary{font-size:11px;padding:8px}.top-actions .secondary{padding:8px}.history-grid{grid-template-columns:repeat(auto-fill,minmax(115px,1fr))}}
@media(max-width:760px){.topbar{height:auto;min-height:109px;padding:14px 15px 0;gap:10px;flex-wrap:wrap;position:relative}.brand{min-width:0}.brand strong{font-size:15px}.brand small{font-size:9px}.brand>b{font-size:27px}.top-actions{gap:5px}.top-actions .secondary{font-size:10px;height:32px;min-height:32px;padding:6px 8px}#manage-models>span{display:none}.workspace-tabs{order:3;width:100%;height:39px;gap:25px}.workspace-tabs button{font-size:12px}.status-strip{margin:0 12px;padding:13px 0;grid-template-columns:1.3fr 1fr}.status-strip>div{padding:0 12px}.status-strip>div:nth-child(2){border-right:0}.status-strip>div:nth-child(3),.status-strip>div:nth-child(4){display:none}.status-strip span{font-size:9px}.status-strip strong{font-size:11px}.workbench{display:block;padding:12px}.controls{position:static;max-height:none;border-radius:5px;margin-bottom:15px;overflow:visible}.controls>.section-head{position:static;border-radius:5px}.generation-footer{position:static}.stage-head{height:auto;min-height:67px;flex-wrap:wrap;padding:12px 0;gap:9px}.stage-actions{margin-left:auto}.stage-actions .icon-button{width:26px}.stage-actions .secondary{min-height:31px;font-size:10px}.stage-panel,.library,.queue-panel{padding:0 11px 12px}.preview-layout{gap:11px}.result-stage{height:315px}.result-bottom{font-size:9px;padding:0 8px}.batch-item{min-width:153px}.library-actions{gap:4px}.library-actions .secondary{font-size:10px;padding:7px}.selection-label{font-size:9px;gap:3px}.library .section-head{flex-wrap:wrap;padding:10px 0}.history-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.queue-actions .secondary{font-size:10px;padding:6px 7px}.queue-actions .icon-button{width:26px}.queue-panel h2,.library h2{font-size:12px}.model-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 30px;border-bottom:1px solid var(--border);padding-bottom:12px}.model-row>input:first-child{grid-column:1/3}.model-row>input:nth-child(2){grid-column:1}.model-row>select{grid-column:2}.model-row>label{grid-column:1}.model-row>button{grid-column:3}.admin-actions{flex-wrap:wrap}.dialog-heading h2{font-size:16px}.ratio-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.primary,.secondary{white-space:normal}.top-actions .secondary{white-space:nowrap}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media(min-width:761px){
html,body{height:100%;overflow:hidden}
.topbar{height:62px}
.status-strip{height:56px;padding:10px 0}
.status-strip span{margin-bottom:4px}
.workbench{height:calc(100dvh - 62px);padding:12px 18px 14px;gap:14px;align-items:stretch;overflow:hidden}
.controls{position:static;top:auto;height:100%;max-height:none;min-height:0;display:grid;grid-template-rows:44px minmax(0,1fr);overflow:hidden}
.controls>.section-head{min-height:44px}
.controls form{min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto}
#parameter-fields{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:12px 14px 8px}
.field{margin-top:12px}
.drawer{margin-top:12px}
.drawer summary{height:37px}
textarea{min-height:88px;max-height:120px;line-height:1.55}
.generation-footer{position:static;margin:0;padding:8px 14px 10px}
.generation-footer p{margin-bottom:6px}
.generation-footer .primary{height:36px}
.results-workspace{height:100%;min-height:0;display:grid;grid-template-columns:minmax(0,1.55fr) minmax(270px,.75fr);grid-template-rows:minmax(0,1fr) minmax(142px,22vh);gap:12px}
.stage-panel{grid-column:1/-1;min-height:0;display:flex;flex-direction:column;padding:0 13px 10px}
.stage-head{height:48px;min-height:48px}
.preview-layout{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) clamp(150px,16vw,210px);gap:10px}
.canvas-shell{height:100%;min-height:0;display:flex;flex-direction:column}
.result-stage{height:auto!important;min-height:0;flex:1}
.batch-panel{min-height:0;display:flex;flex-direction:column;border-left:1px solid var(--border);border-top:0;padding:0 0 0 10px}
.batch-list{display:block;max-height:none!important;min-height:0;flex:1}
.library,.queue-panel{margin:0;min-height:0;overflow:auto;padding:0 12px 10px}
.library .section-head,.queue-panel .section-head{height:40px;min-height:40px}
.library-filter{margin-bottom:8px}
.history-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:8px}
.asset .asset-preview{height:78px}
.queue-row{padding:7px 0}
.empty-note{padding:14px 0}
}
@media(min-width:761px) and (max-height:760px){
.topbar{height:54px}
.status-strip{height:48px;padding:7px 0}
.workbench{height:calc(100dvh - 54px);padding:8px 14px 10px;gap:10px}
.results-workspace{grid-template-rows:minmax(0,1fr) 132px;gap:10px}
.controls{grid-template-rows:40px minmax(0,1fr)}
.controls>.section-head{min-height:40px}
.stage-head{height:42px;min-height:42px}
.library .section-head,.queue-panel .section-head{height:36px;min-height:36px}
}

#drama-panel .drama-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}#drama-panel textarea{min-height:62px}#drama-panel .dialog-note{line-height:1.7;font-size:11px;margin:9px 0}#drama-preview-text{white-space:pre-wrap;font:12px/1.7 inherit;max-height:240px;overflow:auto;background:#f1f6f4;padding:10px}#drama-media-preview video,#drama-media-preview audio{width:100%;max-height:170px;margin:10px 0}.auth-card{max-width:520px;margin:12vh auto;padding:30px;background:white;border:1px solid var(--border);border-radius:12px;display:grid;gap:20px}.auth-card h1{font-size:24px}.auth-card p{font-size:14px;line-height:1.7}.auth-card>a:last-child{font-size:12px;color:var(--accent)}
/* Video settings: one visible section at a time, with a fixed action footer. */
.video-single-screen #parameter-fields > :not(#video-settings-layout){display:none!important}
.video-settings-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;border-bottom:1px solid var(--border);padding-bottom:10px;margin-bottom:12px}
.video-settings-tabs button{font-size:12px;min-height:35px;border-radius:5px;color:#687b75;padding:6px 2px;white-space:nowrap}
.video-settings-tabs button[aria-selected=true]{color:#096d5b;background:#e5f3ed;font-weight:600}
.video-settings-pane{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;align-content:start}
.video-setting{min-width:0}.video-setting-wide{grid-column:1/-1}
.video-settings-pane .field{margin:0}.video-settings-pane label{margin-bottom:5px}
.video-settings-pane .label-row{margin-bottom:3px;min-height:22px}
.video-settings-pane .dialog-note{font-size:11px;line-height:1.6;margin:0;color:#788780;overflow-wrap:anywhere}
.video-settings-pane .drama-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}
.video-settings-pane .drama-actions label{margin:0}
.video-settings-pane textarea{min-height:68px;height:76px;max-height:76px;resize:none;line-height:1.6}
.video-settings-pane #prompt{height:88px;max-height:88px}
.video-settings-pane #drama-negative{height:62px;min-height:62px;max-height:62px}
.video-stack-field+.video-stack-field{margin-top:10px}
.video-settings-pane #duration-field{margin-top:10px}
.video-settings-pane .text-meta{margin-bottom:0}
.video-settings-pane #reference-section{width:100%}
.video-settings-pane .upload{padding:10px;min-height:65px}
.video-settings-pane .upload svg,.video-settings-pane .upload small{display:none}
.video-settings-pane .reference-gallery{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:8px 0}
.video-settings-pane .reference-thumbnail{width:auto;height:62px}
.video-settings-pane .reference-thumbnail img{height:100%;width:100%;object-fit:cover}
.video-settings-pane #drama-shots{height:42px}
.video-detail-dialog{width:min(800px,92vw)}
.video-detail-dialog #drama-preview-text{white-space:pre-wrap;max-height:65vh;overflow:auto;font:13px/1.8 Arial,sans-serif}
.video-detail-dialog #drama-media-preview video{width:100%;max-height:60vh}
.video-detail-dialog #drama-media-preview audio{width:100%;margin-bottom:20px}
@media(min-width:761px){
.video-single-screen .workbench{grid-template-columns:minmax(510px,1.15fr) minmax(350px,1fr)}
.video-single-screen #parameter-fields{overflow:hidden;padding:10px 16px}
.video-single-screen .results-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 105px 105px;gap:10px}
.video-single-screen .preview-layout{grid-template-columns:minmax(0,1fr)}
.video-single-screen .batch-panel{display:none}
.video-single-screen .stage-actions{gap:0}
.video-single-screen .stage-actions .icon-button{width:26px}
.video-single-screen .queue-panel,.video-single-screen .library{grid-column:1}
}
@media(min-width:761px) and (max-height:720px){
.video-settings-tabs{padding-bottom:6px;margin-bottom:8px}
.video-settings-tabs button{min-height:29px}
.video-settings-pane{gap:7px 12px}
.video-settings-pane input,.video-settings-pane select{height:31px}
.video-settings-pane #prompt{height:65px;max-height:65px;min-height:65px}
.video-settings-pane #drama-negative{height:48px;min-height:48px;max-height:48px}
.video-settings-pane .text-meta{font-size:9px}
}
@media(max-width:980px){.video-settings-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:761px) and (max-width:980px){.video-single-screen .workbench{grid-template-columns:minmax(440px,1.4fr) minmax(280px,1fr);padding-left:10px;padding-right:10px;gap:10px}}
@media(max-width:760px){.video-settings-tabs{position:sticky;top:0;background:white;z-index:2}.video-settings-pane{gap:10px}.video-settings-tabs button{font-size:11px}.video-settings-pane .reference-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:761px) and (max-height:620px){.video-single-screen #parameter-fields{overflow-y:auto}}
@media(min-width:761px){
.video-settings-pane{gap:8px 16px}
.video-settings-pane input,.video-settings-pane select{height:32px}
.video-settings-pane .label-row .icon-button{height:26px;width:26px}
.video-settings-pane #prompt{min-height:68px;height:68px;max-height:68px}
.video-settings-pane #drama-negative{min-height:48px;height:48px;max-height:48px}
}
@media(min-width:761px){
.video-single-screen .generation-footer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
.video-single-screen .generation-footer p{grid-column:1/-1;margin:0}
.video-single-screen .generation-footer #generate{grid-column:1;min-width:0}
.video-single-screen .generation-footer #stop-batch{grid-column:2;margin:0;width:auto}
}
.video-settings-tabs{grid-template-columns:repeat(5,minmax(0,1fr))}
#prompt-optimizer{border:1px solid #d9e9e1;background:#f6faf7;border-radius:8px;padding:9px;display:grid;gap:6px}
.optimizer-heading,.asset-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px}
.optimizer-heading .secondary{padding:3px 6px;font-size:11px;min-height:25px}
.optimizer-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
#prompt-optimizer input,#prompt-optimizer select{height:30px;font-size:11px}
#optimizer-dialog{width:min(760px,92vw)}#optimizer-dialog textarea{width:100%;margin:8px 0 15px;resize:vertical}
#unified-asset-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:14px 0}
.unified-asset{position:relative;min-width:0}.asset-open,.asset-add{width:100%;height:90px;border:1px solid #dbe7e0;border-radius:8px;background:#f5f9f7;overflow:hidden}.asset-open{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4px;gap:3px}.asset-open img{width:100%;height:61px;object-fit:cover;border-radius:4px}.asset-open small{font-size:10px}.asset-kind-icon{font-size:28px;color:#27816b}.asset-add{font-size:32px;color:#27816b;border-style:dashed}.asset-remove{position:absolute;right:2px;top:2px;background:#fff;border-radius:50%;width:22px;height:22px;box-shadow:0 1px 5px #0002}#asset-counts{font-size:11px;color:#728079;margin:6px 0}#asset-dialog{width:min(750px,92vw)}#asset-preview img,#asset-preview video{max-width:100%;max-height:60vh;display:block;margin:auto}#asset-preview audio{width:100%}#asset-url-form{display:grid;gap:10px}
@media(min-width:761px){#video-pane-generate{gap:7px 14px}#video-pane-generate #prompt{height:65px;min-height:65px;max-height:65px}#video-pane-generate #drama-negative{height:43px;min-height:43px;max-height:43px}#video-pane-generate .text-meta{display:none}#video-pane-generate .video-stack-field+.video-stack-field,#video-pane-generate #duration-field{margin-top:5px}}
@media(max-width:760px){.video-settings-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}#unified-asset-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

.video-formats{display:grid;grid-template-columns:2fr 1fr;gap:14px}.video-formats #video-size-fields{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.video-formats #video-size-fields>label{grid-column:1;grid-row:1}.video-formats #video-ratio{grid-column:1;grid-row:2}.video-formats #duration-field{grid-column:2;grid-row:1/3;margin:0!important}.video-formats #duration-field label{margin-bottom:5px}
@media(min-width:761px){#video-pane-generate #prompt,#video-pane-generate #drama-negative{height:105px;max-height:105px;min-height:105px}.video-negative>label{min-height:26px;display:flex;align-items:center}#video-pane-generate .video-negative{align-self:start}}
@media(min-width:761px){.asset-open,.asset-add{height:70px}.asset-open img{height:43px}#unified-asset-grid{margin:10px 0}.asset-kind-icon{font-size:24px}}
/* Generation and reference materials share one screen. */
.video-settings-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}
#video-pane-generate{grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:12px}
.video-generation-main{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 10px;align-content:start;min-width:0}
.video-generation-assets{min-width:0;border-left:1px solid var(--border);padding-left:12px}
.video-generation-assets .asset-heading{flex-wrap:wrap;gap:4px;margin-top:10px}.video-generation-assets #asset-counts{line-height:1.5;margin:4px 0}.video-generation-assets #asset-link{min-height:24px;padding:3px 6px;font-size:10px}
.video-generation-assets #unified-asset-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:8px 0}.video-generation-assets .asset-open,.video-generation-assets .asset-add{height:48px}.video-generation-assets .asset-open img{height:27px}.video-generation-assets .asset-open small{font-size:9px}.video-generation-assets .asset-kind-icon{font-size:20px}.video-generation-assets .asset-remove{width:17px;height:17px;font-size:12px}.video-generation-assets #asset-limits{font-size:10px}
.ratio-trigger{width:100%;height:32px;border:1px solid #dce3e7;border-radius:5px;background:white;text-align:left;padding:0 10px;font-size:12px;grid-column:1;grid-row:2}
#video-ratio-dialog{width:min(540px,92vw)}.video-ratio-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.video-ratio-options button{display:grid;gap:9px;justify-items:center;padding:12px 5px;border:1px solid var(--border);border-radius:8px;font-size:12px}.video-ratio-options button[aria-pressed=true]{background:#eaf6f0;border-color:#16836f;color:#096d5b}.ratio-visual{height:52px;display:flex;align-items:center;justify-content:center}.ratio-outline{display:flex;align-items:center;justify-content:center;border:2px dashed currentColor;border-radius:3px;color:#559986}
@media(min-width:761px){.video-single-screen .workbench{grid-template-columns:minmax(670px,1.65fr) minmax(300px,1fr)}#video-pane-generate #prompt,#video-pane-generate #drama-negative{height:75px;min-height:75px;max-height:75px}.video-generation-main .optimizer-heading{font-size:11px}.video-generation-main #optimizer-instruction{font-size:10px}.video-generation-main #optimizer-status{font-size:10px}.video-generation-main #prompt-optimizer{padding:7px;gap:5px}}
@media(max-width:760px){#video-pane-generate{grid-template-columns:1fr}.video-generation-assets{border-left:0;border-top:1px solid var(--border);padding:10px 0 0}.video-generation-assets #unified-asset-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.video-ratio-options{grid-template-columns:repeat(3,minmax(0,1fr))}}
.video-generation-assets #asset-add:disabled{display:none}.video-generation-assets .asset-open,.video-generation-assets .asset-add{height:42px}.video-generation-assets .asset-open img{height:22px}.video-generation-assets .asset-heading{margin-top:6px}.video-generation-assets #asset-counts{font-size:10px}.video-generation-assets #asset-upload-state:empty{display:none}
/* Let the writing area use the available screen instead of leaving a blank lower half. */
.video-model-field #service-note{font-size:10px;line-height:1.5;margin:5px 0 0;text-align:left;color:#9b6b30}
.video-generation-assets{background:#f8faf9;border:1px solid #e3ebe7;border-radius:9px;padding:12px}
.video-generation-assets .asset-purpose label{color:#63776e}.video-generation-assets .asset-heading{margin-top:14px}
.video-generation-assets #unified-asset-grid.is-empty{grid-template-columns:1fr}
.video-generation-assets #unified-asset-grid.is-empty #asset-add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;height:150px;background:#fff;border-color:#a8c8ba;font-size:32px}
#asset-add strong{font-size:13px;font-weight:500}#asset-add small{font-size:10px;color:#7b9186}
.video-generation-assets #asset-limits{line-height:1.7;color:#7b8982}.video-generation-assets #asset-counts{color:#687c72}
@media(min-width:761px) and (min-height:621px){
#video-settings-layout{height:100%;display:flex;flex-direction:column;min-height:0}.video-settings-tabs{flex:none}
#video-pane-generate{flex:1;min-height:0;align-content:stretch;align-items:stretch;grid-template-columns:minmax(0,2fr) minmax(220px,1fr)}
.video-generation-main{grid-template-rows:auto auto minmax(80px,1fr) auto;align-content:stretch;min-height:0}
.video-generation-main .video-positive,.video-generation-main .video-negative{display:flex;flex-direction:column;min-height:0;align-self:stretch}
.video-generation-main .video-positive>.field{display:flex;flex-direction:column;flex:1;min-height:0}
#video-pane-generate #prompt,#video-pane-generate #drama-negative{flex:1;height:0;min-height:50px;max-height:none;line-height:1.8}
.video-generation-main .label-row,.video-generation-main .video-negative>label{flex:none;min-height:26px;margin-bottom:5px}
.video-generation-main .video-positive .inline-icons{flex-shrink:0}
.video-generation-main #prompt-optimizer{margin-top:3px}
.video-generation-assets .asset-open,.video-generation-assets .asset-add{height:clamp(42px,6.8vh,80px)}.video-generation-assets .asset-open img{height:calc(100% - 16px);min-height:0}
.video-single-screen .generation-footer{padding-top:10px}
}
@media(min-width:761px) and (min-height:900px){
.video-settings-tabs{margin-bottom:18px}.video-generation-main{gap:14px 14px}.video-generation-main #prompt-optimizer{padding:14px;gap:9px}.video-generation-main #optimizer-instruction,.video-generation-main #optimizer-model{height:36px;font-size:12px}
.video-generation-assets #unified-asset-grid.is-empty #asset-add{height:240px}.video-generation-assets #asset-counts{font-size:11px}.video-generation-assets #asset-limits{font-size:11px}
.video-single-screen .generation-footer{padding-top:14px;padding-bottom:14px}
}
@media(max-width:760px){.video-generation-assets{padding:12px}.video-generation-assets #unified-asset-grid.is-empty #asset-add{height:130px}}
@media(min-width:761px) and (min-height:621px){
#video-pane-generate .video-positive,#video-pane-generate .video-negative{align-self:stretch;min-height:0;height:100%}
#video-pane-generate .video-positive>.field{height:100%;flex:1 1 0;min-height:0}
#video-pane-generate #prompt,#video-pane-generate #drama-negative{flex:1 1 0;min-height:0;height:0;max-height:none}
#video-pane-generate{grid-template-rows:minmax(0,1fr)}
}
@media(min-width:761px) and (max-height:850px){.video-generation-assets{padding:8px}.video-generation-assets .asset-heading{margin-top:8px}.video-generation-assets .asset-open,.video-generation-assets .asset-add{height:42px}.video-generation-assets #asset-limits,.video-generation-assets #asset-upload-state{font-size:9px;line-height:1.5}}
@media(min-width:761px) and (min-height:900px){.video-generation-main label,.video-generation-assets label{font-size:12px}.video-generation-main select,.video-generation-main .ratio-trigger,.video-generation-assets select{font-size:13px;height:36px}#video-pane-generate #prompt,#video-pane-generate #drama-negative{font-size:14px;padding:14px}.video-generation-main .optimizer-heading{font-size:12px}}
/* Give the library and task queue a usable share of the workspace. */
@media(min-width:761px){
.results-workspace{grid-template-rows:minmax(0,46fr) minmax(0,54fr)}
.video-single-screen .results-workspace{grid-template-rows:var(--video-preview-height,40%) minmax(0,1.1fr) minmax(0,1fr)}
.video-single-screen .canvas-shell{width:100%;max-width:var(--video-canvas-width,100%);justify-self:center;align-self:start}
.video-single-screen .result-stage{flex:none;aspect-ratio:16/9;width:100%;height:auto!important}
.video-single-screen #media{position:absolute;inset:0;padding:0}
.video-single-screen .preview-layout{align-content:start}
.library>.section-head,.queue-panel>.section-head{position:sticky;top:0;background:#fff;z-index:1}
}
@media(max-width:760px){.video-single-screen .result-stage{height:auto!important;aspect-ratio:16/9}.video-single-screen #media{position:absolute;inset:0;padding:0}}
.job-timer{font-variant-numeric:tabular-nums;color:#278269!important;font-size:11px!important}
.generation-timer{font-variant-numeric:tabular-nums;color:#176e59;white-space:nowrap;margin-left:auto}
.result-bottom{flex-shrink:0;flex-wrap:wrap;min-height:32px;height:auto;padding-top:5px;padding-bottom:5px}
/* Image workspace: balanced preview and compact result panels. */
@media(min-width:761px){body:not(.video-single-screen) .results-workspace{grid-template-rows:minmax(0,1fr) clamp(190px,32vh,330px)}}
body:not(.video-single-screen) #parameter-fields>#prompt-optimizer{display:none}
#image-optimize-prompt{display:inline-flex;align-items:center}
#image-optimize-prompt{min-height:26px;height:26px;padding:3px 7px;font-size:10px;color:#16836f;white-space:nowrap}
#image-optimizer-settings{width:min(540px,92vw)}#image-optimizer-settings #prompt-optimizer{display:grid}
/* Keep the image action near the settings rather than pinned to an empty panel bottom. */
@media(min-width:761px){
body:not(.video-single-screen) .controls form{grid-template-rows:minmax(0,max-content) auto;align-content:start}
body:not(.video-single-screen) #parameter-fields{min-height:0}
body:not(.video-single-screen) .generation-footer{margin-top:8px}
}
/* Compact image editor: settings left, uploaded references right. */
@media(min-width:761px){
body.image-edit-layout:not(.video-single-screen) #parameter-fields{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(160px,1fr);gap:6px 12px;align-content:start;padding:10px 14px}
body.image-edit-layout:not(.video-single-screen) #parameter-fields>label{grid-column:1;margin:0}
body.image-edit-layout:not(.video-single-screen) #source-modes{grid-column:1}
body.image-edit-layout:not(.video-single-screen) #clarity-field{grid-column:2;grid-row:1/3;margin:0}
body.image-edit-layout:not(.video-single-screen) #reference-section{grid-column:2;grid-row:3/6;margin:0}
body.image-edit-layout:not(.video-single-screen) .image-advanced{grid-column:1;grid-row:3;border:0;margin:0}
body.image-edit-layout:not(.video-single-screen) .image-advanced>summary{display:none}
body.image-edit-layout:not(.video-single-screen) .image-prompt-field{grid-column:1;grid-row:4;margin:0}
body.image-edit-layout:not(.video-single-screen) .image-template-drawer{grid-column:1;grid-row:5;margin:0}
body.image-edit-layout:not(.video-single-screen) .image-template-drawer summary{height:28px}
body.image-edit-layout:not(.video-single-screen) #parameter-fields label{margin-bottom:4px}
body.image-edit-layout:not(.video-single-screen) #parameter-fields input:not([type=range]),body.image-edit-layout:not(.video-single-screen) #parameter-fields select{height:29px}
body.image-edit-layout:not(.video-single-screen) .segmented button{height:22px}
body.image-edit-layout:not(.video-single-screen) .ratio-grid button{height:25px}
body.image-edit-layout:not(.video-single-screen) .dimension-grid{margin-top:6px;gap:8px}
body.image-edit-layout:not(.video-single-screen) #image-size-fields{margin-top:6px}
body.image-edit-layout:not(.video-single-screen) .dimension-grid .label-row{margin:0;min-height:18px}
body.image-edit-layout:not(.video-single-screen) input[type=range]{height:14px;margin:0}
body.image-edit-layout:not(.video-single-screen) .size-summary{padding-top:2px;min-height:18px}
body.image-edit-layout:not(.video-single-screen) .field-grid.field{margin-top:5px}
body.image-edit-layout:not(.video-single-screen) #prompt{height:72px;min-height:72px;max-height:72px;resize:none}
body.image-edit-layout:not(.video-single-screen) .label-row{margin-bottom:3px;min-height:24px}
body.image-edit-layout:not(.video-single-screen) .label-row .icon-button{height:24px;width:24px}
body.image-edit-layout:not(.video-single-screen) .text-meta{margin:2px 0}
body.image-edit-layout:not(.video-single-screen) #reference-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin:6px 0}
body.image-edit-layout:not(.video-single-screen) .reference-thumbnail{height:48px}
body.image-edit-layout:not(.video-single-screen) .upload{padding:8px 4px;min-height:68px;gap:4px}
body.image-edit-layout:not(.video-single-screen) .upload>svg{display:none}
body.image-edit-layout:not(.video-single-screen) .upload small{font-size:9px}
body.image-edit-layout:not(.video-single-screen) .generation-footer{margin-top:4px}
}
#video-pane-generate .video-model-field>.label-row,#video-pane-generate .video-generation-main>.video-setting:nth-child(2)>label{height:26px;min-height:26px;margin-bottom:5px;display:flex;align-items:center}
@media(min-width:761px){body.image-edit-layout:not(.video-single-screen) #parameter-fields{gap:4px 12px}body.image-edit-layout:not(.video-single-screen) #prompt{height:65px;min-height:65px;max-height:65px}}
@media(min-width:761px){body.image-edit-layout:not(.video-single-screen) .queue-panel h2{white-space:nowrap}body.image-edit-layout:not(.video-single-screen) .queue-actions .secondary{padding:5px;font-size:10px}body.image-edit-layout:not(.video-single-screen) .queue-actions{gap:2px}}
/* Image-to-image keeps the familiar vertical flow; references use compact rows. */
@media(min-width:761px){
body.image-edit-layout:not(.video-single-screen) #parameter-fields{display:block;padding:9px 14px}
body.image-edit-layout:not(.video-single-screen) #parameter-fields>label{margin-bottom:4px}
body.image-edit-layout:not(.video-single-screen) #clarity-field{display:block;margin-top:6px}
body.image-edit-layout:not(.video-single-screen) #clarity-field label{margin:0 0 4px}
body.image-edit-layout:not(.video-single-screen) #reference-section{margin-top:6px}
body.image-edit-layout:not(.video-single-screen) #reference-gallery{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;margin:4px 0}
body.image-edit-layout:not(.video-single-screen) .reference-thumbnail{height:30px}
body.image-edit-layout:not(.video-single-screen) .upload{min-height:37px;padding:4px;flex-direction:row;gap:6px}
body.image-edit-layout:not(.video-single-screen) .upload strong{font-size:10px}
body.image-edit-layout:not(.video-single-screen) .image-advanced{margin-top:6px}
body.image-edit-layout:not(.video-single-screen) .image-prompt-field{margin-top:5px}
body.image-edit-layout:not(.video-single-screen) .image-template-drawer{margin-top:4px}
body.image-edit-layout:not(.video-single-screen) .dimension-grid input[type=range]{display:none}
body.image-edit-layout:not(.video-single-screen) .ratio-grid{gap:4px}
body.image-edit-layout:not(.video-single-screen) .ratio-grid button{height:23px}
body.image-edit-layout:not(.video-single-screen) #prompt{height:55px;min-height:55px;max-height:55px}
body.image-edit-layout:not(.video-single-screen) .size-summary{display:none}
body.image-edit-layout:not(.video-single-screen) #parameter-fields input:not([type=range]),body.image-edit-layout:not(.video-single-screen) #parameter-fields select{height:27px}
body.image-edit-layout:not(.video-single-screen) .image-template-drawer summary{height:24px}
}
@media(min-width:761px) and (min-height:900px){body.image-edit-layout:not(.video-single-screen) #prompt{height:100px;min-height:100px;max-height:100px}body.image-edit-layout:not(.video-single-screen) .reference-thumbnail{height:42px}}
@media(min-width:761px) and (max-height:850px){
body.image-edit-layout:not(.video-single-screen) #reference-gallery{grid-template-columns:repeat(10,minmax(0,1fr))}
body.image-edit-layout:not(.video-single-screen) .reference-thumbnail{height:26px}
body.image-edit-layout:not(.video-single-screen) .dimension-grid .label-row{display:none}
body.image-edit-layout:not(.video-single-screen) .dimension-grid{margin-top:4px}
body.image-edit-layout:not(.video-single-screen) #parameter-fields label{font-size:10px;line-height:12px;margin-bottom:3px}
body.image-edit-layout:not(.video-single-screen) .drawer-body{padding:0}
body.image-edit-layout:not(.video-single-screen) #prompt{height:44px;min-height:44px;max-height:44px}
body.image-edit-layout:not(.video-single-screen) #parameter-fields input:not([type=range]),body.image-edit-layout:not(.video-single-screen) #parameter-fields select{height:25px}
body.image-edit-layout:not(.video-single-screen) .text-meta{display:none}
}
@media(min-width:761px) and (max-height:850px){body.image-edit-layout:not(.video-single-screen) .dimension-grid .label-row{display:flex;height:12px;min-height:12px}body.image-edit-layout:not(.video-single-screen) .dimension-grid .label-row output{display:none}body.image-edit-layout:not(.video-single-screen) .dimension-grid .label-row label{margin:0}}
.retention-notice{padding:8px 10px;background:#fff5dd;border:1px solid #ead29a;border-radius:5px;color:#875616;font-size:11px;line-height:1.6;margin:0 0 8px}
@media(min-width:761px) and (min-height:900px){
body.image-edit-layout:not(.video-single-screen) .controls form{grid-template-rows:minmax(0,1fr) auto;align-content:stretch;padding-bottom:22px}
body.image-edit-layout:not(.video-single-screen) #parameter-fields{display:flex;flex-direction:column;gap:8px;min-height:0}
body.image-edit-layout:not(.video-single-screen) #parameter-fields>label,body.image-edit-layout:not(.video-single-screen) #parameter-fields>.segmented,body.image-edit-layout:not(.video-single-screen) #clarity-field,body.image-edit-layout:not(.video-single-screen) #reference-section,body.image-edit-layout:not(.video-single-screen) .image-advanced,body.image-edit-layout:not(.video-single-screen) .image-template-drawer{flex-shrink:0}
body.image-edit-layout:not(.video-single-screen) .image-prompt-field{display:flex;flex-direction:column;flex:1;min-height:100px}
body.image-edit-layout:not(.video-single-screen) #prompt{flex:1;min-height:70px;height:0;max-height:none}
body.image-edit-layout:not(.video-single-screen) #parameter-fields input:not([type=range]),body.image-edit-layout:not(.video-single-screen) #parameter-fields select{height:34px}
body.image-edit-layout:not(.video-single-screen) #parameter-fields label{font-size:12px}
body.image-edit-layout:not(.video-single-screen) .ratio-grid button{height:29px}
}
.reference-thumbnail button.reference-open{position:static;display:block;width:100%;height:100%;padding:0;background:transparent;border-radius:0;cursor:zoom-in}.reference-thumbnail button.reference-open img{width:100%;height:100%;object-fit:cover}.reference-thumbnail>.icon-button{z-index:2}.asset-preview{position:relative}.video-play-badge{position:absolute;inset:0;display:grid;place-items:center;font-size:26px;color:white;text-shadow:0 2px 8px #0009;background:#0001}.clickable-preview{cursor:zoom-in}
#preview-dialog{width:min(1200px,94vw);padding:18px;overflow:auto}#preview-dialog .dialog-heading{margin-bottom:12px}#large-preview{height:min(64dvh,800px);overflow:auto;background:#f0f3f2;border-radius:7px;display:flex;align-items:center;justify-content:center}#large-preview img,#large-preview video{display:block;width:100%;height:100%;object-fit:contain}#large-preview img{cursor:zoom-in}#large-preview.viewer-zoomed{display:block}#large-preview.viewer-zoomed img{width:200%;height:200%;max-width:none;object-fit:contain;cursor:zoom-out}.viewer-toolbar{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:10px}#viewer-position{font-size:12px;min-width:45px;text-align:center}#viewer-status,.viewer-details{font-size:11px;color:#6c7d75;line-height:1.6;margin:8px 0 0}.viewer-details{overflow-wrap:anywhere}#viewer-status{min-height:18px}
@media(max-width:760px){#preview-dialog{padding:12px}#large-preview{height:55dvh}.viewer-toolbar{gap:5px}.viewer-toolbar .secondary{font-size:11px;padding:6px 8px}}
@media(min-width:761px) and (max-height:850px){body.image-edit-layout:not(.video-single-screen) #reference-gallery{grid-template-columns:repeat(5,minmax(0,1fr))}body.image-edit-layout:not(.video-single-screen) .reference-thumbnail{height:26px}body.image-edit-layout:not(.video-single-screen) #reference-section:has(.reference-thumbnail) .upload{min-height:24px;padding:2px}body.image-edit-layout:not(.video-single-screen) #reference-section:has(.reference-thumbnail) .upload small{display:none}body.image-edit-layout:not(.video-single-screen) #reference-section:has(.reference-thumbnail) .upload strong{font-size:10px}}
.reference-thumbnail>.icon-button{width:18px!important;height:18px!important;right:0;top:0}.reference-thumbnail>.icon-button svg{width:12px;height:12px}
@media(min-width:761px) and (max-height:760px){body.image-edit-layout:not(.video-single-screen) #prompt{height:38px;min-height:38px;max-height:38px;padding:7px}body.image-edit-layout:not(.video-single-screen) .image-template-drawer summary{height:20px}body.image-edit-layout:not(.video-single-screen) #parameter-fields{padding-top:7px;padding-bottom:7px}}
.reference-thumbnail a.reference-open{position:absolute;inset:0;display:block;width:100%;height:100%;padding:0;cursor:zoom-in;z-index:1}.reference-thumbnail a.reference-open img{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none}.reference-thumbnail>.icon-button{z-index:3}.reference-preview-link{font-size:11px;color:#16836f;text-decoration:underline;margin-left:auto;white-space:nowrap;padding:4px 6px;cursor:pointer}.reference-preview-link:focus-visible{outline:2px solid #16836f}
.advanced-title{height:37px;display:flex;align-items:center;font-size:12px;font-weight:600}
body.image-edit-layout:not(.video-single-screen) .advanced-title{display:none}
.image-template-drawer>summary{background:#f1f7f4;border:1px solid #d6e5dd;border-radius:5px;padding:0 8px;color:#296b57;gap:7px}
.template-expand-label{margin-left:auto;font-size:10px;font-weight:400;color:#558372}.image-template-drawer[open]>summary{margin-bottom:6px}.image-template-drawer[open]>summary svg{transform:rotate(180deg)}
#image-optimizer-config{min-height:26px;height:26px;padding:3px 6px;font-size:10px;color:#59736a;white-space:nowrap;margin-right:4px}.video-single-screen #image-optimizer-config{display:none}
/* Keep stacked clarity and all reference rows visible on short desktop screens. */
@media(min-width:761px) and (max-height:760px){
body.image-edit-layout:not(.video-single-screen) #clarity-field,
body.image-edit-layout:not(.video-single-screen) #reference-section,
body.image-edit-layout:not(.video-single-screen) .image-advanced,
body.image-edit-layout:not(.video-single-screen) #image-size-fields{margin-top:4px}
body.image-edit-layout:not(.video-single-screen) .dimension-grid,
body.image-edit-layout:not(.video-single-screen) .image-template-drawer{margin-top:2px}
body.image-edit-layout:not(.video-single-screen) .image-prompt-field{margin-top:3px}
body.image-edit-layout:not(.video-single-screen) .generation-footer:has(#service-note:not([hidden])) #billing-note{display:none}
body.image-edit-layout:not(.video-single-screen) .generation-footer #service-note{margin-top:4px}
}

textarea,input[type=text],input[type=number],select{caret-color:#16836f;cursor:text}

/* Video workbench now uses one parameter page. Keep the negative prompt compact
   instead of letting the legacy multi-page flex rules stretch it. */
.video-single-screen .video-settings-tabs{display:none}
.video-single-screen #video-settings-layout{display:block;height:auto;min-height:0}
.video-single-screen #video-pane-generate{display:block;min-height:0}
.video-single-screen .video-generation-main{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto;align-content:start;align-items:start;gap:10px 14px}
.video-single-screen .video-generation-main .video-positive,
.video-single-screen .video-generation-main .video-negative{display:block;align-self:start;height:auto;min-height:0}
.video-single-screen .video-generation-main .video-positive>.field{display:block;height:auto;min-height:0}
.video-single-screen #video-pane-generate #prompt{height:76px;min-height:76px;max-height:76px;line-height:1.6;resize:none}
.video-single-screen #video-pane-generate #drama-negative{height:26px;min-height:26px;max-height:26px;line-height:1.3;padding:5px 8px;resize:none}
.video-single-screen .video-generation-main .video-negative>label{height:26px;min-height:26px;margin-bottom:5px;display:flex;align-items:center}

@media(max-width:760px){
  .video-single-screen #video-pane-generate{display:block}
  .video-single-screen .video-generation-main{display:grid;grid-template-columns:1fr;gap:10px}
  .video-single-screen #video-pane-generate #prompt{height:92px;min-height:92px;max-height:92px}
  .video-single-screen #video-pane-generate #drama-negative{height:28px;min-height:28px;max-height:28px}
}

/* Video model discovery: let customers describe the job before choosing a model. */
.video-model-filters{border:1px solid #d6e7de;background:#f7fbf8;border-radius:7px;padding:8px 9px;margin-bottom:8px}
.video-filter-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;color:#286a57;font-size:11px}
.video-filter-heading .icon-button{width:auto;height:23px;padding:0 6px;border:1px solid #cfe1d8;font-size:10px;color:#5d8072}
.video-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 9px}
.video-filter-grid label{margin:0;font-size:10px;color:#6e8179}
.video-filter-grid select{height:29px;margin-top:3px;padding:0 7px;font-size:11px;background:#fff}
.video-model-filters .dialog-note{font-size:10px;line-height:1.4;margin:7px 0 0;color:#7a9186}
@media(min-width:1100px){.video-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.video-filter-grid label:last-child{grid-column:1/-1}}
@media(max-width:760px){.video-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.video-model-filters{padding:8px}.video-filter-grid select{height:32px}}
@media(min-width:761px){.video-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 6px}.video-filter-grid label:last-child{grid-column:auto}.video-filter-grid select{height:25px;margin-top:2px;font-size:10px}.video-filter-heading{margin-bottom:4px}.video-model-filters .dialog-note{margin-top:4px}}
@media(min-width:761px) and (max-height:850px){.video-model-filters{padding:5px 6px;margin-bottom:4px}.video-filter-heading{margin-bottom:2px;font-size:10px}.video-filter-heading .icon-button{height:20px}.video-filter-grid{gap:2px 4px}.video-filter-grid label{font-size:9px;line-height:10px}.video-filter-grid select{height:21px;margin-top:1px;padding:0 5px;font-size:9px}.video-model-filters .dialog-note{font-size:9px;line-height:1.2;margin-top:2px}}
@media(min-width:761px) and (max-height:720px){.video-model-filters{padding:3px 5px}.video-filter-heading{margin-bottom:0;font-size:9px}.video-filter-heading .icon-button{height:18px;padding:0 5px}.video-filter-grid{gap:1px 3px}.video-filter-grid label{font-size:8px;line-height:9px}.video-filter-grid select{height:18px;margin-top:0;padding:0 4px;font-size:8px}.video-model-filters .dialog-note{display:none}}

/* Workspace switcher */
.workspace-tabs{align-self:center;height:42px;gap:3px;padding:3px;border:1px solid var(--border);border-radius:999px;background:var(--soft);}
.workspace-tabs button{height:34px;min-width:145px;justify-content:center;gap:8px;padding:0 16px;border:0;border-radius:999px;color:var(--muted);font-size:12px;font-weight:500;transition:background-color .16s ease,color .16s ease,box-shadow .16s ease;}
.workspace-tabs button:hover:not(.active){background:color-mix(in srgb,var(--solid) 72%,transparent);color:var(--ink);}
.workspace-tabs button.active{background:var(--solid);color:var(--accent);box-shadow:0 1px 4px #152c251c,inset 0 0 0 1px var(--border);border-color:transparent;}
.workspace-tabs button svg{width:16px;height:16px;}
body.video-single-screen .workspace-tabs{height:38px;}
body.video-single-screen .workspace-tabs button{height:30px;}
@media(max-width:760px){.workspace-tabs{height:46px;gap:3px;margin-bottom:10px;padding:3px;border-radius:8px}.workspace-tabs button{height:38px;min-width:0;flex:1;padding:0 8px;border-radius:5px;font-size:12px}.workspace-tabs button.active{box-shadow:inset 0 0 0 1px var(--border),0 1px 3px #152c2512}}

/* Aspect-ratio picker: show the shape before the user commits to a ratio. */
#image-ratios.ratio-grid{position:relative;display:block}
#image-ratios .ratio-picker-trigger{display:flex;align-items:center;gap:9px;width:100%;height:37px;padding:0 10px;border:1px solid var(--border);border-radius:6px;background:var(--solid,#fff);text-align:left;font-size:12px;color:var(--ink,#242b30)}
#image-ratios .ratio-picker-trigger[aria-expanded=true]{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 10%,transparent)}
#image-ratios .ratio-picker-trigger-label{flex:1}
#image-ratios .ratio-picker-trigger-arrow{flex:none;width:8px;height:8px;margin-top:-4px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg)}
#image-ratios .ratio-picker-menu{position:absolute;z-index:25;top:calc(100% + 5px);left:0;right:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:8px;background:var(--solid,#fff);border:1px solid var(--border);border-radius:8px;box-shadow:0 10px 28px #1d3b2e22}
#image-ratios .ratio-picker-menu[hidden]{display:none}
#image-ratios .ratio-picker-option{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:100%;min-width:0;height:67px;padding:6px 3px;border:1px solid var(--border);border-radius:6px;background:var(--solid,#fff);color:var(--muted);font-size:10px}
#image-ratios .ratio-picker-option:hover,#image-ratios .ratio-picker-option.selected{border-color:var(--accent);background:var(--soft,#eef8f3);color:var(--accent)}
.ratio-picker-visual{display:flex;align-items:center;justify-content:center;width:48px;height:32px;flex:none}
.ratio-picker-outline{display:block;border:1.5px dashed currentColor;border-radius:2px;color:currentColor;opacity:.9}
#image-ratios .ratio-picker-option-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
@media(max-width:760px){#image-ratios .ratio-picker-menu{grid-template-columns:repeat(3,minmax(0,1fr))}#image-ratios .ratio-picker-option{height:70px}}
