/* Shared conversation geometry and interaction surfaces. Stored content and font preferences stay intact. */
body :is(.chat-main,.document-assistant-shell,.track-ai-panel){
  container: caddie-conversation / inline-size;
  min-width:0;
  --conversation-answer-size:var(--reading-answer-size,16px);
  --conversation-answer-leading:var(--reading-answer-leading,1.85);
  --conversation-user-size:max(14px,calc(var(--reading-answer-size,16px) - 1px));
}

/* One reading axis for the standalone conversation, bubbles and composer. */
body .chat-main .chat-wrap{min-width:0;padding-inline:clamp(24px,2.5vw,48px)}
html:root body .chat-workspace .chat-main :is(.msgs,.composer,.chat-quick,.chat-attachments){width:100%;max-width:100%;box-sizing:border-box;margin-inline:auto}
body .chat-main .msgs{padding:28px 0 16px;scroll-padding-bottom:24px;gap:0}
body .chat-main .msg{width:100%;max-width:100%;min-width:0;margin:0 0 24px}
body .chat-main .msg.ai>.bubble{width:100%;max-width:100%;min-width:0;padding-inline:0}
body .chat-main .msg.user{justify-content:flex-end}
body .chat-main .chat-user-message{position:relative;width:fit-content;max-width:75%;min-width:0;margin-left:auto}
body .chat-main .chat-user-meta{position:absolute;top:100%;right:0;min-height:22px;padding-top:2px}
body .chat-main .msg.user .chat-user-message .bubble{width:fit-content;max-width:100%;padding:11px 15px;border-radius:15px 15px 5px 15px}

/* Flex children must shrink to the sidecar: hiding overflow alone clips prose. */
body :is(.document-assistant-shell,.track-ai-panel) :is(.project-caddie-feed,.pmsgs,.document-assistant-body,.knowledge-caddie-body,.knowledge-agent-body,.msg,.bubble,.project-agent-live-answer,.project-thinking-body,.chat-execution-stream){min-width:0;max-width:100%;box-sizing:border-box}
body :is(.document-assistant-shell,.track-ai-panel) .msg.ai{width:100%;align-self:stretch;gap:8px}
body :is(.document-assistant-shell,.track-ai-panel) .msg.ai>.bubble{flex:1 1 0%;min-width:0;width:0;max-width:100%}
body .project-caddie-panel #pmsgs>.msg.ai>.av{display:none}
body :is(.document-assistant-shell,.track-ai-panel) :is(.pmsgs,.knowledge-caddie-body){padding-inline:18px;gap:0}
body :is(.document-assistant-shell,.track-ai-panel) .msg{margin-bottom:22px}
body :is(.document-assistant-shell,.track-ai-panel) .msg.user .bubble{min-width:0;max-width:80%;padding:10px 13px;border-radius:14px 14px 5px 14px;overflow-wrap:anywhere;white-space:pre-wrap}
body .document-assistant-shell .knowledge-caddie-turn.user{width:fit-content;max-width:80%;margin-left:auto;padding:10px 13px;border-radius:14px 14px 5px 14px;overflow-wrap:anywhere}

/* Higher specificity than historical per-module font-size rules; family stays selected. */
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.chat-answer .prose,#pmsgs .msg.ai .prose,#tmsgs .msg.ai .prose,.knowledge-caddie-turn.assistant .prose,.knowledge-agent-msg:not(.user) .prose,.knowledge-discussion-turn.assistant .prose,.selection-explain-reply.prose,.project-agent-live-answer .prose,.chat-execution-stream .prose){
  width:100%;min-width:0;max-width:100%;box-sizing:border-box;
  font-size:var(--conversation-answer-size)!important;line-height:var(--conversation-answer-leading)!important;
  white-space:normal;overflow-wrap:anywhere;word-break:normal;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.chat-answer .prose,#pmsgs .msg.ai .prose,#tmsgs .msg.ai .prose,.knowledge-caddie-turn.assistant .prose,.knowledge-agent-msg:not(.user) .prose,.knowledge-discussion-turn.assistant .prose,.selection-explain-reply.prose,.project-agent-live-answer .prose,.chat-execution-stream .prose) :is(p,li,blockquote):not([style*="font-size"]){
  font-size:inherit!important;line-height:var(--conversation-answer-leading)!important;max-width:100%;white-space:normal;overflow-wrap:anywhere;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.chat-answer .prose,#pmsgs .msg.ai .prose,#tmsgs .msg.ai .prose,.knowledge-caddie-turn.assistant .prose,.knowledge-agent-msg:not(.user) .prose,.selection-explain-reply.prose,.project-agent-live-answer .prose,.chat-execution-stream .prose) p{margin:0 0 .85em!important}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.msg.user .bubble,.knowledge-caddie-turn.user>div,.knowledge-agent-msg.user>div){font-size:var(--conversation-user-size)!important;line-height:1.65!important}
body :is(.chat-main,.document-assistant-shell,.track-ai-panel) .prose :is(pre,table,.katex-display){max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
body :is(.chat-main,.document-assistant-shell,.track-ai-panel) .prose :is(img,svg){max-width:100%;height:auto}
body :is(.chat-main,.document-assistant-shell,.track-ai-panel) .prose pre{white-space:pre;overflow-wrap:normal}
body :is(.chat-main,.document-assistant-shell,.track-ai-panel) .composer{min-width:0;box-sizing:border-box}
html:root body .chat-main .chat-answer .prose>:first-child{margin-top:0!important}

/* Uses panel width, not screen width: resizing a split view updates type too.
   Larger accessibility preferences remain larger; a narrow pane subtracts only 1px. */
@container caddie-conversation (max-width:620px){
  :is(.msg,.knowledge-caddie-turn,.knowledge-agent-msg,.knowledge-discussion-turn,.selection-explain-reply,.project-agent-live-answer,.chat-execution-stream){
    --conversation-answer-size:max(14px,calc(var(--reading-answer-size,16px) - 1px));
    --conversation-answer-leading:max(1.5,calc(var(--reading-answer-leading,1.85) - .1));
    --conversation-user-size:max(14px,calc(var(--reading-answer-size,16px) - 2px));
  }
  .prose :is(h1,h2){font-size:1.18em!important;line-height:1.5!important}
  .prose :is(h3,h4){font-size:1.06em!important;line-height:1.5!important}
}
@media(max-width:760px){body .chat-main .chat-wrap{padding-inline:14px}body .chat-main .chat-user-message{max-width:85%}}

/* Workspace chrome: a white navigation surface and one blue interaction accent.
   Keep the existing controls, DOM, routing and selected reading fonts intact. */
body .chat-workspace{--chat-chrome-ink:#253248;--chat-chrome-muted:#697a91;--chat-chrome-line:#e5ebf3;background:#fff}
body .chat-workspace .sess-pane{background:#fff;border-right-color:var(--chat-chrome-line);padding:20px 14px 14px}
body .chat-workspace .chat-sess-brand{color:#21314a;font-size:18px;font-weight:650;padding-inline:9px;margin-bottom:8px}
body .chat-workspace .newchat{height:38px;margin:8px 0 22px;padding-inline:12px;background:#edf3ff;color:#3268d6;border:1px solid #e3ecff;border-radius:10px;font-weight:600;box-shadow:none}
body .chat-workspace .newchat:hover{background:#e4eeff;border-color:#ccdfff;color:#245bc8}
body .chat-workspace .newchat kbd{color:#637da8}
body .chat-workspace :is(.chat-sess-label,.sess-folder-head){color:#697a91;font-size:11px;font-weight:550}
body .chat-workspace .sess-folder-head b{color:#7989a0;font-variant-numeric:tabular-nums}
body .chat-workspace .sess{border:1px solid transparent;border-radius:9px;margin:2px 0;padding:10px 11px;transition:background .14s ease,border-color .14s ease;color:var(--chat-chrome-ink)}
body .chat-workspace .sess .st{font-weight:550;line-height:1.45}
body .chat-workspace .sess .sm{margin-top:4px;color:#708096;line-height:1.4}
body .chat-workspace :is(.sess:hover,.sess-folder-head:hover){background:#f5f8fd;color:#2c466c}
body .chat-workspace .sess.on{background:#edf3ff;border-color:#dde8fc;color:#285ec3;box-shadow:none}
body .chat-workspace .sess.on .sm{color:#5e79a5}
body .chat-workspace .sess-status-indicator.completed{width:6px;height:6px;flex-basis:6px;box-shadow:none}
body .chat-workspace :is(.chat-nav-icon,.chat-sess-restore){color:#77869a;background:transparent}
body .chat-workspace :is(.chat-nav-icon:hover,.chat-sess-restore:hover){background:#eff4fc;color:#3569ce}
body .chat-workspace .chat-scopebar{border-bottom-color:var(--chat-chrome-line);background:#fff}
body .chat-workspace .chat-thread-title{color:var(--chat-chrome-ink)}
body .chat-workspace .chat-thread-state{color:#7a889b}
body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector .agent-runtime-selector{height:30px;border:1px solid #e0e7f1;background:#fff;border-radius:7px;box-shadow:none}
body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector .agent-runtime-selector>span{color:#718198}
body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector .agent-runtime-selector select{color:#3c506e;font-weight:550}
body .chat-workspace .agent-runtime-selector:focus-within{outline:2px solid #b7cffb;outline-offset:2px}
body .chat-workspace .chat-main{background:#fff}
body .chat-workspace .empty-chat h2{color:#26364e;font-weight:600;letter-spacing:-.025em}
body .chat-workspace .empty-chat p{color:#72829a}
body .chat-workspace .empty-chat .sugg{background:#fff;border:1px solid #e1e8f2;border-radius:10px;color:#465b79;box-shadow:none;text-align:left}
body .chat-workspace .empty-chat .sugg:hover{background:#f5f8fe;border-color:#c6d7f4;color:#2d60c2}
body .chat-workspace .chat-main .chat-quick{mask-image:none;-webkit-mask-image:none;gap:6px;padding:0 0 2px}
body .chat-workspace .chat-main .chat-quick button{height:29px;border:1px solid transparent;background:#f3f7fc;color:#586d89;border-radius:7px;box-shadow:none;font-size:11px;white-space:nowrap}
body .chat-workspace .chat-main .chat-quick button:hover{background:#eaf1fd;border-color:#dce7fa;color:#3268cf}
body .chat-workspace .chat-main .composer{border:1px solid #dbe4f0;border-radius:16px;background:#fff;box-shadow:0 3px 16px rgba(37,68,112,.045);backdrop-filter:none}
body .chat-workspace .chat-main .composer:focus-within{border-color:#9cbcf3;box-shadow:0 0 0 3px rgba(51,112,255,.07)}
body .chat-workspace .composer-bar :is(.chat-skill-trigger,.tool){height:30px;border-color:transparent;border-radius:7px;background:transparent;color:#607590;box-shadow:none}
body .chat-workspace .composer-bar :is(.chat-skill-trigger,.tool):hover{background:#eff4fc;color:#3165c8}
body .chat-workspace .composer-bar :is(.chat-skill-trigger,.tool)>svg{width:17px;height:17px;stroke-width:1.7}
body .chat-workspace .chat-depth{background:#f2f6fc;border-radius:7px}
body .chat-workspace .chat-depth button{color:#6b7d95!important}
body .chat-workspace .chat-depth button.on{background:#fff!important;color:#3265c4!important;box-shadow:0 1px 3px rgba(35,66,109,.08)}
body .chat-workspace .chat-main .composer .send{background:#3370ff;border-radius:10px;box-shadow:none}
body .chat-workspace .chat-main .composer .send:hover{background:#2862e5;transform:none}
body .chat-workspace .chat-main .composer .send:disabled{opacity:.45;cursor:not-allowed}
body .chat-workspace :is(button,[tabindex="0"]):focus-visible{outline:2px solid #9cbcf3;outline-offset:2px}
@media(prefers-reduced-motion:reduce){body .chat-workspace .sess{transition:none}}

/* Status belongs to a line of text, not a tinted sheet around the answer. */
body .chat-workspace .chat-main .msg.ai.chat-error .bubble{
  background:transparent;border:0;border-radius:0;box-shadow:none;
  padding:0;color:var(--chat-chrome-ink,#303640);
}
body .chat-workspace .chat-main .agent-failure-explain{
  background:transparent;border:0;border-left:2px solid #d7a49f;border-radius:0;
  padding:4px 12px;margin-block:12px;box-shadow:none;color:#525963;
}
body .chat-workspace .chat-main .agent-failure-explain.recovering{background:transparent;border-color:#c8ced8}
body .chat-workspace .chat-main .agent-failure-explain b{color:#525963}
/* The overview is an inspector, not a landing page. Do not style document/expert modes. */
body .chat-workspace .chat-aside:has(>#chatAsideDefault:not([hidden])){
  background:#fff;background-image:none;box-shadow:none;
}
@media(min-width:1281px){
  body .chat-workspace .chat-aside:has(>#chatAsideDefault:not([hidden])){top:0}
  body .chat-workspace.aside-open:not(.aside-expanded) .chat-main{padding-right:0}
}
body .chat-workspace #chatAsideDefault{
  min-height:0;padding:18px 20px 28px;margin:0;background:#fff;
}
body .chat-workspace #chatAsideDefault .chat-collab-hero{
  display:flex;align-items:baseline;flex-wrap:wrap;gap:5px 12px;
  padding:0 0 12px;margin:0;border-bottom:1px solid #ebedef;background:none;
}
body .chat-workspace #chatAsideDefault .chat-collab-kicker{display:none}
body .chat-workspace #chatAsideDefault .chat-collab-hero h2{
  margin:0;font-size:14px;line-height:1.5;font-weight:600;letter-spacing:0;color:#30343b;
}
body .chat-workspace #chatAsideDefault .chat-collab-hero p{
  flex-basis:100%;margin:0;font-size:11px;line-height:1.6;color:#7c818a;
}
body .chat-workspace #chatAsideDefault .chat-collab-current{padding:14px 0;gap:9px}
body .chat-workspace #chatAsideDefault .chat-collab-current b{font-size:13px;font-weight:600;color:#343941;line-height:1.5}
body .chat-workspace #chatAsideDefault .chat-collab-current small{font-size:11px;color:#727984;margin-top:4px;line-height:1.6}
body .chat-workspace #chatAsideDefault .chat-collab-current>i{margin-top:6px;width:7px;height:7px}
body .chat-workspace #chatAsideDefault .chat-collab-meta{gap:10px}
body .chat-workspace #chatAsideDefault .chat-collab-meta span{background:none;border-radius:0;padding:0;color:#727984;font-variant-numeric:tabular-nums}
body .chat-workspace #chatAsideDefault .chat-panel-context{padding:16px 0 0;margin:0;border:0;background:none}
body .chat-workspace #chatAsideDefault .chat-panel-context>h3{font-size:12px!important;font-weight:600;color:#4b515a;margin:0 0 7px!important}
body .chat-workspace #chatAsideDefault .chat-aside-note{max-width:none;font-size:11px;color:#7c818a;line-height:1.65}
body .chat-workspace #chatAsideDefault .chat-context-list{margin-top:10px}
body .chat-workspace #chatAsideDefault .chat-collab-log>summary{padding-block:11px;font-size:12px}
body .chat-workspace #chatAsideDefault .chat-collab-section{padding-top:14px}
body .chat-workspace #chatAsideDefault .chat-collab-empty{padding:14px 0;font-size:12px;color:#727984}

/* Engine/model choice remains usable in split windows, including <1100px. */
body .agent-runtime-control{display:inline-flex;align-items:center;gap:5px;min-width:0;max-width:100%;position:relative}
body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector{flex:0 1 300px;overflow:visible}
body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector .agent-runtime-selector{display:inline-flex;max-width:280px;min-width:0;flex:1}
body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector .agent-runtime-selector select{max-width:none;min-width:0;padding-right:18px}
body .agent-runtime-help{flex:0 0 auto;font-size:11px;color:#697a91}
body .agent-runtime-help>summary{display:grid;place-items:center;width:22px;height:22px;border:1px solid #dce4ee;border-radius:50%;cursor:pointer;list-style:none;font-weight:650}
body .agent-runtime-help>summary::-webkit-details-marker{display:none}
body .agent-runtime-help>div{position:absolute;z-index:80;top:calc(100% + 9px);right:0;width:min(330px,calc(100vw - 38px));padding:14px 16px;background:#fff;border:1px solid #dce4ee;border-radius:10px;box-shadow:0 8px 28px #25324818;color:#3c506e;white-space:normal;font-size:12px;line-height:1.7}
body .agent-runtime-help p{margin:7px 0 0}
body .chat-workspace .chat-scopebar .chat-thread-title{overflow:visible}
@media(max-width:1100px){
  body .chat-workspace .chat-scopebar{height:auto;min-height:46px;flex-wrap:wrap;padding-block:8px}
  body .chat-workspace .chat-thread-title{flex:1 1 100%;min-width:0;flex-wrap:wrap}
  body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector{margin-left:auto;min-width:190px;max-width:100%;flex:1 1 230px}
  body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector .agent-runtime-selector{display:inline-flex;min-width:0}
  body .chat-workspace .chat-thread-title>b{max-width:160px}
  body .chat-workspace .chat-thread-title .chat-thread-state{display:none}
  /* The task panel remains available in the header; the pet must not cover Send. */
  body:has(.chat-workspace) #taskObserver:not(.is-expanded){display:none!important}
}

/* Composer system: one elevated writing surface, a quiet tool rail, one primary action.
   No backdrop blur or full-message animation: streamed text stays readable while updating. */
body :is(.chat-main,.document-assistant-shell,.track-ai-panel){
  --conversation-line:#e3e5e9;
  --conversation-muted:#69717d;
  --conversation-hover:#f3f4f6;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer,.knowledge-caddie-composer-shell){
  padding:0;border:1px solid var(--conversation-line)!important;border-radius:18px!important;
  background:#fff!important;box-shadow:0 2px 5px rgba(28,36,48,.025),0 8px 24px rgba(28,36,48,.055)!important;
  backdrop-filter:none;transition:border-color .16s ease,box-shadow .16s ease;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer,.knowledge-caddie-composer-shell):focus-within{
  border-color:#8daef4!important;box-shadow:0 0 0 2px rgba(51,112,255,.07),0 8px 24px rgba(28,36,48,.06)!important;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer,.knowledge-caddie-composer-shell)>textarea{
  box-sizing:border-box;width:100%;min-height:76px!important;max-height:220px;
  margin:0;padding:17px 18px 12px!important;border:0!important;border-radius:18px 18px 0 0!important;
  background:transparent!important;box-shadow:none!important;color:#303640;
  font-size:14px!important;line-height:1.65!important;resize:none;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) textarea::placeholder{color:#818792;opacity:1}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer-bar,.knowledge-caddie-compose-actions){
  box-sizing:border-box;display:flex;align-items:center;flex-wrap:wrap;gap:6px!important;
  min-height:48px!important;margin:0 8px!important;padding:7px 2px 9px!important;
  border-top:1px solid #f0f1f3;background:transparent;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer-bar,.knowledge-caddie-compose-actions) button:not(.send):not(.knowledge-caddie-send){
  min-height:30px;border:1px solid transparent;border-radius:8px;box-shadow:none;
  background:transparent;color:var(--conversation-muted);font-weight:500;
  transition:background .14s ease,color .14s ease,transform .1s ease;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer-bar,.knowledge-caddie-compose-actions) button:not(:disabled):hover{
  background:var(--conversation-hover);color:#303640;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer-bar,.knowledge-caddie-compose-actions) button:not(:disabled):active{transform:translateY(1px)}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer-bar,.knowledge-caddie-compose-actions) button:focus-visible{
  outline:2px solid #8daef4;outline-offset:2px;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.send,.knowledge-caddie-send){
  display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px;
  width:34px!important;height:34px!important;margin-left:auto;border:0;border-radius:11px!important;
  background:#3370ff!important;color:#fff!important;box-shadow:0 2px 4px rgba(51,112,255,.14)!important;
  transition:background .14s ease,transform .1s ease;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.send,.knowledge-caddie-send):not(:disabled):hover{background:#2862e5!important;color:#fff!important}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.send,.knowledge-caddie-send).is-stop{
  background:#f0f2f5!important;color:#465364!important;box-shadow:none!important;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.send,.knowledge-caddie-send):disabled{opacity:.45;cursor:not-allowed;box-shadow:none!important}
body .chat-workspace .composer-bar .chat-depth{padding:2px;background:#f5f6f8;border-radius:9px}
html:root body .chat-workspace .composer-bar .chat-depth button{min-height:26px;padding-inline:9px}
html:root body .chat-workspace .composer-bar .chat-depth button.on{background:#fff!important;color:#3265c4!important;box-shadow:0 1px 3px #1c243010}
body .chat-workspace .composer-hint{color:#858c97;font-size:10px}
body .chat-workspace :is(.chat-resource-menu,.chat-skill-menu){border-color:#e3e5e9;border-radius:14px;box-shadow:0 8px 32px #1c243014;background:#fff}
/* Text-fitting user bubbles; answers remain on the page, not inside another card. */
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.msg.user .bubble,.knowledge-caddie-turn.user){
  background:#f3f4f6!important;color:#343b46!important;border:0;box-shadow:none;
  border-radius:16px 16px 6px 16px;padding:10px 14px!important;
}
body .chat-main .chat-user-meta{opacity:0;transition:opacity .14s ease}
body .chat-main .chat-user-message:is(:hover,:focus-within) .chat-user-meta{opacity:1}
body .chat-workspace :is(.chat-msg-file,.chat-attachment-chip){background:#fafafa;border-color:#e3e5e9;border-radius:8px}
/* Public progress uses a quiet disclosure row. Do not suppress tool actions or approvals. */
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.object-agent-process,.project-thinking-card,.chat-execution){
  border:0;border-radius:0;background:transparent;box-shadow:none;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.object-agent-process>summary,.project-agent-live-status){
  min-height:32px;padding:4px 0;border:0;background:transparent;color:var(--conversation-muted);
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.object-agent-process>summary,.project-agent-live-status) em{
  padding:0;background:transparent;border:0;color:var(--conversation-muted);font-weight:400;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.object-agent-process-body,.project-thinking-body){
  margin:4px 0 12px 4px;padding:2px 0 2px 15px;border:0;border-left:1px solid #e3e5e9;background:transparent;
}
html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.chat-execution-summary,.chat-execution-steps,.object-agent-process-body){
  font-size:12px;line-height:1.6;color:var(--conversation-muted);
}
body .chat-main .chat-tool-trace{margin:8px 0 16px;border:0;background:transparent}
body .chat-main .chat-tool-trace>summary{padding:6px 0;color:#69717d;font-size:12px;cursor:pointer}
body .chat-main .chat-tool-row{padding:8px 0;border-color:#eef0f2;background:transparent}
/* Never fade the entire answer every time a token arrives. */
body .chat-main :is(.is-refreshing,.is-streaming-update){animation:none!important}
@container caddie-conversation (max-width:620px){
  html:root body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer,.knowledge-caddie-composer-shell)>textarea{min-height:64px!important;padding:14px 14px 10px!important}
  .project-caddie-composer .project-draft-action>span{display:none}
  html:root body .project-caddie-composer .composer-bar{gap:4px!important}
  .project-caddie-composer .composer-bar button{padding-inline:5px}
  .composer-hint{display:none}
  .knowledge-caddie-compose-actions>nav{flex-wrap:wrap}
}
@media(hover:none){body .chat-main .chat-user-meta{opacity:1}}
/* Three-pane workbench: quiet navigation, readable conversation, compact inspector.
   Neutral surfaces are shared; blue is reserved for focus, active actions and status. */
html:root body .chat-workspace{
  --chat-chrome-ink:#26292f;--chat-chrome-muted:#747981;--chat-chrome-line:#e9eaed;
  --workbench-radius:12px;background:#fff;color:var(--chat-chrome-ink);
}
html:root body .chat-workspace .sess-pane{background:#fafbfc!important;padding:0;margin:0;border:0!important;border-right:1px solid #eceef2!important;border-radius:0;box-shadow:none}
html:root body .chat-workspace .chat-sess-brand{height:46px;min-height:46px;padding:0 20px;margin:0 0 12px;border-bottom:1px solid #eceef2;box-sizing:border-box;font-size:18px;letter-spacing:-.5px;color:#25282e}
html:root body .chat-workspace .sess-pane>.sess-list{padding-inline:12px}
body .chat-workspace .chat-sess-brand>span{flex:1}
html:root body .chat-workspace .newchat{width:calc(100% - 24px);height:35px;margin:0 12px 4px;padding:0 10px;border:0!important;border-radius:7px;background:transparent!important;color:#353e4c!important;box-shadow:none!important;font-size:13px;font-weight:500}
body .chat-workspace .newchat>svg{color:#667287;width:16px;height:16px}
html:root body .chat-workspace .newchat:hover{background:#eef0f4!important;color:#2862dc!important}
body .chat-history-search{display:flex;align-items:center;gap:8px;height:34px;margin:0 12px 19px;padding:0 10px;border:1px solid transparent;border-radius:7px;color:#9097a2;background:transparent}
body .chat-history-search:hover{background:#f0f2f5}
body .chat-history-filters{display:flex;gap:18px;padding:0;margin:0 22px 19px;border-bottom:1px solid #e8eaef;border-radius:0;background:transparent}
body .chat-history-filters>button{position:relative;flex:0 0 auto;border:0;border-radius:0;padding:0 0 10px;background:transparent;color:#8b93a0;font-size:11px;cursor:pointer;white-space:nowrap}
body .chat-history-filters>button.on{background:transparent;color:#343e4e;box-shadow:none;font-weight:600}
body .chat-history-filters>button.on:after{content:'';position:absolute;bottom:-1px;left:0;right:0;height:2px;border-radius:2px;background:#537ed5}
body .chat-history-filters>button:hover{color:#3370ff}
body .chat-history-search:focus-within{background:#fff;border-color:#b5c9f0;box-shadow:0 0 0 2px #3370ff0a}
body .chat-history-search>svg{width:15px;height:15px;flex-shrink:0}
body .chat-history-search input{width:100%;min-width:0;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;font:inherit;font-size:12px;color:#30343b;padding:0}
body .chat-history-search input::placeholder{color:#858a93}
html:root body .chat-workspace .chat-sess-label{display:none}
body #chatHistoryCount{font-size:10px;font-variant-numeric:tabular-nums;color:#969aa1}
html:root body .chat-workspace .sess-folder{margin-top:0}
html:root body .chat-workspace .sess-folder+.sess-folder{margin-top:20px}
html:root body .chat-workspace .sess-folder-head{display:flex;align-items:center;gap:8px;width:100%;min-height:40px;padding:10px;margin:0 0 6px;color:#566174;font-size:14px;line-height:20px;font-weight:600;letter-spacing:0;border-radius:6px}
html:root body .chat-workspace .sess-folder-head>span{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html:root body .chat-workspace .sess-folder-head .sess-group-icon{width:15px;height:15px;color:#77869d;flex-shrink:0;transform:none}
html:root body .chat-workspace .sess-folder-head .sess-group-chevron{width:12px;height:12px;color:#939cab;flex-shrink:0;transition:transform .15s ease}
html:root body .chat-workspace .sess-folder.collapsed .sess-group-chevron{transform:rotate(-90deg)}
html:root body .chat-workspace .sess-folder-head b{display:block;min-width:18px;text-align:right;font-size:11px;font-weight:400;color:#929cab;font-variant-numeric:tabular-nums}
html:root body .chat-workspace .sess-folder-head:hover{background:#f0f2f6;color:#3c4c65}
html:root body .chat-workspace .sess{display:flex;align-items:center;gap:7px;position:relative;min-height:42px;border:0!important;padding:10px 30px 10px 45px;margin:2px 0;border-radius:7px;background:transparent;color:#505968;box-shadow:none!important}
html:root body .chat-workspace .sess .sess-copy{flex:1;min-width:0}
html:root body .chat-workspace .sess .st{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:1.5;color:inherit}
html:root body .chat-workspace .sess .sm{display:none;font-size:11px;line-height:16px;color:#8c95a3;margin-top:3px}
html:root body .chat-workspace .sess.needs-attention .sm{display:block}
html:root body .chat-workspace .sess.on{background:#eaf0fb!important;color:#2856a4!important;box-shadow:none!important}
html:root body .chat-workspace .sess.on .st{font-weight:550}
body .chat-workspace .sess.on:before{display:none}
body .chat-workspace .sess-time{flex-shrink:0;font-size:11px;line-height:1.5;color:#949daa;font-variant-numeric:tabular-nums}
body .chat-workspace .sess:has(.sess-status-indicator) .sess-time{display:none}
body .chat-workspace .sess .sx{position:absolute;right:5px;top:50%;transform:translateY(-50%);width:24px;height:25px;border-radius:5px;background:#f0f2f5;opacity:0;pointer-events:none}
body .chat-workspace .sess:is(:hover,:focus-within) .sx{opacity:1;pointer-events:auto}
body .chat-workspace .sess:is(:hover,:focus-within) .sess-time{visibility:hidden}
body .chat-workspace .sess:focus-visible{outline:2px solid #9ab8ef;outline-offset:-2px}
@media(hover:none){body .chat-workspace .sess .sx{position:static;transform:none;opacity:1;pointer-events:auto;background:transparent}body .chat-workspace .sess-time{display:none}}
html:root body .chat-workspace .sess:hover:not(.on){background:#f0f1f3!important}
html:root body .chat-workspace .sess-history>summary{color:#9398a0;font-size:11px;line-height:16px;padding:8px 30px 8px 45px}
html:root body .chat-workspace :is(.chat-nav-icon,.chat-sess-restore){color:#858b94;border-radius:7px}
html:root body .chat-workspace .chat-scopebar{background:#fff;border-bottom:1px solid #ececef;padding-inline:22px}
html:root body .chat-workspace .chat-thread-title{gap:10px;color:#343940;font-size:13px}
body .chat-workspace .chat-thread-title>svg{width:17px;height:17px;color:#8c929a}
body .chat-workspace .chat-thread-title .chat-thread-state{display:none}
html:root body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector .agent-runtime-selector{border:0;background:#f7f7f8;border-radius:7px;height:29px;max-width:210px}
html:root body .chat-workspace .chat-thread-title #chatAgentRuntimeSelector .agent-runtime-selector select{color:#686e78;font-size:11px}
body .chat-workspace .chat-expert-trigger{font-size:11px;color:#737b88}
html:root body .chat-workspace{background:#fff}
html:root body .chat-workspace .chat-main{background:#fff!important;border-radius:0;border:0}
html:root body .chat-workspace .chat-main .chat-wrap{padding-inline:clamp(22px,2.5vw,40px)}
html:root body .chat-workspace .chat-main .msgs{padding-top:32px}
html:root body .chat-workspace .chat-main .msg{margin-bottom:30px}
html:root body .chat-workspace .chat-main .msg.user .bubble{background:#f4f4f6!important;border:1px solid #eeeff2;box-shadow:none!important;color:#444a54}
html:root body .chat-workspace .chat-main .composer{background:rgba(255,255,255,.98)!important;border:1px solid #dedfe5!important;border-radius:16px!important;box-shadow:0 8px 32px #202a4210,0 1px 3px #202a4205!important}
html:root body .chat-workspace .chat-main .composer:focus-within{border-color:#9fbaf0!important;box-shadow:0 8px 30px #202a4210,0 0 0 2px #3370ff0a!important}
html:root body .chat-workspace .chat-main .composer>textarea{padding:18px 18px 12px!important;min-height:72px!important}
html:root body .chat-workspace .chat-main .composer-bar{padding:9px 12px!important;min-height:48px;border-top:1px solid #f0f0f3!important;gap:6px!important}
html:root body .chat-workspace .composer-bar :is(.chat-skill-trigger,.tool,.chat-rollback){color:#767d88!important;font-size:11px}
html:root body .chat-workspace #chatSkillBtn{background:#f5f5f7!important;color:#515865!important;padding-inline:10px;border-radius:7px}
html:root body .chat-workspace .composer-bar .composer-hint{font-size:10px;color:#a1a5ac}
body .chat-response-options{position:relative;flex-shrink:0}
body .chat-response-options>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:5px;padding:6px 8px;border-radius:7px;font-size:11px;color:#747b86}
body .chat-response-options>summary::-webkit-details-marker{display:none}
body .chat-response-options>summary>svg{width:12px;height:12px}
body .chat-response-options>summary:hover{background:#f5f5f7}
html:root body .chat-workspace .chat-response-options>.chat-depth{position:absolute;bottom:calc(100% + 12px);left:0;display:flex;flex-direction:column;gap:4px;width:120px;padding:6px;border:1px solid #e4e5e9;border-radius:10px;background:#fff;box-shadow:0 8px 28px #24293818;z-index:25}
html:root body .chat-workspace .chat-response-options:not([open])>.chat-depth{display:none}
html:root body .chat-workspace .chat-response-options .chat-depth button{width:100%;text-align:left;padding:7px 10px;background:transparent;box-shadow:none;color:#666d78;border-radius:6px}
html:root body .chat-workspace .chat-response-options .chat-depth button.on{background:#f3f5fa;color:#3370ff}
/* Pane seams: the grid already places the inspector below the header.
   Legacy top:55px offsets the second grid row twice at compact widths. */
@media(min-width:761px){
  html:root body .chat-workspace .chat-aside{top:0!important}
}
html:root body .chat-workspace:not(.aside-open) .chat-aside-top{border-left:0!important}
html:root body .chat-workspace.aside-open .chat-aside-top{border-left-color:#eceef2;box-sizing:border-box}
/* The inspector is a compact list of useful information, never a second hero. */
html:root body .chat-workspace .chat-aside:has(>#chatAsideDefault:not([hidden])){background:#fff!important;border-left:1px solid #eceef2!important}
html:root body .chat-workspace #chatAsideDefault{padding:16px 20px 24px;background:transparent!important}
body .chat-inspector-tabs{display:flex;gap:4px;padding:4px;border:0;background:#f5f6f8;border-radius:8px;margin:0 0 20px}
body .chat-inspector-tabs>button{flex:1;padding:7px 6px;border:0;border-radius:6px;background:transparent;color:#8a909b;font-size:12px;cursor:pointer}
body .chat-inspector-tabs>button.on{color:#303947;background:#fff;font-weight:600;box-shadow:0 1px 4px #202c4010}
body .chat-inspector-tabs>button:hover{color:#3370ff}
html:root body .chat-workspace #chatAsideDefault :is(.chat-inspector-section,.chat-panel-context){margin:0 0 20px;padding:0 0 20px!important;border:0!important;border-bottom:1px solid #eceef2!important;border-radius:0;background:transparent;box-shadow:none}
body #chatAsideDefault[data-inspector-view="context"]>.chat-inspector-section,body #chatAsideDefault[data-inspector-view="results"]>.chat-inspector-section:not(.chat-inspector-results),body #chatAsideDefault[data-inspector-view="results"]>.chat-panel-context{display:none}
body #chatAsideDefault[data-inspector-view="context"]>.chat-panel-context{display:block}
body #chatAsideDefault.artifact-mode>.chat-inspector-tabs{display:none}
body #chatAsideDefault.artifact-mode>.chat-inspector-section:not(.chat-inspector-results),body #chatAsideDefault.artifact-mode #chatPending{display:none!important}
body #chatAsideDefault.artifact-mode>.chat-inspector-results{display:block!important}
/* Default mascot dock must not cover inspector tabs. A user-dragged position wins. */
body:has(.chat-workspace.aside-open) #taskObserver:not([style*="left:"]){top:auto;bottom:22px}
body:has(.chat-workspace.aside-open) #taskObserver:not([style*="left:"]) .task-observer-panel{top:auto;bottom:94px;transform-origin:bottom right}
html:root body .chat-workspace #chatAsideDefault .chat-inspector-heading{display:flex;align-items:center;gap:9px;list-style:none;margin:0 0 14px!important;font-size:12px!important;font-weight:600;color:#505762;line-height:20px}
body .chat-inspector-heading>svg{width:16px;height:16px;color:#8c939d;stroke-width:1.65;flex-shrink:0}
body summary.chat-inspector-heading{cursor:pointer}
body summary.chat-inspector-heading::-webkit-details-marker{display:none}
body .chat-inspector-heading>.chat-inspector-chevron{margin-left:auto;width:12px}
body .chat-panel-context:not([open]) .chat-inspector-chevron{transform:rotate(-90deg)}
html:root body .chat-workspace #chatAsideDefault .chat-collab-current{padding:0 0 12px;border:0}
html:root body .chat-workspace #chatAsideDefault .chat-collab-current b{font-size:13px;font-weight:550;color:#303640}
html:root body .chat-workspace #chatAsideDefault .chat-collab-meta{margin-top:12px;gap:8px}
html:root body .chat-workspace #chatAsideDefault .chat-collab-meta span{padding:4px 7px;border:1px solid #e8e9ed;border-radius:5px;background:#fff;color:#818792;font-size:10px}
html:root body .chat-workspace #chatAsideDefault .chat-collab-log{border:0;border-top:1px solid #ececef;margin-top:10px}
html:root body .chat-workspace #chatAsideDefault .chat-collab-log>summary{color:#737a86;font-size:11px}
html:root body .chat-workspace #chatAsideDefault :is(.chat-aside-note,.chat-inspector-empty,.chat-collab-empty){font-size:11px;color:#878d97;line-height:1.7;padding:0;margin:0}
html:root body .chat-workspace #chatAsideDefault .chat-context-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border:0;padding:8px 0;background:transparent;font-size:11px}
html:root body .chat-workspace #chatAsideDefault .chat-context-row>span{color:#969ba4}
html:root body .chat-workspace #chatAsideDefault .chat-context-row>b{font-size:11px;font-weight:500;color:#5e6673}
body .chat-inspector-results:has(#chatTaskOutputs:not(:empty),#chatPending:not(:empty),#proposeArea:not(:empty))>.chat-inspector-empty{display:none}
html:root body .chat-workspace #chatAsideDefault .chat-context-receipt-item{position:relative;border:1px solid #e9ebef;border-radius:8px;background:#fff;padding:12px 10px 12px 35px;margin:8px 0 0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px}
body #chatAsideDefault .chat-context-receipt-item:before{content:'';position:absolute;left:13px;top:15px;width:11px;height:14px;border:1.4px solid #9ba5b4;border-radius:2px;background:linear-gradient(#aab2bf,#aab2bf) 2px 5px/6px 1px no-repeat,linear-gradient(#aab2bf,#aab2bf) 2px 8px/4px 1px no-repeat}
body #chatAsideDefault .chat-context-receipt-item>small{grid-column:1/-1}
html:root body .chat-workspace #chatAsideDefault .chat-context-receipt-item>span{font-size:12px;color:#444c58;font-weight:500}
html:root body .chat-workspace #chatAsideDefault .chat-context-receipt-item>b{font-size:10px;font-weight:500}
html:root body .chat-workspace #chatAsideDefault .chat-context-receipt-item>small{font-size:11px;color:#858c97;line-height:1.65}
html:root body .chat-workspace #chatAsideDefault .chat-inspector-heading{font-size:13px!important}
html:root body .chat-workspace #chatAsideDefault :is(.chat-aside-note,.chat-inspector-empty,.chat-collab-empty){font-size:12px}
html:root body .chat-workspace #chatAsideDefault #chatPending:empty{display:none}
html:root body .chat-workspace #chatAsideDefault :is(.chat-document-result,.chat-action){background:#fff;border:1px solid #e4e6eb;border-radius:10px;box-shadow:none}
body .chat-workspace :is(button,summary,input):focus-visible{outline:2px solid #97b7f4;outline-offset:2px}
@container caddie-conversation (max-width:620px){
  .chat-main #tidyBtn span,.chat-main #addResourceBtn .chat-resource-caret{display:none}
  .chat-main .composer-bar .composer-hint{display:none}
}
@media(max-width:760px){html:root body .chat-workspace .chat-main .chat-wrap{padding-inline:14px}html:root body .chat-workspace .chat-scopebar{padding-inline:12px}}
@media(prefers-reduced-motion:reduce){
  body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.composer,.knowledge-caddie-composer-shell,button,.chat-user-meta){transition:none!important}
  body :is(.chat-main,.document-assistant-shell,.track-ai-panel) :is(.is-entering,.is-settling,.chat-execution-spinner,.object-agent-process-icon,.project-agent-live-status>i){animation:none!important}
}
/* A durable result stays compact in chat; its body opens in the document canvas. */
.chat-saved-artifacts{display:flex;flex-direction:column;gap:8px;margin:14px 0;max-width:460px}
.chat-saved-artifacts>button{display:flex;align-items:center;gap:10px;width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--text);text-align:left;cursor:pointer}
.chat-saved-artifacts>button:hover{border-color:var(--accent);background:var(--hover)}
.chat-saved-artifacts>button>span{flex:1;min-width:0}
.chat-saved-artifacts b{display:block;font-size:13px;font-weight:600;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-saved-artifacts small{display:block;margin-top:2px;font-size:11px;line-height:1.5;color:var(--sub)}
.chat-saved-artifacts svg{flex:none;width:17px;height:17px;color:var(--sub)}
/* One result index for files, native documents and pending task changes. */
#chatTaskOutputs:empty{display:none}
.chat-output-selector{display:block;margin-bottom:14px}.chat-output-selector>span{display:block;color:var(--sub);font-size:11px;margin-bottom:6px}
.chat-output-selector select{display:block;width:100%;min-width:0;font:inherit;font-size:13px;padding:8px 10px;border:1px solid var(--line);border-radius:7px;background:var(--card,#fff);color:var(--ink)}
.chat-output-reading-head{display:flex;align-items:flex-start;gap:6px;padding-bottom:14px;margin-bottom:18px;border-bottom:1px solid var(--line)}
.chat-output-reading-head>div:first-child{flex:1;min-width:0}.chat-output-reading-head h4{margin:0!important;font-size:13px!important;line-height:1.6;font-weight:550;overflow-wrap:anywhere}
.chat-output-reading-head small{display:block;color:var(--sub);font-size:11px;margin-top:4px;line-height:1.6}
.chat-output-expand,.chat-output-menu>summary{display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;background:transparent;color:var(--sub);border-radius:5px;cursor:pointer;list-style:none}
.chat-output-expand:hover,.chat-output-menu>summary:hover{background:var(--accent-soft);color:var(--accent-ink)}
.chat-output-menu{position:relative;flex:none}.chat-output-menu>summary::-webkit-details-marker{display:none}
.chat-output-menu svg,.chat-output-expand svg{width:15px;height:15px}
.chat-output-menu>div{position:absolute;right:0;top:31px;z-index:5;min-width:126px;background:var(--card,#fff);padding:5px;border:1px solid var(--line);border-radius:8px;box-shadow:0 6px 18px #16274412}
.chat-output-menu :is(a,button){display:block;width:100%;padding:8px;border:0;border-radius:5px;background:transparent;font:inherit;font-size:12px;color:var(--ink);text-decoration:none;text-align:left;white-space:nowrap}
.chat-output-menu :is(a,button):hover{background:var(--accent-soft)}
html:root body #chatTaskOutputs .chat-output-content{font-family:var(--font-ui,inherit);font-size:14px;line-height:1.85;overflow-wrap:anywhere;min-width:0;color:var(--ink);padding:0;margin:0}
html:root body #chatTaskOutputs .chat-output-content :is(h1,h2,h3){line-height:1.5;margin:22px 0 10px;font-weight:600;letter-spacing:0}
html:root body #chatTaskOutputs .chat-output-content :is(h1,h2){font-size:19px!important}
html:root body #chatTaskOutputs .chat-output-content h3{font-size:16px!important}
html:root body #chatTaskOutputs .chat-output-content>:first-child{margin-top:0}
html:root body #chatTaskOutputs .chat-output-content p{font-size:inherit;line-height:inherit;margin:0 0 14px}
html:root body #chatTaskOutputs .chat-output-content table{display:block;overflow-x:auto;max-width:100%;font-size:12px;line-height:1.65}
html:root body #chatTaskOutputs .chat-output-content :is(td,th){padding:9px 10px;min-width:100px;height:auto;vertical-align:top}
html:root body #chatTaskOutputs .chat-output-content :is(ul,ol){padding-left:20px}
html:root body #chatTaskOutputs .chat-output-content li{margin-bottom:7px}
html:root body #chatTaskOutputs .chat-output-read-note{color:var(--sub);font-size:13px}
.chat-output-plain{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.7}
.chat-saved-artifacts>button.chat-output-link{width:fit-content;padding:2px 0;border:0;background:transparent;font-size:11px;color:var(--sub);gap:5px}
.chat-output-link svg{width:13px;height:13px}
@media(min-width:1001px){
  html:root body .chat-workspace.aside-open:not(.aside-expanded):has(#chatTaskOutputs){grid-template-columns:var(--chat-sess-width) minmax(0,1fr) var(--chat-aside-width,380px)}
  html:root body .chat-workspace.sessions-collapsed.aside-open:not(.aside-expanded):has(#chatTaskOutputs){grid-template-columns:0 minmax(0,1fr) var(--chat-aside-width,380px)}
}
