/* The task dock owns layout space. It never covers a message or a composer. */
body.app-shell{height:100vh;height:100dvh;overflow:hidden}
.app-frame{height:100%;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"workspace" "tasks";min-width:0;min-height:0}
.app-frame>.layout{grid-area:workspace;min-height:0;height:100%;overflow:hidden}
.app-shell .sidebar-wrap{min-height:0}
.app-shell .sidebar{height:100%;position:relative;top:auto}
.app-shell .content{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding-bottom:0}
.app-shell .content>main.container{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding-bottom:18px;scrollbar-gutter:stable}
.app-shell .header{flex-shrink:0;min-height:54px;padding:9px 0;gap:10px;flex-wrap:wrap}
.shell-brand{display:none;align-items:center;gap:9px;color:var(--txt);font-weight:750;text-decoration:none;margin-right:auto;min-width:0}
.shell-tools{display:flex;align-items:center;gap:8px;margin-left:auto;flex-shrink:0}
.balance-chip,.shell-tasks-button{display:inline-flex;align-items:center;gap:8px;padding:7px 11px;border:1px solid var(--border);border-radius:10px;background:var(--card);color:var(--txt);font:600 12px/1.25 Inter,system-ui,sans-serif;text-decoration:none;cursor:pointer;box-shadow:none;min-height:34px}
.balance-chip:hover,.shell-tasks-button:hover{border-color:var(--grad1)}
.balance-label{color:var(--muted);font-weight:500}
.balance-amount{font-variant-numeric:tabular-nums;white-space:nowrap}
.balance-plus{display:inline-flex;align-items:center;justify-content:center;border-left:1px solid var(--border);padding-left:9px;font-size:16px;color:var(--grad1)}
.balance-chip[data-stale="true"] .balance-amount{opacity:.65}
.balance-chip[data-low="true"] .balance-amount{color:#fbbf24}
.shell-tasks-button[aria-expanded="true"]{border-color:var(--grad1)}
.shell-tasks-count:empty{display:none}
.app-shell.quick-start-mode .sidebar-wrap{display:none}
.app-shell.quick-start-mode .shell-brand{display:flex}
.app-shell.quick-start-mode .content{padding-inline:clamp(12px,3vw,32px)}
.app-shell.quick-start-mode .header{min-height:64px}
.app-shell.quick-start-mode .content>main.container{max-width:none}
/* A chat uses the remaining workspace height, not the browser height. */
.app-shell .content>main:has(>.tg-chat-shell){display:flex;flex-direction:column;padding-bottom:12px;overflow:hidden}
.app-shell .tg-chat-shell{flex:1;min-height:0;height:100%;overflow:hidden}
.app-shell .tg-chat-list{display:flex;flex-direction:column;min-height:0}
.app-shell .tg-chat-list .tg-list-head{position:relative;flex-shrink:0}
.app-shell .tg-chat-list .tg-list-items{flex:1;min-height:0;max-height:none;overflow:auto}
.app-shell .tg-chat-main{min-height:0;overflow:auto;display:flex;flex-direction:column}
.app-shell .tg-chat-main>.page-header{position:relative;flex-shrink:0}
.app-shell .tg-chat-main .chat-wrap{height:auto;min-height:0;flex:1}
.app-shell .tg-chat-main .msgs{min-height:120px;flex:1;overflow:auto}
.app-shell .tg-chat-main .composer{flex-shrink:0}
/* Quiet 34px status line, collapsed by default; details are opt-in. */
.app-shell .task-panel{grid-area:tasks;position:relative;inset:auto;z-index:auto;width:auto;min-width:0;min-height:0;pointer-events:auto;font-size:12px}
.app-shell .task-panel[hidden]{display:none}
.app-shell .task-dock-shell{border:0;border-top:1px solid var(--border);border-radius:0;box-shadow:none;background:var(--bg-2);backdrop-filter:none}
.app-shell .task-statusbar{display:flex;align-items:center;justify-content:space-between;height:34px;min-width:0;border-bottom:0;gap:6px}
.app-shell .task-status-main{display:flex;align-items:center;flex:1;height:100%;border:0;background:transparent;color:var(--txt);text-align:left;cursor:pointer;gap:9px;padding:0 14px;font:inherit;min-width:0}
.app-shell .task-window-actions{display:flex;align-items:stretch;align-self:stretch;flex-shrink:0}
.app-shell .task-window-actions button{display:grid;place-items:center;height:100%;padding:0;margin:0;border:0;background:transparent;color:var(--muted);cursor:pointer}
.app-shell .task-window-actions button:hover,.app-shell .task-status-main:hover{background:var(--card);color:var(--txt)}
.app-shell .task-drawer{display:flex;flex-direction:column}
.app-shell .task-entry{border:1px solid var(--border);background:var(--card)}
.app-shell .task-entry>summary{display:flex;align-items:center;justify-content:space-between;list-style:none;cursor:pointer}
.app-shell .task-entry>summary::-webkit-details-marker{display:none}
.app-shell .task-title{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.app-shell .task-status-main b{font-size:12px;font-weight:650;white-space:nowrap}
.app-shell .task-status-main .task-headline{color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app-shell .task-status-icon{font-size:12px;flex-shrink:0}
.app-shell .task-window-actions button{width:34px;font-size:15px;border-left:0}
.app-shell .task-window-actions [data-task-place]{width:auto;padding:0 10px;font-size:11px}
.app-shell .task-drawer{height:var(--task-drawer-height,220px);max-height:45dvh;min-height:70px;padding:8px 12px;gap:6px;overflow:auto;border-top:1px solid var(--border)}
.app-shell .task-entry{border-radius:7px;flex-shrink:0}
.app-shell .task-entry>summary{padding:7px 9px;gap:12px}
.app-shell .task-title{font-size:12px;font-weight:550}
.app-shell .task-summary-status{max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-shell .task-entry-body{padding:8px 10px;font-size:12px}
.app-shell .task-meta{margin-bottom:5px;overflow-wrap:anywhere}
.task-technical>summary{color:var(--muted);cursor:pointer;font-size:11px}
.task-error-notice{margin:0;padding:7px 14px;color:#fbbf24;font-size:12px}
.task-resize{height:5px;cursor:ns-resize;touch-action:none;position:relative;background:transparent;outline-offset:-2px}
.task-resize:hover,.task-resize:focus-visible{background:var(--grad1)}
.app-frame[data-task-state="collapsed"] .task-resize,.app-frame[data-task-state="hidden"] .task-panel{display:none}
.app-frame[data-task-position="right"][data-task-state="open"]{grid-template-columns:minmax(0,1fr) var(--task-dock-width,340px);grid-template-rows:minmax(0,1fr);grid-template-areas:"workspace tasks"}
.app-frame[data-task-position="right"][data-task-state="open"] .task-panel{border-left:1px solid var(--border)}
.app-frame[data-task-position="right"][data-task-state="open"] .task-dock-shell{height:100%;display:flex;flex-direction:column;border-top:0}
.app-frame[data-task-position="right"][data-task-state="open"] .task-statusbar{flex-shrink:0}
.app-frame[data-task-position="right"][data-task-state="open"] .task-drawer{flex:1;height:auto;max-height:none}
.app-frame[data-task-position="right"][data-task-state="open"] .task-resize{position:absolute;left:0;top:0;width:5px;height:100%;cursor:ew-resize;z-index:1}
@media(max-width:900px){
 .app-frame[data-task-position="right"][data-task-state="open"]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"workspace" "tasks"}
 .app-frame[data-task-position="right"][data-task-state="open"] .task-panel{border-left:0}
 .app-frame[data-task-position="right"][data-task-state="open"] .task-dock-shell{height:auto;border-top:1px solid var(--border)}
 .app-frame[data-task-position="right"][data-task-state="open"] .task-drawer{flex:none;height:var(--task-drawer-height,220px);max-height:40dvh}
 .app-frame[data-task-position="right"][data-task-state="open"] .task-resize{position:relative;inset:auto;width:100%;height:5px;cursor:ns-resize}
 .app-shell .task-window-actions [data-task-place]{display:none}
 .app-shell .tg-chat-list{display:none}
}
@media(max-width:720px){
 .app-shell .app-frame>.layout{flex-direction:column}
 .app-shell .content{order:1;flex:1;min-height:0;padding-inline:8px}
 .app-shell .sidebar-wrap{order:2;width:100%;height:58px;min-height:58px;flex:0 0 58px}
 .app-shell .sidebar{width:100%;height:58px;min-height:58px}
 .app-shell .content>main.container{padding-bottom:6px;scrollbar-gutter:auto}
 .app-shell .content>main:has(>.tg-chat-shell){padding-bottom:4px}
 .app-shell .header{min-height:46px;padding:5px 0}
}
@media(max-width:520px){
 .app-shell .header{min-height:46px;gap:6px}
 .shell-tools{gap:6px}.balance-chip,.shell-tasks-button{min-height:44px;padding:6px 8px;gap:6px}
 .shell-tasks-button{min-width:44px;justify-content:center}
 .balance-label{display:none}.shell-tasks-button .shell-tasks-label{display:none}
 .shell-brand{font-size:13px;gap:6px}.shell-brand img{width:22px;height:22px}
 .app-shell .task-statusbar{height:44px}
 .app-shell .task-status-main{padding-inline:10px;gap:7px}.app-shell .task-drawer{padding:7px;max-height:38dvh}
 .app-shell .task-window-actions button{width:44px}.app-shell .task-summary-status{max-width:34%}
}
@media(prefers-reduced-motion:reduce){.app-shell .task-state-dot{animation:none!important}}
.app-shell .task-panel[data-state="collapsed"] .task-drawer{display:none}
.task-state-dot{display:inline-block;width:6px;height:6px;margin-right:7px;border-radius:50%;background:var(--muted)}
.task-entry.running .task-state-dot,.task-entry.queued .task-state-dot,.task-entry.retrying .task-state-dot{background:var(--grad1)}
.task-entry.done .task-state-dot{background:#4ed68a}.task-entry.error .task-state-dot{background:#fbbf24}
.task-block{margin-top:8px}.task-block b{font-size:11px;color:var(--muted)}
.task-block pre{margin:5px 0;padding:8px;max-height:180px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:var(--card);border-radius:6px;font:11px/1.5 ui-monospace,monospace}
.task-history{padding-left:18px;color:var(--muted);font-size:11px}
.task-actions{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.task-action{border:1px solid var(--border);border-radius:6px;padding:5px 8px;background:var(--card);color:var(--txt);text-decoration:none;font:600 11px/1.4 Inter,system-ui,sans-serif;cursor:pointer}
.task-action:disabled{opacity:.5;cursor:wait}
@media(max-width:1280px){.app-frame[data-task-position="right"][data-task-state="open"] .tg-chat-shell{grid-template-columns:minmax(0,1fr)}.app-frame[data-task-position="right"][data-task-state="open"] .tg-chat-list{display:none}}
