:root{font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#202b3d;background:#fff;color-scheme:light dark;--surface:#fff;--soft:#f4f6fa;--line:#e7ebf2;--muted:#7a89a3;--blue:#0965ff;--green:#16b64b;--amber:#d99310;--red:#ef404b;--gray:#9ba4b5;--human:#eaf2ff;--active:#f0f6ff}
*{box-sizing:border-box;touch-action:manipulation}body{margin:0}button,input,textarea{font:inherit;color:inherit}button{border:0;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default;opacity:.45}button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}input,textarea{border:0;background:none;outline:none;min-width:0}input:focus-visible,textarea:focus-visible{outline:2px solid var(--blue);outline-offset:2px}button svg,.icon svg{width:20px;height:20px;display:block;stroke-width:1.8}svg{flex-shrink:0}.icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}
#app{height:100vh;height:100dvh;display:flex;overflow:hidden}#browser{width:360px;flex:0 0 360px;display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--line);background:var(--surface)}.browse-header{padding:20px 20px 12px;padding-top:max(20px,env(safe-area-inset-top));flex-shrink:0}.brand-row{display:flex;align-items:center;gap:8px}.brand-row h1{font-size:24px;letter-spacing:-.6px;margin:0;line-height:1.3;flex:1}.icon-button{display:flex;align-items:center;justify-content:center;width:44px;height:44px;flex:none;color:inherit}.connection{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:13px;margin-top:3px;min-height:24px}.connection .icon svg{width:10px;height:10px}.connection[data-connected=true] .icon{color:var(--green)}.connection[data-connected=false] .icon{color:var(--amber)}.mode-tabs{display:flex;margin:4px 20px 16px;border-radius:10px;background:var(--soft);padding:3px;flex-shrink:0}.mode-tabs button{width:50%;min-height:39px;font-weight:600;color:#687a96;border-radius:8px}.mode-tabs button[aria-pressed=true]{background:var(--blue);color:#fff}.search-box{display:flex;align-items:center;gap:9px;background:var(--soft);border-radius:11px;margin:0 20px 14px;padding:0 12px;height:44px;flex-shrink:0;color:var(--muted)}.search-box input{width:100%;font-size:15px;height:100%;color:inherit}.search-box input::placeholder{color:var(--muted)}.search-box input:focus-visible{outline:none}.search-box:focus-within{outline:2px solid var(--blue)}#tab-bar{display:flex;margin:0 20px;border-bottom:1px solid var(--line);flex-shrink:0}#tab-bar button{width:33.333%;min-height:44px;position:relative;color:var(--muted);font-weight:500;padding:8px 2px 11px;white-space:nowrap;font-size:14px}#tab-bar button[aria-selected=true]{color:var(--blue);box-shadow:inset 0 -3px var(--blue)}#tab-bar span{font-size:12px;margin-left:3px}
#pager{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;min-height:0;flex:1;overscroll-behavior-x:contain}#pager::-webkit-scrollbar{display:none}#pager>section{min-width:100%;width:100%;height:100%;flex:0 0 100%;overflow-y:auto;scroll-snap-align:start;scroll-snap-stop:always;overscroll-behavior-y:contain;padding:6px 20px 20px;scrollbar-width:thin}.list-group{margin:17px 0 5px;font-size:13px;font-weight:500;color:var(--muted)}.conversation-row{position:relative;display:flex;align-items:flex-start;border-bottom:1px solid var(--line);min-height:87px}.conversation-row[aria-current=true]{background:var(--active);border-radius:6px}.open-conversation{display:flex;align-items:flex-start;gap:13px;text-align:left;flex:1;min-width:0;padding:17px 32px 15px 0;line-height:1.5}.status-dot{display:flex;align-items:center;justify-content:center;width:14px;height:23px;flex:0 0 14px;color:var(--gray)}.status-dot svg{width:12px;height:12px}.status-dot.running{color:var(--green)}.status-dot.running svg{width:17px;height:17px;animation:spin 1.3s linear infinite;stroke-width:2.8}.status-dot.unread{color:var(--blue)}.status-dot.attention{color:var(--amber)}.status-dot.error{color:var(--red)}.row-content{min-width:0;flex:1}.row-title{font-weight:600;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0 0 3px}.row-meta,.row-summary{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.6}.row-meta{display:flex;gap:6px;align-items:center}.row-meta .state-label{flex:none}.state-label{font-size:13px}.state-label.running{color:var(--green)}.state-label.unread{color:var(--blue)}.state-label.attention{color:var(--amber)}.state-label.error{color:var(--red)}.row-meta .scope-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-time{color:var(--muted);font-size:11px;white-space:nowrap;margin-left:auto;flex:none}.row-pin{position:absolute;right:-8px;top:7px;width:38px;height:38px;color:var(--muted);opacity:0}.row-pin[aria-pressed=true],.conversation-row:focus-within .row-pin,.conversation-row:hover .row-pin{opacity:1}.row-pin svg{width:16px;height:16px}.row-pin[aria-pressed=true]{color:var(--blue)}.empty-state{padding:48px 12px;text-align:center;color:var(--muted);font-size:14px;line-height:1.8}.empty-state .icon{margin-bottom:12px}.empty-state p{margin:0}.browser-foot{padding:7px 20px calc(7px + env(safe-area-inset-bottom));font-size:10px;color:var(--muted);margin:0;border-top:1px solid var(--line);flex-shrink:0}
#project-list{flex:1;overflow:auto;padding:4px 20px 24px;min-height:0;overscroll-behavior-y:contain}.project-row{display:flex;align-items:center;width:100%;gap:17px;text-align:left;border-bottom:1px solid var(--line);padding:18px 0;min-height:103px}.project-folder{color:var(--blue)}.project-folder svg{width:29px;height:29px;fill:currentColor;stroke-width:1}.project-row.unassigned .project-folder{color:var(--gray)}.project-row-content{min-width:0;flex:1}.project-row h3{margin:0 0 3px;font-size:16px;font-weight:600}.project-path,.project-summary{color:var(--muted);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;line-height:1.7}.project-row>.icon{color:var(--muted)}.project-row>.icon svg{width:17px;height:17px}#project-header{display:flex;align-items:center;gap:6px;padding:16px 13px 20px;flex-shrink:0}#project-header>div{min-width:0;flex:1;text-align:center;padding-right:35px}#project-header h2{font-size:17px;margin:0 0 3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#project-header p{font-size:11px;color:var(--muted);margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.back-button{display:flex;gap:2px;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0 4px;font-size:14px;white-space:nowrap}.back-button svg{width:21px;height:21px}
#chat{flex:1;min-width:0;position:relative;background:var(--surface)}#chat-placeholder{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;color:var(--muted);padding:24px}#chat-placeholder>.icon svg{width:32px;height:32px}#chat-placeholder h2{font-size:20px;color:inherit;margin:15px 0 6px}#chat-placeholder p{font-size:14px;line-height:1.8}#chat-content{height:100%;display:flex;flex-direction:column;min-height:0}.chat-header{display:flex;align-items:center;gap:5px;padding:15px 12px 13px;padding-top:max(15px,env(safe-area-inset-top));min-height:76px;flex-shrink:0;border-bottom:1px solid var(--line)}.chat-identity{min-width:0;flex:1;text-align:center}.chat-identity h2{font-size:17px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0 0 3px}.chat-identity p{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}#chat-pin[aria-pressed=true]{color:var(--blue)}.chat-meta{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0}.chat-meta #chat-subtitle{min-width:0;flex:0 1 auto}#task-status{display:inline-flex;align-items:center;gap:5px;flex:none;padding-left:8px;border-left:1px solid var(--line);color:var(--muted);font-size:11px;line-height:18px;white-space:nowrap}#task-status .status-dot{height:16px;width:10px;flex-basis:10px}#task-status.running{color:var(--green)}#task-status.attention{color:var(--amber)}#task-status.error{color:var(--red)}#task-detail{flex-shrink:0;padding:8px 20px;border-bottom:1px solid var(--line);background:var(--soft);color:var(--muted);font-size:12px;overflow-wrap:anywhere}#task-detail.running{color:var(--green)}#task-detail.attention{color:var(--amber)}#task-detail.error{color:var(--red)}
#messages{--code-sticky-offset:-18px;min-height:0;flex:1;overflow-y:auto;overscroll-behavior-y:contain;padding:18px 20px 25px;scrollbar-width:thin;scroll-behavior:auto;overflow-anchor:none}.turn{margin-bottom:36px;max-width:760px;margin-left:auto;margin-right:auto}.turn-caption{font-size:11px;color:var(--muted);margin:0 0 9px}.human-message{padding:13px 15px;border-left:4px solid var(--blue);background:var(--human);border-radius:3px 11px 11px 3px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.65;margin-bottom:20px}.assistant-message{font-size:16px;line-height:1.8;overflow-wrap:anywhere;margin:18px 0 0}.assistant-message>:first-child{margin-top:0}.assistant-message p{margin:0 0 15px}.assistant-message h1,.assistant-message h2,.assistant-message h3{font-size:17px;line-height:1.6;margin:25px 0 12px}.assistant-message ul,.assistant-message ol{padding-left:23px;margin:8px 0 19px}.assistant-message li{margin:4px 0}.assistant-message blockquote{border-left:3px solid var(--line);margin:16px 0;padding-left:12px;color:var(--muted)}.assistant-message a{color:var(--blue);text-decoration:underline}.assistant-message code,.activity-detail code{font:13px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--soft);border-radius:4px;padding:2px 4px}.assistant-message pre{position:relative;background:var(--soft);padding:15px 38px 15px 15px;border-radius:10px;overflow:auto;margin:16px 0;max-width:100%;font-size:13px}.assistant-message pre code{padding:0;white-space:pre;background:none}.code-copy{position:absolute;right:4px;top:3px;width:30px;height:30px;color:var(--muted)}.code-copy svg{width:16px;height:16px}.assistant-message table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;font-size:13px}.assistant-message th,.assistant-message td{border:1px solid var(--line);padding:6px 9px;text-align:left}.assistant-message hr{border:0;border-top:1px solid var(--line);margin:20px 0}.copy-reply{color:var(--muted);font-size:11px;display:flex;align-items:center;gap:5px;padding:5px 0;margin-top:8px;min-height:32px}.copy-reply svg{width:13px;height:13px}.activities{background:var(--soft);border-radius:11px;margin-bottom:20px;font-size:13px}.activities>summary{display:flex;align-items:center;gap:9px;list-style:none;padding:13px;min-height:48px;cursor:pointer}.activities>summary::-webkit-details-marker{display:none}.activities>summary>.activity-summary-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activities>summary svg{width:17px;height:17px}.activities[open]>summary>.chevron{transform:rotate(180deg)}.activity-detail{padding:10px 13px;border-top:1px solid var(--line);overflow-wrap:anywhere}.activity-detail h4{font-size:13px;margin:0 0 6px;font-weight:500}.activity-detail pre{font:11px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;max-height:230px;overflow:auto;margin:6px 0}.activity-detail small{color:var(--muted);font-size:11px}.generation-placeholder{color:var(--muted);font-size:13px;line-height:1.7;margin:18px 0 0}.notice-box{padding:12px;border-radius:8px;background:var(--soft);color:var(--muted);font-size:12px;line-height:1.7;margin:12px 0}
#new-reply{position:absolute;right:24px;bottom:160px;background:var(--human);color:var(--blue);border-radius:22px;padding:9px 15px;display:flex;align-items:center;gap:6px;font-size:13px;box-shadow:0 2px 10px #1a387314;z-index:2}#new-reply svg{width:15px;height:15px}#draft-host{flex-shrink:0;max-height:160px;overflow:auto}.desktop-draft{margin:0 20px 10px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;font-size:12px}.desktop-draft summary{cursor:pointer;font-weight:500;color:var(--muted)}.desktop-draft pre{white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.7 inherit;color:var(--muted);max-height:95px;overflow:auto;margin:8px 0 0}.desktop-draft p{margin:6px 0 0;color:var(--muted);font-size:11px}#composer{flex-shrink:0;padding:10px 20px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface)}.composer-input{display:flex;align-items:flex-end;border:1px solid #dce3ef;border-radius:13px;padding:9px 9px 9px 12px;gap:8px;background:var(--surface)}#prompt{width:100%;flex:1;resize:none;padding:1px 0;line-height:1.6;min-height:49px;max-height:115px;font-size:15px}#prompt::placeholder{color:var(--muted)}#prompt:focus-visible{outline:none}.composer-input:focus-within{border-color:#8db8ff}#send{display:flex;align-items:center;justify-content:center;background:var(--blue);color:#fff;width:43px;height:43px;flex:none;border-radius:50%}#send svg{width:21px;height:21px}#send:disabled{background:#aab6ca;opacity:.45}#composer-help{margin:7px 0 0;font-size:11px;color:var(--muted);line-height:1.6}#send-status{margin:0 0 7px;font-size:12px;color:var(--muted)}#send-status:empty{display:none}#send-status.error{color:var(--red)}#check-receipt{font-size:12px;color:var(--blue);padding:6px 0;margin-bottom:5px}
#diagnostics{width:min(90vw,480px);border:1px solid var(--line);border-radius:14px;background:var(--surface);color:inherit;padding:18px}#diagnostics::backdrop{background:#17223555}#diagnostics header{display:flex;align-items:center;justify-content:space-between}#diagnostics h2{margin:0;font-size:18px}#diagnostics p{font-size:13px;color:var(--muted);line-height:1.8}#diagnostics pre{font:11px/1.6 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-height:35vh;overflow:auto;background:var(--soft);padding:10px;border-radius:8px}#refresh-directory{background:var(--human);color:var(--blue);padding:10px 15px;border-radius:8px;min-height:44px}#toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);max-width:90vw;border-radius:10px;padding:10px 16px;background:#22324bed;color:white;z-index:20;font-size:13px;box-shadow:0 6px 22px #0002}
@keyframes spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}@media(max-width:699px){#browser{width:100%;flex:0 0 100%;border:0}#chat{display:none;width:100%;height:100%}#app[data-screen=chat] #browser{display:none}#app[data-screen=chat] #chat{display:block;flex:1}#chat-placeholder{display:none}.browse-header{padding-top:max(19px,env(safe-area-inset-top))}.row-pin{opacity:.5}.row-pin[aria-pressed=true]{opacity:1}#pager>section{padding-bottom:30px}.chat-header{min-height:77px}.browser-foot{font-size:10px}}@media(min-width:700px){#chat-back{visibility:hidden}.chat-header{max-width:900px;width:100%;align-self:center}#messages{padding-left:max(24px,calc((100% - 760px)/2));padding-right:max(24px,calc((100% - 760px)/2))}#composer{padding-left:max(24px,calc((100% - 760px)/2));padding-right:max(24px,calc((100% - 760px)/2))}#new-reply{right:calc(50% - 55px)}}
@media(prefers-color-scheme:dark){:root{background:#171d27;color:#e1e8f4;--surface:#171d27;--soft:#222c3c;--line:#2d394b;--muted:#99a8be;--blue:#70a5ff;--green:#55d88b;--amber:#efb951;--red:#ff7f89;--gray:#8492a7;--human:#23395c;--active:#23334b}.mode-tabs button[aria-pressed=true],#send{background:#347df0;color:#fff}.composer-input{border-color:#3a4960}.project-folder{color:#70a5ff}#task-detail.running{background:#55d88b0c}#task-detail.attention{background:#efb9510c}#task-detail.error{background:#ff7f890c}}

/* Source-matched leading folders; the trailing chevron keeps its smaller size. */
.project-row>.project-folder{color:var(--blue)}.project-row>.project-folder svg{width:29px;height:29px}.project-row.unassigned>.project-folder{color:var(--gray)}
.status-dot.running svg{stroke-dasharray:48 16;stroke-linecap:round}
.pin-icon{width:20px;height:20px;background:currentColor;mask:url(/vendor/pin-angle.svg) center/contain no-repeat;-webkit-mask:url(/vendor/pin-angle.svg) center/contain no-repeat}.row-pin .pin-icon{width:16px;height:16px}

#chat-connection{flex-shrink:0;padding:7px 20px;font-size:12px;color:var(--amber);background:#d9931010;border-bottom:1px solid var(--line)}

/* Keep the approved mobile header rhythm and quiet non-pinned rows. */
.brand-row{position:relative;padding-right:44px}.brand-row>.icon-button{position:absolute;right:-7px;top:-6px}.browse-header{padding-top:max(24px,env(safe-area-inset-top))}
.project-row{padding:16px 0;min-height:99px}.row-pin[aria-pressed=false]{display:none}.row-chevron{position:absolute;right:-3px;top:32px;color:var(--muted);pointer-events:none}.row-chevron svg{width:16px;height:16px}

/* Individual native operations: friendly outcome, expandable command and text output. */
.activity-item{border-top:1px solid var(--line)}.activity-item>summary{display:flex;align-items:center;gap:9px;list-style:none;padding:11px 13px;cursor:pointer;min-height:50px}.activity-item>summary::-webkit-details-marker{display:none}.activity-item>summary>.icon{color:var(--muted)}.activity-item>summary>.icon svg{width:16px;height:16px}.activity-item.success>summary>.icon:first-child{color:var(--green)}.activity-item.error>summary>.icon:first-child,.activity-item.error .activity-item-meta,.activity-exit.error{color:var(--red)}.activity-item.attention>summary>.icon:first-child{color:var(--amber)}.activity-item-heading{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}.activity-item-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.activity-item-meta{color:var(--muted);font-size:11px}.activity-item[open]>summary>.icon:last-child{transform:rotate(180deg)}.activity-item .activity-detail{padding:11px 14px 13px;border-top:0}.activity-item .activity-detail h4{margin-top:10px;font-size:11px;color:var(--muted)}.activity-item .activity-detail h4:first-child{margin-top:0}.activity-command,.activity-output{background:var(--surface);padding:9px;border-radius:6px}.activity-empty,.activity-exit{margin:5px 0;font-size:11px;color:var(--muted)}.activity-exit.success{color:var(--green)}.history-loading{max-width:760px;margin:0 auto 18px;font-size:12px;color:var(--muted)}

.assistant-message,.activities{max-width:760px;min-width:0}

.activity-item .activity-detail pre{font-size:12px;line-height:1.65}

/* Avoid iPhone focus zoom as well as accidental double-tap zoom. */
@media(max-width:699px){.search-box input,#prompt{font-size:16px}}

/* Fit the visible viewport when iOS overlays its keyboard; keep the composer in flow. */
html,body{height:100%;overflow:hidden}
#app{position:absolute;left:0;top:var(--app-top,0px);width:100%;height:var(--app-height,100dvh)}
#composer{padding-top:8px;padding-bottom:calc(8px + env(safe-area-inset-bottom))}
.composer-input{padding:3px 5px 3px 12px;gap:5px;align-items:flex-end;border-radius:18px;background:var(--soft)}
#prompt{height:24px;min-height:24px;max-height:128px;padding:2px 0;margin:10px 0;line-height:normal;overflow-y:hidden}
#send{width:44px;height:44px;margin:0;flex:0 0 44px;border:4px solid transparent;background-clip:padding-box}
#send svg{width:19px;height:19px}
#insert-newline{display:none;width:36px;height:44px;flex:none;padding:0;font-size:24px;line-height:1;color:var(--muted)}
#composer-help:empty{display:none}
#new-reply{bottom:calc(var(--composer-height,76px) + 12px)}
#send-status.sr-only{margin:0}
@media(max-width:699px){#composer{padding-left:12px;padding-right:12px;padding-bottom:max(6px,calc(env(safe-area-inset-bottom) - 2px))}.composer-input:focus-within #insert-newline{display:block}}
:root[data-keyboard=true] #composer{padding-bottom:2px}
:root[data-keyboard=true] #prompt{max-height:104px}

/* Compact phone browsing; let search results use the visible keyboard viewport. */
@media(max-width:699px){
 .browse-header{padding:8px 16px 6px;padding-top:max(8px,env(safe-area-inset-top))}
 .brand-row h1{font-size:20px;letter-spacing:-.4px}
 .brand-row>.icon-button{top:-4px}
 .connection{font-size:11px;min-height:18px;margin-top:1px;gap:6px}
 .mode-tabs{margin:4px 16px 10px;padding:3px;border-radius:9px}
 .mode-tabs button{min-height:34px;font-size:14px}
 .search-box{height:40px;margin:0 16px 6px;border-radius:10px}
 #tab-bar{margin:0 16px}
 #tab-bar button{min-height:40px;padding:8px 2px;font-size:13px}
 #pager>section{padding:0 16px 10px}
 .list-group{margin:10px 0 3px;font-size:11px}
 .conversation-row{min-height:76px}
 .open-conversation{padding:10px 32px 10px 0;gap:10px}
 .row-title{font-size:15px;margin-bottom:1px}
 .row-meta,.row-summary{font-size:12px;line-height:1.5}
 .row-chevron{top:27px}
 .row-pin{top:1px}
 .browser-foot{padding:4px 16px calc(4px + env(safe-area-inset-bottom));font-size:9px}
 #project-list{padding:0 16px 12px}
 .project-row{padding:11px 0;min-height:80px;gap:12px}
 .project-row h3{font-size:15px}
 .project-path,.project-summary{font-size:12px;line-height:1.5}
 #project-header{padding:6px 10px 8px;padding-top:max(6px,env(safe-area-inset-top))}
 .chat-header{padding:8px 10px;padding-top:max(8px,env(safe-area-inset-top));min-height:62px}
 #messages{--code-sticky-offset:-12px;padding:12px 16px 18px}
 .human-message{padding:10px 12px;margin-bottom:14px}
 .turn{margin-bottom:26px}
 :root[data-keyboard=true] .browse-header{padding-bottom:2px}
 :root[data-keyboard=true] .brand-row h1{font-size:17px}
 :root[data-keyboard=true] .connection[data-connected=true]{display:none}
 :root[data-keyboard=true] .mode-tabs{margin-top:4px;margin-bottom:8px}
 :root[data-keyboard=true] .browser-foot{display:none}
 :root[data-keyboard=true] #pager>section{padding-bottom:4px}
 :root[data-keyboard=true] #project-list{padding-bottom:4px}
}

.browse-header,#project-header,.chat-header{-webkit-user-select:none;user-select:none;touch-action:manipulation}.chat-identity{cursor:pointer}

#new-reply{width:44px;height:44px;min-width:44px;padding:0;justify-content:center;right:18px;border:1px solid var(--line);background:var(--surface);color:var(--muted);box-shadow:0 2px 12px #10203824;border-radius:50%}#new-reply svg{width:21px;height:21px}

/* A small creation entry keeps browsing uncluttered. */
.brand-row{padding-right:80px}.brand-row>.create-entry{right:31px;color:var(--blue)}#project-header>div{padding-right:0}.create-project-entry{color:var(--blue)}
.create-dialog{width:min(480px,calc(100% - 24px));max-height:calc(var(--app-height,100dvh) - 24px);overflow:auto;margin:auto;padding:16px 18px 20px;background:var(--surface);color:inherit;border:1px solid var(--line);border-radius:18px;box-shadow:0 16px 80px #0003;overscroll-behavior:contain}
.create-dialog::backdrop{background:#0005}.create-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;touch-action:manipulation}.create-dialog h2{font-size:20px;margin:0}.create-note{font-size:13px;color:var(--muted);margin:5px 0 18px}.create-fields{display:flex;flex-direction:column;gap:13px}.create-field{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}.create-field select,.create-field textarea{font:400 16px/1.5 -apple-system,BlinkMacSystemFont,sans-serif;width:100%;border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--soft);color:inherit}.create-field textarea{resize:vertical;min-height:110px;max-height:30dvh}.create-status{font-size:13px;color:var(--muted);margin:0}.create-actions{display:flex;flex-wrap:wrap;gap:8px}.create-actions button,.create-reload{min-height:42px;padding:8px 12px;border-radius:10px;background:var(--soft)}.create-actions .create-primary{background:var(--blue);color:white;flex:1}.create-reload{color:var(--muted);font-size:13px;background:none}.create-dialog :focus-visible{outline:2px solid var(--blue)}
@media(max-width:700px){.create-dialog{position:fixed;top:calc(var(--app-top,0px) + 8px);bottom:auto;max-height:calc(var(--app-height,100dvh) - 16px);padding-bottom:max(16px,env(safe-area-inset-bottom))}}
.create-entry[data-pending=true]::after{content:'';position:absolute;width:6px;height:6px;border-radius:50%;background:var(--amber);top:8px;right:7px}

.create-target-detail{font-size:11px;font-weight:400;overflow-wrap:anywhere;color:var(--muted);margin:0}
.choose-directory{align-self:flex-start;color:var(--blue);font-size:13px;padding:4px 0;min-height:32px;text-align:left}.directory-location{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end}.directory-location>.create-field:first-child{grid-column:1/-1}.directory-location select,.directory-location input,.directory-mkdir input{width:100%;font-size:16px;line-height:1.5;padding:10px;border:1px solid var(--line);background:var(--soft);border-radius:10px;color:inherit}.directory-location button,.directory-toolbar button,.directory-mkdir button,.directory-actions button,.directory-more{min-height:42px;padding:8px 12px;background:var(--soft);border-radius:10px;font-size:13px}.directory-toolbar{display:flex;gap:8px;margin:12px 0}.directory-toolbar button:last-child{margin-left:auto}.directory-mkdir{display:flex;gap:8px;margin:10px 0}.directory-mkdir input{min-width:0;flex:1}.directory-mkdir button{flex:none}.directory-list{max-height:32dvh;overflow:auto;overscroll-behavior:contain;margin-top:8px}.directory-row{display:flex;align-items:center;gap:10px;width:100%;min-height:45px;padding:10px 4px;text-align:left;border-bottom:1px solid var(--line)}.directory-row>.icon:first-child{color:var(--blue)}.directory-row>span:nth-child(2){flex:1;min-width:0;overflow-wrap:anywhere}.directory-row>.icon:last-child{color:var(--muted)}.directory-actions{display:flex;gap:10px;padding-top:14px;position:sticky;bottom:0;background:var(--surface)}.directory-actions>.create-primary{background:var(--blue);color:#fff;flex:1}.directory-more{width:100%;margin-top:8px;color:var(--blue)}
.directory-location select,.directory-location input,.directory-mkdir input{font-weight:400}
.create-dialog #create-title:focus{outline:none}
/* Keep the complete editor above the IME instead of clipping an outer outline. */
.create-dialog[open]{display:flex;flex-direction:column;overflow:hidden}
.create-dialog>header,.create-dialog>.create-note{flex-shrink:0}
.create-dialog>.create-fields,.create-dialog>.directory-picker{min-height:0;overflow-y:auto;padding:2px 2px 8px;scroll-padding-block:8px;overscroll-behavior:contain}
.create-dialog .create-field textarea:focus,.create-dialog .create-field select:focus,.create-dialog .directory-location input:focus,.create-dialog .directory-location select:focus,.create-dialog .directory-mkdir input:focus{outline:none;border-color:var(--blue);box-shadow:inset 0 0 0 1px var(--blue)}
@media(max-width:700px){
 :root[data-keyboard=true] .create-dialog{padding:8px 12px;max-height:calc(var(--app-height,100dvh) - 16px)}
 :root[data-keyboard=true] .create-dialog>.create-note{display:none}
 :root[data-keyboard=true] .create-dialog .create-field textarea{height:clamp(88px,calc(var(--app-height,100dvh) * .27),136px);min-height:88px;max-height:min(144px,calc(var(--app-height,100dvh) - 124px));resize:none}
}

/* Stacked field labels with a persistent creation action. */
.create-select-field{display:flex;flex-direction:column;align-items:stretch;gap:6px}
.create-select-field>.create-field-name{font-weight:500}
.create-select-field select{min-width:0;padding:9px 10px;text-overflow:ellipsis}
.create-project-field{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:10px;row-gap:6px;align-items:center}
.create-project-field>.create-field-name{grid-column:1;grid-row:1}
.create-project-field select{grid-column:1/-1;grid-row:2}
.create-project-field .create-target-detail{grid-column:1/-1;grid-row:3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.create-project-field .choose-directory{grid-column:2;grid-row:1;min-height:32px;padding:3px 0;font-size:12px;white-space:nowrap}
.create-footer{flex-shrink:0;padding-top:8px;margin-top:8px;border-top:1px solid var(--line);background:var(--surface)}
.create-footer .create-status:empty{display:none}.create-footer .create-status:not(:empty){margin-bottom:8px}
.create-footer .create-actions{align-items:center}.create-footer .create-actions button{min-height:44px}
.create-footer .create-reload{width:100%;min-height:30px;padding:4px 8px;font-size:12px}
@media(max-width:700px){
 :root[data-keyboard=true] .create-fields{gap:6px}
 :root[data-keyboard=true] .create-project-field .create-target-detail,:root[data-keyboard=true] .create-footer .create-reload{display:none}
 :root[data-keyboard=true] .create-dialog .create-field textarea{height:clamp(80px,calc(var(--app-height,100dvh) * .24),128px);min-height:80px;max-height:min(128px,calc(var(--app-height,100dvh) - 200px))}
}

/* Per-conversation native model selector; provider labels remain distinguishable. */
.conversation-model-button{display:block;max-width:100%;padding:0 2px 5px;text-align:left;color:var(--muted);font:12px/1.5 -apple-system,BlinkMacSystemFont,sans-serif;background:transparent;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;touch-action:manipulation}
.conversation-model-button:hover,.conversation-model-button[data-pending=true]{color:var(--blue)}
.conversation-model-dialog{width:min(440px,calc(100% - 24px));max-height:calc(var(--app-height,100dvh) - 24px);overflow:auto;margin:auto;padding:18px;border:1px solid var(--line);border-radius:16px;color:inherit;background:var(--surface)}
.conversation-model-dialog::backdrop{background:#0005}.conversation-model-dialog header{display:flex;align-items:center;justify-content:space-between;gap:10px}.conversation-model-dialog h2{font-size:19px;margin:0}.conversation-model-dialog h2:focus{outline:none}.conversation-model-current{font-size:13px;color:var(--muted);overflow-wrap:anywhere;margin:10px 0 18px}.conversation-model-dialog label{display:block;font-size:13px;margin-bottom:6px}.conversation-model-dialog select{width:100%;min-height:44px;padding:8px;border:1px solid var(--line);border-radius:9px;font:16px/1.5 -apple-system,BlinkMacSystemFont,sans-serif;color:inherit;background:var(--soft)}.conversation-model-status{font-size:13px;line-height:1.6;color:var(--muted)}.conversation-model-actions{display:flex;flex-wrap:wrap;gap:8px}.conversation-model-actions button{min-height:42px;padding:8px 12px;border-radius:9px;background:var(--soft)}#conversation-model-apply{background:var(--blue);color:white}.conversation-model-dialog button:disabled{opacity:.5}.conversation-model-dialog :focus-visible{outline:2px solid var(--blue);outline-offset:2px}

/* Side chats retain their parent relationship; live-state tabs show them independently. */
.conversation-row[data-side-chat=true]{margin-left:16px;padding-left:10px;border-left:2px solid var(--line)}
.row-parent{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.side-chat-toggle{display:block;min-height:36px;padding:4px 10px 6px 24px;font-size:12px;color:var(--muted);text-align:left;width:100%;border-bottom:1px solid var(--line)}
.side-chat-toggle:hover{background:var(--soft)}
.side-chat-parent{font-size:11px;color:var(--blue);max-width:100%;min-height:28px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 6px}

/* Native Agent questions: separate from command approvals and the chat draft. */
.question-card{max-width:760px;margin:14px 0;padding:16px;border:1px solid var(--amber);border-radius:12px;background:var(--soft);color:inherit}
.question-card h3{margin:0 0 12px;font-size:16px}.question-card fieldset{min-width:0;margin:0 0 18px;padding:0;border:0}.question-card legend{font-weight:600;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}.question-note,.question-status{font-size:12px;color:var(--muted);margin:5px 0 8px}.question-option{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px;border:1px solid var(--line);border-radius:8px;margin:6px 0;font-size:14px;cursor:pointer;background:var(--surface)}.question-option input{flex:none;width:18px;height:18px;accent-color:var(--blue)}.question-option:has(input:checked){border-color:var(--blue);background:var(--human)}.question-option span{overflow-wrap:anywhere;min-width:0}.question-freeform{display:block;width:100%;min-height:76px;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font-size:16px;resize:vertical}.question-submit,.question-check,.question-ack{min-height:44px;padding:10px 16px;border-radius:9px;font-weight:600}.question-submit{background:var(--blue);color:var(--surface);width:100%}.question-check,.question-ack{color:var(--blue);width:100%}.question-card:focus-within{scroll-margin-top:12px}

/* Explicit one-request approvals; details stay separate from editable chat drafts. */
.approval-host{max-width:760px;margin:14px 0}.approval-card{border:1px solid var(--amber);background:var(--soft);border-radius:12px;padding:16px;margin-bottom:12px;overflow:hidden}.approval-card h3{font-size:16px;margin:0 0 5px}.approval-card h4{font-size:12px;color:var(--muted);margin:13px 0 4px}.approval-scope,.approval-note,.approval-status{font-size:12px;color:var(--muted);overflow-wrap:anywhere}.approval-card pre{font:12px/1.6 ui-monospace,SFMono-Regular,monospace;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;background:var(--surface);border-radius:7px;padding:10px;max-height:320px;overflow:auto;margin:0}.approval-lines{font-size:13px;color:var(--muted)}.approval-file{margin-top:12px}.approval-diff summary{font-size:13px;min-height:38px;padding:8px 0;cursor:pointer}.approval-actions{display:flex;gap:10px;margin-top:15px}.approval-actions button{flex:1;min-height:44px;border-radius:8px;font-weight:600}.approval-allow{background:var(--blue);color:var(--surface)}.approval-reject{background:var(--surface);color:var(--red);border:1px solid var(--line)}.approval-check{display:block;color:var(--blue);min-height:44px;padding:8px 10px}.approval-status{padding:0 4px}
/* Dedicated native stop: always reachable, separate from the draft/send action. */
.run-stop-button{flex:none;min-width:44px;min-height:44px;padding:7px 9px;border-radius:9px;color:var(--red);background:var(--soft);font:600 13px/1.3 -apple-system,BlinkMacSystemFont,sans-serif;touch-action:manipulation}.run-stop-button:disabled{opacity:.55}.run-stop-notice{flex:none;display:flex;align-items:center;gap:10px;padding:7px 14px;background:var(--soft);border-bottom:1px solid var(--line);font-size:12px;line-height:1.5;color:var(--muted)}.run-stop-notice span{flex:1;min-width:0;overflow-wrap:anywhere}.run-stop-notice button{flex:none;min-height:36px;padding:4px 8px;color:var(--blue);font:inherit}
/* Document fences wrap for reading; their copy toolbar stays outside the scroller. */
.code-block{min-width:0;max-width:100%;margin:16px 0;background:var(--soft);border-radius:10px}.code-toolbar{position:sticky;top:var(--code-sticky-offset,0px);z-index:2;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:2px 8px 2px 14px;border-bottom:1px solid var(--line);border-radius:10px 10px 0 0;background:var(--soft);color:var(--muted)}.code-language{font:12px/1.5 -apple-system,BlinkMacSystemFont,sans-serif;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-toolbar .code-copy{position:static;display:inline-flex;align-items:center;justify-content:center;gap:5px;flex:none;width:auto;min-width:68px;height:40px;padding:4px 8px;border-radius:7px;font:12px/1.5 -apple-system,BlinkMacSystemFont,sans-serif;white-space:nowrap}.code-toolbar .code-copy:hover{background:var(--surface)}.code-block pre{position:static;margin:0;padding:12px 14px;border-radius:0 0 10px 10px;max-width:100%;overflow:auto}.code-block pre code{display:block;padding:0;background:none;white-space:pre;tab-size:2}.code-block.code-prose pre,.code-block.code-prose pre code{white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal}.assistant-message .code-block pre{margin:0;padding:12px 14px;border-radius:0 0 10px 10px}
/* Scoped token colors use local code text only, in both system appearances. */
.code-block{--syntax-keyword:#7c3aed;--syntax-string:#087443;--syntax-number:#a34b08;--syntax-comment:#687482;--syntax-function:#185bd5;--syntax-type:#086b84;--syntax-meta:#a63254}.code-block .hljs-keyword,.code-block .hljs-selector-tag,.code-block .hljs-literal{color:var(--syntax-keyword)}.code-block .hljs-string,.code-block .hljs-regexp,.code-block .hljs-addition{color:var(--syntax-string)}.code-block .hljs-number,.code-block .hljs-attr,.code-block .hljs-symbol{color:var(--syntax-number)}.code-block .hljs-comment,.code-block .hljs-quote{color:var(--syntax-comment);font-style:italic}.code-block .hljs-title,.code-block .hljs-selector-class,.code-block .hljs-selector-id{color:var(--syntax-function)}.code-block .hljs-type,.code-block .hljs-built_in,.code-block .hljs-builtin-name,.code-block .hljs-attribute{color:var(--syntax-type)}.code-block .hljs-meta,.code-block .hljs-name,.code-block .hljs-deletion{color:var(--syntax-meta)}.code-block .hljs-emphasis{font-style:italic}.code-block .hljs-strong{font-weight:600}@media(prefers-color-scheme:dark){.code-block{--syntax-keyword:#c9a0ff;--syntax-string:#91d4a8;--syntax-number:#f3bd89;--syntax-comment:#9aa7b7;--syntax-function:#8dbaff;--syntax-type:#7ed5e8;--syntax-meta:#f39bad}}
.code-block .hljs-section{color:var(--syntax-function);font-weight:600}.code-block .hljs-bullet{color:var(--syntax-keyword)}.code-block .hljs-code,.code-block .hljs-link{color:var(--syntax-string)}

/* Phone subagents: a dedicated, read-only page in the existing chat pane. */
#chat{position:relative}.mobile-subagents{position:absolute;inset:0;z-index:15;display:flex;flex-direction:column;background:var(--surface);min-width:0;padding-top:env(safe-area-inset-top);overflow:hidden}.ms-header{display:flex;align-items:center;gap:4px;flex:none;min-height:72px;padding:4px 12px 8px;border-bottom:1px solid var(--line)}.ms-identity{flex:1;min-width:0;text-align:center}.ms-identity h2{font-size:16px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms-subtitle{font-size:12px;color:var(--muted);margin-top:5px;display:flex;gap:9px;align-items:center;justify-content:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms-tools{padding:12px 18px 8px}.ms-search{height:40px;background:var(--soft);border-radius:10px;display:flex;align-items:center;gap:8px;padding:0 10px;color:var(--muted)}.ms-search input{width:100%;height:100%;font-size:16px}.ms-search input::placeholder{font-size:14px}.ms-search svg{width:17px;height:17px}.ms-tabs{display:flex;margin:0 18px;flex:none;border-bottom:1px solid var(--line)}.ms-tabs button{flex:1;min-height:44px;font-size:14px;color:var(--muted)}.ms-tabs button[aria-selected=true]{color:var(--blue);box-shadow:inset 0 -2px var(--blue)}.ms-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px 18px max(24px,env(safe-area-inset-bottom));scrollbar-width:thin;scrollbar-color:#9ba4b54d transparent}.ms-group{font-size:12px;color:var(--muted);font-weight:500;margin:12px 0 3px}.ms-row{width:100%;display:flex;align-items:flex-start;gap:10px;min-height:88px;padding:13px 0;text-align:left;border-bottom:1px solid var(--line)}.ms-row>.status-dot{margin-top:5px;flex:none}.ms-row-content{flex:1;min-width:0}.ms-row-title{display:flex;gap:8px;align-items:center;line-height:22px}.ms-row-title strong{min-width:0;flex:1;font-size:16px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms-row-title svg{width:15px;height:15px;color:var(--gray)}.ms-row-meta{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);margin-top:3px;min-width:0;white-space:nowrap}.ms-model{display:inline-flex;align-items:center;gap:5px;min-width:0;font-size:13px;color:var(--muted)}.ms-model>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ms-model svg{width:14px;height:14px;flex:none}.ms-row-meta>.ms-model{flex:1}.ms-type{max-width:60px;overflow:hidden;text-overflow:ellipsis;flex:none}.ms-state{white-space:nowrap;flex:none;color:var(--gray)}.ms-state.running{color:var(--green)}.ms-state.unread{color:var(--blue)}.ms-state.attention{color:var(--amber)}.ms-state.error{color:var(--red)}.ms-time{font-size:11px;color:var(--muted);margin:3px 0 0;line-height:18px}.ms-empty{font-size:14px;text-align:center;color:var(--muted);padding:35px 8px}.ms-parent{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;min-height:32px;text-align:left;width:100%}.ms-parent svg{width:14px;height:14px;margin-left:auto}.ms-context{font-size:11px;color:var(--muted);margin:4px 0 0}.ms-section{margin-top:24px}.ms-section h3{font-size:14px;font-weight:600;margin:0 0 10px}.ms-section .markdown{font-size:15px;line-height:1.85}.ms-current{background:var(--soft);border-radius:11px;padding:14px;margin-top:24px;font-size:13px}.ms-current p{font-size:12px;color:var(--muted)}.ms-current button,.ms-warning button{color:var(--blue);min-height:36px;font-size:13px}.ms-current-step{border-left:2px solid var(--green);padding:10px 12px;font-size:13px;color:var(--green)}.ms-foot{font-size:11px;line-height:1.7;color:var(--muted);margin-top:25px}.ms-notice{margin:8px 18px;padding:9px;background:var(--soft);font-size:12px;color:var(--amber)}.ms-warning{margin:14px 0;padding:13px;background:var(--soft);border:1px solid var(--amber);border-radius:10px;font-size:13px}.ms-warning>strong{color:var(--amber)}.ms-warning.error{border-color:var(--red)}.ms-warning.error>strong{color:var(--red)}.ms-warning p{line-height:1.8}.subagent-entry{display:flex;gap:7px;align-items:center;color:var(--muted);font-size:12px;min-height:36px;padding:4px 18px;border-bottom:1px solid var(--line);flex:none}.subagent-entry svg{width:14px;height:14px}.subagent-entry span:last-child{margin-left:auto;color:var(--green)}.subagent-call-highlight{outline:2px solid var(--blue);outline-offset:3px;border-radius:6px}.mobile-subagents .code-toolbar{top:0}.ms-model svg{color:inherit}

.ms-header>.icon-button[hidden]{display:flex!important;visibility:hidden;pointer-events:none}.ms-row .status-dot{width:15px;height:18px;flex-basis:15px}.ms-row .status-dot svg{width:12px;height:12px}

/* Reuse the composer's existing model row instead of taking a chat header row. */
.composer-tools{display:flex;align-items:center;gap:10px;min-width:0;max-width:100%;padding-bottom:5px;flex:none}.composer-tools .conversation-model-button{flex:1;min-width:0;max-width:none;padding-bottom:0;margin:0;font-size:12px;min-height:24px}.composer-tools .subagent-entry{flex:0 1 auto;min-width:0;max-width:58%;padding:0;border:0;min-height:24px;font-size:12px;gap:5px;white-space:nowrap}.composer-tools .subagent-entry>span:last-child{margin:0;color:var(--green)}.composer-tools .subagent-entry svg{width:13px;height:13px}.composer-tools .subagent-entry>span{overflow:hidden;text-overflow:ellipsis}
/* Let text wrap; keep wide tables/program code scrolling inside their own block. */
.mobile-subagents .ms-body{overflow-x:hidden;overflow-wrap:anywhere}.ms-section,.ms-section .markdown,.ms-conversation-turn{min-width:0;max-width:100%;overflow-wrap:anywhere}.ms-section>h3{font-size:14px;line-height:1.6;margin:0 0 10px}.ms-section .markdown> :first-child{margin-top:0}.mobile-subagents .markdown{min-width:0;max-width:100%;overflow-wrap:anywhere}.mobile-subagents .markdown a,.mobile-subagents .markdown :not(pre)>code{overflow-wrap:anywhere;word-break:normal}.mobile-subagents .markdown pre{max-width:100%;overflow-x:auto}.mobile-subagents .markdown table{display:block;max-width:100%;overflow-x:auto}.ms-parent{overflow-wrap:anywhere;min-width:0}.ms-context,.ms-warning,.ms-current{overflow-wrap:anywhere;min-width:0;max-width:100%}.ms-conversation-turn{margin:24px 0 30px}.ms-conversation-turn .assistant-message{font-size:15px;line-height:1.85}.ms-message-role{font-size:11px!important;color:var(--muted);margin:0 0 8px!important}.ms-load-earlier{display:block;width:100%;min-height:40px;font-size:13px;color:var(--blue);background:var(--soft);border-radius:8px;margin:16px 0}.ms-conversation-turn .human-message{font-size:14px}.ms-conversation-turn .copy-reply{margin-top:10px}


/* Match the main phone task list's three-line density. */
@media(max-width:699px){
 .mobile-subagents[data-view=list] .ms-header{min-height:64px}
 .mobile-subagents[data-view=list] .ms-tools{padding:8px 16px 6px}
 .mobile-subagents[data-view=list] .ms-tabs{margin:0 16px}
 .mobile-subagents[data-view=list] .ms-tabs button{min-height:40px;font-size:13px}
 .mobile-subagents[data-view=list] .ms-body{padding:0 16px max(10px,env(safe-area-inset-bottom))}
 .ms-group{margin:10px 0 3px;font-size:11px}
 .ms-row{min-height:76px;padding:10px 0;gap:10px}
 .ms-row-title{font-size:15px;line-height:1.5}
 .ms-row-title strong{font-size:15px}
 .ms-row-meta{gap:5px;margin-top:1px;font-size:12px;line-height:18px}
 .ms-row-meta .ms-model{font-size:12px;line-height:18px}
 .ms-row .ms-time{margin-top:0;font-size:12px;line-height:18px}
 .ms-row>.status-dot{margin-top:0;width:14px;height:22.5px;flex-basis:14px}
 .ms-row .status-dot.running svg{width:17px;height:17px}
}

/* On-demand history and process details: footer actions exist only in open groups. */
.history-page-button,.reading-action{font:inherit;color:var(--accent,#2563eb);border:1px solid var(--line,#dce2eb);background:transparent;border-radius:8px;min-height:36px;padding:7px 11px;cursor:pointer;touch-action:manipulation;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.history-page-button{display:block;width:100%;margin:9px 0 16px;font-size:12px}
.history-page-button:disabled,.reading-action:disabled{opacity:.55;cursor:default}
.reading-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:10px 0 2px;padding-top:7px;border-top:1px solid var(--line,#dce2eb)}
.reading-footer .reading-action{font-size:12px;flex:1 1 auto}
.reading-note{font-size:12px;line-height:1.5;opacity:.7;margin:9px 0;overflow-wrap:anywhere}
.reading-process-body,.paged-activities .activity-detail{min-width:0;max-width:100%;overflow-wrap:anywhere}
.paged-activities .activity-result{flex:none;font-size:11px;white-space:nowrap}
.paged-activities .activity-detail pre{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;max-width:100%}

/* Progressive body continuation occupies only its local reading boundary. */
.reading-body-edge{font-size:11px;line-height:1.5;color:var(--muted);margin:10px 0;overflow-wrap:anywhere}

/* Mobile task handoff: lightweight child status, no transcript prefetch. */
.child-activity-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:-3px 0 5px;padding:0 14px 0 34px;min-width:0}
.child-activity{display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-width:0;min-height:32px;padding:3px 0;font-size:11px;color:var(--muted);text-align:left;flex:0 1 50%}
.child-activity.subagent{margin-left:auto;justify-content:flex-end;text-align:right}.child-count{white-space:nowrap}.child-badge{display:inline-flex;align-items:center;gap:3px;padding:2px 4px;border-radius:4px;white-space:nowrap;background:var(--soft)}
.child-badge.running{color:var(--green)}.child-badge.attention{color:var(--amber)}.child-badge.error{color:var(--red)}.child-badge.unread{color:var(--blue)}
.child-spinner{width:9px;height:9px;flex:none;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:child-spin 1s linear infinite}@keyframes child-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.child-spinner{animation:none}}
.entry-return{flex:none;align-self:flex-start;color:var(--blue);font-size:11px;min-height:28px;padding:4px 16px}.entry-return[hidden]{display:none}

.composer-tools .subagent-entry>span[data-state=attention]{color:var(--amber)}.composer-tools .subagent-entry>span[data-state=error]{color:var(--red)}

.attention-group.action{color:var(--amber)}.attention-group.unread{color:var(--blue)}

/* Keep actionable children inside their owning attention row. */
#panel-attention .conversation-row.has-child-alert{display:block}
#panel-attention .has-child-alert>.open-conversation{width:100%;padding-bottom:0}
.row-child-alert{display:flex;align-items:center;gap:3px;max-width:calc(100% - 46px);min-height:30px;margin:0 22px 7px 24px;padding:2px 0;text-align:left;font-size:11px;line-height:1.5;color:var(--muted);flex-wrap:wrap}
.row-child-alert .attention{color:var(--amber)}.row-child-alert .error{color:var(--red)}.row-child-alert svg{width:12px;height:12px;flex:none;margin-left:3px}
.row-child-alert:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}

/* Attention is a flat inbox: side-chat ownership is explicit, not positional. */
#panel-attention .conversation-row[data-side-chat=true]{margin-left:0;padding-left:0;border-left:0}
#panel-attention .row-side-badge{display:inline-block;vertical-align:1px;margin-right:6px;padding:1px 5px;border-radius:4px;background:#f1e9fc;color:#6d3caa;font-size:11px;font-weight:600;line-height:1.5}

#panel-attention .row-parent-name{color:#8060a6}
@media(prefers-color-scheme:dark){#panel-attention .row-side-badge{background:#332744;color:#d3b3ff}#panel-attention .row-parent-name{color:#bba3d6}}

/* The All tab keeps child entry points inside the parent's row boundary. */
#panel-all .conversation-row.has-child-bar{display:block}
#panel-all .has-child-bar>.open-conversation{width:100%;padding-bottom:1px}
#panel-all .has-child-bar>.child-activity-bar{margin:0;padding:0 0 2px 24px}
#panel-all .child-activity.side>.child-count{color:#8060a6}
#panel-all .child-activity svg{width:12px;height:12px;flex:none}
#panel-all .conversation-row[data-side-chat=true]:not([aria-current=true]){background:var(--soft)}
@media(prefers-color-scheme:dark){#panel-all .child-activity.side>.child-count{color:#bba3d6}}

/* Compact All-tab child controls and expanded side-chat rows. */
#panel-all .child-activity{min-height:26px;padding:1px 0;row-gap:2px}
#panel-all .conversation-row[data-side-chat=true]{min-height:0}
#panel-all .conversation-row[data-side-chat=true]>.open-conversation{padding-top:6px;padding-bottom:6px;line-height:1.4}
#panel-all .conversation-row[data-side-chat=true] .row-title{font-size:14px;line-height:1.4;margin-bottom:1px}
#panel-all .conversation-row[data-side-chat=true] .row-meta,#panel-all .conversation-row[data-side-chat=true] .row-summary{font-size:11px;line-height:1.45}
#panel-all .conversation-row[data-side-chat=true] .row-parent{font-size:10.5px;line-height:1.4}
#panel-all .conversation-row[data-side-chat=true] .row-chevron{top:22px}

#panel-all .conversation-row[data-nested-side-chat=true] .row-title{font-size:13px}

.side-create-entry{display:inline-flex;align-items:center;gap:3px;flex:none;min-height:28px;padding:0 4px;font-size:12px;color:var(--muted);white-space:nowrap}.side-create-entry svg{width:13px;height:13px}.side-create-entry[hidden]{display:none}.side-create-entry:disabled{opacity:.5}.side-create-dialog .create-note{overflow-wrap:anywhere}.side-create-dialog textarea{width:100%;font-size:16px;resize:none}.side-create-dialog .create-footer{flex:none}.side-create-dialog .create-fields{min-height:0;overflow:auto}

.side-create-dialog #side-create-title:focus{outline:none}

/* Current main conversation's side chats; a modal drawer keeps the chat anchor. */
.side-drawer{position:fixed;inset:var(--app-top,0px) 0 auto auto;margin:0;width:min(360px,88vw);max-width:none;height:var(--app-height,100dvh);max-height:none;padding:0;border:0;border-left:1px solid var(--line);background:var(--surface);color:inherit;box-shadow:-8px 0 30px #0002;overflow:hidden}
.side-drawer[open]{display:flex;flex-direction:column;animation:side-drawer-in .16s ease-out}.side-drawer::backdrop{background:#0005}
@keyframes side-drawer-in{from{transform:translateX(100%)}to{transform:translateX(0)}}
.side-drawer-header{display:flex;align-items:center;gap:6px;flex:none;padding:max(14px,env(safe-area-inset-top)) 10px 12px 16px;border-bottom:1px solid var(--line)}
.side-drawer-identity{min-width:0;flex:1}.side-drawer-identity h2{font-size:17px;margin:0 0 4px}.side-drawer-identity p{margin:0;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.side-drawer-new{display:flex;align-items:center;gap:3px;flex:none;min-height:36px;padding:4px 5px;color:var(--blue);font-size:12px;white-space:nowrap}.side-drawer-new svg{width:14px;height:14px}.side-drawer-new:disabled{opacity:.45}
.side-drawer-list{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1;padding:0 14px max(12px,env(safe-area-inset-bottom));scrollbar-width:thin}
.side-drawer-row{display:flex;align-items:flex-start;gap:9px;width:100%;text-align:left;padding:12px 0;border-bottom:1px solid var(--line);min-height:65px}.side-drawer-row>.status-dot{flex:none;margin-top:5px}.side-drawer-content{flex:1;min-width:0}.side-drawer-row-title{font-size:14px;line-height:1.45;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.side-drawer-meta{display:flex;align-items:center;gap:6px;margin-top:5px;font-size:11px;color:var(--muted)}.side-drawer-meta time{margin-left:auto;white-space:nowrap}.side-drawer-row>.icon svg{width:13px;height:13px;color:var(--muted);margin-top:5px}
.side-drawer-empty{padding:55px 8px;text-align:center;font-size:13px;color:var(--muted)}.side-drawer-empty>.icon svg{width:28px;height:28px}.side-drawer-empty p{line-height:1.7}.side-drawer-notice{font-size:11px;color:var(--amber);padding:8px 16px;margin:0;background:var(--soft)}
@media(prefers-reduced-motion:reduce){.side-drawer[open]{animation:none}}

#panel-all .child-activity.side>.child-count{display:inline-flex;align-items:center;gap:3px}
#panel-all .side-expand-arrow{display:inline-flex;align-items:center;justify-content:center;width:12px;flex:none;font-size:20px;line-height:12px;height:12px;font-weight:500}

/* Panel entry focuses its heading; touch close controls have no focus box. */
.modal-entry-title:focus,.modal-entry-title:focus-visible{outline:none!important}
dialog .icon-button,.mobile-subagents .icon-button{border-radius:10px}
dialog .icon-button:focus-visible,.mobile-subagents .icon-button:focus-visible{outline-offset:-3px}
:root:not([data-input-mode=keyboard]) dialog .icon-button:focus,:root:not([data-input-mode=keyboard]) .mobile-subagents .icon-button:focus{outline:none;box-shadow:none}

/* Keep creation within thumb reach and identify side chats without a banner. */
.side-drawer-footer{flex:none;padding:10px 14px max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface)}
.side-drawer-footer .side-drawer-new{width:100%;min-height:46px;justify-content:center;gap:6px;padding:10px 12px;border-radius:10px;background:var(--soft);font-size:14px}
.side-drawer-footer .side-drawer-new svg{width:16px;height:16px}.side-drawer-list{padding-bottom:12px}
.chat-title-line{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;margin-bottom:3px}.chat-title-line #chat-title{min-width:0;flex:0 1 auto;margin:0}
.chat-side-badge{flex:none;white-space:nowrap;font-size:11px;font-weight:600;line-height:16px;padding:1px 5px;border-radius:4px;background:#f1e9fc;color:#6d3caa}
@media(prefers-color-scheme:dark){.chat-side-badge{background:#332744;color:#d3b3ff}}

.side-chat-parent{display:inline-flex;align-items:center;justify-content:center;gap:3px;color:var(--muted);vertical-align:middle}
.side-chat-parent>.icon,.parent-link-label{flex:none}.side-chat-parent svg{width:13px;height:13px;stroke-width:1.6}
.parent-link-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8060a6}
@media(prefers-color-scheme:dark){.parent-link-name{color:#bba3d6}}

.chat-actions{position:fixed;inset:calc(var(--app-top,0px) + max(58px,env(safe-area-inset-top))) 12px auto auto;width:190px;max-width:calc(100vw - 24px);margin:0;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:inherit;box-shadow:0 8px 30px #0002}
.chat-actions::backdrop{background:#0001}.chat-action{display:block;width:100%;min-height:44px;text-align:left;padding:10px 12px;border-radius:7px;font-size:14px}.chat-action:hover{background:var(--soft)}.chat-action:disabled{opacity:.45}

.reply-footer{display:flex;align-items:flex-start;gap:4px;margin-top:7px;max-width:100%;color:var(--muted);font-size:11px}
.reply-footer .copy-reply{flex:none;margin:0;padding:0 8px;min-width:40px;min-height:40px;justify-content:center;gap:5px}.reply-footer .copy-reply svg{width:15px;height:15px}.reply-preview-label{font-size:11px;white-space:nowrap}
.reply-timing{min-width:0;flex:1;align-self:stretch}.reply-timing>summary{list-style:none;display:flex;align-items:center;min-height:40px;cursor:pointer;font-size:11px;line-height:1.5;overflow-wrap:anywhere}.reply-timing>summary::-webkit-details-marker{display:none}.reply-timing>summary:focus-visible{outline:2px solid var(--blue);border-radius:6px}
.reply-time-detail{padding:8px 10px;margin:0 0 8px;background:var(--soft);border-radius:8px;font-size:11px;line-height:1.6}.reply-time-detail p{margin:0 0 3px}

.reply-footer .copy-reply:not(.is-preview){margin-left:-12px;justify-content:flex-end;padding-right:2px}

.model-picker-native{display:none!important}
.model-picker-trigger{width:100%;min-width:0;display:flex;align-items:center;gap:8px;min-height:44px;border:1px solid var(--line);border-radius:10px;padding:9px 10px;background:var(--soft);color:var(--text);text-align:left;font:400 14px/1.5 -apple-system,BlinkMacSystemFont,sans-serif}.model-picker-trigger:disabled{opacity:.55}.model-picker-value{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.model-picker-trigger>.icon{flex:none}.model-picker-full{font-size:11px;font-weight:400;color:var(--muted);overflow-wrap:anywhere;margin:4px 0 0;line-height:1.5}.model-picker-full[hidden]{display:none}
.model-picker-dialog{width:min(480px,calc(100vw - 24px));max-width:none;max-height:min(70dvh,620px);padding:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--text);overflow:hidden}.model-picker-dialog::backdrop{background:#0005}.model-picker-dialog[open]{display:flex;flex-direction:column}.model-picker-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:12px 14px;border-bottom:1px solid var(--line)}.model-picker-dialog h2{margin:0;font-size:16px;font-weight:600}.model-picker-dialog .icon-button{min-width:40px;min-height:40px}.model-picker-list{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:4px 8px;scrollbar-width:thin}.model-picker-row{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:10px 8px;border-radius:8px;text-align:left;color:inherit;background:transparent;font:400 14px/20px -apple-system,BlinkMacSystemFont,sans-serif}.model-picker-row-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.model-picker-check{width:18px;flex:none;color:var(--blue);display:flex;align-items:center}.model-picker-check svg{width:16px;height:16px}.model-picker-row[aria-selected=true]{background:var(--human)}.model-picker-row:disabled{opacity:.45}.model-picker-row:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}.model-picker-empty{font-size:13px;color:var(--muted);padding:16px}.model-picker-dialog .modal-entry-title:focus{outline:none}

/* Tool activity and thinking share a quiet opacity-only rhythm, distinct from
   conversation status rings. Fixed geometry keeps text and reading anchors still. */
.activity-dots{display:inline-flex;align-items:center;justify-content:center;gap:3px;width:21px;height:17px;flex:0 0 21px;color:var(--muted)}
.activity-dots i{display:block;width:4px;height:4px;border-radius:50%;background:currentColor;opacity:.28;animation:activity-pulse 1.4s ease-in-out infinite}
.activity-dots i:nth-child(2){animation-delay:.18s}.activity-dots i:nth-child(3){animation-delay:.36s}
@keyframes activity-pulse{0%,70%,100%{opacity:.28}35%{opacity:1}}
.activity-live-summary{gap:7px!important}.activity-live-summary>svg{flex-shrink:0}
.activity-count,.activity-wait{flex-shrink:0;white-space:nowrap;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.generation-placeholder{display:flex;align-items:center;gap:7px}
[data-activity-paused=true] .activity-dots i{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.activity-dots i{animation:none;opacity:.6}}

.keyboard-probe-launch{display:block;color:var(--blue);min-height:44px;padding:10px 0;font-size:13px}
.keyboard-probe{position:fixed;inset:auto;left:50%;transform:translateX(-50%);margin:0;width:min(100vw,480px);max-width:100vw;max-height:none;box-sizing:border-box;border:0;background:var(--surface);color:inherit;padding:12px 16px;overflow:auto}
.keyboard-probe header{display:flex;align-items:center;justify-content:space-between}.keyboard-probe h2{font-size:17px;margin:0;outline:none}.keyboard-probe p{font-size:12px;line-height:1.5;color:var(--muted);margin:8px 0}
.keyboard-probe select,.keyboard-probe textarea{width:100%;box-sizing:border-box;font-size:16px;border:1px solid var(--line);border-radius:8px;padding:8px;background:var(--soft);color:inherit}.keyboard-probe select{min-height:40px}.keyboard-probe textarea{height:80px;resize:none}.keyboard-probe-controls{display:flex;gap:8px;flex-wrap:wrap}.keyboard-probe-controls button{min-height:40px;font-size:13px;padding:6px 10px;border-radius:8px;background:var(--human);color:var(--blue)}.keyboard-probe pre{font-size:10px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:140px;overflow:auto}

/* Immediate, quiet send feedback; receipt uncertainty remains a separate state. */
#send[data-busy=true]:disabled{background:var(--blue);opacity:.8}#send .activity-dots{color:inherit}

/* Everyday settings are separate from technical diagnostics. */
.mobile-settings{width:min(94vw,440px);max-height:calc(100dvh - 40px);overflow:auto;margin:auto;border:1px solid var(--line);border-radius:18px;padding:18px;background:var(--surface);color:inherit}.mobile-settings::backdrop{background:#17223566}.mobile-settings header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.mobile-settings h2{font-size:19px;margin:0}.mobile-settings .icon-button{border-radius:10px}.mobile-settings .modal-entry-title{outline:none}
.settings-link{display:flex;align-items:center;gap:12px;width:100%;min-height:68px;text-align:left;padding:14px 0;color:inherit}.settings-link>svg{width:20px;height:20px;color:var(--muted)}.settings-link-copy{flex:1;min-width:0;display:grid;gap:4px}.settings-link-title{font-size:15px}.settings-link-note{font-size:12px;color:var(--muted);line-height:1.5}.notification-setting-row{display:flex;align-items:center;justify-content:space-between;gap:14px}.task-notification-settings{padding:12px 0 18px;border-bottom:1px solid var(--line)}.notification-setting-copy{min-width:0}.notification-setting-copy h3{font-size:15px;font-weight:600;margin:0 0 5px}.notification-setting-copy p{font-size:12px;color:var(--muted);margin:0;line-height:1.5}.notification-setting-status{font-size:12px;color:var(--muted);margin:10px 0}.notification-setting-note{font-size:12px;color:var(--muted);line-height:1.65;margin:0}.notification-setting-retry{font-size:13px;color:var(--blue);min-height:40px;padding:6px 0}.notification-switch{position:relative;flex:0 0 48px;width:48px;height:44px;border-radius:10px;padding:0}.notification-switch::before{content:"";position:absolute;left:2px;top:9px;width:44px;height:26px;border-radius:20px;background:var(--gray);transition:background .15s}.notification-switch::after{content:"";position:absolute;left:5px;top:12px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0002;transition:transform .15s}.notification-switch[aria-checked=true]::before{background:var(--blue)}.notification-switch[aria-checked=true]::after{transform:translateX(18px)}.connection-technical{margin-top:16px;color:var(--muted);font-size:12px}.connection-technical>summary{min-height:36px;line-height:36px;cursor:pointer}

.notification-setting-row:has(.notification-mode){align-items:flex-start;flex-direction:column;gap:10px}.notification-mode{width:100%;min-height:44px;border:1px solid var(--line);border-radius:9px;padding:8px 10px;font-size:15px;background:var(--soft);color:inherit}
