@layer legacy, theme, base, components, utilities;
@layer legacy {
/* Mobile shell (<=760px): full-screen chat, conversation list as a left drawer. */
.nav-toggle{display:none}
@media(max-width:760px){
  html body,html body:has(.workspace-screen:not([hidden])){display:flex;flex-direction:column;grid-template-rows:none;grid-template-columns:none;height:100dvh;overflow:hidden}
  html body main,html body .workspace-screen{flex:1 1 0;min-height:0;width:100%;padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
  html body aside,html body:has(.workspace-screen:not([hidden])) aside{position:fixed;inset:0 auto 0 0;z-index:100;width:min(86vw,340px);display:flex;flex-direction:column;grid-template-columns:none;grid-template-rows:none;gap:12px;padding:max(16px,env(safe-area-inset-top)) 14px max(16px,env(safe-area-inset-bottom));border:0;border-right:1px solid var(--line);box-shadow:0 0 40px #0005;overflow-y:auto;overscroll-behavior:contain;transform:translateX(-104%);visibility:hidden;transition:transform .22s cubic-bezier(.32,.72,0,1),visibility 0s .22s}
  html body[data-nav-open][data-nav-open] aside{transform:none;visibility:visible;transition:transform .22s cubic-bezier(.32,.72,0,1),visibility 0s}
  html body[data-nav-open]::after{content:"";position:fixed;inset:0;z-index:90;background:#0006;animation:nav-fade .2s ease-out}
  @keyframes nav-fade{from{opacity:0}}
  body aside>*{flex-shrink:0}
  body aside #search{display:block}
  body aside footer{display:none}
  body aside nav,body aside .workspace-tree{flex:1 0 auto;min-height:120px;display:block;overflow:visible;max-height:none}
  body aside nav button{width:100%;max-width:none;margin-bottom:4px}
  body aside #new{justify-self:auto;width:100%;min-height:44px}
  html body .nav-toggle{display:inline-grid;place-items:center;flex:0 0 44px;box-sizing:border-box;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border-radius:10px;color:var(--text)}
  body .workspace-screen>header,body main>header{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:max(10px,env(safe-area-inset-top)) 0 8px}
  body .workspace-screen>header .chat-heading-identity{flex:1 1 0;min-width:0;order:1}
  body .workspace-screen>header .chat-heading-controls{display:contents}
  body .workspace-screen>header .chat-heading-controls>button{order:2;flex:0 0 auto;grid-column:auto;grid-row:auto}
  body .workspace-screen>header .chat-heading-controls>.agent-picker{order:3;flex:1 1 calc(50% - 4px);min-width:0;max-width:none;width:auto;grid-column:auto;grid-row:auto}
  body .workspace-screen>header .chat-heading-controls>.agent-picker select{width:100%}
  body .workspace-screen>header h1,body main>header h1{font-size:18px;flex:1 1 0}
  body main>header .actions{margin-left:auto}
  body .workspace-content{padding:12px 0}
  body .ui-composer-host{padding:6px 0 max(10px,env(safe-area-inset-bottom))}
  body #latest{bottom:calc(150px + env(safe-area-inset-bottom))}
  body main .hint{display:none}
  body main #composer{margin-bottom:max(8px,env(safe-area-inset-bottom))}
}
@media(prefers-reduced-motion:reduce){html body aside{transition:none!important}html body[data-nav-open]::after{animation:none}}

}
