.chat-composer #chatRequest,.chat-composer:focus-within #chatRequest,.chat-composer:has(#chatRequest:not(:placeholder-shown)) #chatRequest{height:34px;min-height:34px;max-height:180px;resize:none;transition:none;box-sizing:border-box;overflow-y:hidden}
.composer-entry{align-items:center;gap:6px}.composer-entry #liveVoiceButton{align-self:center;width:32px;height:34px;min-height:34px;padding:6px}
.composer-selection{display:flex;gap:5px;align-items:center;flex-wrap:wrap;margin:0 0 4px 34px}.composer-selection button{border:0;border-radius:12px;background:transparent;color:#777;padding:2px 6px;font-size:10px;max-width:100%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.composer-selection button:hover{background:#eaeaea;color:#333}
#chatAttachmentStatus{display:none}#chatAttachments:empty{display:none}
.compact-menu{position:fixed;inset:auto;width:320px;max-width:calc(100vw - 16px);max-height:min(440px,70dvh);overflow:auto;margin:0;padding:10px;border:1px solid #ddd;border-radius:15px;background:#fff;box-shadow:0 8px 30px #0002;color:#333}
.compact-menu>button{display:block;width:100%;text-align:left;border:0;background:transparent;border-radius:8px;padding:11px 12px;font-size:13px}.compact-menu>button:hover{background:#f4f4f4}.compact-menu>strong{display:block;font-size:13px;margin:12px}.compact-menu input[type=search]{width:100%;padding:9px;font-size:13px;margin:8px 0}.compact-menu #chatDocuments{display:grid;gap:6px;max-height:260px;overflow:auto}.compact-menu #chatDocuments label{display:flex;align-items:center;gap:8px;padding:9px;margin:0;border-radius:8px;font-size:12px;background:#fafafa}.compact-menu #chatDocuments label[hidden]{display:none}.compact-menu #chatDocuments input{width:16px;flex:none}.compact-menu .composer-tools{display:grid;gap:12px;padding:10px}.compact-menu .composer-tools label{display:block;font-size:12px!important;margin:0!important;max-width:none}.compact-menu .composer-tools select{display:block;width:100%;height:38px;max-width:none;font-size:13px}.compact-menu [hidden]{display:none!important}
.workspace-projects{margin:14px 0 8px;padding:0 6px}.project-heading,.project-row{display:flex;align-items:center;gap:5px}.project-heading strong{flex:1;font-size:11px;color:#888}.project-row>button:first-child{flex:1;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workspace-projects button{font-size:12px;padding:8px;border-radius:7px}.workspace-projects button[aria-pressed=true]{background:#e7e7e7;color:#222}.history-filters{display:flex;gap:3px;margin-top:8px}.history-filters button{font-size:11px}.history-action-popover>button{display:block;width:100%;text-align:left;color:#444;padding:9px}.history-action-popover>button:last-child{color:#a43131}.workspace-projects .project-heading button{font-size:18px}.action-dialog>button{display:block;width:100%;padding:12px;text-align:left}.action-dialog form input{width:100%;margin:16px 0}
@media(max-width:550px){.composer-selection{margin-left:26px}.composer-entry{gap:3px}.chat-composer{padding:8px}.composer-entry #chatAttach{width:28px;min-width:28px}.composer-entry #voiceInputButton,.composer-entry #liveVoiceButton{width:28px}}
.live-voice-dialog{width:min(560px,calc(100vw - 28px))}.live-orb{display:grid;place-items:center;width:110px;height:110px;margin:24px auto;border-radius:50%;background:#eef1f4;color:#475569;font-size:18px;letter-spacing:2px;transition:transform .15s,background .3s}.live-voice-dialog[data-phase=listening] .live-orb{background:#e1f1e9;transform:scale(calc(1 + var(--voice-level,0)*.15))}.live-voice-dialog[data-phase=speaking] .live-orb{background:#e2eafa}.live-voice-dialog #liveStatus{text-align:center;min-height:44px;font-size:13px;line-height:1.7}.live-voice-dialog audio{width:100%;margin-top:14px}.live-transcript{max-height:220px;overflow:auto;font-size:13px;line-height:1.8;margin-top:18px;white-space:pre-wrap}.live-transcript p{padding:10px;background:#fafafa;border-radius:10px}.live-voice-dialog .voice-input-actions{justify-content:center}.live-voice-dialog [hidden]{display:none!important}
/* Model settings live on the lower right, alongside voice and send. */
.chat-composer .composer-entry{display:block}.chat-composer .composer-entry #chatRequest{display:block;width:100%;padding:5px 2px}
.compact-toolbar{display:flex;align-items:center;gap:5px;margin-top:5px;min-width:0}.compact-toolbar .composer-selection{display:flex;gap:3px;margin:0;flex:1;min-width:0}.compact-toolbar .composer-model-button{margin-left:auto;max-width:48%;min-width:0;border:0;background:transparent;padding:6px;font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#555;border-radius:7px}.compact-toolbar .composer-model-button:hover{background:#ececec}.compact-toolbar>#voiceInputButton,.compact-toolbar>#liveVoiceButton{width:30px;min-width:30px;height:34px;min-height:34px;padding:6px;flex:none}.compact-toolbar>#sendChat{width:34px;min-width:34px;height:34px;min-height:34px;padding:0;border-radius:50%;font-size:22px;flex:none}.compact-toolbar>#chatStop{width:34px;height:34px;padding:7px;flex:none}.compact-toolbar #chatAttach{flex:none}.compact-options{padding:0 10px}.compact-options label{font-size:12px;margin:12px 0;display:block}.compact-options select{width:100%;margin-top:7px;font-size:13px}.compact-menu .composer-thinking:before{content:'생각 모드';font-size:12px}.chat-attachment .reference-label{font-size:10px;color:#648064}
@media(max-width:550px){.compact-toolbar{gap:2px}.compact-toolbar .composer-model-button{max-width:42%;font-size:10px}.compact-toolbar .composer-selection{gap:0}.compact-toolbar .composer-selection button{font-size:9px;padding:3px}.compact-toolbar>#voiceInputButton,.compact-toolbar>#liveVoiceButton{width:28px;min-width:28px}}
body>aside .workspace-projects{flex:none;margin:8px 0;padding:4px 6px 10px;border-bottom:1px solid #e7e7e7}body>aside .workspace-projects>.project-heading{display:list-item;cursor:pointer;list-style:disclosure-closed;padding:8px 2px;font-size:11px;color:#777}body>aside .workspace-projects[open]>.project-heading{list-style:disclosure-open}body>aside .workspace-projects>.project-heading strong{font-size:11px;font-weight:500;color:#555}.workspace-projects>.text-button{font-size:11px;color:#777}.history-fold .history-filters{padding:0 6px}.history-fold .history-filters button{border-radius:7px;padding:7px}.history-fold .history-filters button[aria-pressed=true]{background:#e7e7e7}
/* Brand and tools share real layout space; no absolutely positioned overlap. */
body>aside .sidebar-brand-row{display:grid;grid-template-columns:minmax(0,1fr) 28px 28px;align-items:center;gap:4px;flex-shrink:0;min-width:0}
body>aside .sidebar-brand-row .brand{padding:0;margin:0;white-space:nowrap;font-size:18px;line-height:32px;letter-spacing:-.5px}
body>aside .sidebar-brand-row .sidebar-collapse,#historySearchToggle{position:static;width:28px;height:28px;margin:0;padding:6px;border:0;border-radius:7px;display:grid;place-items:center;background:transparent;color:#777}
body>aside .sidebar-brand-row button:hover{background:#eaeaea;color:#222}
#historySearchToggle svg,.sidebar-brand-row .sidebar-collapse svg{width:16px;height:16px}
.history-search-dialog{width:min(560px,calc(100vw - 32px));max-height:min(680px,calc(100dvh - 48px));padding:8px;border:1px solid #e9e9e9;border-radius:22px;box-shadow:0 18px 65px #0002;overflow:auto;background:#fff;color:#333}
.history-search-dialog::backdrop{background:#0002}
.search-palette-input{display:flex;align-items:center;padding:0 6px 5px 8px;gap:8px}
.search-palette-input input{flex:1;min-width:0;padding:13px 0;margin:0;border:0;outline:none;background:transparent;box-shadow:none;font-size:14px}
.search-palette-input input:focus{outline:none;box-shadow:none}
.search-palette-input .icon-action{width:28px;height:28px;padding:7px;color:#999}
.search-palette-label,.search-palette-status{font-size:11px;color:#929292;margin:7px 6px 5px;padding:0 6px;font-weight:400}
.search-palette-list{max-height:390px;overflow:auto;scrollbar-width:thin}
.search-palette-row{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:7px 12px;min-height:32px;margin:0;border:0;border-radius:12px;background:transparent;color:#505050;font:inherit;font-size:13px;line-height:1.4}
.search-palette-row:hover,.search-palette-row.palette-selected{background:#f3f3f3;color:#222}
.search-palette-row:focus-visible{outline:2px solid #777;outline-offset:-2px}
.search-palette-copy{flex:1;min-width:0}.search-palette-title{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-palette-meta{flex:none;font-size:12px;color:#a0a0a0}.search-palette-snippet{display:block;font-size:11px;color:#888;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:3px}
.search-palette-actions{padding-bottom:4px}.search-palette-row>svg{width:15px;height:15px;flex-shrink:0;color:#777}.search-palette-empty{font-size:12px;color:#888;padding:10px 12px}.search-palette-status[hidden]{display:none}
@media(max-width:550px){.history-search-dialog{max-height:calc(100dvh - 32px)}.search-palette-list{max-height:45dvh}.search-palette-meta{max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
.history-search[hidden]{display:none!important}
/* ChatGPT-inspired plus menu, using unmodified Bootstrap icon assets. */
.compact-menu[data-page=main]{width:480px;padding:8px;border-radius:18px;border-color:#e9e9e9;box-shadow:0 8px 28px #00000014}
.composer-menu-heading{font-size:11px;color:#999;margin:5px 7px 4px;line-height:1.6}
.composer-menu-heading:not(:first-child){margin-top:13px}
.compact-menu>button.composer-tool-item{display:flex;align-items:center;gap:10px;min-height:37px;padding:8px 10px;border-radius:10px}
.composer-tool-icon{display:block;width:17px;height:17px;flex:0 0 17px;background-color:#888;mask-size:contain;mask-repeat:no-repeat;mask-position:center}
.composer-tool-icon.tone-cyan{background-color:#24bde7}.composer-tool-icon.tone-blue{background-color:#318df4}.composer-tool-icon.tone-purple{background-color:#a16be5}
.icon-paperclip{mask-image:url('/static/vendor/bootstrap-icons/paperclip.svg')}.icon-image-fill{mask-image:url('/static/vendor/bootstrap-icons/image-fill.svg')}.icon-camera-video-fill{mask-image:url('/static/vendor/bootstrap-icons/camera-video-fill.svg')}.icon-soundwave{mask-image:url('/static/vendor/bootstrap-icons/soundwave.svg')}.icon-globe2{mask-image:url('/static/vendor/bootstrap-icons/globe2.svg')}.icon-file-earmark-text{mask-image:url('/static/vendor/bootstrap-icons/file-earmark-text.svg')}
.composer-tool-name{font-size:13px;color:#303030;white-space:nowrap;flex:none}.composer-tool-description{font-size:12px;color:#999;text-align:left;min-width:0;line-height:1.4}.composer-tool-state{font-size:10px;line-height:1.5;color:#888;background:#f2f2f2;padding:2px 6px;border-radius:6px;margin-left:auto;flex:none}
.composer-tool-item[aria-pressed=true] .composer-tool-state{color:#117e6e;background:#e6f5ef}.composer-tool-item:focus-visible{outline:2px solid #999;outline-offset:-2px}
@media(max-width:550px){.compact-menu[data-page=main]{width:calc(100vw - 24px)}.compact-menu>button.composer-tool-item{gap:8px}.composer-tool-name{font-size:12px}.composer-tool-description{font-size:11px}.composer-tool-state{padding:2px 4px}}
.compact-menu>button.composer-tool-item,.composer-tool-name,.composer-tool-description{font-weight:400}
/* Pointer selection stays quiet; keyboard focus remains clearly visible. */
.compact-menu select,.live-voice-dialog select{border:0;background:#f5f5f5;box-shadow:none;border-radius:10px;padding:11px 12px}
.compact-menu select:focus:not(:focus-visible),.live-voice-dialog select:focus:not(:focus-visible){outline:none;box-shadow:none}
.compact-menu select:focus-visible,.live-voice-dialog select:focus-visible{outline:2px solid #4c87e8;outline-offset:3px;box-shadow:none}
.compact-menu .composer-thinking:before{content:none}
.reasoning-control{padding:12px 0 2px;width:100%;min-width:0}
.reasoning-head{display:flex;align-items:center;gap:10px;font-size:12px;color:#737373;margin-bottom:12px}
.reasoning-head output{color:#347ce2;font-size:14px;font-weight:600;margin-left:auto}
.reasoning-control .reasoning-head .reasoning-toggle{padding:3px 8px;min-height:24px;width:auto;border:0;border-radius:6px;background:#eee;font-size:10px;color:#777}
.reasoning-control .reasoning-head .reasoning-toggle[aria-checked=true]{color:#236ad4;background:#eaf2ff}
.reasoning-control input[type=range]{display:block;width:100%;height:26px;min-height:0;padding:0;margin:0;border:0;box-shadow:none;accent-color:#3981ed;cursor:ew-resize}
.reasoning-control input[type=range]:focus:not(:focus-visible){outline:none}
.reasoning-stops{display:flex;justify-content:space-between;margin-top:7px}
.reasoning-control .reasoning-stops button{width:auto;min-height:22px;padding:2px 4px;border:0;background:none;color:#999;font-size:10px;text-align:center}
.reasoning-control .reasoning-stops button[aria-pressed=true]{color:#347ce2}
.composer-thinking>select[hidden]{display:none!important}
#liveVoiceButton .composer-tool-icon{width:22px;height:22px;background-color:currentColor;display:block}
.live-voice-dialog{width:min(530px,calc(100vw - 32px));padding:24px;border:0;border-radius:24px;max-height:calc(100dvh - 40px);overflow:auto}
.live-voice-dialog::backdrop{background:rgb(0 0 0 / .22)}
#liveWindowActions{display:flex;gap:3px;margin-left:auto}#liveWindowActions button{border:0;background:transparent;width:30px;height:30px;min-height:30px;padding:5px;color:#888}
.live-models{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:20px}.live-models label:first-child{grid-column:1/-1}.live-models label{font-size:11px;color:#777;margin:0}.live-models select{margin-top:6px;width:100%;font-size:12px;min-width:0}
#liveReasoning{margin:10px 0}.live-ready{font-size:11px;color:#738272;margin:12px 0 5px}#liveLoad{font-size:11px;border:0;background:#f0f3f8;border-radius:8px;padding:8px 12px;min-height:30px}
.live-wave{display:block;width:100%;height:96px;margin:14px auto 0}.live-voice-dialog #liveStatus{font-size:12px;min-height:36px;margin:0 0 12px;color:#616873}
.live-voice-dialog .voice-input-actions button{border:0;border-radius:20px;padding:10px 18px;min-height:38px;background:#2d2d2d;color:white;font-size:12px}.live-voice-dialog .voice-input-actions .secondary{background:#f0f0f0;color:#555}
.live-idle{background:#f2f6fc;border-radius:12px;padding:14px;margin:12px 0;font-size:12px}.live-idle button{font-size:12px;margin-right:8px}
.live-mini{position:fixed;right:24px;bottom:24px;z-index:1005;display:flex;align-items:center;gap:8px;width:360px;max-width:calc(100vw - 32px);padding:12px;border:1px solid #e5e5e5;border-radius:20px;background:#fff;box-shadow:0 6px 30px #0002}
.live-mini[hidden]{display:none}.live-restore{display:flex;align-items:center;gap:10px;flex:1;min-width:0;border:0;background:transparent;padding:3px;text-align:left}.live-restore .composer-tool-icon{width:25px;height:25px;background-color:#3981ed;flex:none}.live-restore strong{font-size:12px}.live-restore>span:last-child{display:flex;flex-direction:column;min-width:0;gap:4px}#liveMiniStatus{font-size:10px;color:#777;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#liveMiniMute{font-size:10px;border:0;border-radius:10px;padding:7px;white-space:nowrap}.live-mini>.icon-button{flex:none}
.voice-input-dialog{border:0;border-radius:22px}.voice-input-dialog .voice-input-actions button{border:0;border-radius:18px}
@media(max-width:550px){.live-voice-dialog{padding:18px}.live-mini{right:16px;bottom:16px}.live-models{gap:8px}}

/* Chunky slider track and white thumb match the supplied Codex control. */
.reasoning-control input[type=range]{appearance:none;-webkit-appearance:none;height:24px;border-radius:999px;background:linear-gradient(to right,#3981ed 0 var(--reasoning-progress,0%),#e8e8e8 var(--reasoning-progress,0%) 100%)}
.reasoning-control input[type=range]::-webkit-slider-runnable-track{height:24px;border:0;border-radius:999px;background:transparent}
.reasoning-control input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:28px;height:28px;margin-top:-2px;border:1px solid #e0e0e0;border-radius:50%;background:white;box-shadow:0 1px 3px #0002}
.reasoning-control input[type=range]::-moz-range-track{height:24px;border:0;border-radius:999px;background:transparent}
.reasoning-control input[type=range]::-moz-range-thumb{width:26px;height:26px;border:1px solid #e0e0e0;border-radius:50%;background:white;box-shadow:0 1px 3px #0002}

/* Compact Live controls with a bounded transcript and visible mini captions. */
.live-voice-dialog{width:min(460px,calc(100vw - 28px));padding:18px;border-radius:20px;margin:clamp(12px,4dvh,40px) auto auto;max-height:calc(100dvh - 32px)}
.live-voice-dialog .section-top{margin-bottom:8px}.live-voice-dialog .hint{margin:6px 0 10px;font-size:11px;line-height:1.6}
.live-settings{border:0;margin:4px 0}.live-settings>summary{font-size:12px;color:#777;cursor:pointer;padding:6px 0}.live-models{margin-top:8px;gap:8px}.live-models select{padding:9px 10px}
#liveReasoning{margin:4px 0}.live-voice-dialog .reasoning-control{padding-top:6px}.live-voice-dialog .reasoning-head{margin-bottom:8px}
.live-wave{height:44px;margin:8px auto 0}.live-voice-dialog #liveStatus{min-height:18px;margin:4px 0 10px;font-size:11px}.live-voice-dialog .voice-input-actions{justify-content:center;gap:6px}.live-voice-dialog .voice-input-actions button{padding:8px 12px;min-height:32px}
.live-transcript{max-height:150px;overflow:auto;overscroll-behavior:contain;font-size:12px;line-height:1.6;margin-top:10px;scrollbar-width:thin}.live-transcript:empty{display:none}.live-transcript p{margin:6px 0}.live-transcript strong{font-size:11px;color:#777}
.live-voice-dialog audio{height:30px;width:100%;margin-top:8px}
.live-preview{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0}.live-preview button{border:0;border-radius:9px;background:#edf2fa;color:#375c92;font-size:11px;padding:8px 12px}.live-preview .hint{margin:0;font-size:11px}.live-preview audio{flex-basis:100%}
.live-mini{width:320px;right:20px;bottom:112px;padding:10px 12px;gap:6px;display:grid;grid-template-columns:minmax(0,1fr) auto auto;border-radius:16px}
.live-mini-words{grid-column:1/-1;min-width:0;max-height:108px;overflow:auto;overscroll-behavior:contain;border-top:1px solid #f0f0f0;padding-top:6px}
.live-mini-words p{font-size:12px;line-height:1.5;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.live-mini-words p+p{font-size:11px;color:#777;margin-top:5px}.live-mini>.icon-action{width:24px;height:24px;padding:4px}.live-restore{gap:7px}.live-restore .composer-tool-icon{width:20px;height:20px}
@media(max-width:550px){.live-mini{right:12px;bottom:114px;max-width:calc(100vw - 24px)}.live-voice-dialog{padding:16px}.live-transcript{max-height:120px}}

.voice-expression-settings{margin:12px 0;border:0}.voice-expression-settings>summary{cursor:pointer;font-size:12px;color:#555;padding:6px 0}.voice-style-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.voice-style-grid label:first-child{grid-column:auto}

.refine-image-toggle{display:flex;align-items:center;gap:8px;font-size:12px}.refine-image-toggle input{width:auto;margin:0}

.composer-selection button{display:inline-flex;align-items:center;gap:5px}
.composer-selection .composer-tool-icon{display:inline-block;width:13px;height:13px;flex:none}
.composer-selection button>svg{width:13px;height:13px;flex:none}

/* Touch targets, safe areas and readable form fields on phone browsers. */
@media(max-width:600px){
 body[data-workspace="chat"] main{padding-left:12px;padding-right:12px;min-width:0}
 .chat-workspace,.chat-main,.chat-turn{min-width:0;max-width:100%;overflow-wrap:anywhere}
 .chat-main #messages{margin-top:8px}.chat-empty{min-height:20dvh;font-size:18px}
 .chat-composer{bottom:max(8px,env(safe-area-inset-bottom));padding:10px 12px;border-radius:20px}
 .chat-composer #chatRequest,input:not([type=checkbox]):not([type=radio]),textarea,select{font-size:16px!important}
 .compact-toolbar{flex-wrap:wrap;gap:4px}
 .compact-toolbar #chatAttach,.compact-toolbar>#voiceInputButton,.compact-toolbar>#liveVoiceButton,.compact-toolbar>#sendChat,.compact-toolbar>#chatStop{width:44px;min-width:44px;height:44px;min-height:44px}
 .compact-toolbar .composer-model-button{font-size:12px;min-height:44px;max-width:calc(100% - 200px);flex:1}
 .compact-toolbar .composer-selection{flex:1 0 calc(100% - 52px);min-height:32px}
 .composer-selection button{font-size:12px!important;min-height:32px;padding:5px 8px!important}
 .chat-turn-actions{gap:4px 10px;flex-wrap:wrap}.chat-turn-actions button,.media-request>button{min-height:44px;min-width:44px}
 .chat-turn.user{max-width:94%;padding:12px 16px}.media-turn img,.media-turn video,.media-turn audio{max-width:100%}
 .chat-attachment{max-width:100%;min-width:0}.chat-attachment button{min-width:44px;min-height:44px}
 dialog{max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);box-sizing:border-box;overflow:auto}
 .compact-menu{max-height:calc(100dvh - 100px)}.compact-menu>button{min-height:44px}
 .sidebar-toggle{min-width:44px;min-height:44px}body>aside{padding-bottom:max(16px,env(safe-area-inset-bottom))}
}
@media(max-width:600px){
 .compact-toolbar{display:grid;grid-template-columns:44px minmax(0,1fr) 44px 44px 44px 44px;gap:4px;align-items:center}
 .compact-toolbar .composer-selection{grid-row:1;grid-column:1/3;min-width:0;flex:none}
 .compact-toolbar .composer-model-button{grid-row:1;grid-column:3/7;max-width:100%;width:100%;margin:0;text-align:right}
 .compact-toolbar #chatAttach{grid-row:2;grid-column:1}
 .compact-toolbar #voiceInputButton{grid-row:2;grid-column:3}
 .compact-toolbar #liveVoiceButton{grid-row:2;grid-column:4}
 .compact-toolbar #readAloudMode{grid-row:2;grid-column:5;min-width:44px;min-height:44px;padding:2px}
 .compact-toolbar #sendChat,.compact-toolbar #chatStop{grid-row:2;grid-column:6;justify-self:end}
 .compact-toolbar:has(#chatStop:not([hidden])) #sendChat{display:none}
}
@media(max-width:600px){
 #chatDropZone .compact-toolbar .model-status-chip{grid-row:1;grid-column:3;justify-self:end}
 #chatDropZone #composerModelButton{grid-row:1;grid-column:4/7;max-width:100%;width:100%;font-size:12px}
 #chatDropZone .composer-selection button>span:last-child{display:inline}
}
.voice-lab{width:min(680px,calc(100vw - 28px));max-height:calc(100dvh - 32px);padding:24px;border:0;border-radius:20px;overflow:auto}.voice-lab::backdrop{background:#0004}.voice-lab label{display:flex;flex-direction:column;gap:7px;margin:12px 0;font-size:13px}.voice-lab input,.voice-lab select{width:100%;padding:10px;border:1px solid #ddd;border-radius:8px}.voice-lab input[type=checkbox]{width:auto;align-self:flex-start}.voice-lab fieldset{margin:20px 0;padding:14px;border:1px solid #ddd;border-radius:12px}.voice-lab button{margin:5px 4px 5px 0}.voice-lab audio{width:100%;max-width:100%}.voice-lab [hidden]{display:none!important}.voice-lab .hint{line-height:1.65}.voice-lab legend{font-size:14px;font-weight:600}
.voice-lab-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));position:sticky;top:-24px;z-index:2;background:var(--surface,#fff);padding:10px 0;border-bottom:1px solid var(--line,#ddd);gap:5px}.voice-lab-tabs button{margin:0;min-height:44px;padding:10px 5px;white-space:normal;border:1px solid transparent;background:transparent;border-radius:9px;font-size:13px}.voice-lab-tabs [aria-selected=true]{background:var(--bg,#f0f0f0);border-color:var(--line,#ddd);font-weight:650}.voice-lab-panel{padding-top:10px;min-width:0}.voice-lab input,.voice-lab select{box-sizing:border-box;min-width:0}.voice-slider-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.voice-slider{border:1px solid var(--line,#ddd);padding:12px;border-radius:12px;min-width:0}.voice-slider label{font-weight:600;margin:0}.voice-slider output{font-size:20px;font-weight:600}.voice-lab input[type=range]{padding:0;min-height:34px;border:0;accent-color:var(--accent,#333)}.voice-slider .hint{font-size:12px;margin-bottom:0}.voice-tuning-advanced{margin:14px 0}.voice-tuning-advanced .voice-slider{margin:10px 0}.voice-tuning-actions{display:flex;flex-wrap:wrap;gap:5px;margin-top:15px}.voice-lab .voice-tuning-actions button{margin:0;min-height:44px}.voice-test-result{border:1px solid var(--line,#ddd);border-radius:12px;padding:12px;margin:14px 0}.voice-test-result h4{margin:0;overflow-wrap:anywhere}.voice-lab button:focus-visible,.voice-lab input:focus-visible{outline:2px solid var(--accent,#555);outline-offset:2px}@media(max-width:520px){.voice-lab{padding:16px;width:calc(100vw - 20px)}.voice-lab-tabs{top:-16px}.voice-slider-grid{grid-template-columns:1fr}.voice-lab-tabs button{font-size:12px}.voice-tuning-actions button{flex:1 1 145px}}
.personal-voice-picker{min-width:0;max-width:100%;box-sizing:border-box;margin:12px 0;padding:12px;border:1px solid #ddd;border-radius:10px}.personal-voice-picker label{display:block;margin:6px 0}.personal-voice-picker select,.personal-voice-picker audio{width:100%;min-width:0;max-width:100%;box-sizing:border-box}.personal-voice-picker button{margin:6px 0}.personal-voice-picker [hidden]{display:none!important}
.voice-recording-guide ol,.voice-lab ol{padding-left:1.4rem}.voice-lab li{margin:.45rem 0}.voice-example-text{white-space:pre-wrap;line-height:1.75;padding:.8rem;border-radius:10px;background:var(--surface,#f5f5f5);overflow-wrap:anywhere}.voice-preparation{margin:.8rem 0;padding:.8rem;border:1px solid var(--line,#ddd);border-radius:10px}.voice-preparation progress{width:100%;max-width:100%}.voice-lab textarea{box-sizing:border-box;max-width:100%;width:100%}
.voice-recording-actions{position:sticky;top:0;z-index:2;display:flex;flex-wrap:wrap;gap:4px;padding:4px 0;background:#fff;box-shadow:0 2px 4px #0001}

.voice-enrollment,.voice-enrollment section,.voice-enrollment details{min-width:0;max-width:100%;box-sizing:border-box}.voice-enrollment canvas,.voice-enrollment select,.voice-enrollment progress{min-width:0;max-width:100%;box-sizing:border-box}.voice-enrollment button,.voice-enrollment summary,.voice-enrollment p{overflow-wrap:anywhere}.voice-enrollment button{max-width:100%;white-space:normal}.voice-enrollment .voice-example-text{white-space:pre-line}
.voice-input-monitor{min-width:0;max-width:100%;box-sizing:border-box;margin:8px 0;padding:10px;border:1px solid #ddd;border-radius:10px;background:#fff}.voice-input-monitor>strong{display:block;margin-bottom:6px;font-size:12px}.voice-input-monitor .hint{margin:5px 0 0;font-size:12px}.voice-input-monitor.is-recording{position:sticky;top:0;z-index:5;margin:0 0 12px;box-shadow:0 3px 10px #0002}.voice-input-monitor.is-recording canvas{height:48px!important}.voice-input-monitor[data-signal=active]{border-color:#15803d}.voice-input-monitor[data-signal=quiet]{border-color:#a16207}.voice-input-monitor[data-signal=clipping]{border-color:#b91c1c}.voice-input-monitor[data-signal=active] progress{accent-color:#15803d}.voice-input-monitor[data-signal=quiet] progress{accent-color:#a16207}.voice-input-monitor[data-signal=clipping] progress{accent-color:#b91c1c}

.music-settings,.music-settings fieldset,.music-settings details{min-width:0;max-width:100%;box-sizing:border-box}.music-settings [hidden]{display:none!important}.music-settings .music-source{margin:12px 0;padding:14px;border:1px solid #ddd;border-radius:12px}.music-settings .music-source audio{width:100%;max-width:100%}.music-settings .music-source-timing{line-height:1.6;font-size:13px;font-weight:500}.music-settings .music-advanced{margin-top:16px;border-top:1px solid #ddd;padding-top:12px}.music-settings .music-advanced>summary{cursor:pointer;padding:8px 0;font-weight:600}.music-settings .hint{overflow-wrap:anywhere}.music-settings input[type=url]{width:100%;min-width:0;box-sizing:border-box;padding:10px;border:1px solid #ddd;border-radius:8px;font:inherit;font-weight:400;background:#fff}.music-settings button{max-width:100%;white-space:normal}
.voice-lab .voice-lab-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.voice-lab-header h2{margin:0}.voice-lab .voice-lab-header button{width:auto;flex:none;margin:0}.voice-lab fieldset{min-width:0;max-width:100%;box-sizing:border-box}.voice-lab button{max-width:100%;white-space:normal}.voice-lab select{max-width:100%}.voice-lab audio{min-width:0}.voice-lab-panel p,.voice-lab-panel summary{overflow-wrap:anywhere}
.voice-model-card{padding:14px 0;border-bottom:1px solid var(--line,#ddd)}.voice-model-card>p{font-weight:600;line-height:1.6;margin:4px 0 8px}.voice-model-card>details{margin-top:8px}.voice-model-card summary{font-size:12px;cursor:pointer}.voice-lab .voice-tuning-actions .primary{background:var(--ink,#222);color:var(--paper,#fff)}

/* Media composition: visible reference roles, next actions and compact settings. */
.composer-media-hint{margin:6px 4px 0;color:#626262;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.composer-media-hint[hidden],.chat-context-gauge[hidden]{display:none!important}
.media-next-actions{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 4px}
.media-next-actions button{min-height:44px;padding:8px 16px;font-size:13px}
.video-quality-options{margin:16px 0 8px;padding:14px;border:1px solid var(--line,#e6e6e6);border-radius:12px;min-width:0}
.video-quality-heading{display:flex;align-items:baseline;justify-content:space-between;gap:6px 12px;flex-wrap:wrap;margin-bottom:12px}
.video-quality-heading strong{font-size:13px}.video-quality-heading .hint{margin:0;font-size:12px}
.video-quality-options .hint{color:var(--muted)}
.video-quality-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.video-quality-option:last-child:nth-child(odd){grid-column:1/-1}
.video-quality-purpose{margin:0 0 7px;font-size:12px;font-weight:600;line-height:1.6;color:var(--ink)}
.video-quality-option{min-width:0}.video-quality-option button{width:100%;min-height:44px;padding:10px 12px;font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.video-quality-option .hint{margin:7px 0 0;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.video-quality-options .video-quality-note{margin:12px 0 0;padding-top:10px;border-top:1px solid var(--line,#e6e6e6);font-size:12px;overflow-wrap:anywhere}
@media(max-width:550px){.video-quality-grid{grid-template-columns:1fr}.video-quality-option button{text-align:left}}
.video-prompt-details{margin:10px 0;padding:10px 12px;background:#f6f7f8;border-radius:10px;min-width:0}
.video-prompt-details summary,.composer-residency summary{cursor:pointer;min-height:32px;display:list-item;line-height:32px;font-size:13px}
.video-prompt-details p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.65}
.compact-menu .composer-residency{border-top:1px solid #e4e4e4;margin-top:12px;padding-top:8px}
.compact-menu .compact-options>label{color:#454545}
.compact-menu .compact-options .hint{font-size:12px;line-height:1.6;color:#626262}
@media(max-width:550px){
  .chat-attachment button{min-width:44px;min-height:44px}
  .media-next-actions button{flex:1}
  .composer-media-hint{font-size:12px}
  .compact-menu label select{font-size:16px;min-height:44px}
  .compact-menu>button,.composer-residency summary{min-height:44px}
}

@media (max-width:600px), (max-width:1000px) and (pointer:coarse){
  body[data-workspace="chat"]>main{
    height:var(--composer-viewport,100dvh);
    padding-bottom:max(7px,env(safe-area-inset-bottom));
  }
  .chat-composer #chatRequest,
  .chat-composer:focus-within #chatRequest,
  .chat-composer:has(#chatRequest:not(:placeholder-shown)) #chatRequest{
    min-height:54px;
    max-height:min(280px,calc(var(--composer-viewport,100dvh) * .47));
    font-size:16px;
  }
  body[data-workspace="chat"]>main[data-short-typing]{padding-top:48px}
  body[data-workspace="chat"]>main[data-short-typing]>header{display:none}
  main[data-short-typing] .chat-main>.section-top,
  main[data-short-typing] .chat-main>.chat-toolbar{display:none}
  main[data-short-typing] #chatPanel #messages{min-height:0;margin-block:2px 4px;padding-bottom:4px}
  main[data-short-typing] .chat-main .chat-composer{padding:7px}
  main[data-short-typing] .chat-attachments{max-height:48px;overflow-y:auto}
  main[data-short-typing] .chat-composer{--typing-reserved:235px}
  main[data-short-typing] .chat-composer:has(.chat-attachment){--typing-reserved:285px}
  main[data-short-typing] #chatDropZone .composer-entry #chatRequest{
    max-height:min(200px,calc(var(--composer-viewport,100dvh) - var(--typing-reserved)));
  }
}

/* Phone composer: predictable rows instead of flex-wrap gaps consuming the chat. */
@media (max-width:600px), (max-width:1000px) and (pointer:coarse){
  body[data-workspace="chat"] #chatPanel #messages{min-height:0}
  .chat-main .chat-composer{padding:8px;bottom:auto}
  .chat-composer #chatRequest,
  .chat-composer:focus-within #chatRequest,
  .chat-composer:has(#chatRequest:not(:placeholder-shown)) #chatRequest{
    min-height:34px;max-height:min(120px,calc(var(--composer-viewport,100dvh) * .25));
  }
  #chatDropZone .compact-toolbar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px 4px;margin-top:2px}
  #chatDropZone .compact-toolbar .composer-selection:empty{display:none}
  #chatDropZone .compact-toolbar .composer-selection{grid-column:1/-1;grid-row:3;min-height:0}
  #chatDropZone .compact-toolbar .model-status-chip{grid-row:1;grid-column:1;justify-self:start;margin:0;min-height:24px;padding:3px 6px}
  #chatDropZone .compact-toolbar .model-status-text{display:none}
  #chatDropZone .compact-toolbar .composer-model-button{grid-row:1;grid-column:2/-1;width:100%;max-width:none;margin:0;min-height:28px;padding:3px 6px;text-align:right}
  #chatDropZone .compact-toolbar #chatAttach{grid-row:2;grid-column:1}
  #chatDropZone .compact-toolbar #voiceInputButton{grid-row:2;grid-column:2}
  #chatDropZone .compact-toolbar #liveVoiceButton{grid-row:2;grid-column:3}
  #chatDropZone .compact-toolbar #readAloudMode{grid-row:2;grid-column:4;min-height:44px;padding:4px}
  #chatDropZone .compact-toolbar #sendChat,#chatDropZone .compact-toolbar #chatStop{grid-row:2;grid-column:5;justify-self:end}
  #chatDropZone .compact-toolbar .send-shortcut{display:none}
  .chat-composer .chat-context-gauge{display:none}
  main[data-short-typing] #chatDropZone .composer-entry #chatRequest{
    max-height:max(34px,min(96px,calc(var(--composer-viewport,100dvh) * .22)));
  }
  .chat-composer .chat-attachments{max-height:64px;overflow-y:auto}
}
