/* The 对话 / Agent switch lives in the composer's tool row. */
.chat-mode-switch{display:inline-flex;align-items:center;gap:2px;margin:0 0 0 6px;padding:3px;border:1px solid var(--line);border-radius:999px;background:var(--surface)}
.chat-mode-switch button{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:28px;padding:0 12px;border:0;border-radius:999px;background:transparent;color:var(--muted);font:inherit;font-size:13px;font-weight:500;line-height:1;cursor:pointer;white-space:nowrap;transition:background .16s,color .16s}
.chat-mode-switch button:hover{color:var(--ink)}
.chat-mode-switch button.is-active{background:var(--ink);color:var(--surface)}
.chat-mode-switch button[data-chat-mode=work].is-active{background:#5d5cde;color:#fff}
.chat-mode-switch button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.chat-mode-switch button:disabled{opacity:.6;cursor:wait}
.composer-zone>.chat-mode-switch{margin:0 0 10px}
.work-composer-status{color:var(--muted);font-size:11px;line-height:1.7;margin:9px 5px 0}
.work-composer-status[hidden]{display:none}
.workspace-heading #toggle-sidebar[hidden],.workspace-heading h1[hidden],.conversation-status[hidden]{display:none}
.workspace-heading #mobile-navigation{display:none}
@media(max-width:760px){.workspace-heading #mobile-navigation{display:inline-flex}.chat-mode-switch button{padding:0 10px}}
@media(max-width:420px){.chat-mode-switch{margin-left:2px}.chat-mode-switch button{width:32px;padding:0}.chat-mode-switch button span{display:none}}

/* An Agent task is a turn of the conversation: the request, then one
   assistant message whose body is a timeline of text, steps and images. */
.agent-turn{display:contents}
.agent-reply .message-body{min-width:0}
.agent-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-height:24px}
.agent-head .message-name{margin:0}
.agent-badge{padding:1px 7px;border-radius:5px;background:#5d5cde1f;color:#4a49c4;font-size:11px;font-weight:600;letter-spacing:.02em}
html[data-theme=dark] .agent-badge{background:#a9a8ff26;color:#b9b8ff}
.agent-mark{display:grid;place-items:center;width:100%;height:100%;min-width:30px;min-height:30px;background:#5d5cde1f;color:#5d5cde;border-radius:inherit}
.agent-run-status{font-size:11px;padding:2px 8px;border-radius:999px;color:var(--muted);background:var(--hover)}
.agent-run-status.running,.agent-run-status.preparing,.agent-run-status.queued,.agent-run-status.cancelling{background:#5d5cde1f;color:#4a49c4}
.agent-run-status.succeeded{background:#e3f6eb;color:#1f7a4a}
.agent-run-status.failed,.agent-run-status.budget_exhausted,.agent-run-status.interrupted{background:#fff0ec;color:#b84b2e}
html[data-theme=dark] .agent-run-status.running,html[data-theme=dark] .agent-run-status.preparing,html[data-theme=dark] .agent-run-status.queued,html[data-theme=dark] .agent-run-status.cancelling{background:#a9a8ff26;color:#b9b8ff}
html[data-theme=dark] .agent-run-status.succeeded{background:#203d30;color:#92c6a5}
html[data-theme=dark] .agent-run-status.failed,html[data-theme=dark] .agent-run-status.budget_exhausted,html[data-theme=dark] .agent-run-status.interrupted{background:#46261f;color:#f0a892}
.agent-timeline{display:grid;gap:8px;margin-top:8px;min-width:0}
.agent-timeline:empty{display:none}
.agent-text{min-width:0}
.agent-text> :first-child{margin-top:0}.agent-text> :last-child{margin-bottom:0}
.agent-step{border:1px solid var(--line);border-radius:10px;background:var(--surface);font-size:13px;min-width:0}
.agent-step>summary,div.agent-step{display:flex;align-items:center;gap:8px;padding:8px 12px;min-width:0;color:var(--muted)}
.agent-step>summary{cursor:pointer;list-style:none}
.agent-step>summary::-webkit-details-marker{display:none}
.agent-step>summary>svg:last-child{margin-left:auto;flex:none;transition:transform .16s}
.agent-step[open]>summary>svg:last-child{transform:rotate(180deg)}
.agent-step>summary>svg:first-child,div.agent-step>svg{flex:none}
.agent-step-label{flex:none;color:var(--ink)}
.agent-step code{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;color:var(--ink);background:none;padding:0}
.agent-step-state{flex:none;font-size:11px;padding:1px 7px;border-radius:999px;background:var(--hover);color:var(--muted)}
.agent-step-state.is-ok{background:#e3f6eb;color:#1f7a4a}
.agent-step-state.is-error{background:#fff0ec;color:#b84b2e}
.agent-step-state.is-running{background:#5d5cde1f;color:#4a49c4}
html[data-theme=dark] .agent-step-state.is-ok{background:#203d30;color:#92c6a5}
html[data-theme=dark] .agent-step-state.is-error{background:#46261f;color:#f0a892}
html[data-theme=dark] .agent-step-state.is-running{background:#a9a8ff26;color:#b9b8ff}
.agent-step pre{margin:0;padding:10px 12px;border-top:1px solid var(--line);max-height:320px;overflow:auto;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink);background:transparent}
.agent-step pre.agent-command{color:var(--muted)}
.agent-steer{border-left:2px solid #5d5cde;padding:2px 0 2px 12px;font-size:14px}
.agent-steer span{display:block;font-size:11px;color:var(--muted)}
.agent-steer p{margin:2px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.agent-image{margin:2px 0;max-width:min(100%,520px)}
.agent-image img{display:block;max-width:100%;height:auto;border-radius:12px;border:1px solid var(--line);background:var(--hover)}
.agent-image figcaption{margin-top:6px;font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.agent-live{margin-top:8px;min-width:0}
.agent-live[hidden],.agent-wait[hidden]{display:none}
.agent-wait{display:flex;align-items:center;gap:10px;margin-top:10px;font-size:13px;color:var(--muted)}
.agent-extra{margin-top:10px;display:grid;gap:10px}
.agent-error{margin:0}
.agent-downloads{display:flex;flex-wrap:wrap;gap:8px}
.agent-download{display:inline-flex;align-items:center;gap:10px;max-width:100%;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);text-decoration:none;min-width:0}
.agent-download:hover{border-color:var(--line-strong)}
.agent-download>span{min-width:0}
.agent-download strong{display:block;font-size:13px;font-weight:500;overflow-wrap:anywhere}
.agent-download small{display:block;margin-top:1px;font-size:11px;color:var(--muted)}
.agent-foot{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted)}
.agent-stop{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:1px solid var(--line);border-radius:999px;font-size:12px}
.agent-stop:hover{border-color:var(--line-strong)}
.work-attachment-reminder{font-size:12px;color:var(--muted);line-height:1.6;margin:8px 0;overflow-wrap:anywhere}
.work-attachment-reminder button{background:transparent;border:0;color:var(--ink);font:inherit;text-decoration:underline;cursor:pointer;margin-left:5px}
.agent-image-note{margin:6px 0 0;font-size:12px;color:#b84b2e}
html[data-theme=dark] .agent-image-note{color:#f0a892}
/* The tool row holds the mode switch and keeps its width; in a narrow window
   the status text and the model button on the right give way instead. */
.monochrome-shell .composer-tools{flex:0 0 auto}
.monochrome-shell .composer-actions{flex:0 1 auto;min-width:0}
.monochrome-shell .composer-actions .composer-model{flex:0 1 auto;min-width:56px}
.monochrome-shell .composer-actions #stream-status{flex:0 1 auto;min-width:0}
.monochrome-shell .composer-actions .send-btn{flex:none}
@media(max-width:900px){.monochrome-shell .composer-actions #stream-status{max-width:5em}.chat-mode-switch button:not(.is-active) span{display:none}.chat-mode-switch button:not(.is-active){padding:0 9px}}
/* A step with nothing to open is a line of the log, not a card: only rows
   that expand look like something to click. */
.agent-step.agent-step-quiet{border:0;border-radius:0;background:transparent;padding:1px 2px;gap:7px;font-size:12.5px}
.agent-step.agent-step-quiet .agent-step-label{color:var(--muted)}
.agent-step.agent-step-quiet code{color:var(--muted);font-size:12px}
.agent-step.agent-step-quiet>svg{width:14px;height:14px}
.agent-step>summary:hover{background:var(--hover);border-radius:10px}
.agent-step[open]>summary:hover{border-radius:10px 10px 0 0}
