/* Mobile is a workspace in its own right. Desktop geometry stays in its page styles. */
.home-introduction { display:contents }
.mobile-home-welcome,.mobile-new-chat,.mobile-model-rail { display:none }

@media (max-width:760px) {
 html { scroll-padding-top:64px; -webkit-text-size-adjust:100% }
 body { --mobile-canvas:var(--surface); --mobile-fill:color-mix(in srgb,var(--ink) 5%,var(--surface)); --mobile-selected:color-mix(in srgb,var(--accent) 12%,var(--surface)); --mobile-composer-fill:color-mix(in srgb,var(--ink) 2%,var(--surface)); --mobile-composer-edge:color-mix(in srgb,var(--ink) 9%,var(--surface)) }
 :is(.monochrome-shell,.adm) { -webkit-tap-highlight-color:transparent }
 :is(.monochrome-shell,.adm) ::selection { background:var(--accent-soft); color:var(--ink) }
 :is(.monochrome-shell,.adm) :is(input,textarea) { caret-color:var(--accent); scroll-margin-block:76px }
 :is(.monochrome-shell,.adm) :is(button,a,input,textarea,select):focus-visible { outline:2px solid var(--accent); outline-offset:3px }
 :is(.monochrome-shell,.adm) :is(input,textarea):focus:not(:focus-visible) { outline:0; box-shadow:none }
 .monochrome-shell { height:var(--mobile-viewport-height,100dvh); min-height:0; background:var(--mobile-canvas) }
 .monochrome-shell .workspace { display:flex; flex-direction:column; min-height:0; height:100%; background:var(--mobile-canvas) }
 .monochrome-shell .workspace-header { --topbar-height:56px; min-height:56px; height:calc(56px + env(safe-area-inset-top)); flex:0 0 calc(56px + env(safe-area-inset-top)); padding:env(safe-area-inset-top) 8px 0; border:0; background:var(--mobile-canvas); box-shadow:none; position:relative }
 .monochrome-shell .workspace-heading { display:contents }
 .monochrome-shell #workspace-title { position:absolute; left:58px; right:58px; margin:0; text-align:center; font-size:16px; font-weight:600; line-height:24px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; pointer-events:none }
 .monochrome-shell .workspace-header .icon-btn { display:grid; place-items:center; width:44px; min-width:44px; height:44px; padding:0; border:0; background:transparent; color:var(--ink); border-radius:50% }
 .monochrome-shell .workspace-header #toggle-sidebar { display:none }
 .monochrome-shell .topbar-actions { margin-left:auto; gap:0 }
 .monochrome-shell .topbar-actions .mobile-new-chat { display:grid }
 .monochrome-shell .workspace-header .topbar-actions .icon-btn {width:44px;height:44px;min-width:44px;min-height:44px}
 .monochrome-shell .workspace-header .topbar-actions .mobile-new-chat:not([hidden]) {display:flex}
 .monochrome-shell #workspace-title {right:108px;text-align:left}
 .monochrome-shell.deepseek-chat #workspace-title {right:152px}
 .monochrome-shell #main { flex:1; min-height:0; width:100%; max-width:100%; background:var(--mobile-canvas) }
 .monochrome-shell #main:not(.chat-main):not(.image-studio-main):not(.novels-main) { overflow:auto; overscroll-behavior-y:contain }
 .monochrome-shell #main.chat-main,.monochrome-shell #main.image-studio-main { height:auto; overflow:hidden }
 .monochrome-shell .chat-work { display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden; padding:0 }
 .monochrome-shell .chat-scroll { flex:1; min-height:0; overflow:auto; overscroll-behavior-y:contain; padding:18px 18px 10px }

 /* New conversation: a quiet centre, one persistent composer, a searchable catalogue. */
 .monochrome-shell .home-view .home-surface,.monochrome-shell .home-view .home-hero,.monochrome-shell .home-view #home-composer-slot { display:contents }
 .monochrome-shell .home-view .home-introduction { flex:1; min-height:120px; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:20px 20px 12px; overflow:auto }
 .monochrome-shell .home-view .home-brand { flex:none; justify-content:center; gap:9px; margin:0 0 18px }
 .monochrome-shell .home-view .home-brand-icon { width:38px; height:38px; box-shadow:none }
 .monochrome-shell .home-view .home-brand-name { font-size:25px; letter-spacing:-.025em }
 .monochrome-shell .mobile-home-welcome { display:block; text-align:center }
 .mobile-home-welcome h2 { margin:0; font-size:22px; line-height:1.4; font-weight:600; letter-spacing:-.025em }
 .mobile-home-welcome p { margin:12px 0 8px; font-size:13px; line-height:1.7; color:var(--muted) }
 .mobile-home-welcome .mobile-model-browser { display:inline-flex; align-items:center; gap:7px; min-height:44px; padding:8px 14px; border:0; border-radius:22px; background:transparent; color:var(--ink); font:inherit; font-size:13px; cursor:pointer }
 .mobile-model-browser svg { transform:rotate(-90deg) }
 .monochrome-shell .home-view .home-catalog,.monochrome-shell .home-view .chat-scroll { display:none }
 .monochrome-shell .home-view .home-shortcuts { flex:none; margin:0 14px 4px; padding:0 0 4px; gap:5px; max-width:calc(100% - 28px); min-height:0; mask-image:linear-gradient(to right,#000 calc(100% - 12px),transparent) }
 .monochrome-shell .home-view .home-shortcut { min-height:44px; max-width:180px; padding:7px 10px; border:0; border-radius:12px; background:transparent; font-size:12px }
 .monochrome-shell .home-view .home-shortcut[aria-pressed=true],.monochrome-shell .home-view .home-shortcut.active { background:var(--mobile-fill); color:var(--ink) }

 /* Model choice belongs above the draft; the bottom row is reserved for actions. */
 .monochrome-shell .home-view .home-shortcuts { display:none }
 .monochrome-shell :is(.home-view,.model-chat-view) .mobile-model-rail { display:flex; flex:none; align-items:center; gap:7px; min-width:0; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; padding:3px 25px 7px 2px; margin:0 0 5px; mask-image:linear-gradient(to right,#000 calc(100% - 20px),transparent) }
 .mobile-model-rail::-webkit-scrollbar { display:none }
 .monochrome-shell .mobile-model-pill,.monochrome-shell .mobile-model-all { display:inline-flex; flex:none; align-items:center; justify-content:flex-start; gap:6px; min-height:38px; max-width:210px; padding:8px 11px; border:1px solid color-mix(in srgb,var(--ink) 5%,transparent); border-radius:11px; background:color-mix(in srgb,var(--ink) 2%,var(--surface)); color:var(--muted); font:inherit; font-size:11px; line-height:20px; white-space:nowrap }
 .monochrome-shell .mobile-model-pill>span:last-child { overflow:hidden; text-overflow:ellipsis; min-width:0 }
 .monochrome-shell .mobile-model-pill .identity-image { width:18px; height:18px; flex:0 0 18px; border-radius:5px }
 .monochrome-shell .mobile-model-pill.is-active { background:#fff; color:var(--ink); border-color:rgb(0 0 0 / .05); box-shadow:0 2px 5px rgb(0 0 0 / .07); font-weight:500 }
 html[data-theme=dark] .monochrome-shell .mobile-model-pill.is-active { background:color-mix(in srgb,var(--ink) 12%,var(--surface)); border-color:rgb(255 255 255 / .08); box-shadow:0 2px 5px rgb(0 0 0 / .2) }
 .monochrome-shell .mobile-model-pill:hover,.monochrome-shell .mobile-model-all:hover { color:var(--ink) }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-bottom #composer-model { display:none }
 .monochrome-shell .home-view .home-brand { align-items:center; gap:10px }
 .monochrome-shell .home-view .home-brand-icon { width:36px; height:36px; display:grid; place-items:center }
 .monochrome-shell .home-view .home-brand-icon :is(img,svg) { width:100%; height:100%; object-fit:cover; object-position:center }
 .monochrome-shell .home-view .home-brand .brand-wordmark { line-height:1.15; align-self:center }
 .monochrome-shell .mobile-home-welcome h2 { font-weight:600; letter-spacing:-.025em }
 .monochrome-shell .mobile-home-welcome .mobile-model-browser { margin-top:6px; min-height:36px; padding:6px 16px; border-radius:999px; background:color-mix(in srgb,var(--ink) 4%,var(--surface)); color:var(--muted); font-size:12px; font-weight:500 }
 .monochrome-shell .mobile-model-browser:hover { background:var(--mobile-fill); color:var(--ink) }

 /* Chat and Agent share one uncluttered, thumb-friendly input surface. */
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-zone { position:relative; flex:none; width:100%; max-width:100%; margin:0; padding:8px 10px max(8px,env(safe-area-inset-bottom)); background:var(--mobile-canvas); border:0; box-shadow:none }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer { margin:0; width:100%; padding:12px 8px 6px; border:1px solid var(--mobile-composer-edge); border-radius:24px; background:var(--mobile-composer-fill); box-shadow:0 4px 20px -4px rgb(0 0 0 / .05); outline:0 }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer:focus-within { border:1px solid var(--mobile-composer-edge); box-shadow:0 4px 20px -4px rgb(0 0 0 / .05); background:var(--mobile-composer-fill) }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer textarea { padding:2px 8px 6px; min-height:44px; max-height:168px; font-size:16px; line-height:1.6; border:0; background:transparent; box-shadow:none; outline:0 }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-bottom { display:flex; flex-wrap:nowrap; justify-content:flex-start; align-items:center; gap:0; margin-top:2px }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-tools { display:contents }
 .monochrome-shell :is(.home-view,.model-chat-view) :is(.attachment-add,.composer-tools>.icon-btn) { display:grid; place-items:center; width:36px; min-width:36px; min-height:44px; height:44px; padding:0; background:transparent; border:0; border-radius:50%; color:var(--ink) }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-actions { display:contents }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-model { display:inline-flex; flex:0 1 auto; justify-content:flex-start; min-width:0; max-width:none; margin-right:auto; min-height:44px; padding:5px 6px; border:0; border-radius:12px; background:transparent; color:var(--ink); font-size:11px; box-shadow:none; gap:4px }
 .monochrome-shell #active-model { min-width:0; gap:5px; display:flex; align-items:center }
 .monochrome-shell #active-model>span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0 }
 .monochrome-shell #active-model .identity-image { width:18px; height:18px; flex:0 0 18px; border-radius:5px }
 .monochrome-shell .composer-model>svg { flex:none; width:12px }
 .monochrome-shell :is(.home-view,.model-chat-view) .send-btn { flex:0 0 44px; width:44px; min-width:44px; height:44px; min-height:44px; border-radius:50%; margin:0 0 0 auto; padding:4px; background-clip:content-box; box-shadow:none }
 .monochrome-shell :is(.home-view,.model-chat-view) .send-btn:not(:disabled) { background:var(--ink); color:var(--surface) }
 .monochrome-shell :is(.home-view,.model-chat-view) .send-btn:not(:disabled):hover { background:color-mix(in srgb,var(--ink) 85%,var(--surface)) }
 .monochrome-shell :is(.home-view,.model-chat-view) .send-btn:disabled { background:color-mix(in srgb,var(--ink) 12%,var(--surface)); color:color-mix(in srgb,var(--ink) 40%,var(--surface)) }
 .monochrome-shell :is(.home-view,.model-chat-view) .send-btn[data-mode=stop]:disabled { background:var(--ink); color:var(--surface); opacity:.65 }
 .monochrome-shell .chat-mode-switch { flex:none; gap:0; margin:0; padding:2px; border:0; border-radius:22px; background:transparent; box-shadow:none }
 .monochrome-shell .chat-mode-switch button { display:grid; place-items:center; width:36px; min-width:36px; height:40px; min-height:40px; padding:0; border:0; border-radius:50%; box-shadow:none }
 .monochrome-shell .chat-mode-switch button>span { display:none }
 .monochrome-shell .chat-mode-switch button { position:relative; isolation:isolate; background:transparent }
 .monochrome-shell .chat-mode-switch button::before { content:""; position:absolute; width:32px; height:32px; top:50%; left:50%; transform:translate(-50%,-50%); border-radius:50%; z-index:-1; pointer-events:none }
 .monochrome-shell .chat-mode-switch button:is([aria-pressed=true],.is-active) { background:transparent; color:var(--surface) }
 .monochrome-shell .chat-mode-switch button:is([aria-pressed=true],.is-active)::before { background:var(--ink) }
 .monochrome-shell .composer-meta { display:none }
 .monochrome-shell .composer-disclaimer { padding:0; margin:6px 0 0; font-size:10px; line-height:15px; color:var(--muted); text-align:center }
 .monochrome-shell #stream-status:empty { display:none }
 .monochrome-shell #stream-status:not(:empty) { position:absolute; bottom:calc(100% + 3px); right:18px; font-size:11px; background:var(--surface); padding:3px 8px; border-radius:12px }
 .monochrome-shell .model-intro { border:0; background:transparent; padding:12px 0 24px; box-shadow:none }
 .monochrome-shell .model-intro-footer { border:0; padding-top:6px }
 .monochrome-shell .message { max-width:100%; margin:0 0 26px }
 .monochrome-shell .message.user .message-content { border:0; border-radius:20px; background:var(--mobile-fill) }
 .monochrome-shell .message.assistant .message-content { border:0; background:transparent; padding-inline:0 }
 .monochrome-shell .message .markdown { font-size:16px; line-height:1.8; overflow-wrap:anywhere }
 .monochrome-shell .message-actions { gap:5px; flex-wrap:wrap }
 .monochrome-shell .message-actions button { min-height:40px; min-width:40px }
 .monochrome-shell .code-block { border:0; border-radius:16px; box-shadow:none; max-width:100% }
 .monochrome-shell .rich-table-wrap { border:0; border-radius:12px; max-width:100%; overflow:auto }
 .monochrome-shell .agent-step,.monochrome-shell .agent-artifact { border:0; border-radius:12px; background:var(--mobile-fill) }

 /* Navigation is a drawer; history rows never get an extra enclosing frame. */
 .monochrome-shell .workspace-sidebar { max-width:calc(100vw - 40px); border:0; box-shadow:12px 0 38px #0002; background:var(--surface) }
 .monochrome-shell .workspace-rail { border:0; background:var(--surface) }
 .monochrome-shell .workspace-history-panel { background:var(--surface); border:0; padding:16px 12px max(12px,env(safe-area-inset-bottom)) }
 .monochrome-shell .sidebar-brand-row { border:0; padding-bottom:4px }
 .monochrome-shell .history-search { border:0; height:44px; border-radius:14px; background:var(--mobile-fill); box-shadow:none }
 .monochrome-shell .history-filters { gap:8px; padding-block:4px }
 .monochrome-shell .history-filters button { min-height:44px }
 .monochrome-shell .session-card { border:0; box-shadow:none; background:transparent; border-radius:12px; margin-bottom:4px }
 .monochrome-shell .session-card.selected { background:var(--mobile-selected) }
 .monochrome-shell .sidebar-footer { border:0; background:transparent; padding-top:12px }

 /* Image studio: a compact canvas with controls grouped by purpose. */
 .monochrome-shell .image-studio { height:100%; position:relative }
 .monochrome-shell .image-studio-top { position:absolute; z-index:2; top:0; right:8px; min-height:44px; padding:0; border:0; background:transparent }
 .monochrome-shell .image-studio-top>div { display:none }
 .monochrome-shell .image-studio-top-refresh { width:44px; height:44px; border-radius:50%; background:var(--surface) }
 .monochrome-shell .image-studio-feed { padding:34px 16px 8px }
 .monochrome-shell .image-studio-welcome { padding:24px 0 12px; max-width:100% }
 .monochrome-shell .image-studio-welcome h2 { font-size:27px; line-height:1.35; letter-spacing:-.025em; font-weight:600 }
 .monochrome-shell .image-studio-welcome>p { margin:14px 0 24px; font-size:13px; line-height:1.7; max-width:28em }
 .monochrome-shell .image-studio-suggestions { display:flex; gap:10px; overflow-x:auto; margin-inline:-16px; padding:0 16px 10px; scroll-snap-type:x proximity; scrollbar-width:none }
 .monochrome-shell .image-studio-inspiration { flex:0 0 146px; min-width:0; height:180px; border:0; border-radius:16px; box-shadow:none; scroll-snap-align:start }
 .monochrome-shell .image-studio-welcome-note { font-size:10px; padding-top:4px }
 .monochrome-shell .image-studio-composer-wrap { padding:8px 10px max(8px,env(safe-area-inset-bottom)); border:0; box-shadow:none; background:var(--surface) }
 .monochrome-shell .image-studio-composer { border:0; box-shadow:none; background:var(--mobile-fill); border-radius:24px; padding:14px 10px 8px }
 .monochrome-shell .image-studio-composer:focus-within { border:0; box-shadow:none }
 .monochrome-shell #image-studio-prompt { min-height:50px; max-height:120px; height:auto; padding:0 6px; font-size:16px; line-height:1.6; border:0; outline:0; box-shadow:none }
 .monochrome-shell .image-studio-composer-bottom { display:grid; grid-template-columns:36px minmax(0,1fr) 44px; align-items:end; gap:4px }
 .monochrome-shell .image-studio-composer-bottom>.attachment-add { grid-row:1; align-self:end }
 .monochrome-shell .image-studio-controls { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:0 6px; min-width:0 }
 .monochrome-shell .image-studio-model-picker { width:100%; min-width:0 }
 .monochrome-shell .image-studio-model-trigger { max-width:100%; justify-content:flex-start; min-height:40px; padding:4px 2px; gap:5px; background:transparent; border:0; box-shadow:none; font-size:12px }
 .monochrome-shell [data-image-model-name] { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
 .monochrome-shell .image-studio-size-trigger { min-height:40px; padding:4px 2px; background:transparent; border:0; box-shadow:none; font-size:11px }
 .monochrome-shell .image-studio-sharing { min-height:40px; margin:0; padding:0 2px; gap:4px; font-size:11px; border:0; background:transparent }
 .monochrome-shell .image-studio-sharing>svg { display:none }
 .monochrome-shell .image-studio-count { min-height:40px; font-size:11px; gap:2px; padding:0 2px; background:transparent; border:0 }
 .monochrome-shell .image-studio-count select { min-height:40px; font-size:12px; width:auto; padding:4px 20px 4px 3px; background-color:transparent; border:0; box-shadow:none }
 .monochrome-shell .image-studio-submit { width:44px; height:44px; min-height:44px; padding:0; border-radius:50%; box-shadow:none }
 .monochrome-shell .image-studio-composer-foot { display:flex; justify-content:center; padding:6px 4px 0; font-size:10px; gap:6px }
 .monochrome-shell .image-studio-composer-foot>span:first-child,.monochrome-shell .image-studio-composer-foot>span:last-child { display:none }
 .monochrome-shell .image-studio-entry { gap:8px; margin-bottom:14px; padding-bottom:20px; border:0 }
 .monochrome-shell .image-studio-model-avatar { width:28px; height:28px; flex-basis:28px; border:0 }
 .monochrome-shell .image-studio-prompt { font-size:14px; line-height:1.75 }
 .monochrome-shell .image-studio-image { border:0; border-radius:16px; overflow:hidden }
 .monochrome-shell .image-studio-entry-actions { display:flex; flex-wrap:wrap; gap:5px; border:0 }
 .monochrome-shell .image-studio-entry-actions button { min-height:44px; border:0; background:transparent; padding:7px 9px; border-radius:12px }
 .monochrome-shell :is(.image-studio-model-popover,.image-studio-size-popover) { position:fixed; left:10px!important; right:10px!important; bottom:max(10px,env(safe-area-inset-bottom))!important; top:auto!important; width:auto!important; max-width:none; max-height:72dvh; overflow:auto; border:0; padding:16px; border-radius:24px; background:var(--paper); box-shadow:0 -10px 60px #0003; z-index:100 }
 .monochrome-shell .image-studio-model-search { border:0; border-radius:12px; background:var(--mobile-fill) }
 .monochrome-shell .image-studio-model-search input { font-size:16px }
 .monochrome-shell :is(.image-studio-model-option,.image-studio-size-option) { min-height:54px; border:0; border-radius:12px; padding:10px; margin-top:4px }
 .monochrome-shell :is(.image-studio-model-option,.image-studio-size-option)[aria-selected=true] { background:var(--mobile-selected) }

 /* Libraries and creation stages: open sections, no stacked outlines. */
 .monochrome-shell .cs-library.nv-library { padding:16px 18px max(32px,env(safe-area-inset-bottom)) }
 .monochrome-shell .cs-library-heading { margin-bottom:24px; gap:16px }
 .monochrome-shell .cs-library-heading h1 { font-size:25px; letter-spacing:-.025em; line-height:1.4 }
 .monochrome-shell .cs-library-heading p { max-width:30em; line-height:1.75 }
 .monochrome-shell .cs-library-actions { gap:8px }
 .monochrome-shell .cs-library-actions .nv-button { min-height:44px; border:0; border-radius:12px; background:var(--mobile-fill) }
 .monochrome-shell .cs-library-actions .nv-primary { background:var(--ink); color:var(--surface) }
 .monochrome-shell .cs-launch { gap:22px; margin-bottom:32px; border:0; border-radius:0; background:transparent; box-shadow:none }
 .monochrome-shell .cs-launch-copy { padding:18px; border:0; border-radius:20px; background:var(--mobile-fill); box-shadow:none }
 .monochrome-shell .cs-launch h2 { font-size:19px; line-height:1.5; font-weight:600 }
 .monochrome-shell .cs-launch textarea { background:transparent; border:0; padding:12px 0; border-radius:0; font-size:16px; box-shadow:none; min-height:100px }
 .monochrome-shell .cs-launch-foot { gap:12px; flex-wrap:wrap; padding-top:8px; border:0 }
 .monochrome-shell .cs-launch-foot .nv-button { min-height:44px; border-radius:12px }
 .monochrome-shell .cs-starter { padding:0; border:0 }
 .monochrome-shell .cs-starter>button { min-height:52px; padding:12px 4px; border:0; background:transparent; gap:10px }
 .monochrome-shell .cs-starter>button:hover { background:var(--mobile-fill) }
 .monochrome-shell .cs-label { font-size:12px; margin-bottom:6px; color:var(--muted) }
 .monochrome-shell .cs-work-bar { gap:12px; border:0; margin-bottom:16px }
 .monochrome-shell .cs-search { min-height:44px; border:0; border-radius:14px; background:var(--mobile-fill); box-shadow:none }
 .monochrome-shell .cs-work-bar select { min-height:44px; border:0; background:var(--mobile-fill); border-radius:12px }
 .monochrome-shell .cs-library .nv-book { padding:16px; border:0; border-radius:18px; background:var(--mobile-fill); box-shadow:none; gap:14px }
 .monochrome-shell .cs-library .nv-cover { width:82px; height:116px; border-radius:8px }
 .monochrome-shell .cs-library-empty { border:0; border-radius:0; background:transparent; padding:26px 10px }
 .monochrome-shell .cs-library-privacy { border:0; padding:14px 0 }
 .monochrome-shell .cs-workspace { height:100%; min-height:0; border:0; background:var(--surface) }
 .monochrome-shell .cs-workspace .nv-toolbar { min-height:0; gap:8px; padding:8px 16px 10px; border:0; background:var(--surface) }
 .monochrome-shell .cs-workspace .nv-document-context { padding-top:4px }
 .monochrome-shell .cs-workspace .nv-top-actions .nv-button { border:0; background:transparent; min-width:40px; min-height:44px; padding:6px }
 .monochrome-shell .cs-stage-bar { border:0; padding:0 12px 8px; gap:4px; background:var(--surface) }
 .monochrome-shell .cs-stage-nav { gap:3px; min-width:0; overflow:auto; scrollbar-width:none }
 .monochrome-shell .cs-stage-nav>button { flex:none; min-height:44px; padding:8px 12px; border:0; border-radius:12px; background:transparent; white-space:nowrap }
 .monochrome-shell .cs-stage-nav>button[aria-selected=true],.monochrome-shell .cs-stage-nav>button[aria-current=page],.monochrome-shell .cs-stage-nav>button.active { background:var(--mobile-selected); color:var(--accent) }
 .monochrome-shell .cs-workspace .nv-mobile-tabs { border:0; padding:0 14px 8px; background:var(--surface); gap:6px }
 .monochrome-shell .cs-workspace .nv-mobile-tabs button { min-height:44px; background:transparent; border:0; border-radius:12px; font-size:12px }
 .monochrome-shell .cs-workspace .nv-mobile-tabs button[aria-pressed=true] { background:var(--mobile-fill); color:var(--ink) }
 .monochrome-shell .cs-workspace :is(.nv-manuscript,.nv-outline,.nv-assistant) { border:0; box-shadow:none; background:var(--surface) }
 .monochrome-shell .cs-workspace .nv-editor-foot { border:0; padding-top:10px; gap:8px; flex-wrap:wrap }
 .monochrome-shell .cs-workspace .nv-editor-foot .nv-button { min-height:44px }
 .monochrome-shell :is(.cs-plan-intro,.cs-budget-total,.cs-plan-confirm) { border:0; border-radius:16px; background:var(--mobile-fill); padding:18px; box-shadow:none }
 .monochrome-shell :is(.cs-plan-row,.cs-page-heading,.cs-entry-editor,.cs-tool-form,.nv-chapter-brief,.nv-settings-heading,.nv-settings-footer,.cs-structured-result article) { border:0; box-shadow:none }
 .monochrome-shell .cs-plan-row { margin-bottom:12px; padding:18px 0 }
 .monochrome-shell :is(.cs-data-form,.cs-tool-form,.nv-settings) :is(input,select,textarea) { border:0; border-radius:12px; background:var(--mobile-fill); box-shadow:none; font-size:16px; min-height:44px }
 .monochrome-shell .cs-entry-list>button:not(.nv-button) { border:0; border-radius:14px; min-height:76px }
 .monochrome-shell .cs-entry-list>button[aria-current=true] { background:var(--mobile-selected) }
 .monochrome-shell .cs-subnav { border:0; gap:6px; overflow:auto; scrollbar-width:none }
 .monochrome-shell .cs-subnav button { border:0; min-height:44px; border-radius:12px; flex:none }
 .monochrome-shell .nv-settings { padding:10px 0 24px }

 /* Gallery and account share the same mobile spacing and calm section rhythm. */
 .monochrome-shell :is(.gallery-page,.account-page,.page) { padding:18px 16px max(28px,env(safe-area-inset-bottom)); max-width:100%; width:100% }
 .monochrome-shell .page-heading { gap:14px; margin-bottom:22px }
 .monochrome-shell .page-heading h1 { font-size:25px; line-height:1.4; letter-spacing:-.025em }
 .monochrome-shell :is(.page-tabs,.gallery-tabs) { display:flex; width:100%; gap:6px; border:0; background:transparent; overflow-x:auto; scrollbar-width:none; padding:0 0 8px; margin-bottom:18px }
 .monochrome-shell :is(.page-tabs,.gallery-tabs)>:is(a,button) { flex:none; min-height:44px; padding:10px 14px; border:0; border-radius:12px; background:transparent; white-space:nowrap; font-size:13px }
 .monochrome-shell :is(.page-tabs,.gallery-tabs)>:is(.active,[aria-current=page],[aria-selected=true]) { background:var(--mobile-fill); color:var(--ink); box-shadow:none }
 .monochrome-shell .gallery-toolbar { gap:12px; border:0; padding:0; flex-wrap:wrap }
 .monochrome-shell .gallery-search { min-height:44px; width:100%; border:0; border-radius:14px; background:var(--mobile-fill); box-shadow:none }
 .monochrome-shell .gallery-search input { font-size:16px }
 .monochrome-shell .gallery-grid { gap:10px }
 .monochrome-shell .gallery-card { border:0; border-radius:16px; box-shadow:none; background:var(--mobile-fill); overflow:hidden }
 .monochrome-shell .gallery-card-caption { position:static; opacity:1; transform:none; background:transparent; color:var(--ink); padding:10px; font-size:12px }
 .monochrome-shell .gallery-image-button { display:flex; flex-direction:column; align-items:stretch; aspect-ratio:auto!important; height:auto; padding:0 }
 .monochrome-shell .gallery-image-button img { display:block; position:static; width:100%; height:auto; object-fit:contain; flex:none }
 .monochrome-shell .gallery-card-caption :is(strong,small) { color:var(--ink) }
 .monochrome-shell .gallery-scope-note { border:0; padding:10px 0; font-size:12px; line-height:1.7 }
 .monochrome-shell :is(.membership-tier-card,.membership-usage-card,.membership-card,.account-profile>.panel,.account-page>.panel) { border:0; border-radius:18px; background:var(--mobile-fill); padding:20px; box-shadow:none }
 .monochrome-shell .membership-overview { gap:12px }
 .monochrome-shell .membership-tier-heading { font-size:23px }
 .monochrome-shell .membership-cards { gap:12px }
 .monochrome-shell :is(.upgrade-card,.product-card) { border:0; border-radius:18px; box-shadow:none; background:var(--mobile-fill) }
 .monochrome-shell :is(.upgrade-card,.product-card).selected { background:var(--mobile-selected); outline:2px solid var(--accent); outline-offset:-2px }
 .monochrome-shell :is(.upgrade-periods,.upgrade-card-features,.membership-card-footer) { border:0 }
 .monochrome-shell .account-profile :is(input,textarea,select) { min-height:48px; font-size:16px; border:0; border-radius:12px; background:var(--surface); box-shadow:none }
 .monochrome-shell .notice-card { border:0; border-radius:16px; padding:20px; background:var(--mobile-fill); box-shadow:none; margin-bottom:12px }
 .monochrome-shell .table-wrap { max-width:100%; overflow:auto; border:0; border-radius:12px }

 /* Existing dialogs retain focus management, now sized as scrollable mobile sheets. */
 body dialog:not(.auth-entry-dialog) { position:fixed; inset:auto 0 0!important; width:100%!important; max-width:100%!important; max-height:calc(var(--mobile-viewport-height,100dvh) - 28px); margin:0!important; padding:22px 20px max(22px,env(safe-area-inset-bottom)); border:0; border-radius:24px 24px 0 0; background:var(--paper); color:var(--ink); box-shadow:0 -14px 60px #0003; overflow:auto; overscroll-behavior:contain }
 body dialog::backdrop { background:#0005; backdrop-filter:none }
 body dialog:not(.auth-entry-dialog)>header { border:0; padding-bottom:16px; gap:12px }
 body dialog:not(.auth-entry-dialog)>header h2 { font-size:20px; line-height:1.4 }
 body dialog:not(.auth-entry-dialog) :is(.dialog-close,header>.icon-btn) { min-width:44px; min-height:44px; border:0; background:var(--mobile-fill); border-radius:50% }
 body dialog:not(.auth-entry-dialog) :is(input[type=text],input[type=password],input[type=number],input[type=search],input[type=email],input[type=url],textarea,select) { font-size:16px; min-height:44px; border:0; border-radius:12px; background-color:var(--mobile-fill); box-shadow:none }
 body dialog:not(.auth-entry-dialog) .model-search { border:0; border-radius:14px; background:var(--mobile-fill); min-height:48px }
 body dialog:not(.auth-entry-dialog) .model-search input { background:transparent }
 body dialog:not(.auth-entry-dialog) .model-cats { border:0; padding-block:8px; gap:6px; overflow:auto; flex-wrap:nowrap; scrollbar-width:none }
 body dialog:not(.auth-entry-dialog) .model-cat { min-height:44px; flex:none; padding:8px 12px; border:0; border-radius:12px; background:transparent }
 body dialog:not(.auth-entry-dialog) .model-cat.active { background:var(--mobile-selected) }
 body dialog:not(.auth-entry-dialog) .model-options { gap:6px; max-height:52dvh; overflow:auto }
 body dialog:not(.auth-entry-dialog) .model-choice { border:0; border-radius:14px; background:transparent; box-shadow:none }
 body dialog:not(.auth-entry-dialog) .model-choice.selected { background:var(--mobile-selected) }
 body dialog:not(.auth-entry-dialog) .model-choice-main { min-height:64px; padding:10px 12px; border:0; background:transparent }
 body dialog:not(.auth-entry-dialog) .model-favorite { min-width:44px; min-height:44px }
 body dialog:not(.auth-entry-dialog) .dialog-actions { border:0; gap:10px; padding-top:16px; flex-wrap:wrap }
 body dialog:not(.auth-entry-dialog) .dialog-actions .btn { min-height:46px; border-radius:12px }
 .reasoning-popover { border:0; box-shadow:0 10px 40px #0003; border-radius:22px }
 .reasoning-picker-reset { width:44px; height:44px; top:6px; right:6px }
 .reasoning-picker-model { min-height:44px }
 .auth-entry-dialog { width:calc(100% - 24px); max-width:400px; max-height:calc(var(--mobile-viewport-height,100dvh) - 24px); border:0; border-radius:24px; box-shadow:0 20px 70px #0003 }
 .auth-entry-dialog :is(input,button) { min-height:46px; font-size:16px }
 .connection-error { padding:24px 20px; min-height:100dvh }

 /* Admin: same neutral canvas, full-width content and deliberate section spacing. */
 body.admin-mode { --admin-bg:var(--surface); --admin-panel:var(--surface); --admin-shadow:none; --admin-input:var(--mobile-fill) }
 body.admin-mode .adm { min-height:var(--mobile-viewport-height,100dvh); background:var(--surface) }
 body.admin-mode .adm-main { min-width:0; background:var(--surface) }
 body.admin-mode .adm-top { min-height:60px; padding:8px 12px; border:0; background:var(--surface); box-shadow:none; backdrop-filter:none; gap:10px }
 body.admin-mode .adm-title { min-width:0 }
 body.admin-mode .adm-title h1 { font-size:17px; line-height:24px; font-weight:600 }
 body.admin-mode .adm-title p,body.admin-mode .adm-version { display:none }
 body.admin-mode .adm-menu { width:44px; height:44px; min-width:44px; border:0; border-radius:50%; background:transparent }
 body.admin-mode .adm-side { border:0; background:var(--paper); width:min(300px,calc(100vw - 44px)); box-shadow:12px 0 44px #0003 }
 body.admin-mode .adm-brand,body.admin-mode .adm-side-foot { border:0 }
 body.admin-mode .adm-nav-link { min-height:46px; border:0; border-radius:12px; margin-bottom:3px }
 body.admin-mode .adm-tabs { position:sticky; top:var(--admin-header-offset,60px); padding:4px 16px 10px; gap:6px; border:0; background:var(--surface); box-shadow:none; overflow-x:auto; scrollbar-width:none }
 body.admin-mode .adm-tab { min-height:44px; flex:none; border:0; padding:10px 14px; border-radius:12px; background:transparent; font-size:13px }
 body.admin-mode .adm-tab.active { background:var(--mobile-fill); color:var(--ink) }
 body.admin-mode .adm-tab.active::after { display:none }
 body.admin-mode .adm #main { padding:0; background:var(--surface) }
 body.admin-mode .admin-content { padding:16px 16px 32px; width:100%; max-width:100%; min-width:0 }
 body.admin-mode .adm .panel { border:0; border-radius:0; background:transparent; box-shadow:none; padding:0; margin-bottom:28px; min-width:0; max-width:100% }
 body.admin-mode .adm :is(.section-heading,.panel-head,.panel-heading) { border:0; background:transparent; padding:0 0 18px; margin-bottom:0 }
 body.admin-mode .adm :is(.section-heading,.panel-head,.panel-heading) h2 { font-size:18px; font-weight:600 }
 body.admin-mode .adm .section-body { padding:0 }
 body.admin-mode .adm :is(.field-grid,.settings-grid,.two-columns,.coding-limit-grid,.storage-settings-grid) { grid-template-columns:minmax(0,1fr); gap:20px }
 body.admin-mode .adm .field { margin-bottom:20px }
 body.admin-mode .adm :is(input[type=text],input[type=password],input[type=search],input[type=email],input[type=url],input[type=number],textarea,select) { min-height:46px; max-width:100%; border:0; border-radius:12px; background-color:var(--mobile-fill); box-shadow:none; font-size:16px }
 body.admin-mode .adm :is(.btn,.icon-btn) { min-height:44px; border-radius:12px; box-shadow:none }
 body.admin-mode .adm .icon-btn { min-width:44px }
 body.admin-mode .adm :is(.settings-nav,.storage-nav,.registry-tabs) { display:flex; gap:6px; overflow-x:auto; flex-wrap:nowrap; border:0; padding:0 0 12px; margin-bottom:18px; scrollbar-width:none }
 body.admin-mode .adm :is(.settings-nav,.storage-nav,.registry-tabs)>:is(a,button) { flex:none; min-height:44px; border:0; border-radius:12px; background:transparent; padding:10px 14px }
 body.admin-mode .adm :is(.settings-nav,.storage-nav,.registry-tabs)>:is(.active,[aria-current=true],[aria-current=page],[aria-selected=true]) { background:var(--mobile-fill); color:var(--ink) }
 body.admin-mode .adm :is(.switch-field,.checkbox-field,.setting-switch,.coding-enable) { padding:14px; min-height:60px; border:0; border-radius:14px; background:var(--mobile-fill); gap:14px; margin-block:8px 16px }
 body.admin-mode .adm :is(.brand-preview-wrap,.coding-worker-hint,.storage-status,.settings-callout) { border:0; border-radius:16px; background:var(--mobile-fill); padding:18px; box-shadow:none }
 body.admin-mode .adm .settings-save { border:0; background:var(--surface); padding:16px 0 max(16px,env(safe-area-inset-bottom)); box-shadow:none }
 body.admin-mode .adm .settings-save .btn { min-height:48px }
 body.admin-mode .adm :is(.table-wrap,.resource-table-wrap,.channel-table-scroll,.record-table-wrap) { max-width:100%; width:100%; overflow:auto; border:0; border-radius:12px; box-shadow:none; -webkit-overflow-scrolling:touch }
 body.admin-mode .adm :is(.resource-filters,.model-toolbar,.model-filters,.record-filters) { display:flex; flex-wrap:wrap; gap:10px; padding:0 0 18px; border:0; background:transparent }
 body.admin-mode .adm :is(.resource-filters,.model-filters,.record-filters)>:is(label,input,select) { flex:1 1 145px; min-width:0 }
 body.admin-mode .adm :is(.pagination,.bulk-bar) { border:0; gap:10px; padding:14px 0; flex-wrap:wrap; background:transparent }
 body.admin-mode .adm .pagination .btn { min-width:44px }
 body.admin-mode .adm .channel-workspace { gap:24px; padding:0; background:transparent; border:0 }
 body.admin-mode .adm .channel-directory-head { padding:0 0 12px; gap:12px; border:0; background:transparent }
 body.admin-mode .adm .channel-category-bar { max-width:100%; min-width:0 }
 body.admin-mode .adm .channel-category-tab { min-height:44px; border:0; border-radius:12px; background:transparent }
 body.admin-mode .adm .channel-category-tab.active { background:var(--mobile-fill) }
 body.admin-mode .adm .channel-filters { padding:0 0 12px; gap:10px; flex-wrap:wrap }
 body.admin-mode .adm .channel-editor { width:100%; min-width:0; border:0; border-radius:0; background:transparent; box-shadow:none; padding:0 }
 body.admin-mode .adm .channel-editor-head { border:0; padding:16px 0; background:var(--surface) }
 body.admin-mode .adm .channel-editor-section { border:0; padding:20px 0; background:transparent }
 body.admin-mode .adm .channel-editor-actions { border:0; padding:16px 0; gap:10px; background:var(--surface) }
 body.admin-mode .adm .channel-binding-pill { min-height:44px; border:0; border-radius:10px; background:var(--mobile-fill) }
 body.admin-mode .adm .channel-redirect-row { gap:7px }
 body.admin-mode .adm .channel-redirect-row input { font-size:11px; min-height:44px; border-radius:10px }
 body.admin-mode .adm .channel-redirect-row .channel-redirect-remove { min-width:32px; width:32px; min-height:44px; padding:0 }
 body.admin-mode .adm .channel-group-label { border:0; background:transparent }
 body.admin-mode .adm .plan-list { border:0; border-radius:0; background:transparent; box-shadow:none }
 body.admin-mode .adm .plan-list .plan-card { border:0; border-radius:18px; background:var(--mobile-fill); margin-bottom:14px; overflow:hidden }
 body.admin-mode .adm .plan-overview { padding:18px; gap:16px }
 body.admin-mode .adm .plan-expanded { border:0; background:transparent; padding:0 18px 20px }
 body.admin-mode .adm .plan-expanded :is(input,select) { background:var(--surface) }
 body.admin-mode .adm :is(.overview-card,.stat-card,.metric-card) { border:0; border-radius:16px; padding:18px; box-shadow:none; background:var(--mobile-fill) }
 body.admin-mode .adm .agent-extension-entry { border:0; border-radius:14px; padding:14px; background:var(--mobile-fill) }
 body.admin-mode .adm :is(.model-admin-row,.coding-model-row) { border:0; border-radius:12px; margin-bottom:6px; padding:12px; background:var(--mobile-fill) }
}

@media(max-width:360px) {
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-tools { gap:0 }
 .monochrome-shell :is(.home-view,.model-chat-view) :is(.attachment-add,.composer-tools>.icon-btn) { width:32px; min-width:32px }
 .monochrome-shell .chat-mode-switch button { width:32px; min-width:32px }
 .monochrome-shell #active-model .identity-image { width:17px; height:17px; flex-basis:17px }
 .monochrome-shell .mobile-home-welcome h2 { font-size:20px }
 .monochrome-shell .home-view .home-shortcuts { margin-inline:10px; max-width:calc(100% - 20px) }
 .monochrome-shell .image-studio-composer-bottom { grid-template-columns:32px minmax(0,1fr) 44px }
}

@media(max-width:760px) and (max-height:540px) {
 .monochrome-shell .home-view .home-introduction { padding-block:4px; min-height:0 }
 .monochrome-shell .home-view .home-brand { margin-bottom:6px }
 .monochrome-shell .home-view .home-brand-icon { width:28px; height:28px }
 .monochrome-shell .home-view .home-brand-name { font-size:21px }
 .monochrome-shell .mobile-home-welcome p { display:none }
 .monochrome-shell .mobile-home-welcome h2 { font-size:17px }
 .monochrome-shell .home-view .home-shortcuts { display:none }
 .monochrome-shell .composer-disclaimer { display:none }
}

@media(max-width:760px) {
 .monochrome-shell :is(.home-view,.model-chat-view) :is(.attachment-add,.composer-tools>.icon-btn),.monochrome-shell :is(.home-view,.model-chat-view) .chat-mode-switch button { width:44px; min-width:44px; height:44px; min-height:44px }
 .monochrome-shell :is(.image-studio-size-trigger,.image-studio-model-trigger,.image-studio-sharing,.image-studio-count,.image-studio-count select) { min-height:44px }
 .monochrome-shell .image-studio-composer-actions { grid-column:3; grid-row:1; align-self:end; margin:0 }
 .monochrome-shell .image-studio-controls { grid-column:2; grid-row:1 }
 .monochrome-shell .image-studio-controls>* { grid-column:auto; grid-row:auto }
 body.admin-mode,.admin-shell { --admin-canvas:#111; --admin-side:#171717; --surface:#111; --paper:#1c1c1c; --ink:#ededed; --muted:#afafaf; --mobile-fill:#202020; --admin-glass:#111; --admin-input:#202020; --admin-scene:none; --admin-shadow:none }
 html[data-theme=light] body.admin-mode,html[data-theme=light] .admin-shell { --admin-canvas:#fff; --admin-side:#fff; --surface:#fff; --paper:#fff; --ink:#202124; --muted:#65676b; --mobile-fill:#f4f4f5; --admin-glass:#fff; --admin-input:#f4f4f5; --admin-scene:none; --admin-shadow:none }
 body.admin-mode .adm .settings-section { padding:0!important; gap:20px; margin-bottom:30px }
 body.admin-mode .adm .settings-save { backdrop-filter:none; -webkit-backdrop-filter:none }
 .monochrome-shell .upgrade-card.is-selected { background:var(--mobile-selected); outline:2px solid var(--accent); outline-offset:-2px }
 .monochrome-shell .image-studio-controls>.image-studio-model-picker { flex:0 0 100% }
 .monochrome-shell .image-studio-model-trigger>[data-image-model-icon] { display:block; width:18px; height:18px; flex:0 0 18px }
}

@media(max-width:760px) {
 body .auth-entry-dialog .auth-premium .field input:focus { border-color:transparent; box-shadow:none }
}

/* Keep optional Agent controls from displacing the model or shrinking the draft. */
@media(max-width:760px) {
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-model #active-model { flex:0 1 auto; min-width:0 }
 .monochrome-shell :is(.home-view,.model-chat-view) .send-btn svg { width:20px; height:20px }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-bottom .chat-mode-switch { flex:0 0 auto; padding:0; margin:0 2px 0 0 }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-bottom .chat-mode-switch button { width:36px; min-width:36px; height:44px; min-height:44px }
 .monochrome-shell :is(.home-view,.model-chat-view) .composer-bottom .chat-mode-switch button::before { width:28px; height:28px }
 .monochrome-shell :is(.home-view,.model-chat-view) .work-mode .composer-bottom { flex-wrap:wrap }
 .monochrome-shell :is(.home-view,.model-chat-view) .work-mode .composer-bottom::after { content:""; order:1; flex-basis:100%; height:0 }
 .monochrome-shell :is(.home-view,.model-chat-view) .work-mode .chat-mode-switch { order:2; margin-right:auto }
 .monochrome-shell :is(.home-view,.model-chat-view) .work-mode .agent-skills-menu { order:3; margin:0 }
}
