/* Workspace dimensions follow the available browser viewport, including zoom. */
html:has(#main #studio-editor){overflow:hidden;scrollbar-gutter:auto}
body:has(#main #studio-editor){overflow:hidden}
body:has(#main #studio-editor) #app{height:100dvh;display:flex;flex-direction:column}
body:has(#main #studio-editor) #app>header{flex:none;height:46px;min-height:46px;padding:0 14px;gap:24px}
body:has(#main #studio-editor) #app>header nav{height:46px}
body:has(#main #studio-editor) #app>main.container{flex:1;min-height:0;padding:6px 8px 4px;display:flex;flex-direction:column}
#studio-editor{height:100%;min-height:0;flex:1;--studio-chat-width:clamp(360px,calc(var(--st-sidebar,370px) * .5 + 17vw),600px)}
#studio-editor .studio-toolbar{gap:8px;min-height:32px;flex-wrap:wrap}
#studio-editor .studio-toolbar>div:first-child{gap:8px;flex:1;min-width:160px}
#studio-editor .studio-toolbar>.actions{gap:5px;flex-wrap:wrap;justify-content:flex-end}
#studio-editor .studio-toolbar .btn{padding:5px 8px;min-height:30px;font-size:11px;white-space:nowrap}
#studio-editor #studio-project-title{max-width:28vw}
#studio-editor .studio-toolbar .tag{display:none}
.studio-workspace-meta{display:flex;align-items:center;gap:12px;min-width:0;min-height:26px;flex:none}
#studio-editor .studio-workspace-meta .studio-save-status{margin-left:auto;min-height:0;padding:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:55%;font-size:10px}
#studio-editor .studio-workspace-meta .studio-app-steps{height:26px;min-height:26px;padding:0;gap:16px}
#studio-editor .studio-app-steps button{padding:2px 0}
#studio-editor[data-appearance] .studio-layout:has(.studio-composer),#studio-editor[data-appearance].is-comparing .studio-layout{grid-template-columns:clamp(280px,var(--studio-chat-width),min(640px,48%)) 6px minmax(0,1fr);gap:0;min-height:0}
.studio-panel-resize{cursor:col-resize;touch-action:none;position:relative;outline-offset:-1px;z-index:2}
.studio-panel-resize:after{content:'';position:absolute;top:35%;bottom:35%;left:2px;width:2px;border-radius:2px;background:var(--st-border,#dfe3e9)}
.studio-panel-resize:is(:hover,:focus-visible,.is-resizing):after{background:var(--st-accent,#6650c5);top:10%;bottom:10%}
#studio-editor .studio-composer,#studio-editor .studio-preview-panel{border-radius:8px}
#studio-editor .studio-modes{height:35px;padding:0 8px;gap:8px}
#studio-editor .studio-modes button{padding:5px 3px;font-size:11px}
#studio-editor .studio-chat-heading{padding:8px 10px;gap:8px}
#studio-editor .studio-partner-name{display:flex;align-items:center;gap:6px;white-space:nowrap}
#studio-editor .studio-partner-name b{font-size:14px}
#studio-editor .studio-ai-avatar{width:23px;height:23px}
#studio-editor .studio-chat-heading>.studio-session-state{display:flex;margin-left:auto;padding:8px 0 8px 4px}
#studio-editor .studio-session-state i{width:8px;height:8px;margin:0;background:#2b9a74;box-shadow:0 0 0 3px #2b9a7415}
#studio-editor .studio-session-state:is([data-state=error],[data-state=offline]) i{background:#d35461;box-shadow:0 0 0 3px #d3546115}
#studio-editor .studio-session-state:is([data-state=working],[data-state=connecting]) i{background:#d39b35;box-shadow:0 0 0 3px #d39b3515}
#studio-editor .studio-chat-scroll{padding:0 12px 8px;scrollbar-gutter:stable}
#studio-editor .studio-chat-memory{margin:0 0 8px;padding:3px 0;border:0}
#studio-editor .studio-chat-memory>span{display:none}
#studio-editor .studio-chat-memory button{padding:2px 5px;min-height:22px;font-size:10px}
#studio-editor .studio-conversation-empty{padding:clamp(12px,3vh,36px) 4px}
#studio-editor .studio-empty-symbol{margin-bottom:14px}
#studio-editor .studio-prompt-dock{position:relative;padding:5px 9px 6px}
#studio-editor .studio-chat-save{font-size:9px;margin:0 2px 4px}
#studio-editor .studio-response-mode{display:flex;align-items:center;gap:7px;margin:0 0 4px;padding:0}
#studio-editor .studio-response-mode label{font-size:10px;white-space:nowrap}
#studio-editor .studio-response-mode select{font-size:11px;padding:4px 7px;min-height:26px;width:auto;max-width:100%;flex:none}
#studio-editor[data-density] #studio-ai-prompt{min-height:56px;max-height:120px;padding:8px 10px 2px;font-size:13px}
#studio-editor .studio-composer-actions{padding:3px 6px;min-height:34px}
#studio-editor .prompt-completion-bar{padding:0 8px;min-height:20px;margin:0;font-size:10px}
#studio-editor .prompt-completion-bar label{font-size:10px}
.studio-request-tools{font-size:10px;color:var(--st-muted,#687382);margin-top:4px}
.studio-request-tools>summary{width:max-content;cursor:pointer}
.studio-request-popover,.studio-usage-popover{position:absolute;z-index:30;border:1px solid var(--st-border,#e2e5eb);border-radius:10px;background:var(--st-surface,#fff);color:var(--st-ink,#252b37);padding:12px;box-shadow:0 10px 40px #18253b30;overflow:auto}
.studio-request-popover{bottom:28px;left:8px;right:8px;max-height:min(360px,55dvh)}
.studio-request-popover p{font-size:11px;line-height:1.6}
.studio-usage-menu{position:relative}
.studio-usage-menu>summary{cursor:pointer;list-style:none}
.studio-usage-menu>summary::-webkit-details-marker{display:none}
.studio-usage-popover{top:36px;right:0;width:300px;max-width:calc(100vw - 24px);max-height:70dvh}
#studio-editor .studio-usage-popover .ai-usage{margin:0}
#studio-editor .studio-preview-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px;padding:5px 8px;flex:none;border-bottom:1px solid var(--st-border,#e2e5eb);background:var(--st-surface,#fff)}
#studio-editor #studio-canvas-toolbar{flex:1;min-width:0;padding:0;border:0}
#studio-editor .studio-app-controls{gap:4px;flex-wrap:wrap;padding:0}
#studio-editor .studio-app-controls>span{font-size:10px;width:auto;margin-right:auto}
#studio-editor .studio-app-controls button{min-height:28px;font-size:11px;padding:4px 7px}
#studio-editor .studio-preview-tabs{margin:0;padding:0;gap:2px;background:transparent}
#studio-editor .studio-preview-tabs button{padding:4px 6px;min-height:26px}
#studio-editor #studio-preview-content{padding:6px;gap:6px;flex:1;min-height:0}
#studio-editor .studio-app-formatbar{padding:4px 8px;gap:6px;min-height:30px;flex:none;flex-wrap:wrap;overflow:visible}
#studio-editor .studio-format-label{font-size:10px;max-width:100%}
#studio-editor .studio-format-selection-hint{font-size:10px}
#studio-editor .studio-app-formatbar fieldset{gap:5px;flex-wrap:wrap;flex-shrink:1;min-width:0}
#studio-editor .studio-app-formatbar button{min-height:28px;font-size:11px}
#studio-editor .studio-app-formatbar input,#studio-editor .studio-app-formatbar select{height:27px;min-height:27px;padding:3px 5px}
#studio-editor .studio-move-hint{margin:3px 0;font-size:10px}
#studio-editor .studio-app-canvas-tools{padding:4px 8px;flex:none}
#studio-editor .studio-canvas-command-row{padding:0;min-height:28px}
#studio-editor .studio-canvas-command-row .studio-canvas-drawer-triggers{flex:1 1 auto}
#studio-editor .studio-canvas-command-row .studio-canvas-drawer-triggers button{min-height:28px;padding:4px 7px}
#studio-editor .studio-canvas-drawer-triggers{gap:4px}
#studio-editor .studio-canvas-drawer-triggers button{padding:4px 7px;min-height:28px;font-size:11px}
#studio-editor .studio-canvas-drawer-triggers .studio-command-copy b{font-size:11px}
#studio-editor .studio-scene-picker{flex:none;margin:0;padding:4px 8px;max-height:110px;overflow:auto}
#studio-editor .studio-scene-heading,#studio-editor .studio-scene-picker>p,#studio-editor .studio-scene-card small{display:none}
#studio-editor .studio-scene-list{margin:0;gap:4px}
#studio-editor .studio-scene-card{padding:4px 8px;min-height:28px}
#studio-editor .studio-scene-states{margin-top:4px}
#studio-editor>.studio-history{min-height:22px;padding:3px 6px;margin-top:2px}
#studio-editor>.studio-history summary{font-size:10px}
.studio-preview-generation{bottom:16px}
body:has(#main #studio-editor) #gai-assistant{display:none!important}
@media(min-width:761px) and (max-height:820px){
 #studio-editor .studio-chat-heading{padding-block:6px}
 #studio-editor .studio-format-selection-hint{display:none}
 #studio-editor .studio-chat-save:empty{display:none}
 #studio-editor .studio-move-hint{display:none}
 #studio-editor .studio-conversation-empty h3{font-size:16px}
}
@media(min-width:761px) and (max-width:1500px){
 #studio-editor .studio-toolbar>.actions{gap:3px}
 #studio-editor .studio-toolbar .btn{padding-inline:6px;font-size:10px}
 #studio-editor .studio-app-controls>span{display:none}
 #studio-editor .studio-workspace-meta .studio-save-status{max-width:40%}
}
@media(max-width:760px){
 body:has(#main #studio-editor) #app>header{height:auto;min-height:44px;padding:3px 8px;gap:6px}
 body:has(#main #studio-editor) #app>header nav{height:30px}
 body:has(#main #studio-editor) #app>main.container{padding:4px}
 #studio-editor .studio-toolbar{flex-wrap:wrap;gap:4px}
 #studio-editor .studio-toolbar>div:first-child{flex-basis:100%}
 #studio-editor #studio-project-title{max-width:90vw}
 #studio-editor .studio-toolbar>.actions{display:flex;flex-wrap:wrap;width:100%;justify-content:flex-start;gap:4px}
 #studio-editor .studio-toolbar .btn{font-size:10px;padding:5px 6px}
 #studio-editor .studio-workspace-meta{min-height:26px}
 #studio-editor .studio-workspace-meta .studio-save-status{display:none}
 #studio-editor .studio-panel-resize{display:none}
 #studio-editor .studio-preview-panel{overflow:hidden}
 #studio-editor .studio-preview-panel #studio-preview-content{flex:1;height:auto;min-height:0}
 #studio-editor .studio-usage-popover{position:fixed;top:120px;right:12px}
 #studio-editor .studio-app-controls>span{display:none}
 #studio-editor .studio-canvas-drawer-triggers button{flex:0 1 auto}
 #studio-editor .studio-command-copy b{font-size:10px}
 #studio-editor .studio-format-selection-hint,#studio-editor .studio-move-hint{display:none}
 #studio-editor[data-density] #studio-ai-prompt{font-size:16px}
}

/* Keep reference files in one compact row so the conversation keeps its height. */
#studio-editor .studio-bubble{max-width:100%;padding:10px 12px}
#studio-editor .studio-bubble p{line-height:1.65}
#studio-editor .studio-attachments{flex-wrap:nowrap;overflow-x:auto;max-height:48px;gap:5px;padding:3px 8px;scrollbar-width:thin}
#studio-editor .studio-attachments>div{display:flex;align-items:center;gap:5px;flex:0 0 auto;width:auto;max-width:195px;height:36px;padding:3px 5px;border-color:var(--st-border);background:var(--st-raised)}
#studio-editor .studio-attachments img{width:30px;height:26px;flex:none;object-fit:cover;border-radius:3px}
#studio-editor .studio-attachments span{font-size:10px;min-width:0;color:var(--st-ink)}
#studio-editor .studio-attachments button{position:static;flex:none;width:22px;height:22px;border:0;background:transparent;color:var(--st-muted)}
#studio-editor .studio-attachments .studio-file-kind{font-size:9px;flex:none;color:var(--st-accent-ink);font-weight:700}
#studio-editor .studio-chat-files{display:flex;gap:5px;flex-wrap:wrap;font-size:10px;color:var(--st-muted)}
#studio-editor .studio-chat-files span{border:1px solid var(--st-border);border-radius:5px;padding:3px 6px;overflow-wrap:anywhere}
