/* Model-aware AI Studio */
body:has(#ai-view:not([hidden])) .page-heading{display:none}
.studio{max-width:1500px;margin:auto}.studio-heading{display:flex;justify-content:space-between;gap:20px;align-items:center;margin:0 0 28px}.studio-heading h2{font-size:clamp(24px,2.5vw,36px);line-height:1.15;letter-spacing:-1px;margin:8px 0}.studio-toolbar{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #d0c2c2;margin-bottom:22px;padding-bottom:12px;gap:15px}.studio-tabs{display:flex;gap:6px}.studio-tabs button{border:0;background:transparent;padding:11px 22px;font:inherit;font-weight:500;border-radius:6px;color:#4c4b4b;cursor:pointer}.studio-tabs button[aria-selected=true]{background:#0d0606;color:#fdfdfc}.studio-tabs button:disabled{opacity:.6;cursor:wait}#studio-balance{font-size:13px;color:#4c4b4b}.studio-workspace{display:grid;grid-template-columns:minmax(330px,.9fr) minmax(350px,1.15fr);gap:24px;align-items:start}.studio-composer{background:#fff;border:1px solid #d0c2c2;border-radius:10px;overflow:hidden}.studio-composer fieldset{min-width:0;border:0;padding:0;margin:0}.studio-references{padding:20px 20px 0;display:flex;gap:12px;flex-wrap:wrap}.studio-reference-note{font-size:12px;line-height:1.5;color:#7f7f7f;margin:0}.studio-field{display:flex;flex-direction:column;gap:6px;min-width:0}.studio-field>label,.studio-count,.studio-model-label{font-size:12px;font-weight:500;color:#4c4b4b}.studio-field input:not([type=checkbox]):not([type=file]),.studio-field select,.studio-field textarea,.studio-count select,.studio-model-label select{width:100%;border:1px solid #d0c2c2;border-radius:5px;padding:9px;background:#fdfdfc;color:#0d0606;font:inherit;font-size:14px;box-sizing:border-box}.studio-field small{font-size:11px;line-height:1.5;color:#7f7f7f}.studio-field textarea{resize:vertical;min-height:90px}#studio-prompt{padding:20px}#studio-prompt>.studio-field>label,#studio-prompt small{display:none}#studio-prompt textarea{border:0;background:transparent;min-height:270px;resize:vertical;padding:0;font-size:17px;line-height:1.65;outline-offset:6px}#studio-prompt textarea::placeholder{color:#7f7f7f}.studio-options{padding:12px 20px;display:flex;align-items:start;gap:10px;flex-wrap:wrap;border-top:1px solid #eee8e8}.studio-count{width:65px;display:flex;gap:6px;flex-direction:column}#studio-primary{display:contents}#studio-primary .studio-field{flex:1;min-width:85px}#studio-primary small{display:none}.studio-check{justify-content:center;min-height:52px}.studio-check label{display:flex;gap:7px;align-items:center}.studio-check input{accent-color:#dd2d34}#studio-advanced{border-top:1px solid #eee8e8;padding:12px 20px}#studio-advanced summary{font-size:13px;cursor:pointer;color:#4c4b4b}#studio-extra{display:grid;gap:16px;margin-top:16px}#studio-extra .studio-field .studio-field{margin:8px 0 0 10px}.studio-array-row{padding:10px;border:1px solid #eee8e8;border-radius:5px;margin:6px 0}.studio-composer-footer{display:flex;align-items:end;gap:12px;padding:16px 20px;border-top:1px solid #d0c2c2;background:#f7f5f5}.studio-model-label{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}.studio-model-label select{font-weight:500}.studio-composer-footer .button{min-height:40px;font-size:13px;white-space:nowrap;padding:10px 14px}.studio-quote:empty{display:none}.studio-quote{padding:12px 20px;font-size:13px;line-height:1.5;border-top:1px solid #eee8e8}.studio-note{font-size:12px;line-height:1.5;color:#7f7f7f;margin:0;padding:12px 20px}.studio-output{min-width:0}.studio-results{min-height:540px;background:#f1eeee;border:1px solid #e5dddd;border-radius:10px;display:grid;place-items:center;overflow:hidden}.studio-empty{text-align:center;padding:40px;color:#4c4b4b}.studio-empty>span{font-size:54px;font-weight:400;color:#dd2d34;display:block;margin-bottom:22px}.studio-empty h3{font-size:20px;font-weight:500;letter-spacing:-.4px}.studio-empty p{font-size:14px;line-height:1.7;color:#7f7f7f}.studio-results.has-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));padding:12px;gap:12px;align-items:start;min-height:300px}.studio-results figure{margin:0;width:100%;min-width:0}.studio-results img,.studio-results video{display:block;width:100%;max-height:620px;object-fit:contain;border-radius:5px;background:#e5dddd}.studio-results a{display:block;font-size:12px;margin:10px 0 4px;color:#4c4b4b}#studio-status{font-size:13px;line-height:1.6;color:#4c4b4b}.studio-job-actions{display:flex;gap:10px;align-items:center}.studio-bottom{display:flex;gap:18px;align-items:center;flex-wrap:wrap;margin-top:22px;font-size:12px;color:#7f7f7f}.studio-bottom p{margin-left:auto}.studio-bottom .text-btn{font-size:13px}.studio-history{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.studio-history .button{font-size:12px}.studio-account{padding:20px;border:1px solid #d0c2c2;border-radius:8px;margin-bottom:18px}.studio-account form{display:flex;flex-wrap:wrap;gap:12px;align-items:end}.studio-account label{font-size:13px;display:flex;flex-direction:column;gap:6px}.studio-account input{padding:10px;border:1px solid #d0c2c2;border-radius:4px}.studio-account .text-btn{margin-right:18px}.studio-connection{font-size:13px;background:#f1eeee;padding:14px 18px;border-radius:6px}.reference-field>label:first-child{font-size:11px}.reference-list{display:flex;flex-wrap:wrap;gap:8px}.reference-add{border:1px dashed #d0c2c2!important;border-radius:6px;min-height:65px;padding:12px;display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;background:#f7f5f5;max-width:210px}.reference-add span{font-size:22px;color:#7f7f7f}.reference-input{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}.reference-input:focus-visible+.reference-status{outline:2px solid #dd2d34}.reference-thumb{width:70px;height:65px;position:relative;background:#eee8e8;border-radius:5px;overflow:hidden}.reference-thumb img{width:100%;height:100%;object-fit:cover}.reference-thumb>span{font-size:10px;padding:8px;display:block}.reference-thumb button{position:absolute;right:2px;top:2px;border:0;border-radius:50%;background:#0d0606;color:#fff;width:22px;height:22px;cursor:pointer}.reference-status{font-size:11px;color:#7f7f7f;margin:0}.studio [hidden]{display:none!important}.studio button:focus-visible,.studio select:focus-visible{outline:2px solid #dd2d34;outline-offset:3px}.studio fieldset:disabled{opacity:.65}@media(max-width:1100px){.studio-workspace{grid-template-columns:1fr}.studio-results{min-height:360px}#studio-prompt textarea{min-height:200px}.studio-heading{align-items:start}.studio-heading .button{font-size:12px}.studio-bottom p{margin-left:0}}@media(max-width:600px){.studio-heading h2{font-size:26px}.studio-heading{flex-direction:column;gap:10px}.studio-toolbar{align-items:start;flex-direction:column;gap:10px}.studio-composer-footer{flex-direction:column;align-items:stretch}.studio-tabs button{padding:10px 20px}.studio-options{padding:12px}.studio-references,#studio-prompt{padding:16px}.studio-results{min-height:300px}.studio-account form{flex-direction:column;align-items:stretch}.studio-bottom{gap:12px}}
@media(prefers-reduced-motion:reduce){.studio .soul-progress span{animation:none;width:50%}}

body:has(#ai-view:not([hidden])) #upload-top,body:has(#ai-view:not([hidden])) .local-badge{display:none}.studio-heading{padding:0;background:transparent;border:0;min-height:0}.studio-composer-footer{position:static}
.studio-heading{height:auto}.studio-composer-footer{height:auto;flex-wrap:wrap}body:has(#ai-view:not([hidden])) .private-badge{display:none}
.studio-heading>div{flex:1}.studio-workflow{padding:18px 20px;border-left:3px solid #dd2d34;background:#f4efef;margin:0 0 20px}.studio-workflow p{font-size:14px;line-height:1.6;margin:8px 0}.studio-workflow strong{font-size:18px}.asset-library{margin:0 0 24px;padding:22px;background:#f8f6f6;border:1px solid #d0c2c2;border-radius:8px}.asset-library-heading{display:flex;align-items:start;gap:20px;justify-content:space-between}.asset-library h3{margin:0;font-size:22px}.asset-library p{font-size:14px;line-height:1.5;color:#4c4b4b}.asset-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:16px}.asset-grid article{background:#fff;border:1px solid #d0c2c2;border-radius:6px;padding:12px;min-width:0}.asset-grid img,.asset-grid video{width:100%;height:180px;object-fit:contain;background:#ece8e8;border-radius:4px}.asset-grid audio{width:100%}.asset-grid h4{font-size:14px;overflow-wrap:anywhere;margin:12px 0 6px}.asset-grid p{font-size:12px}.asset-grid a,.asset-grid .text-btn{display:block;margin:10px 0;font-size:14px}.studio-results figure small{display:block;font-size:12px;color:#4c4b4b}.connection-card input[readonly]{display:block;width:100%;padding:12px;font:inherit;font-size:14px;margin:16px 0;border:1px solid #d0c2c2}@media(max-width:700px){.studio-heading{flex-wrap:wrap;flex-direction:row}.studio-heading>div{flex-basis:100%}.studio-heading>button{font-size:13px}.asset-library{padding:14px}.asset-library-heading{flex-direction:column}}

/* Keep adjacent controls on a shared baseline, overriding global form margins. */
.studio .studio-options{align-items:flex-end}.studio .studio-field>label{margin:0;line-height:18px}.studio .studio-count,.studio .studio-model-label{margin:0;line-height:18px;gap:6px}.studio .studio-field select,.studio .studio-count select,.studio .studio-model-label select{margin:0;height:42px;min-height:42px}.studio .studio-composer-footer{align-items:flex-end}.studio #studio-generate{margin:0;height:42px;min-height:42px}.studio-estimate-help{margin:0;padding:10px 20px;font-size:12px;color:#4c4b4b;line-height:1.5}
.studio-audio-panel{padding:64px 40px;background:#f5f0ee;border:1px solid #ddd2cf;border-radius:12px;min-height:330px}.studio-audio-panel h2{font-size:40px;margin:16px 0}.studio-audio-panel p{max-width:650px;line-height:1.7;color:#756866}.studio-audio-panel>div{display:flex;gap:12px;flex-wrap:wrap;margin-top:28px}.studio-audio-panel[hidden]{display:none}@media(max-width:650px){.studio-audio-panel{padding:32px 22px}.studio-audio-panel h2{font-size:30px}}
.studio-audio-modes{display:flex;align-items:center;gap:10px;padding:14px 0 22px;flex-wrap:wrap}.studio-audio-modes[hidden]{display:none}.studio-audio-modes button{border:1px solid #d9cece;border-radius:24px;padding:10px 22px;background:white;cursor:pointer}.studio-audio-modes button[aria-pressed=true]{background:#201817;color:white;border-color:#201817}.studio-audio-modes p{font-size:14px;color:#756969;margin:0 8px}.studio-results audio{width:100%;min-width:220px;margin:30px 0}.studio-results figure:has(audio){padding:24px;background:#f4eeee;border-radius:12px}

/* Keep project selection aligned with the composer's padded fields. */
.studio .studio-project{display:flex;flex-direction:column;align-items:stretch;gap:10px;margin:0;padding:22px 20px 18px;font-size:13px;font-weight:500;line-height:1.4}
.studio .studio-project select{box-sizing:border-box;width:100%;min-width:0;min-height:44px;margin:0;padding:10px 14px;border:1px solid #d0c2c2;border-radius:6px;background:#fdfdfc;color:#0d0606;font:inherit}
.studio-brand-row{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:24px}
.studio-brand-row .category-brand-logo{margin:0;max-width:min(280px,100%)}
.studio-model-guide{display:inline-flex;align-items:center;gap:8px;color:#594f4b;font-size:13px;text-decoration:none;border:1px solid #ded5d0;border-radius:8px;padding:9px 12px;background:#fff}
.studio-model-guide:hover{color:#d83228;border-color:#d83228;background:#fff7f4}
.studio-model-guide:focus-visible{outline:2px solid #d83228;outline-offset:3px}

.studio-results .studio-format-warning{color:#a52d24;margin-top:6px;line-height:1.4}.studio-results img{height:auto}

.reference-library-button{padding:9px 12px;border:1px solid #d0c2c2;border-radius:6px;background:#fff;color:#292323;font:inherit;font-size:13px;cursor:pointer}.reference-library-picker{width:min(720px,90vw);max-height:80vh;padding:24px;border:1px solid #ddd;border-radius:16px;color:#231c1c;background:#fff;box-shadow:0 20px 80px #0004}.reference-library-picker::backdrop{background:#0007}.reference-library-picker header{display:flex;align-items:center;justify-content:space-between}.reference-library-picker h2{margin:0}.reference-library-picker header button{border:0;background:transparent;font-size:28px;cursor:pointer}.reference-library-picker input{box-sizing:border-box;width:100%;padding:12px;border:1px solid #d0c2c2;border-radius:8px;font:inherit}.reference-library-picker p{font-size:14px}.reference-library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px}.reference-library-grid button{min-width:0;padding:6px;border:1px solid #e5dddd;border-radius:8px;background:white;cursor:pointer;text-align:left}.reference-library-grid button:hover,.reference-library-grid button:focus-visible{border-color:#eb2a2f;outline:2px solid #eb2a2f}.reference-library-grid img{width:100%;height:125px;object-fit:contain;background:#f5f2f2;border-radius:5px}.reference-library-grid span{display:block;font-size:12px;padding:7px 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.studio-unified-references{width:100%;display:grid;gap:12px}.reference-dropzone{width:100%;min-height:128px;padding:24px;border:1px dashed #aaa;border-radius:12px;background:#f7f5f4;color:inherit;white-space:pre-line;font:inherit;line-height:1.7;cursor:pointer}.reference-dropzone:hover,.reference-dropzone.dragover{border-color:#ed4137;background:#fff0ee}.reference-dropzone:focus-visible{outline:3px solid #ed4137;outline-offset:3px}.reference-dropzone:disabled{opacity:.6;cursor:default}.studio-unified-references small{color:#655f5d}.studio-unified-references .reference-list{flex-wrap:wrap}.studio-unified-references .reference-thumb span{font-size:11px}.studio-unified-references p:empty{display:none}
.reference-library-grid button[aria-pressed="true"]{border-color:#ef443b;outline:2px solid #ef443b;background:#fff2f1}.reference-library-grid button[aria-pressed="true"] span::before{content:'✓ ';color:#d52b25}.reference-library-picker>button{position:sticky;bottom:0;display:block;margin:16px 0 0 auto;padding:12px 20px}.reference-library-picker>button[hidden]{display:none}
