: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}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 0 15px;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 30px 3px 0}.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}.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)}#task-status{flex-shrink:0;display:flex;gap:7px;align-items:center;justify-content:center;border-bottom:1px solid var(--line);padding:0 20px 13px;color:var(--muted);font-size:12px;min-height:32px}#task-status .status-dot{height:16px;width:10px;flex-basis:10px}#task-status.running{color:var(--green);justify-content:flex-start;padding:10px 20px;background:#16b64b0c;border:0}#task-status.attention,#task-status.error{justify-content:flex-start;padding:10px 20px;background:#d9931010;color:var(--amber)}#task-status.error{background:#ef404b0c;color:var(--red)}
#messages{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}.streaming-label{display:flex;align-items:center;gap:8px;color:var(--green);font-size:12px;padding-top:12px}.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-status.running{background:#55d88b0c}#task-status.attention{background:#efb9510c}#task-status.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}
