/* Stable rows: the command bar never shares a row with the page title. */
@media(min-width:1051px){
 body.warm-modern>main,body.warm-modern[data-screen=chats]>main{grid-template-rows:minmax(64px,auto) auto auto minmax(0,1fr)!important;row-gap:14px!important}
 body.warm-modern main>.command-bar{grid-row:1!important;min-height:58px;height:auto!important}
 body.warm-modern main>header,body.warm-modern[data-screen=chats] main>header{grid-row:2!important;max-width:none!important;min-height:46px;padding:6px 0!important;gap:16px;align-items:center}
 body.warm-modern main>header h1{margin:0!important;line-height:1.2}
 body.warm-modern main>#notice{grid-row:3!important;margin:0!important}
 body.warm-modern main>.workspace{grid-row:4!important}
 body.warm-modern .assistant-mode{margin:0 0 0 auto;display:flex;flex-direction:column;gap:6px;min-width:180px}
 body.warm-modern .assistant-mode button{margin:0!important;width:100%;min-height:36px;padding:6px 12px!important}
 body.warm-modern[data-screen=engineer] #view{display:flex!important;flex-direction:column;overflow:hidden!important;gap:12px}
 body.warm-modern .engineer-messages{flex:1;min-height:0;overflow:auto;padding-right:8px}
 body.warm-modern .engineer-compose{position:static;flex:none}
}
.assistant-mode[hidden]{display:none!important}
.engineer-project-toolbar{padding:0!important;flex:none}
.engineer-project-toolbar label{display:flex;align-items:center;gap:12px;margin:0!important}
.engineer-project-toolbar select{flex:1;min-width:0;margin:0!important}
.engineer-compose textarea{min-height:48px!important;max-height:160px}
.engineer-compose .actions{margin:0!important;align-self:center}
.engineer-actions:empty,.engineer-compose p:empty{display:none}
.sidebar-connection{flex:none;padding:8px 14px;text-align:center;font-size:12px}
body.warm-modern aside .sidebar-connection #connection{color:#f2eadb!important;background:transparent!important;border:0;white-space:normal;opacity:1}
.organization-preview{display:block;max-width:180px;max-height:120px;object-fit:contain;margin:12px 0}
.organization-preview[hidden]{display:none}
.platform-editor{max-width:620px;width:calc(100% - 28px);max-height:85dvh;overflow:auto;box-sizing:border-box}
.platform-editor label{display:block;margin:12px 0}
.platform-editor input,.platform-editor textarea{width:100%;box-sizing:border-box}
.company-brand strong{white-space:normal;overflow-wrap:anywhere}
/* Phone secretary: keep controls out of the message viewport. */
@media(max-width:1050px){
 body.warm-modern[data-screen=chats] main>.workspace,
 body.warm-modern[data-screen=chats] #view,
 body.warm-modern[data-screen=chats] .chat-layout,
 body.warm-modern[data-screen=chats] .chat-panel{display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;height:auto!important;overflow:hidden!important;gap:0!important}
 body.warm-modern[data-screen=chats] .chat-panel{position:relative}
 body.warm-modern[data-screen=chats] .chat-scroll{flex:1 1 0!important;min-height:0!important;overflow-y:auto!important}
 body.warm-modern[data-screen=chats] .composer{position:static!important;flex:0 0 auto!important;min-height:64px!important;width:100%!important;margin:6px 0 0!important;padding:8px!important;gap:6px!important;grid-template-columns:36px minmax(0,1fr) 36px 36px!important}
 body.warm-modern[data-screen=chats] .composer textarea{height:44px;min-height:44px!important;max-height:100px!important;font-size:16px!important;padding:8px 4px!important}
 body.warm-modern[data-screen=chats] .composer .actions>.muted{display:none!important}
 body.warm-modern[data-screen=chats] .dialogue-shortcuts{flex:0 0 auto;flex-wrap:nowrap!important;overflow-x:auto;padding:6px 0!important;gap:6px!important;scrollbar-width:none}
 body.warm-modern[data-screen=chats] .dialogue-shortcuts button{flex:none;min-height:38px!important;padding:6px 9px!important;font-size:12px!important;white-space:nowrap}
 body.warm-modern[data-screen=chats] .dialogue-shortcuts button:last-child{order:-1;margin:0!important}
 body.warm-modern[data-screen=chats]:not(.dialogue-tools-open) .chat-toolbar{display:none!important}
 body.warm-modern[data-screen=chats].dialogue-tools-open .chat-toolbar{display:flex!important;position:absolute;top:50px;left:0;right:0;z-index:15;max-height:50%;overflow-y:auto;padding:12px!important;background:var(--ap-card,#f6f2ea)!important;border:1px solid #d6c7b5!important;border-radius:14px;box-shadow:0 6px 18px #634b3230!important}
 body.warm-modern[data-screen=chats].dialogue-tools-open .context-rail{display:none!important}
 body.warm-modern[data-screen=chats] .bubble.user{max-width:94%!important;margin-left:12px!important}
 body.warm-modern[data-screen=chats] .assistant-mode button{min-height:40px!important;padding:8px!important;font-size:14px!important}
}
@media(max-width:1050px){
 body.warm-modern[data-screen=engineer] main>.command-bar{display:none!important}
 body.warm-modern[data-screen=engineer]>main,body.warm-modern[data-screen=chats]>main{display:flex!important;flex-direction:column;overflow:hidden!important;min-height:0;padding:10px 12px max(8px,env(safe-area-inset-bottom))!important}
 body.warm-modern[data-screen=engineer] main>.workspace,body.warm-modern[data-screen=engineer] #view{display:flex!important;flex-direction:column;flex:1;min-height:0;overflow:hidden!important}
 body.warm-modern[data-screen=engineer] #view{gap:12px}
 body.warm-modern[data-screen=engineer] .engineer-messages{flex:1;min-height:0;overflow:auto}
 body.warm-modern[data-screen=engineer] .engineer-compose{flex:none;position:static}
 body.warm-modern main>.assistant-mode{flex:none}
 body.warm-modern.compact-desktop-shell>main{row-gap:16px!important}
 body.warm-modern main>header{margin:12px 0!important;gap:12px;flex-wrap:wrap}
 body.warm-modern main>header h1{margin:0!important;line-height:1.25}
 body.warm-modern .assistant-mode{margin:0;gap:8px;width:100%}
 .assistant-mode button{flex:1;min-width:0;margin:0!important}
 .engineer-project-toolbar label{display:block}
 .engineer-project-toolbar select{width:100%}
 .engineer-compose{grid-template-columns:minmax(0,1fr) auto!important;padding:8px!important;gap:6px}
 .engineer-compose .actions{display:flex;flex-wrap:nowrap;gap:4px}
 .engineer-compose button{padding:8px!important;min-width:40px}
}
.engineer-compose > div:first-child,.engineer-compose > details{grid-column:1/-1}.engineer-compose > div:first-child:empty{display:none}.engineer-compose > details{font-size:14px}.engineer-compose > details input{width:100%;box-sizing:border-box}.engineer-compose [hidden]{display:none!important}
