/* A task shares the conversation; it never opens a second page or blocks chat. */
.companion-page .task-workspace{min-width:0;background:#f8f8f3;border-left:1px solid var(--line);padding:0 20px 22px;position:sticky;top:112px;max-height:calc(100dvh - 112px);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
.companion-page .task-workspace[hidden]{display:none}
.companion-page .task-edit-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:8px 0}
.companion-page .task-edit-tools[hidden],.companion-page .task-code-editor[hidden],.companion-page .task-code[hidden],.companion-page .task-code-diff[hidden]{display:none}
.companion-page .task-edit-tools button{min-height:44px;padding:8px 10px;border:1px solid var(--line);border-radius:4px;font-size:13px;text-align:left}
.companion-page .task-code-editor{display:block;width:100%;max-width:100%;min-height:340px;resize:vertical;border:1px solid var(--green);border-radius:4px;padding:14px;background:#e9ece5;color:var(--ink);font:12px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre;tab-size:4}
.companion-page .task-code-editor:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.companion-page .task-code-diff{min-width:0;margin:12px 0}
.companion-page .task-code-diff>summary{min-height:44px;padding:10px 0;font-size:13px;cursor:pointer}
.companion-page .task-code-diff pre{max-height:40vh;white-space:pre;overflow:auto}
.companion-page .content-layout,.companion-page .content-layout.has-context{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,0fr);max-width:1440px}
.companion-page .content-layout.has-task-workspace,.companion-page .content-layout.has-task-workspace.has-context{grid-template-columns:minmax(0,1fr) minmax(0,1.05fr)}
.companion-page .task-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:79px;padding:14px 0 10px}
.companion-page .task-heading h2{font-family:inherit;font-size:15px;font-weight:500;line-height:1.6;margin:0}
.companion-page .task-status{margin:3px 0 0;color:var(--muted);font-size:12px}
.companion-page .task-heading .text-button{flex:none;font-size:12px}
.companion-page .task-tabs{display:flex;gap:24px;border-bottom:1px solid var(--line);margin-bottom:16px}
.companion-page .task-tabs button{min-height:44px;background:none;border:0;border-bottom:2px solid transparent;color:var(--muted);padding:8px 2px;font-size:14px}
.companion-page .task-tabs button[aria-selected=true]{color:var(--green);border-bottom-color:var(--green)}
.companion-page .task-page{min-height:350px;min-width:0;overflow-wrap:anywhere}
.companion-page .task-filename{margin:8px 0 12px;font:12px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace}
.companion-page .task-code{white-space:pre;tab-size:4;overflow:auto;min-height:260px;max-height:48vh;border:0;border-radius:4px;background:#e9ece5;margin:0;padding:14px;font:12px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace}
.companion-page .task-code-waiting{min-height:260px;display:flex;align-items:center;justify-content:center;gap:12px;padding:24px;background:#e9ece5;border-radius:4px;color:var(--muted)}
.companion-page .task-code-waiting[hidden]{display:none}
.companion-page .task-code-waiting p{max-width:28em;margin:0;font-size:13px;line-height:1.9}
.companion-page .task-code-activity{flex:none;width:18px;height:18px;border:2px solid var(--line);border-top-color:var(--green);border-radius:50%}
@media(prefers-reduced-motion:no-preference){
 .companion-page .task-code-activity{animation:task-wait 1.2s linear infinite}
 @keyframes task-wait{to{transform:rotate(360deg)}}
}
.companion-page .task-code-explanation{min-height:260px;padding:18px;background:#e9ece5;border-radius:4px;overflow-wrap:anywhere;font-size:13px;line-height:1.9}
.companion-page .task-note{font-size:12px;line-height:1.8;color:var(--muted);margin:12px 0;min-height:44px}
.companion-page .task-attempt{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin:8px 0 16px}
.companion-page .task-attempt select{min-height:44px;max-width:100%;border:1px solid var(--line);border-radius:4px;background:var(--paper);padding:7px 10px;font:inherit}
.companion-page .task-steps{font-size:13px;padding-left:20px;margin:4px 0 22px;line-height:1.9}
.companion-page .task-steps li{padding:3px 0}
.companion-page .task-page h3{font-size:13px;font-weight:500;margin:18px 0 8px}
.companion-page .task-log{font:12px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-height:32vh;overflow:auto;margin:0 0 14px;padding:12px;background:#e9ece5;border-radius:4px}
.companion-page .task-download{display:inline-flex;align-items:center;min-height:44px;margin-top:10px;font-size:13px}
.companion-page .task-workspace .run-section-heading h2{font-size:14px}
.companion-page .task-workspace .run-actions{position:static;background:transparent}
.companion-page .task-workspace .code-run-card{padding:8px 0 16px}
.companion-page .task-workspace .run-chart-tabs{flex-wrap:wrap;overflow:visible}
.companion-page .task-workspace .run-heading{align-items:flex-start}
.companion-page .task-workspace .run-heading h3{flex:1 1 160px}
.companion-page .task-workspace .run-status{flex:0 1 auto;line-height:1.8}
.companion-page .task-workspace .run-assessment,.companion-page .task-workspace .run-comparison{max-width:100%}
.companion-page .task-workspace .run-compare-grid .run-waveform{padding-inline:6px}
.companion-page .task-toggle{margin-left:auto}
.companion-page .page-actions .task-toggle:not([hidden])+#context-toggle{margin-left:0}
@media(min-width:900px) and (prefers-reduced-motion:no-preference){
 .companion-page .task-workspace:not([hidden]){animation:task-open .28s cubic-bezier(.2,.7,.2,1)}
 @keyframes task-open{from{opacity:.3;transform:translateX(-8px)}to{opacity:1;transform:none}}
}
@media(max-width:899px){
 .companion-page .content-layout,.companion-page .content-layout.has-task-workspace,.companion-page .content-layout.has-context{display:block}
 .companion-page .has-task-workspace>.conversation{display:none}
 .companion-page .task-workspace{border-left:0;position:static;max-height:none;overflow:visible;padding-inline:16px;min-height:calc(100dvh - 112px)}
 .companion-page .task-code{font-size:12px;min-height:270px}
 .companion-page .page-actions .icon-control{padding-inline:7px;gap:4px}
 .companion-page .page-actions .task-toggle:not([hidden])~#context-toggle .control-label{display:none}
 .companion-page .page-actions:has(.task-toggle:not([hidden])) #history-toggle .control-label{display:none}
}
@media(max-width:640px){
 .companion-page .task-code-editor{font-size:16px}
}

.companion-page .run-source-identity{min-height:0;margin:4px 0 12px;font:12px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}
