/* Phone layout also applies to phones in landscape, independent of desktop CSS. */
.mobile-model-picker{display:none}.mobile-sheet{display:none}
html.mobile-layout{background:#fff}
.mobile-layout:has(#shell:not([hidden])) body{position:fixed;inset:0;overflow:hidden;overscroll-behavior:none}
.mobile-layout #shell{position:fixed;top:var(--mobile-top,0px);left:var(--mobile-left,0px);width:var(--mobile-width,100%);height:var(--mobile-height,100dvh);overflow:hidden}
.mobile-layout #shell .sidebar{position:fixed;inset:var(--mobile-top,0px) auto auto var(--mobile-left,0px);z-index:40;width:min(340px,calc(100vw - 48px));height:var(--mobile-height,100dvh);padding:calc(12px + env(safe-area-inset-top)) 14px env(safe-area-inset-bottom);transform:translateX(-100%);transition:transform .2s ease;box-shadow:12px 0 50px #1f382120;align-items:stretch;background:#f5f7f5}
.mobile-layout #shell:not(.nav-open) .sidebar{box-shadow:none}
.mobile-layout #shell.nav-open .sidebar{transform:translateX(0)}
.mobile-layout .sidebar .brand{display:flex;font-size:22px}.mobile-layout .sidebar .brand-name{display:block}
.mobile-layout .sidebar .workspace-name{display:block;font-size:12px;margin:10px 8px 0}
.mobile-layout .sidebar #sidebar-toggle{width:44px;height:44px}
.mobile-layout .sidebar #new-chat{height:44px;margin:12px 0 6px;justify-content:center;font-size:15px}
.mobile-layout .sidebar #new-chat span,.mobile-layout .sidebar .nav span{display:inline}
.mobile-layout .sidebar .nav{height:44px;font-size:15px;justify-content:flex-start;padding:10px 12px}
.mobile-layout .sidebar .sidebar-tools{display:block}.mobile-layout .sidebar-tools>summary{padding:12px;font-size:14px}
.mobile-layout .sidebar .history-heading{display:flex;font-size:13px;margin-top:10px;min-height:36px}
.mobile-layout .sidebar .history-panel:not([hidden]){display:flex}
.mobile-layout .history-search{height:44px;font-size:16px;padding:10px 12px}
.mobile-layout .history button{min-height:44px;padding:11px 12px;font-size:14px}
.mobile-layout .sidebar .sidebar-bottom{flex-direction:row;padding:10px 6px;min-height:64px}
.mobile-layout .sidebar-bottom>div:not(.avatar){display:block}.mobile-layout .sidebar-bottom strong{font-size:13px}
.mobile-layout .sidebar-bottom>button{width:44px;height:44px;margin-left:auto}
.mobile-layout #nav-backdrop:not([hidden]){display:block;position:fixed;inset:0;background:#17352955;z-index:35;backdrop-filter:blur(2px)}
.mobile-layout #shell #main-content header{display:flex;height:calc(58px + env(safe-area-inset-top));padding:env(safe-area-inset-top) max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));border-bottom:0;gap:8px;flex-shrink:0;align-items:center}
.mobile-layout #mobile-menu{display:grid;width:44px;height:44px;font-size:21px;flex-shrink:0}
.mobile-layout .sidebar-reopen{display:none!important}
.mobile-layout #main-content:has(#view-chat:not([hidden])) header>div:not(.header-actions){display:none}
.mobile-layout #main-content:has(#view-chat:not([hidden])) .mobile-model-picker{display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:44px;padding:2px 0;border-radius:12px}
.mobile-model-title{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;font-weight:600}
.mobile-model-title::after{content:'⌄';margin-left:6px;font-size:13px;color:var(--muted)}
.mobile-model-scope{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:1.3;color:var(--muted)}
.mobile-layout #main-content header .header-actions{margin-left:auto;flex-shrink:0}
.mobile-layout #header-new-chat{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;background:none;box-shadow:none}
.mobile-layout #header-new-chat span,.mobile-layout #mode-badge{display:none}
.mobile-layout #header-new-chat .icon{width:24px;height:24px}
.mobile-layout #view-chat,.mobile-layout #view-chat.chat-start{display:flex;flex-direction:column;min-height:0}
.mobile-layout #view-chat[hidden]{display:none!important}
.mobile-layout #messages,.mobile-layout .chat-start #messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:16px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));-webkit-overflow-scrolling:touch}
.mobile-layout .chat-start #messages{display:flex;flex-direction:column;justify-content:center}
.mobile-layout .welcome{padding:0;max-width:520px;width:100%;margin:0 auto}
.mobile-layout .welcome h1{font-size:25px;line-height:1.45;letter-spacing:-.5px;font-weight:500}
.mobile-layout .suggestions{display:flex;overflow-x:auto;gap:8px;margin:24px -4px 0;padding:2px 4px 6px;scrollbar-width:none;max-width:100%}
.mobile-layout .suggestion{flex:1 0 auto;min-height:44px;padding:12px 16px;justify-content:center;border-radius:16px;background:#f8faf7}
.mobile-layout .suggestion strong{font-size:12px}
.mobile-layout .suggestion .icon,.mobile-layout .suggestion span{display:none}
.mobile-layout .composer-area,.mobile-layout .chat-start .composer-area{width:100%;flex-shrink:0;align-self:stretch;padding:8px max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:#fff}
.mobile-layout #chat-form{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;grid-template-rows:auto auto;align-items:end;gap:0 4px;padding:6px;border-radius:28px;background:#f4f6f4;border:1px solid #edf0ed;box-shadow:none;min-height:58px}
.mobile-layout #chat-attachments{grid-row:1;grid-column:1/-1;max-width:100%;overflow-x:auto;flex-wrap:nowrap;padding:4px 4px 8px}
.mobile-layout #chat-attachments .attachment-tile{flex-shrink:0;background:#fff}
.mobile-layout #question{grid-row:2;grid-column:2;width:100%;min-width:0;min-height:36px;max-height:120px;height:36px;padding:4px 0;font-size:16px;line-height:1.4;background:transparent;border-radius:0;align-self:center;overflow-y:auto}
.mobile-layout #question::placeholder{font-size:15px}
.mobile-layout .composer-bottom{display:contents}
.mobile-layout #attach-file,.mobile-layout #send,.mobile-layout #stop{grid-row:2;width:44px;height:44px;min-width:44px;padding:0;margin:0;font-size:0;border:0;border-radius:50%;display:grid;place-items:center;align-self:end;box-shadow:none;transform:none}
.mobile-layout #attach-file{grid-column:1;background:transparent;color:var(--ink)}
.mobile-layout #attach-file::before{content:'+';font-size:29px;font-weight:300}
.mobile-layout #send,.mobile-layout #stop{grid-column:3;background:var(--green);color:#fff}
.mobile-layout #send::before{content:'↑';font-size:24px;font-weight:600}
.mobile-layout #stop::before{content:'■';font-size:15px}
.mobile-layout #stop:not([hidden])+#send{display:none}
.mobile-layout .message{margin-bottom:24px;font-size:15px;line-height:1.8}
.mobile-layout .message.user{max-width:88%;padding:10px 15px;background:#f0f3ee;border-radius:20px;font-size:15px}
.mobile-layout .message-label{font-size:12px}.mobile-layout .message-body.rich{font-size:15px}
.mobile-layout .message-actions button,.mobile-layout .message-sources summary{min-height:40px;padding:8px 4px}
.mobile-layout .message-body pre{max-width:100%;overflow-x:auto}.mobile-layout .message-body table{font-size:13px}
.mobile-layout #chat-warning{font-size:12px}.mobile-layout #chat-warning button{min-height:40px}
.mobile-layout .mobile-sheet[open]{display:flex;flex-direction:column;position:fixed;inset:auto 0 var(--mobile-bottom,0px);margin:0;width:100%;max-width:none;max-height:calc(var(--mobile-height,100dvh) - 12px);border:0;border-radius:24px 24px 0 0;padding:8px max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));background:#fff;overflow-y:auto}
.mobile-sheet::backdrop{background:#142d2755;backdrop-filter:blur(3px)}
.sheet-handle{min-height:20px;display:grid;place-items:center;touch-action:none}
.sheet-handle::before{content:'';width:38px;height:4px;border-radius:5px;background:#d9e1db}
.mobile-sheet .dialog-head{margin:8px 0 18px}.mobile-sheet .icon-button{width:44px;height:44px}
.mobile-sheet .dialog-head,.mobile-sheet .sheet-handle{flex-shrink:0}
.mobile-sheet-body{min-height:0;overflow-y:auto;overscroll-behavior:contain}
.mobile-layout .mobile-sheet .chat-controls{display:flex;flex-direction:column;align-items:stretch;gap:18px;border:0;padding:0;background:none}
.mobile-layout .mobile-sheet .chat-controls label{display:flex;flex-direction:column;align-items:stretch;gap:8px;font-size:14px;min-width:0;max-width:none;flex:initial;white-space:normal;color:var(--ink)}
.mobile-sheet .chat-controls .sr-only{position:static;width:auto;height:auto;margin:0;clip:auto;overflow:visible;white-space:normal;font-size:13px;color:var(--muted)}
.mobile-layout .mobile-sheet .chat-controls select{width:100%;max-width:none!important;height:48px;min-width:0;font-size:16px;padding:10px 32px 10px 12px;border-radius:12px}
.mobile-layout .mobile-sheet .chat-controls .web-search-control{flex-direction:row;align-items:center;margin:0;gap:10px;min-height:44px;font-size:15px}
.mobile-sheet #web-search{width:22px;height:22px;accent-color:var(--green)}
.mobile-sheet-done{margin-top:24px;min-height:48px;font-size:15px;border-radius:14px;flex-shrink:0}
.mobile-layout .auth{display:block;min-height:100dvh}.mobile-layout .auth .intro{display:none}
.mobile-layout .auth-panel{padding:32px 24px;min-height:100dvh}.mobile-layout .auth-card{width:100%;max-width:400px}
.mobile-layout .auth-card:before{content:'Grovi Cloud';display:block;font-size:24px;font-weight:700;color:var(--green);margin-bottom:36px}
.mobile-layout input,.mobile-layout textarea,.mobile-layout select{font-size:16px}
.mobile-layout .auth-card input{min-height:48px}
.mobile-layout .content-view{padding:24px 16px;overscroll-behavior:contain}
.mobile-layout .metrics,.mobile-layout .settings-grid,.mobile-layout .billing-plans{grid-template-columns:1fr}
.mobile-layout .page-heading{gap:12px}.mobile-layout .page-heading h1{font-size:24px}
.mobile-layout .document-row{grid-template-columns:minmax(0,1fr) 85px;padding:16px;gap:10px}
.mobile-layout .document-row>small{display:none}.mobile-layout .doc-actions{grid-column:1/-1;padding-left:0;justify-content:flex-start;gap:16px}
.mobile-layout .table-heading{flex-wrap:wrap}.mobile-layout .table-heading>div{width:100%;flex-wrap:wrap;justify-content:flex-start}
.mobile-layout .upload-box{flex-wrap:wrap;padding:18px;gap:12px}
.mobile-layout .upload-box>.primary{margin-left:0;min-height:44px}
.mobile-layout #toast{bottom:calc(84px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);font-size:13px}
@media(prefers-reduced-motion:reduce){.mobile-layout .sidebar{transition:none}}
.mobile-layout.compact-viewport #messages .welcome h1{font-size:20px}.mobile-layout.compact-viewport .suggestions{display:none}
.mobile-layout.compact-viewport #question{max-height:max(36px,min(72px,calc(var(--mobile-height,100dvh) * .2)))}
.mobile-layout.compact-viewport .composer-area{padding-top:4px;padding-bottom:6px;max-height:calc(var(--mobile-height,100dvh) - 44px);overflow-y:auto;overscroll-behavior:contain}
.mobile-layout.compact-viewport #chat-warning{max-height:36px;overflow-y:auto;padding:4px 8px;margin-bottom:4px}
.mobile-layout.compact-viewport #chat-attachments{max-height:42px;padding:2px 4px}
.mobile-layout.compact-viewport #chat-attachments img{width:28px;height:28px}
.mobile-layout.compact-viewport #shell #main-content header{height:44px;padding-top:0}
.mobile-layout.tight-viewport.composer-focused #shell #main-content header{display:none}
.mobile-layout.tight-viewport.composer-focused .composer-area{max-height:var(--mobile-height,100dvh)}
.mobile-layout dialog[open]:not(.mobile-sheet),.mobile-layout #task-dialog[open],.mobile-layout #task-runs-dialog[open]{position:fixed;inset:var(--mobile-top,0px) 0 auto;margin:12px auto;max-height:calc(var(--mobile-height,100dvh) - 24px);overflow-y:auto}
