/* Conversations tab: a chat view. Colors come from the tokens in style.css. Every rule is scoped under .chat. */
:root{--chat-code:#E8917A;--chat-online:#4CAF7A}
html.light{--chat-code:#A2533F;--chat-online:#2E8B57}
/* Code syntax colors (highlight.js classes). Dark is the default; html.light switches them. Muted, and each reads at 4.5:1 or more on the code surface. */
:root{--hl-keyword:#c39ad6;--hl-string:#a3c98a;--hl-number:#e0a676;--hl-func:#8db3e6;--hl-type:#e3c27f;--hl-attr:#e09f94;--hl-tag:#7fc2bd;--hl-meta:#c4bfb3;--hl-comment:#908c83;--hl-del:#e3857a}
html.light{--hl-keyword:#7d3f9b;--hl-string:#356d2d;--hl-number:#9c4f16;--hl-func:#2b5fa3;--hl-type:#7d5a0c;--hl-attr:#a64b3e;--hl-tag:#1d7570;--hl-meta:#5f5b52;--hl-comment:#6b675d;--hl-del:#b03b30}
.layout>main.chat-mode{padding:0;max-width:none;min-width:0}

.chat{display:grid;position:relative;grid-template-columns:var(--side-width,240px) minmax(0,1fr);height:calc(var(--viewport-height) - var(--header-height));min-height:0}
.chat .chat-side{display:flex;flex-direction:column;position:relative;min-height:0;border-right:1px solid var(--line);padding:12px}
/* The drag handle on the right edge of the sidebar. */
.chat .chat-resize{position:absolute;top:0;right:-4px;bottom:0;z-index:2;width:8px;padding:0;border:0;background:transparent;cursor:col-resize;touch-action:none}
.chat .chat-resize::after{content:'';position:absolute;top:0;bottom:0;left:3px;width:2px;background:var(--accent,#5B8CFF);opacity:0;transition:opacity .15s}
.chat .chat-resize:hover::after,.chat .chat-resize:focus-visible::after,.chat.resizing .chat-resize::after{opacity:1}
.chat.resizing{cursor:col-resize;user-select:none}
.chat .chat-search{width:100%;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);font:inherit;font-size:14px}
.chat .chat-search:focus{outline:1px solid var(--muted);outline-offset:0}
.chat .chat-list{flex:1;min-height:0;overflow-y:auto;margin-top:12px}
.chat .chat-group{margin-bottom:8px}
.chat .chat-group-title{margin:12px 10px 6px;font-size:13px;font-weight:500;color:var(--muted)}
.chat .chat-item{display:flex;align-items:baseline;justify-content:space-between;gap:8px;width:100%;margin:0 0 2px;padding:8px 10px;border:0;border-radius:8px;background:none;color:var(--text);text-align:left;font-size:14px}
.chat .chat-item:hover{background:var(--surface)}
.chat .chat-item[aria-current=true]{background:var(--pill)}
.chat .chat-item-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
.chat .chat-item[aria-current=true] .chat-item-name{color:var(--strong)}
.chat .chat-item-time{flex:none;font-size:12px;color:var(--muted)}
.chat .chat-none{margin:8px 10px;color:var(--muted);font-size:13px}
.chat .chat-skel{height:30px;margin:4px 8px;border-radius:8px;background:var(--line,rgba(127,127,127,.18));opacity:.6;animation:chat-skel 1.2s ease-in-out infinite alternate}
@keyframes chat-skel{to{opacity:.25}}
@media (prefers-reduced-motion:reduce){.chat .chat-skel{animation:none}}
.chat .chat-pane{display:flex;flex-direction:column;min-width:0;min-height:0}
.chat .chat-head{display:flex;align-items:center;gap:12px;flex:none;height:48px;padding:0 20px;border-bottom:1px solid var(--line)}
.chat .chat-title{min-width:0;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 14px/1.3 Inter,sans-serif;color:var(--strong)}
.chat .chat-tools{display:flex;align-items:center;gap:12px;margin-left:auto;flex:none}
.chat .chat-status{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.chat .chat-status::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--muted)}
.chat .chat-status.on{color:var(--text)}
.chat .chat-status.on::before{background:var(--chat-online)}
.chat .chat-share button{border:1px solid var(--line);border-radius:8px;padding:6px 12px;background:none;color:var(--text);font-size:13px}
.chat .chat-share button:hover{background:var(--pill)}
.chat .chat-drawer{display:none}

.chat .chat-view{flex:1;min-height:0;display:flex;flex-direction:column}
.chat .chat-transcript{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
.chat .chat-log{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;padding:4px 20px 16px}
.chat .chat-older{flex:none;align-self:center;width:min(760px,calc(100% - 48px));margin:12px auto 0;padding:6px 12px;text-align:center;border:1px solid var(--line);border-radius:999px;background:none;color:var(--muted);font-size:12px}
.chat .chat-older:hover{background:var(--pill)}
.chat .chat-jump{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--text);font-size:16px;line-height:1;box-shadow:0 2px 8px rgb(0 0 0 / .25)}
.chat .chat-jump:hover{background:var(--pill)}
.chat .chat-empty{margin:auto;padding:40px 24px;text-align:center}
.chat .chat-empty-title{margin:0 0 8px;font:500 26px/1.2 'Source Serif 4',serif;color:var(--strong)}
.chat .chat-empty-hint{margin:0;color:var(--muted)}

/* Messages */
.chat .chat-msg{width:min(760px,100%);padding-top:14px}
.chat .chat-msg.chat-msg-flash{outline:2px solid var(--accent);outline-offset:4px;border-radius:10px;transition:outline-color .6s}
@media (prefers-reduced-motion: reduce){.chat .chat-msg.chat-msg-flash{transition:none}}
.chat .chat-msg.cont{padding-top:4px}
.chat .chat-msg-head{display:flex;align-items:center;gap:8px;min-width:0;height:auto;margin-bottom:4px;padding:0;border:0;flex-wrap:wrap}
.chat .chat-msg.cont .chat-msg-head{display:none}
.chat .chat-msg-head strong{font-size:15px;font-weight:600;color:var(--strong)}
.chat .chat-msg-head time{font-size:12px;color:var(--muted)}
.chat .chat-edited{font-size:11px;color:var(--muted);background:var(--pill);border-radius:999px;padding:0 8px}
.chat .chat-mark{display:block;flex:none;width:18px;height:18px}
.chat .chat-mark.still .all,.chat .chat-mark.still .p{animation:none}
.chat .chat-run-sum .chat-mark{width:16px;height:16px}
.chat .chat-avatar{flex:none;width:28px;height:28px;border-radius:50%;object-fit:cover}
.chat .chat-avatar-pill{display:inline-grid;place-items:center;background:var(--pill);color:var(--strong);font-size:13px;font-weight:600}
.chat .chat-text{font-family:Inter,sans-serif;font-size:14px;line-height:1.6;color:var(--text);overflow-wrap:anywhere}
.chat .chat-msg.bot .chat-text{font-family:Inter,sans-serif;font-size:14px;line-height:1.65;margin:0}
.chat .chat-msg.human .chat-text{padding-left:36px}
.chat .chat-msg.mine{display:flex;flex-direction:column;align-items:flex-end}
.chat .chat-msg.mine .chat-edited{display:inline-block;margin-top:4px}
.chat .chat-msg.mine .chat-text{max-width:80%;padding:10px 14px;border-radius:16px;background:var(--surface)}
.chat .live-text{white-space:pre-wrap}

/* Markdown (web/markdown.js) */
.chat .chat-text p{margin:0 0 .8em}
.chat .chat-text p:last-child{margin-bottom:0}
.chat .chat-text ul,.chat .chat-text ol{margin:.4em 0 .8em;padding-left:1.4em}
.chat .chat-text li{margin:.2em 0}
.chat .chat-text blockquote{margin:.6em 0;padding:0 0 0 14px;border-left:2px solid var(--line);color:var(--muted)}
.chat .chat-text a{color:var(--accent);text-decoration:none}
.chat .chat-text a:hover{text-decoration:underline}
.chat .chat-text code{font-family:'JetBrains Mono',monospace;font-size:.88em;color:var(--chat-code);background:var(--pill);border-radius:6px;padding:.1em .35em}
.chat .chat-text .md-code{margin:.6em 0;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
.chat .chat-text .md-code .md-code-lang{flex:1;min-width:0;padding:8px 0 0 14px;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat .chat-text .md-code pre{margin:0;padding:10px 14px 14px;overflow-x:auto;white-space:pre;font:13px/1.55 'JetBrains Mono',monospace;color:var(--text)}
.chat .chat-text .md-code code{padding:0;border-radius:0;background:none;color:inherit;font-size:inherit}
/* Global, so the admin prompt preview gets the same code blocks. */
.md-code-head{display:flex;align-items:center;gap:8px;padding-right:8px}
.md-code-head .md-code-lang{min-width:0}
.md-copy{margin:6px 0 0 auto;flex:none;min-height:24px;padding:2px 8px;border:1px solid var(--line);border-radius:6px;background:transparent;color:var(--muted);font:12px/1.4 Inter,sans-serif;cursor:pointer}
.md-copy:hover{background:var(--pill);color:var(--text)}
.md-code .hljs{background:none;color:inherit}
.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-doctag{color:var(--hl-keyword)}
.hljs-string,.hljs-regexp,.hljs-addition{color:var(--hl-string)}
.hljs-number,.hljs-symbol,.hljs-bullet{color:var(--hl-number)}
.hljs-title,.hljs-function .hljs-title,.hljs-section{color:var(--hl-func)}
.hljs-type,.hljs-built_in,.hljs-class .hljs-title{color:var(--hl-type)}
.hljs-attr,.hljs-attribute,.hljs-property,.hljs-variable,.hljs-template-variable,.hljs-params{color:var(--hl-attr)}
.hljs-tag,.hljs-name,.hljs-selector-class,.hljs-selector-id{color:var(--hl-tag)}
.hljs-meta,.hljs-link{color:var(--hl-meta)}
.hljs-comment,.hljs-quote{color:var(--hl-comment);font-style:italic}
.hljs-deletion{color:var(--hl-del)}
.hljs-emphasis{font-style:italic}
.hljs-strong{font-weight:600}
.chat .chat-text .md-mention{color:var(--accent);background:var(--pill);border-radius:4px;padding:0 .25em}
.chat .chat-text .md-spoiler{background:var(--pill);color:transparent;border-radius:4px;padding:0 .2em;cursor:pointer;user-select:none}
.chat .chat-text .md-spoiler.revealed{color:inherit;user-select:auto}

/* Runs */
.chat .chat-run{margin:0 0 8px}
.chat .chat-run-sum{display:inline-flex;align-items:center;gap:6px;padding:2px 0;border:0;background:none;color:var(--muted);font-size:14px;text-align:left;font-variant-numeric:tabular-nums}
.chat .chat-run-sum:hover{color:var(--text)}
.chat .chat-chev{display:inline-block;color:var(--muted);transition:transform .15s ease}
.chat .chat-run-sum[aria-expanded=true] .chat-chev{transform:rotate(90deg)}
.chat .chat-run-box{margin-top:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
.chat .chat-run-box>*{display:block;width:100%;margin:0;border:0;border-top:1px solid var(--line)}
.chat .chat-run-box>:first-child{border-top:0}
.chat .chat-run-box .busy{padding:10px 12px}
.chat .chat-run-prose{padding:10px 12px;font-size:13px;color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere}
.chat .chat-run-error{padding:10px 12px;font-size:13px;color:var(--muted)}
/* A thinking row uses the tool row layout (.chat-tool-line). Its text is muted and shows in full when open. */
.chat .chat-think .chat-think-text{color:var(--muted)}
.chat .chat-think.open .chat-think-text{overflow:visible;white-space:pre-wrap;overflow-wrap:anywhere}
.chat .chat-think.open .chat-chev{transform:rotate(90deg)}
.chat .chat-tool-line{display:flex;width:100%;align-items:baseline;gap:8px;padding:9px 12px;border:0;border-radius:0;background:none;color:var(--text);font-size:14px;text-align:left}
.chat .chat-tool-line:hover{background:var(--pill)}
.chat .chat-tool-status{flex:none;width:14px;text-align:center;color:var(--muted)}
.chat .chat-tool-name{flex:none;color:var(--muted)}
.chat .chat-tool-args{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
.chat .chat-tool[data-open=true] .chat-chev{transform:rotate(90deg)}
.chat .chat-tool-child{padding-left:28px}
.chat .chat-tool-code{margin:0 12px 10px 34px;font-size:13px;color:var(--muted)}
.chat .chat-tool-code summary{cursor:pointer;padding:4px 0}
.chat .chat-tool-detail{margin:0;padding:10px 12px 12px 34px;max-height:260px;overflow:auto;font:12px/1.55 'JetBrains Mono',monospace;color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere}


/* Composer */
.chat .chat-composer{flex:none;display:flex;justify-content:center;padding:8px 20px 12px}
.chat .chat-form{width:min(760px,100%)}
.chat .chat-status-line{margin:0 0 6px 4px;font-size:12px;color:var(--muted)}
.chat .chat-status-line:empty{display:none}
.chat .chat-status-line{transition:opacity .6s ease}
.chat .chat-status-line.fading{opacity:0}
.chat .chat-input{display:flex;align-items:flex-end;gap:8px;padding:10px 10px 10px 16px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
.chat .chat-input:focus-within{border-color:var(--muted)}
.chat .chat-input textarea{flex:1;min-width:0;max-height:12em;margin:0;padding:4px 0;border:0;outline:0;resize:none;overflow-y:auto;background:transparent;color:var(--strong);font:inherit;font-size:16px;line-height:1.5;box-sizing:border-box}
.chat .chat-input textarea::placeholder{color:var(--muted)}
.chat .chat-send{flex:none;display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:50%;background:var(--pill);color:var(--muted)}
.chat .chat-send:hover{background:var(--pill)}
.chat .chat-input.has-text .chat-send{background:var(--accent);color:var(--bg)}
.chat .chat-send:disabled{opacity:.6;cursor:wait}
.chat .chat-foot{margin:8px 0 0;text-align:center;font-size:12px;color:var(--muted)}

/* Live status line and verb */
.chat .chat-verb{color:var(--accent)}
.chat .chat-run-meta{color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.chat .chat-run-sum{font-variant-numeric:tabular-nums}
.chat .chat-run-sum>.chat-mark+.chat-run-text{margin-left:0}

/* Server picker at the top of the conversation list */
.chat .chat-server{padding:0 0 10px;flex:none}
.chat .chat-server .pick{padding:7px 10px;border-radius:10px;font-size:14px}

/* Top bar: Chat and Settings tabs, Docs, theme icon and the account menu */
.topbar .top-tabs{display:flex;gap:4px;position:relative}
.topbar .top-tab{position:relative;z-index:1;display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border:0;border-radius:7px;background:none;color:var(--muted);font-size:14px}
.topbar .top-tab:hover{color:var(--strong)}
.topbar .top-tab.selected{color:var(--strong)}
/* The pill behind the active tab. conversations.js sets its width and position (placeTabPill). */
.topbar .top-tab-pill{position:absolute;left:0;top:0;height:100%;border-radius:7px;background:var(--pill);pointer-events:none;transition:transform .2s ease-out,width .2s ease-out}
@media (prefers-reduced-motion:reduce){.topbar .top-tab-pill{transition:none}}
/* View switch (Chats and Servers): the sidebar and the main pane slide and cross-fade. animateViews in conversations.js sets data-view-dir on html. */
.chat .chat-side{view-transition-name:chat-side}
.chat .chat-pane{view-transition-name:chat-main}
::view-transition-old(root),::view-transition-new(root){animation:none}
::view-transition-old(chat-side),::view-transition-old(chat-main){animation:200ms ease-out both view-out-left}
::view-transition-new(chat-side),::view-transition-new(chat-main){animation:200ms ease-out both view-in-left}
html[data-view-dir=back]::view-transition-old(chat-side),html[data-view-dir=back]::view-transition-old(chat-main){animation-name:view-out-right}
html[data-view-dir=back]::view-transition-new(chat-side),html[data-view-dir=back]::view-transition-new(chat-main){animation-name:view-in-right}
@keyframes view-out-left{to{opacity:0;transform:translateX(-24px)}}
@keyframes view-in-left{from{opacity:0;transform:translateX(24px)}}
@keyframes view-out-right{to{opacity:0;transform:translateX(24px)}}
@keyframes view-in-right{from{opacity:0;transform:translateX(-24px)}}
@media (prefers-reduced-motion:reduce){::view-transition-old(chat-side),::view-transition-old(chat-main),::view-transition-new(chat-side),::view-transition-new(chat-main){animation:none}}
.topbar .top-link{display:inline-flex;align-items:center;gap:8px;color:var(--text);font-size:14px}
.topbar .top-link:hover{color:var(--strong)}
.topbar .icon-button{display:inline-grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--line);border-radius:8px;background:none;color:var(--text)}
.topbar .icon-button:hover{background:var(--pill)}
.topbar .theme-icon{display:block;line-height:0}
.topbar .account{position:relative}
.topbar .avatar-button{display:block;width:24px;height:24px;padding:0;border:0;border-radius:50%;overflow:hidden;background:var(--pill)}
.topbar .avatar-img{display:block;width:24px;height:24px;border-radius:50%;object-fit:cover}
.topbar .avatar-pill{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--pill);color:var(--strong);font-size:12px;font-weight:600}
.topbar .account-menu{position:absolute;right:0;top:calc(100% + 10px);z-index:20;min-width:220px;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.topbar .account-name{margin:0 0 6px;padding:6px 10px;font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.topbar .menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;border-radius:8px;background:none;color:var(--text);text-align:left}
.topbar .menu-item:hover{background:var(--pill)}

/* Chat view: the Settings sidebar is hidden */
.layout.chat-only{grid-template-columns:minmax(0,1fr)}
.layout.chat-only>aside{display:none}

@media (max-width:760px){
  .topbar .top-tab{padding:8px}
}

/* Private chats: the New chat button, the rows with a lock and the options menu, the rename box */
.chat .chat-new{display:flex;align-items:center;gap:8px;width:100%;margin:0 0 8px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:none;color:var(--strong);font-size:14px}
.chat .chat-new:hover{background:var(--pill)}
.chat .chat-new:disabled{opacity:.6}
.chat .chat-row{position:relative;display:flex;align-items:center;gap:2px}
.chat .chat-row>.chat-item{flex:1 1 auto;width:auto;min-width:0}
.chat .chat-lock{display:inline-flex;flex:none;margin-right:6px;color:var(--muted);vertical-align:-3px}
.chat .chat-lock svg{display:block}
.chat .chat-more{flex:none;display:grid;place-items:center;width:26px;height:26px;padding:0;border:0;border-radius:6px;background:none;color:var(--muted)}
.chat .chat-more:hover,.chat .chat-more[aria-expanded=true]{background:var(--pill);color:var(--strong)}
.chat .chat-menu{position:absolute;right:0;top:100%;z-index:20;min-width:150px;margin-top:4px;padding:4px;border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:0 8px 24px rgb(0 0 0 / .25)}
.chat .chat-menu-item{display:block;width:100%;padding:7px 10px;border:0;border-radius:6px;background:none;color:var(--text);font-size:13px;text-align:left}
.chat .chat-menu-item:hover,.chat .chat-menu-item:focus-visible{background:var(--pill);color:var(--strong)}
.chat .chat-menu-item.danger{color:var(--chat-code)}
.chat .chat-rename{flex:1 1 auto;min-width:0;margin:0;padding:6px 8px;border:1px solid var(--muted);border-radius:8px;background:var(--surface);color:var(--strong);font:inherit;font-size:14px}
.chat .chat-private{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.chat .chat-private svg{display:block}

/* A new chat: the greeting, with the composer under it, until the first message */
.chat .chat-hero{width:min(760px,100%);margin:auto;padding:32px 0 24px;display:flex;flex-direction:column;align-items:center;gap:18px;text-align:center}
.chat .chat-hero-logo{display:block;width:56px;height:56px}
.chat .chat-hero-title{margin:0;font:500 30px/1.2 'Source Serif 4',serif;color:var(--strong)}
.chat .chat-hero-composer{width:100%;text-align:left}

/* Channels and threads are read-only. The note sits at the bottom of the column. */
.chat .chat-readonly{margin:0;padding:12px 24px 16px;text-align:center;font-size:12px;color:var(--muted)}
.chat .chat-usage-reset{display:block;width:100%;margin:8px 0 0;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:none;color:var(--strong);font-size:13px;text-align:center}
.chat .chat-usage-reset:hover:not(:disabled){background:var(--pill)}
.chat-link-warning{border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin-bottom:8px;font-size:13px;color:var(--muted);background:var(--surface)}.chat-link-warning strong{color:var(--strong)}

/* A message that is not saved yet, or that failed to send. */
.chat-msg.pending .chat-text { opacity: .6; }
.chat-msg.failed .chat-text { outline: 1px solid var(--danger, #c0392b); }
.chat-retry { margin: 4px 0 0 auto; display: block; background: none; border: 0; color: var(--danger, #c0392b); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
/* Reasoning effort picker in the composer */
.chat .effort-pick{position:relative;flex:none}
.chat .effort-button{padding:6px 10px;border:0;border-radius:999px;background:var(--pill);color:var(--muted);font-size:12px}
.chat .effort-button:hover{color:var(--strong)}
.chat .effort-menu{position:absolute;right:0;bottom:100%;z-index:20;min-width:120px;margin-bottom:6px;padding:4px;border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:0 8px 24px rgb(0 0 0 / .25)}
.chat .effort-item{display:block;width:100%;padding:7px 10px;border:0;border-radius:6px;background:none;color:var(--text);font-size:13px;text-align:left}
.chat .effort-item:hover,.chat .effort-item:focus-visible{background:var(--pill);color:var(--strong)}
.chat .effort-item[aria-checked=true]{color:var(--strong);font-weight:600}
.chat .chat-tray{display:flex;flex-wrap:wrap;gap:8px;padding:0 0 8px}
.chat .chat-thumb{position:relative;display:flex;align-items:center}
.chat .chat-thumb img{width:64px;height:64px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.chat .chat-thumb button{position:absolute;top:-6px;right:-6px;width:20px;height:20px;padding:0;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:var(--text);cursor:pointer;line-height:1}
.chat .chat-image-chip{font-size:13px;color:var(--muted);padding:4px 8px;border:1px solid var(--line);border-radius:8px}
.chat .chat-images{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;margin-bottom:6px}
.chat .chat-images img{max-width:180px;max-height:180px;border-radius:10px;border:1px solid var(--line)}
.chat .chat-file-chip{display:inline-block;max-width:min(260px,100%);font-size:13px;color:var(--muted);text-decoration:none;overflow-wrap:anywhere;padding:4px 8px;border:1px solid var(--line);border-radius:8px}
.chat a.chat-file-chip:hover{text-decoration:underline}
.chat .chat-files{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;margin-bottom:6px}
.chat .chat-attach{border:0;background:transparent;color:var(--muted);font-size:22px;cursor:pointer;padding:0 8px}
.chat .chat-card{margin-top:8px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;max-width:100%;overflow-wrap:anywhere}
.chat .chat-card-title{display:block;margin-bottom:6px}
.chat .chat-card-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.chat .chat-card-button{font:inherit;font-size:14px;padding:6px 12px;border:1px solid var(--line);border-radius:8px;background:transparent;color:inherit;cursor:pointer}
.chat .chat-card-button:disabled{opacity:.5;cursor:default}
.chat .chat-form.dragging .chat-input{outline:2px dashed var(--accent)}

/* The mobile list overlays the transcript so opening it never moves the composer. */
.chat .chat-drawer-close,.chat .chat-backdrop{display:none}
.chat .chat-head{min-width:0}.chat .chat-title{flex:1}.chat .chat-tools{gap:8px}.chat .chat-msg{min-width:0}.chat .chat-text{max-width:100%;min-width:0}
.chat .chat-text img{max-width:100%;height:auto}.chat .chat-images img{max-width:min(180px,100%)}
.chat .chat-images a{max-width:100%}
.chat .chat-msg.bot .chat-images{justify-content:flex-start}
.chat .chat-msg.bot .chat-images img{max-width:min(640px,100%);max-height:420px}
.chat .chat-input{position:relative;display:grid;grid-template-columns:34px minmax(0,1fr) auto 34px;gap:4px 6px;padding:8px 10px;border-radius:12px}.chat .chat-input textarea{grid-column:1/-1;grid-row:1;width:100%;max-height:min(12em,30dvh)}.chat .chat-attach{grid-column:1;grid-row:2}.chat .chat-usage{grid-column:2;grid-row:2;justify-self:end}.chat .effort-pick{grid-column:3;grid-row:2}.chat .chat-send{grid-column:4;grid-row:2}
.chat .chat-attach,.chat .chat-send,.chat .chat-usage-button{min-height:34px;height:34px;width:34px;padding:0;flex:none}.chat .effort-button{min-height:34px}
.chat .chat-usage-pop{width:min(260px,calc(100vw - 32px));max-height:50dvh;overflow-y:auto}.chat .chat-foot{margin-top:6px;font-size:11px}
.topbar .avatar-button{width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--line)}.topbar .icon-button,.topbar .top-tab{min-height:36px}.topbar .top-link{min-height:36px}
.chat .chat-hero{gap:12px;padding:20px 0}.chat .chat-hero-logo{width:40px;height:40px}.chat .chat-hero-title{font-size:26px}
@media(max-width:760px){
 .chat{grid-template-columns:minmax(0,1fr);height:calc(var(--viewport-height) - var(--header-height));overflow:hidden}
 .chat .chat-resize{display:none}
 .chat .chat-side{display:flex;position:absolute;inset:0 auto 0 0;z-index:42;width:min(300px,calc(100% - 40px));padding:12px;background:var(--bg);border-right:1px solid var(--line);transform:translateX(-100%);visibility:hidden;transition:transform .22s ease-out,visibility 0s linear .22s}
 .chat.drawer-open .chat-side{transform:none;visibility:visible;transition:transform .22s ease-out,visibility 0s}
 .chat .chat-backdrop{display:block;position:absolute;inset:0;z-index:41;width:100%;height:100%;border:0;border-radius:0;background:rgb(0 0 0 / .55);opacity:0;visibility:hidden;transition:opacity .22s ease-out,visibility 0s linear .22s}
 .chat.drawer-open .chat-backdrop{opacity:1;visibility:visible;transition:opacity .22s ease-out,visibility 0s}
 .chat .chat-drawer-close{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;min-height:40px;font-size:13px}
 .chat .chat-drawer{display:grid;place-items:center;flex:none;width:40px;height:40px;min-height:40px;padding:0;border:0;background:none}
 .chat .chat-pane{height:100%;min-height:0}.chat .chat-head{height:48px;gap:6px;padding:0 8px;flex-wrap:nowrap}.chat .chat-title{font-size:14px}.chat .chat-tools{gap:6px}.chat .chat-private span{display:none}.chat .chat-status{font-size:0;gap:0}.chat .chat-status::before{width:6px;height:6px}
 .chat .chat-share button{min-height:40px;padding:6px 8px}.chat .chat-log{padding:4px 12px 12px}.chat .chat-older{width:calc(100% - 24px);min-height:40px;margin-top:8px}
 .chat .chat-msg.mine .chat-text{max-width:92%;padding:8px 12px;border-radius:12px}.chat .chat-msg.human .chat-text{padding-left:0}.chat .chat-msg-head strong{font-size:13px}.chat .chat-avatar{width:22px;height:22px}
 .chat .chat-composer{padding:6px 12px max(8px,env(safe-area-inset-bottom))}.chat .chat-input textarea{font-size:16px;max-height:25dvh}.chat .chat-foot{margin-top:4px}.chat .chat-readonly{padding:8px 12px max(8px,env(safe-area-inset-bottom))}
 .chat .chat-item,.chat .chat-new,.chat .chat-more,.chat .chat-menu-item,.chat .effort-item{min-height:40px}.chat .chat-more{width:36px}.chat .chat-search{font-size:16px}.chat .chat-empty{padding:24px 12px}.chat .chat-empty-title{font-size:22px}.chat .chat-run-sum{min-height:36px;flex-wrap:wrap}.chat .chat-tool-name{flex-shrink:1;overflow-wrap:anywhere}.chat .chat-tool-line{min-height:40px}
 .topbar .top-link span{display:none}.topbar .top-link{width:32px;justify-content:center}.topbar .top-tabs{gap:2px}.topbar .top-tab{min-width:36px;padding:8px}.topbar .account-menu{max-width:calc(100vw - 24px)}
 /* New chat on mobile: the greeting sits centered in the free space, and the composer is pinned to the bottom. */
 .chat .chat-hero{width:100%;flex:1 1 auto;margin:0;padding:12px 4px max(0px,env(safe-area-inset-bottom));box-sizing:border-box}
 .chat .chat-hero-logo,.chat .chat-hero-composer{margin-top:auto}
}
@media(prefers-reduced-motion:reduce){.chat .chat-chev,.chat .chat-status-line,.chat .chat-side,.chat.drawer-open .chat-side,.chat .chat-backdrop,.chat.drawer-open .chat-backdrop{transition:none}}
/* Conversations under a channel row. The list opens with a grid row, so its height is never measured. */
.chat .chat-chevron{flex:none;display:flex;align-items:center;justify-content:center;width:28px;min-height:32px;padding:0;border:0;border-radius:8px;background:none;color:var(--muted)}
.chat .chat-chevron:hover{background:var(--surface)}
.chat .chat-chevron svg{transition:transform .2s ease}
.chat .chat-tree.open>.chat-row .chat-chevron svg{transform:rotate(90deg)}
.chat .chat-sub{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease}
.chat .chat-tree.open>.chat-sub{grid-template-rows:1fr}
.chat .chat-sub-inner{min-height:0;overflow:hidden;padding-left:18px}
.chat .chat-run{font-size:14px}
.chat .chat-run-all .chat-item-name{color:var(--muted)}
.chat .chat-sub-note{margin:4px 10px 6px;font-size:13px;color:var(--muted)}
.chat .chat-sub-more{justify-content:center;font-size:13px;color:var(--muted)}
@media(prefers-reduced-motion:reduce){.chat .chat-chevron svg,.chat .chat-sub{transition:none}}
.chat .chat-inbox{justify-content:space-between}
.chat .chat-inbox[aria-pressed=true]{background:var(--pill);color:var(--strong)}
.chat .chat-inbox-count{min-width:22px;padding:0 7px;border-radius:999px;background:var(--accent);color:var(--bg);font-size:12px;line-height:20px;text-align:center}
.chat .inbox{flex:1;min-height:0;overflow-y:auto;width:100%;max-width:760px;margin:0 auto;padding:12px 20px 16px;box-sizing:border-box}
.chat .inbox-bar{display:flex;gap:8px;justify-content:flex-end;margin-bottom:12px}
.chat .inbox-bar button{min-height:36px;padding:6px 12px;font-size:13px}
.chat .inbox-toggle[aria-pressed=true]{background:var(--pill);color:var(--strong)}
.chat .inbox-list{margin:0;padding:0;list-style:none}
.chat .inbox-item{padding:12px 0;border-bottom:1px solid var(--line)}
.chat .inbox-item.done{opacity:.6}
.chat .inbox-head{display:flex;gap:10px;align-items:baseline;justify-content:space-between;font-size:13px}
.chat .inbox-sender{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--strong)}
.chat .inbox-time{flex:none;color:var(--muted)}
.chat .inbox-summary{margin:6px 0 8px;overflow-wrap:anywhere;color:var(--text)}
.chat .inbox-actions{display:flex;align-items:center;gap:12px;font-size:13px}
.chat .inbox-actions a{color:var(--accent)}
.chat .inbox-actions button,.chat .inbox-done-mark{margin-left:auto;min-height:32px;padding:4px 10px;font-size:13px}
.chat .inbox-done-mark{color:var(--muted)}
.chat .inbox-empty{margin:24px 0;text-align:center;color:var(--muted)}
.math-block{overflow-x:auto}
.math-src{white-space:pre-wrap;overflow-wrap:anywhere}
