/* One document at a time on compact screens; desktop keeps its two panes. */
@media (max-width:1100px){
 body[data-work-mode="work"] main.workspace{display:block;height:auto;min-height:0;overflow:visible}
 body[data-work-mode="work"] main.workspace>#copilot{display:none}
 body[data-work-mode="work"] main.workspace>[data-active-work]{display:block;width:100%;height:auto;max-height:none;min-height:0;overflow:visible;padding:0 0 24px;border-bottom:0}
 body[data-work-mode="work"] main.workspace>[data-active-work]>.workspace-save-panel{display:block}
 body[data-work-mode="work"] main.workspace>[data-active-work]>.module-agent-tools{display:block}
 body[data-work-mode="work"] footer{display:block}
}
@media (max-width:760px){
 .workspace-header{padding-left:max(10px,env(safe-area-inset-left,0px));padding-right:max(10px,env(safe-area-inset-right,0px));padding-top:env(safe-area-inset-top,0px);height:auto;min-height:calc(68px + env(safe-area-inset-top,0px));gap:6px}
 .workspace-modes{min-width:0;padding:3px}
 .workspace-modes button{min-width:58px;min-height:44px;padding:8px;font-size:13px}
 #sidebarToggle,.header-locale-tools .international-open,.header-account .avatar{width:44px;height:44px;min-width:44px}
 .header-locale-tools{gap:4px;min-width:0}
 .header-account{padding:0;min-height:44px}
 .workspace{padding-left:max(12px,env(safe-area-inset-left,0px));padding-right:max(12px,env(safe-area-inset-right,0px));min-width:0}
 .workspace>section,.workspace .card,.workspace .fields>*,.workspace .grid>*,.workspace .grid3>*{min-width:0;max-width:100%;box-sizing:border-box}
 .workspace :is(input,select,textarea){max-width:100%;font-size:16px;box-sizing:border-box}
 .workspace :is(button,.primary,.secondary){min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
 .workspace .fields,.workspace .grid,.workspace .grid3{grid-template-columns:minmax(0,1fr)}
 .workspace :is(table,.portfolio-table){display:block;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 .workspace :is(pre,.source,.msg){overflow-wrap:anywhere;word-break:normal}
 .workspace pre{white-space:pre-wrap}
 .workspace :is(img,video,canvas,iframe){max-width:100%}
 body[data-work-mode="chat"] main.workspace{height:auto;min-height:0;padding-top:8px;padding-bottom:max(8px,env(safe-area-inset-bottom,0px))}
 body[data-work-mode="chat"] #copilot{height:var(--work-height,calc(100dvh - 120px));min-height:0}
 body[data-work-mode="chat"] #copilot>.card{height:auto;min-height:0;flex:1;overflow:visible}
 #copilot .compose{flex-shrink:0}
 #copilot .compose textarea{font-size:16px}
 #copilot #sendChat,#copilot .composer-voice,#copilot .attachment-plus{width:44px;height:44px;min-width:44px;min-height:44px}
 .sidebar{padding-bottom:max(16px,env(safe-area-inset-bottom,0px));max-height:100dvh}
 .sidebar .nav{overscroll-behavior-y:contain}
 .sidebar-tools>summary{min-height:44px;box-sizing:border-box}
 dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;box-sizing:border-box}
}
@media (max-width:760px) and (max-height:600px){
 body[data-work-mode="chat"] #copilot .chat-access{padding:4px;margin-bottom:4px;gap:0}
 body[data-work-mode="chat"] #chatAccessText{display:none}
 body[data-work-mode="chat"] #copilot .composer-note{display:none}
 body[data-work-mode="chat"] #copilot .compose{padding:6px 10px}
 body[data-work-mode="chat"] #copilot .compose textarea{min-height:32px}
}
