#mobile-toolbar { display:none; }
#mobile-network { position:fixed;top:0;left:0;right:0;z-index:20;background:#fff4df;color:#8a5c20;text-align:center;font-size:12px; }
#mobile-network:empty { display:none; }
@media(max-width:800px) {
  html { height:100%;overflow:hidden;overscroll-behavior:none; }
  body { position:fixed;left:0;top:0;overflow:hidden;overscroll-behavior:none;display:flex;flex-direction:column;width:100%;height:100dvh;min-width:0;padding-top:env(safe-area-inset-top); }
  #mobile-toolbar { display:flex;flex-shrink:0;align-items:center;gap:8px;height:52px;padding:8px 14px;border-bottom:1px solid #e4eaee;background:white; }
  #mobile-toolbar strong { margin-right:auto;font-size:16px;color:#224474; }
  #mobile-toolbar button { padding:7px 10px;min-height:36px; }
  body.auth-locked #mobile-toolbar { visibility:hidden; }
  body>.sidebar { height:auto;display:block;flex-shrink:0;overflow:visible;padding:8px 10px;border:0;border-bottom:1px solid #e3e6eb;background:#f5f6f8; }
  .sidebar>.brand,.sidebar>#home,.sidebar>.eyebrow { display:none; }
  #slots { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;flex:none; }
  #slots .slot { padding:9px 7px;margin:0;min-height:42px;border-radius:9px; }
  #slots .slot strong { font-size:12px;gap:3px;overflow:hidden;white-space:nowrap; }
  #slots .slot p,#slots .slot small { display:none; }
  body>#work-area { height:auto;flex:1;min-height:0;min-width:0;overflow:hidden; }
  #work-area>main:has(.overview) { overflow:auto; }
  .overview { padding:24px 18px; }
  .overview h1 { font-size:25px; }
  .grid { margin:22px 0;gap:10px; }
  .grid .slot { padding:13px;min-height:130px; }
  .summary { margin-top:20px; }
  .chat { min-height:0; }
  .chat-header { padding:10px 14px;gap:6px;flex-shrink:0; }
  .chat-header h2 { font-size:16px; }
  .chat-header small { font-size:10px; }
  #restart { padding:7px;font-size:11px; }
  .badge { padding:5px 6px;font-size:10px; }
  #messages { min-height:0;padding:16px 14px;overscroll-behavior:contain; }
  .message { padding:12px;margin-bottom:15px; }
  .message.assistant { padding:8px 0 15px; }
  #composer { padding:9px 12px max(10px,env(safe-area-inset-bottom));flex-shrink:0; }
  #draft { height:76px;max-height:24vh;padding:10px;font-size:16px; }
  #composer #send { display:none; }
  .compose-footer:not(:has(#stop)) { display:none; }
  .compose-footer { margin-top:7px; }
  .compose-footer>small { display:none; }
  .compose-footer>div { margin-left:auto; }
  .sidebar>.files { display:none;position:absolute;inset:110px 0 0;z-index:7;border:0;background:#fafbfc;padding-bottom:env(safe-area-inset-bottom); }
  body.files-open .sidebar>.files { display:flex; }
  .files header { padding:14px 18px; }
  #tree { padding:12px 15px;min-height:100px;flex:1; }
  .file { font-size:14px;min-height:40px; }
  summary { font-size:14px;min-height:32px; }
  .download-file { min-width:40px;min-height:40px; }
  .files .preview { flex:0 1 30%;min-height:70px;padding:12px 18px; }
  .sidebar>.sidebar-bottom { display:none;position:absolute;z-index:8;top:52px;right:10px;width:min(320px,calc(100vw - 20px));background:#fff;padding:14px;border:1px solid #dce0e6;border-radius:12px;box-shadow:0 10px 40px #19263822; }
  body.menu-open .sidebar>.sidebar-bottom { display:grid; }
  .sidebar-bottom .nav { min-height:44px; }
  .sidebar-bottom .demo { margin:10px 6px; }
  .sidebar-bottom>small { display:none; }
  #service-error { left:10px;right:10px;top:112px;max-height:100px;overflow:auto;z-index:9; }
  .login-screen { position:absolute;display:flex;flex-direction:column;overflow:auto;padding:24px 22px max(24px,env(safe-area-inset-bottom)); }
  .login-intro { display:block;padding:10px 0 16px;background:none; }
  .login-intro .brand { position:static;margin:0 0 10px;font-size:20px; }
  .login-intro h1 { font-size:27px;line-height:1.5;margin:10px 0; }
  .login-intro p,.login-intro>small { display:none; }
  .login-form { width:100%;max-width:400px;align-self:center;flex-shrink:0; }
  .login-form .eyebrow { margin-top:8px; }
  .login-form h2 { font-size:22px; }
  .login-form input { font-size:16px; }
  .login-form label { margin-top:12px; }
  dialog,#history-dialog,#instructions-dialog { width:calc(100vw - 24px);max-height:calc(var(--app-height,100dvh) * .85);padding:18px; }
  #instructions-text { font-size:16px;min-height:160px; }
  .dialog-actions { flex-wrap:wrap; }
}
.voice-input { display:flex;align-items:center;gap:10px;margin-top:8px;min-width:0; }
.voice-toggle { flex-shrink:0;padding:7px 10px;font-size:12px; }
.voice-input small { font-size:10px;line-height:1.5;overflow-wrap:anywhere; }
.voice-input.recording .voice-toggle { background:#e7ecf4;border-color:#869cbc;color:#1f3e6b; }
@media(max-width:800px) {
  .voice-toggle { touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;min-height:42px;min-width:110px; }
  .voice-input { gap:8px;margin-top:6px; }
  .voice-input small { max-height:32px;overflow:auto; }
}

@media(max-width:800px) { .voice-input { display:none; } }
@media(max-width:800px) {
  #chat-pending-uploads { max-height:90px; }
  #chat-draft-uploads { max-height:64px;gap:5px;margin-bottom:5px; }
  #composer-upload-tools { margin-bottom:5px; }
  #composer-upload-tools button { min-height:30px;padding:4px 8px;font-size:12px; }
  .chat-file { font-size:11px;padding:5px 7px; }
  .chat-file-name { max-width:170px; }
}

@media(max-width:800px) {
  #work-area.file-open { position:static; }
  #work-area.file-open #file-preview { position:absolute;inset:0;z-index:30;width:100%;height:100%;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom); }
  #work-area #file-splitter { display:none; }
  #file-preview .file-preview-header { padding:12px; }
  #file-preview .file-preview-actions button { min-height:40px; }
  #fullscreen-file-preview { display:none; }
  #file-preview #file-content { padding:18px; }
}

@media(max-width:800px) { #file-preview #file-content.office-content { padding:0; } }
@media(max-width:800px){
 #mobile-toolbar{border-bottom-color:#dce4ef;background:#fff}
 #mobile-toolbar strong{display:flex;align-items:center;gap:8px;color:#004685}
 #mobile-toolbar .company-logo{width:30px;height:28px;border-radius:4px}
 .login-intro{background:none}
 .login-intro .brand{display:flex;align-items:center;gap:10px}
 .login-intro .company-logo{width:45px;height:41px}
 body>.sidebar{background:#f4f6fa;border-bottom-color:#dce4ef}
}
