#chat-draft-check { margin:0 8px 6px; }
#chat-draft-status { margin:2px 8px 6px; color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.attach-remove { border:0; background:transparent; color:var(--muted); cursor:pointer; font-size:10px; padding:3px; }
.attach-thumb .attach-remove { position:absolute; right:0; top:0; background:var(--panel-solid); max-width:70px; }
.attach-remove:is(:hover, :focus-visible) { color:var(--red); }
.attachment-invalid { border-color:var(--red); gap:8px; flex-wrap:wrap; }
.attachment-invalid > span { overflow-wrap:anywhere; }

/* chat：对话页（OpenWebUI 式对话流 × 机房控制台色板）。
 * 结构：用户消息=右侧圆角气泡；agent 回合=左侧品牌头像 + 内容列（.turn，
 * 由 chat.js 分组）；工具调用/状态为无框细行，不打断阅读流。 */

/* 对话流与输入区共用一条居中栏（内容宽度封顶 800px）。
 * position:relative 必须保留：KaTeX 的无障碍 MathML 节点是 position:absolute
 * 的隐藏元素，若最近的定位祖先在滚动容器之外（.pane），长对话里深处的公式
 * 会以内容坐标锚出去，把整页撑出一条看不见的滚动区（双滚动条）。 */
.chat-log {
  position: relative;
  flex: 1; overflow-y: auto;
  padding: 24px max(20px, calc((100% - 800px) / 2)) 8px;
  display: flex; flex-direction: column; gap: 14px;
  /* 上下边界虚化：对话内容在贴近「对话切换栏」和「输入卡」时渐隐，
   * 与上下两栏之间留出一道柔和的分界，视觉上把中间的对话流单独划出来。
   * 顶部渐隐更长（旧内容滚上去时溶入切换栏），底部只轻描一笔，
   * 避免流式输出时最新一行被压暗影响阅读。 */
  --fade-top: 30px;
  --fade-bottom: 14px;
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0, #000 var(--fade-top),
    #000 calc(100% - var(--fade-bottom)), transparent 100%);
  mask-image: linear-gradient(to bottom,
    transparent 0, #000 var(--fade-top),
    #000 calc(100% - var(--fade-bottom)), transparent 100%);
}
/* 滚动 flex 容器的子项禁止收缩，否则内容超高时消息会被垂直压扁 */
.chat-log > * { flex-shrink: 0; }

/* 对话流顶部：还有更早的内容时挂这一条，滚到附近自动加载上一页（older.ts） */
.chat-older {
  align-self: center;
  display: flex; align-items: center; gap: 8px;
  min-height: 34px;
  color: var(--muted);
  font-size: 12.5px;
}
.chat-older > [hidden] { display: none; }
.chat-older.error { color: var(--text); }

/* 新消息淡入（历史加载在隐藏态完成，呈现时整体淡入一次） */
.msg, .turn, .user-turn { animation: msg-in 0.2s ease-out; }
.user-turn .msg { animation: none; }
@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
}

/* ---- 用户消息：右对齐圆角气泡 + 右侧首字头像（与左侧 Agent 头像对称），
 * 气泡下方一行时间 / 复制 / 填回输入框，悬停或键盘获焦才显出来 ---- */
.msg { font-size: 15px; line-height: 1.75; }
.user-turn {
  align-self: flex-end;
  display: flex; align-items: flex-start; gap: 12px;
  max-width: calc(78% + 40px);
  margin-top: 8px;
}
.user-main { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.msg.user {
  max-width: 100%;
  background: var(--panel-2);
  border-radius: calc(18px * var(--radius-scale)) calc(18px * var(--radius-scale)) calc(6px * var(--radius-scale)) calc(18px * var(--radius-scale));
  padding: 10px 16px;
  white-space: pre-wrap;
  word-break: break-word;
}
/* 发给 CLI 的斜杠命令（syntax.ts）：等宽字、淡蓝底加细边，前面一个终端提示符，
 * 一眼和普通提问分开；命令名标蓝，后面的参数照常 */
.msg.user.cmd {
  background: color-mix(in srgb, var(--info) 9%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 30%, transparent);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  padding: 10px 16px 10px 13px;
}
.msg-cmd-icon.ui-icon { display: inline-block; color: var(--info); vertical-align: -2px; margin-right: 7px; }
.msg-cmd { color: var(--info); font-weight: 600; }
/* @路径：文件引用标签（图标 + 路径），和命令同一种蓝 */
.msg-mention {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 0 6px; margin: 0 1px;
  vertical-align: 1px;
  border-radius: calc(6px * var(--radius-scale));
  background: color-mix(in srgb, var(--info) 13%, transparent);
  color: var(--info); font-size: .86em; line-height: 1.6;
  overflow-wrap: anywhere;
}
.msg-mention .ui-icon { flex: none; }
/* 单行气泡高 46px，28px 头像下移 9px 正好与它居中 */
.user-avatar {
  flex: none; width: 28px; height: 28px; margin-top: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-round);
  background: var(--panel-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; font-weight: 600; line-height: 1;
  user-select: none;
}
.user-actions {
  display: flex; align-items: center; gap: 2px;
  margin-top: 2px; margin-right: -6px;
  color: var(--muted); font-size: 12px;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-out);
}
.user-turn:hover .user-actions, .user-actions:focus-within { opacity: 1; }
@media (hover: none) { .user-actions { opacity: 1; } }
.user-time { margin-right: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.user-actions .answer-copy { width: 28px; height: 28px; }

/* ---- Agent 回合：品牌头像 + 内容列 ---- */
.turn { display: flex; gap: 12px; align-items: flex-start; }
/* 回合头像用原始品牌 logo（不套圆圈瓦片），略放大，色随品牌 */
.turn-avatar { flex: none; margin-top: 2px; }
.turn-avatar .agent-ico { width: 24px; height: 24px; }
.turn-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding-top: 2px;
}
.turn-body > * { min-width: 0; }

.msg.agent { word-break: break-word; }
.msg.agent > :first-child { margin-top: 0; }
.msg.agent > :last-child { margin-bottom: 0; }

/* Answer actions and provenance: one quiet footer, always reachable on touch. */
.answer-footer {
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 0 8px;
  margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6;
}
.answer-footer[hidden] { display: none; }
.answer-actions { display: flex; flex: none; }
.answer-copy {
  flex: none; width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: calc(7px * var(--radius-scale)); background: transparent; color: var(--muted);
  cursor: pointer; transition: background 140ms, color 140ms;
}
.answer-copy:hover { background: var(--panel-2); color: var(--text); }
.answer-copy:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.answer-copy.copied { color: var(--green); }
/* 复制成功：对勾一笔画出来，按钮轻轻弹一下（回答底部与代码块共用；对勾路径长约 20） */
:is(.answer-copy.copied, .cb-copy:disabled) .ui-icon[data-icon-name="check"] { animation: copied-pop var(--dur-slow) var(--ease-out); }
:is(.answer-copy.copied, .cb-copy:disabled) .ui-icon[data-icon-name="check"] path {
  stroke-dasharray: 20; animation: check-draw var(--dur-slow) var(--ease-out) both;
}
@keyframes copied-pop { 45% { scale: 1.2; } }
@keyframes check-draw { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
.answer-context {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px;
  flex: 1; min-width: 0; padding: 6px 0;
}
.answer-context > * { min-width: 0; overflow-wrap: anywhere; }
.answer-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.answer-model { color: var(--text); opacity: .72; }
.answer-effort { white-space: nowrap; }
.answer-cost { white-space: nowrap; font-variant-numeric: tabular-nums; }
.answer-cost.priced { color: var(--text); font-family: var(--mono); font-size: 0.95em; }
.answer-details {
  flex-basis: 100%; margin: 6px 0 4px 8px; padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line); overflow-wrap: anywhere;
}
.answer-details[hidden] { display: none; }
.answer-details > div + div { margin-top: 4px; }
.ad-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.ad-k { flex: none; width: 4.5em; color: var(--muted); }
.ad-v { color: var(--text); font-variant-numeric: tabular-nums; }
.ad-note { flex-basis: 100%; padding-left: calc(4.5em + 10px); color: var(--muted); }
.ad-note:empty { display: none; }
@media (max-width: 760px) { .ad-note { padding-left: 0; } }
.answer-details .chip.result { font-size: inherit; padding: 0; opacity: 1; }
@media (max-width: 760px) {
  .answer-copy { width: 34px; height: 34px; }
  .answer-context { padding: 9px 0; gap: 3px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .answer-copy { transition: none; }
}

/* ---- 轻量 Markdown ---- */
.md-p { white-space: pre-wrap; margin: 0 0 10px; }
.md-h { font-weight: 650; line-height: 1.45; margin: 16px 0 6px; }
.md-h1 { font-size: 19px; }
.md-h2 { font-size: 17px; }
.md-h3 { font-size: 15.5px; }
.md-h4 { font-size: 15px; color: var(--muted); }
.md-hr { height: 1px; background: var(--line); margin: 14px 0; }

/* 数学公式（KaTeX）：字号与正文协调，颜色随文本；块级居中，过宽时自身横向滚动 */
.katex { font-size: 1.05em; }
.math-inline { white-space: normal; }
.math-display {
  margin: 12px 0; padding: 2px 0;
  overflow-x: auto; overflow-y: hidden;
}
.math-display .katex-display { margin: 0; }
.md-list { margin: 0 0 10px; padding-left: 22px; }
.md-list li { margin: 3px 0; white-space: pre-wrap; }
.md-list li::marker { color: var(--muted); }
.md-quote {
  margin: 0 0 10px;
  padding: 2px 2px 2px 13px;
  border-left: 3px solid var(--amber-dim);
  color: var(--muted);
  white-space: pre-wrap;
}
.md-link { color: var(--amber); text-decoration: none; border-bottom: 1px solid var(--amber-dim); }
.md-link:hover { border-bottom-color: var(--amber); }
/* 文档里的图片：没写尺寸时不许撑破正文；透明 PNG/SVG 铺棋盘格才看得清边界 */
.md-img {
  max-width: 100%; height: auto;
  vertical-align: middle; border-radius: calc(6px * var(--radius-scale));
  background: repeating-conic-gradient(var(--panel-2) 0 25%, transparent 0 50%) 0 0 / 16px 16px;
}
.md-tablewrap {
  max-width: 100%; overflow-x: auto;
  margin: 2px 0 10px;
  border: 1px solid var(--line); border-radius: calc(10px * var(--radius-scale));
}
.md-table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.md-table th, .md-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top;
  white-space: nowrap;
}
.md-table th { background: var(--panel); font-weight: 600; }
.md-table tr:last-child td { border-bottom: none; }

/* 行内代码：暗底小片，字用正文色（琥珀留给主操作与选中态，不再给代码） */
.msg code {
  font-family: var(--mono); font-size: 12.5px;
  color: var(--text-hi);
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: calc(5px * var(--radius-scale));
  padding: 1.5px 6px;
}

/* ---- 代码块：语言头 + 复制按钮 ---- */
.codeblock {
  margin: 2px 0 10px;
  border: 1px solid var(--line);
  border-radius: calc(12px * var(--radius-scale));
  background: var(--code-bg);
  overflow: hidden;
}
.cb-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 7px 4px 8px;
  background: var(--code-head);
  border-bottom: 1px solid var(--code-line);
}
/* 折叠开关：箭头 + 语言 + 行数，整块可点 */
.cb-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  min-width: 0;
  background: none; border: none; border-radius: calc(6px * var(--radius-scale));
  color: var(--muted);
  padding: 3px 8px 3px 5px;
}
.cb-toggle:hover { color: var(--text); background: var(--panel-2); }
.cb-caret {
  display: inline-flex; flex: none;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}
.codeblock.folded .cb-caret { transform: none; }
.cb-lang { font-size: 11px; letter-spacing: 0.07em; }
.cb-count { font-size: 11px; opacity: 0.65; }
.cb-copy {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; border-radius: calc(6px * var(--radius-scale));
  color: var(--muted);
  font-family: var(--sans); font-size: 12px;
  padding: 3px 8px;
}
.cb-copy:hover { color: var(--text); background: var(--panel-2); }
.cb-copy:disabled { color: var(--green); cursor: default; background: none; }
/* 主体：行号列固定，代码区横向滚动；折叠时整体隐藏 */
.cb-body { display: flex; align-items: stretch; }
.codeblock.folded .cb-body { display: none; }
.codeblock.folded .cb-head { border-bottom: none; }
.cb-gutter {
  flex: none;
  padding: 12px 0 12px 14px;
  text-align: right;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  font-size: 12.5px; line-height: 1.65;
  white-space: pre;
  user-select: none;
}
.codeblock pre {
  flex: 1; min-width: 0;
  margin: 0; padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  white-space: pre;
}
.codeblock code {
  background: none; border: none; padding: 0;
  color: var(--text); font-size: inherit;
}

/* ---- 事件行：无框细行（工具调用 / 状态），错误保留醒目面板 ---- */
.chip {
  max-width: 100%;
  font-family: var(--mono); font-size: 12px;
  color: var(--muted);
  padding: 1px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip .name { color: var(--text); margin-right: 9px; }
/* base.css 给 .ui-icon 设了 display:block，这里按行内图标排，否则图标独占一行 */
.chip .name svg { display: inline-block; vertical-align: -1.5px; margin-right: 5px; }
.chip .sum { color: var(--muted); }
.chip.result { font-family: var(--sans); font-size: 11.5px; color: var(--green); opacity: 0.75; padding-top: 3px; }
/* 「预览」入口：Agent 刚写出的 HTML 直接在这里点开渲染 */
.chip.has-open { display: flex; align-items: center; }
.chip.has-open .name { flex: none; }
.chip.has-open .sum { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip.has-open .chip-open { flex: none; }
.chip-open {
  margin-left: 9px; padding: 0 8px; height: 18px;
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  border-radius: calc(9px * var(--radius-scale)); background: transparent;
  color: var(--amber); font: inherit; font-size: 11px; line-height: 16px;
  vertical-align: 1px; cursor: pointer;
}
.chip-open:hover, .chip-open:focus-visible {
  background: color-mix(in srgb, var(--amber) 12%, transparent); outline: none;
}
/* 工具行上的「后台」：run_in_background 的命令，结束时另有一行通知 */
.chip .bg-tag {
  margin-right: 9px; padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  border-radius: var(--radius-pill);
  color: var(--amber); font-family: var(--sans); font-size: 11px;
}
/* 用户停止的回合、后台任务结束：说明性的细行，不是错误 */
.chip.stopped, .chip.bg-task {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 12.5px; white-space: normal;
}
.chip.stopped svg, .chip.bg-task svg { flex: none; }
.chip.bg-task[data-status="completed"] svg { color: var(--green); }
.chip.bg-task[data-status="failed"] { color: var(--warn); }
/* 错误 / 警告是中文句子，用正文字体（等宽字体里没有中文字形） */
.chip.err, .chip.warn {
  font-family: var(--sans); font-size: 12.5px;
  border-radius: calc(10px * var(--radius-scale));
  padding: 8px 13px;
  white-space: pre-wrap; overflow: visible; text-overflow: clip;
  word-break: break-word;
}
.chip.err {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
}
.chip.warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 7%, transparent);
  border: 1px solid var(--warn-line);
}

details.raw { font-family: var(--mono); font-size: 12px; color: var(--muted); }
details.raw summary { cursor: pointer; }
details.raw pre { max-height: 240px; overflow: auto; margin: 6px 0 0; }

/* 思考过程：折叠细行，展开为左侧竖线的引文 */
details.think { max-width: 100%; font-size: 13px; color: var(--muted); }
details.think summary {
  cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  border-radius: calc(6px * var(--radius-scale));
}
details.think summary::-webkit-details-marker { display: none; }
details.think summary::before {
  content: "›";
  transition: transform 0.15s ease;
  color: var(--muted);
}
details.think[open] summary::before { transform: rotate(90deg); }
details.think summary:hover { color: var(--text); }
details.think .think-body {
  white-space: pre-wrap;
  border-left: 2px solid var(--line);
  padding: 4px 0 4px 14px;
  margin: 8px 0 2px 4px;
  opacity: 0.8;
  line-height: 1.7;
}

/* ---- 流式生成中：打字机增量节点（完整事件到达后被正式渲染替换）。
 * text 块内容是 Markdown 渲染产物（块级），光标挂在最后一个块的末尾；
 * 首个字符到达前节点为空，光标退回容器本身 ---- */
.msg.live-text.streaming:empty::after,
.msg.live-text.streaming > :last-child::after,
details.think.streaming .think-body::after {
  content: "▍";
  margin-left: 2px;
  color: var(--amber);
  animation: cursor-blink 1s steps(2) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }

/* ---- 附件条：composer 内输入框上方的缩略图 / 文件条 ---- */
.chat-attach {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 2px 4px 4px;
}
.attach-file {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: calc(10px * var(--radius-scale));
  background: var(--panel-2);
  padding: 6px 10px;
  font-size: 12px; color: var(--text);
  max-width: 240px;
}
.attach-file .fn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-file .spin { width: 10px; height: 10px; }
.file-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 3px 4px;
  border: 1px solid var(--line); border-radius: calc(10px * var(--radius-scale));
  background: var(--code-bg);
  padding: 5px 10px;
  font-size: 12px; color: var(--text);
  text-decoration: none;
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-link:hover { border-color: var(--amber); }
.attach-thumb {
  position: relative;
  width: 64px; height: 64px;
  border: 1px solid var(--line); border-radius: calc(10px * var(--radius-scale));
  overflow: hidden;
  background: var(--code-bg);
  display: flex; align-items: center; justify-content: center;
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.attach-thumb .badge {
  position: absolute; left: 3px; top: 3px; z-index: 1;
  background: var(--overlay-chip);
  color: #fff;
  font-family: var(--mono); font-size: 10px;
  padding: 1px 5px; border-radius: calc(4px * var(--radius-scale));
}
.attach-thumb .up {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--muted); font-size: 11px;
}

/* 消息气泡里的图片缩略图 */
.msg.user .chat-thumb {
  display: inline-block; vertical-align: middle;
  max-width: 200px; max-height: 110px;
  border: 1px solid var(--line); border-radius: calc(10px * var(--radius-scale));
  margin: 3px 4px;
  cursor: zoom-in;
}
.msg.user .chat-thumb:hover { border-color: var(--amber); }
.img-gone { color: var(--muted); font-size: 12px; font-family: var(--mono); }

/* ---- 对话切换栏：当前对话标题（历史面板入口）+ 新对话（chat-threads.js） ---- */
.thread-bar {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 8px max(20px, calc((100% - 800px) / 2)) 0;
}

/* 对话通道连接状态：仅断开/重连时出现（连上即隐藏），让长回合期间的掉线
 * 可见，而不是等到用户按发送才发现发不出去。 */
.chat-conn {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  margin: 8px max(20px, calc((100% - 800px) / 2)) 0;
  padding: 7px 12px;
  border: 1px solid var(--line); border-radius: calc(9px * var(--radius-scale));
  background: var(--panel-2);
  font-size: 12.5px; color: var(--muted);
}
.chat-conn .btn { margin-left: auto; flex-shrink: 0; }
#chat-conn-text { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .chat-conn { margin: 6px 8px 0; }
}
.thread-cur {
  display: inline-flex; align-items: center; gap: 7px;
  min-width: 0;
  background: none; border: none; border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 12px;
}
.thread-cur:hover { color: var(--text); background: var(--panel); }
.thread-cur .t {
  min-width: 0; max-width: 52vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-cur svg { flex: none; display: block; }
/* 内网是对话的辅助状态入口，与历史标题同级，避免做成主操作按钮。 */
.chat-network {
  position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 32px; margin-left: 4px; padding: 5px 8px;
  border: 0; border-radius: calc(6px * var(--radius-scale)); background: transparent;
  color: var(--muted); font: 400 12px/1.5 var(--sans);
  white-space: nowrap; transition: background 140ms ease, color 140ms ease;
}
.chat-network::before {
  content: ""; position: absolute; left: -7px; top: 10px; bottom: 10px;
  width: 1px; background: var(--line);
}
.chat-network:hover, .chat-network:focus-visible { background: var(--panel); color: var(--text); }
.chat-network-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.chat-network-status { color: var(--muted); }
.chat-network[data-state="ready"] .chat-network-dot { background: var(--green); }
.chat-network[data-state="ready"] .chat-network-status { color: var(--green); }
.chat-network[data-state="pending"] .chat-network-dot { background: var(--warn); }
.chat-network[data-state="pending"] .chat-network-status { color: var(--warn); }
.chat-network[data-state="proxy"] .chat-network-dot { background: var(--green); }
.chat-network-arrow { flex: none; opacity: .5; transition: opacity 140ms ease, transform 140ms ease; }
.chat-network:hover .chat-network-arrow, .chat-network:focus-visible .chat-network-arrow { opacity: 1; transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
  .chat-network, .chat-network-arrow { transition: none; }
}
.thread-new {
  flex: none; margin-left: auto;
  background: none;
  border: 1px solid var(--line); border-radius: calc(8px * var(--radius-scale));
  color: var(--text);
  font-size: 12px; font-weight: 500;
  min-height: 32px; padding: 4px 10px;
}
.thread-new:hover { color: var(--text); border-color: var(--amber-dim); background: var(--panel); }

/* ---- 历史对话面板：右侧滑出，列表可切换 / 新建 / 删除 ---- */
.tp-scrim {
  position: fixed; inset: 0; z-index: 79;
  background: var(--scrim);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.tp-scrim.show { opacity: 1; pointer-events: auto; }
.thread-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: min(360px, 92vw);
  background: var(--panel-solid);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform 0.22s ease;
  display: flex; flex-direction: column;
}
.thread-panel.open { transform: none; }
.tp-head {
  flex: none;
  display: flex; align-items: center; gap: 9px;
  padding: 16px 14px 12px 18px;
}
.tp-head b { font-size: 15px; }
.tp-count { flex: 1; color: var(--muted); font-size: 11.5px; }
.tp-new { flex: none; margin: 0 16px 10px 18px; }
/* 搜索：对话攒多了靠标题快速定位；只有一条时由 JS 隐藏 */
.tp-search {
  flex: none; margin: 0 16px 10px 18px;
  padding: 7px 10px;
  border: 1px solid var(--line); border-radius: calc(8px * var(--radius-scale));
  background: var(--panel-2); color: var(--text);
  font-size: 13px;
}
.tp-search:focus-visible { outline: none; border-color: var(--amber); }
.tp-search::placeholder { color: var(--muted); }
.tp-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
  padding: 2px 10px 12px;
}
.tp-item {
  display: flex; align-items: stretch;
  border-radius: calc(10px * var(--radius-scale));
}
.tp-item:hover { background: var(--panel-2); }
.tp-item.on { background: color-mix(in srgb, var(--amber) 9%, transparent); }
.tp-open {
  flex: 1; min-width: 0; text-align: left;
  display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 3px 7px;
  background: none; border: none; border-radius: calc(10px * var(--radius-scale)) 0 0 calc(10px * var(--radius-scale));
  padding: 9px 4px 9px 10px;
}
.tp-open > .ui-icon { grid-row: 1 / 3; align-self: center; color: var(--muted); }
.tp-open > .tp-meta { grid-column: 2; }
.tp-title {
  color: var(--text); font-size: 13.5px; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tp-item.on .tp-title { color: var(--amber); }
.tp-meta { color: var(--muted); font-size: 11px; }
.tp-del {
  flex: none; align-self: center;
  width: 30px; height: 30px; margin: 0 6px 0 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: calc(8px * var(--radius-scale));
  color: var(--muted);
}
.tp-del:is(:hover, :focus-visible) { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
/* 桌面端删除钮悬停行才浮现；触屏无悬停，常驻可见 */
@media (hover: hover) {
  .tp-item .tp-del { opacity: 0; }
  .tp-item:hover .tp-del, .tp-item .tp-del:focus-visible { opacity: 1; }
}
.tp-empty {
  color: var(--muted); font-size: 13px; line-height: 1.7;
  text-align: center;
  padding: 34px 18px;
}
.tp-empty .spin { margin-right: 8px; }
.tp-skeleton { display: flex; flex-direction: column; gap: 3px; }
.tp-skeleton .tp-item:hover { background: none; }
.tp-hint {
  flex: none;
  color: var(--muted); font-size: 11.5px; line-height: 1.6;
  border-top: 1px solid var(--line);
  margin: 0; padding: 10px 18px 12px;
}

/* ---- 上下文分割线：新对话起点 ---- */
.chat-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 8px;
  color: var(--muted); font-size: 11px; letter-spacing: 0.08em;
}
.chat-divider::before,
.chat-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chat-divider span { white-space: nowrap; }

/* ---- 执行指示：对话流末尾一枚会动的品牌头像 + 阶段文案（仿桌面端 Contemplating）。
 * 沿用 .turn 布局（左头像 + 右内容列），头像按品牌做不同动画，文案在头像右侧。 ---- */
.turn.working .turn-body { justify-content: center; }
.work-label {
  font-size: 13px;
  color: var(--muted);
  animation: work-breathe 1.6s ease-in-out infinite;
}
@keyframes work-breathe { 50% { opacity: 0.45; } }
/* 模型还在干活时，后台任务的计数挂在阶段文案下面 */
.turn.working .turn-body { gap: 3px; }
.work-bg { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.work-bg[hidden] { display: none; }
.work-bg::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

/* Claude：星芒脉动（触手伸缩跳动） */
.turn.working .agent-ico.agent-claude {
  transform-origin: center;
  animation: claude-throb 1.15s ease-in-out infinite;
}
@keyframes claude-throb {
  0%, 100% { transform: scale(0.82); }
  50% { transform: scale(1.08); }
}
/* Codex：图标转圈 */
.turn.working .agent-ico.agent-codex {
  transform-origin: center;
  animation: codex-spin 1.4s linear infinite;
}
@keyframes codex-spin { to { transform: rotate(360deg); } }

/* ---- 输入卡：大圆角悬浮卡，聚焦时琥珀微光 ---- */
.composer-wrap {
  flex: none;
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 6px max(20px, calc((100% - 800px) / 2)) 18px;
}
.chat-scroll-bottom {
  position: absolute; left: 50%; top: 2px; z-index: 5;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, 1px) scale(0.88);
  transition: opacity 0.16s ease, visibility 0.16s ease,
    transform 0.2s cubic-bezier(0.2, 0.75, 0.25, 1),
    color 0.12s ease, background 0.12s ease;
}
.chat-scroll-bottom.show {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate(-50%, -100%) scale(1);
}
.chat-scroll-bottom:hover {
  color: var(--text-hi);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}
.chat-scroll-bottom:active {
  transform: translate(-50%, -100%) scale(0.92);
}
.chat-scroll-bottom:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}
.composer {
  position:relative;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: calc(24px * var(--radius-scale));
  padding: 12px 12px 10px 16px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer:focus-within {
  border-color: var(--amber-dim);
  box-shadow: var(--shadow-md),
    0 0 0 3px color-mix(in srgb, var(--amber) 12%, transparent);
}
/* 输入框与身后的标记镜像（input-marks.ts）共用排版：字体、字号、行高、内边距、换行规则
 * 逐项一致，镜像画出的字才和光标、选区对得上 */
.composer-field { position: relative; display: flex; flex-direction: column; min-width: 0; }
.composer textarea, .composer-marks {
  padding: 4px 6px 8px 2px;
  font: inherit; font-size: 15px; line-height: 1.6; letter-spacing: normal;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 8;
}
.composer textarea {
  position: relative; /* 盖在镜像上面 */
  background: transparent; border: none; outline: none;
  resize: none;
  min-height: 36px; max-height: 220px;
  color: var(--text);
}
.composer-marks {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  padding-right: calc(6px + var(--marks-gutter, 0px));
  color: var(--text);
}
.composer-marks:empty { display: none; }
/* 有标记时字由镜像来画，textarea 只留光标和选区 */
.composer textarea.marked { color: transparent; caret-color: var(--text); }
.composer textarea.marked::selection { color: var(--text); }
.composer-marks :is(.mark-command, .mark-mention, .mark-attachment) {
  color: var(--info);
  background: color-mix(in srgb, var(--info) 13%, transparent);
  border-radius: calc(4px * var(--radius-scale));
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.composer textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.composer textarea:focus-visible { outline: none; }
.composer-bar { display: flex; align-items: center; gap: 2px; min-width: 0; }

/* 下一步提示：空输入框的占位文字就是提示本身，这枚键帽说明怎么填入（suggestion.ts） */
.suggest-key {
  flex: none; height: 26px; margin-left: 4px; padding: 0 9px 0 4px;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px dashed var(--line); border-radius: var(--radius-pill);
  color: var(--muted); font-size: 12px; line-height: 1; white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.suggest-key kbd {
  font: 600 10.5px/1 var(--mono);
  padding: 3px 5px 2px;
  background: var(--panel-2);
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: calc(5px * var(--radius-scale));
  color: var(--text);
}
.suggest-key:hover { color: var(--text); border-style: solid; border-color: var(--amber-dim); background: color-mix(in srgb, var(--amber) 6%, transparent); }
.suggest-key:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
/* 触屏没有 Tab 键，只留「填入」 */
@media (hover: none), (pointer: coarse) {
  .suggest-key { height: 30px; padding: 0 12px; }
  .suggest-key kbd { display: none; }
}

/* 圆形幽灵图标钮 */
.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none; border-radius: var(--radius-round);
  color: var(--muted);
  line-height: 1;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn.rec {
  color: var(--on-red); background: var(--red);
  animation: voice-pulse 1.4s ease-out infinite;
}
@keyframes voice-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); }
  100% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--red) 0%, transparent); }
}

/* 跟进：执行中输入框有字时出现在中断钮左边，按默认方式（排队 / 引导）发送 */
.follow-btn {
  height: 34px; flex: none; margin-left: 6px; padding: 0 12px 0 10px;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent); color: var(--on-accent);
  border: none; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.follow-btn:hover { background: var(--accent-hi); }
.follow-btn:active { transform: scale(0.96); }
.follow-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 引导：插进运行中回合的跟进消息，排在 CLI 实际接收它的位置；虚线框区别于开新一轮的消息 */
.steer-msg { align-self: flex-end; max-width: 78%; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin: 2px 0; }
.steer-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11.5px; }
.steer-text {
  padding: 7px 14px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
  background: var(--panel-2); border: 1px dashed var(--line);
  border-radius: calc(16px * var(--radius-scale)) calc(16px * var(--radius-scale)) calc(6px * var(--radius-scale)) calc(16px * var(--radius-scale));
}
.steer-msg[data-state="dropped"] .steer-tag { color: var(--warn); }
.steer-msg[data-state="dropped"] .steer-text { opacity: .7; }
.steer-note { margin: 0; color: var(--muted); font-size: 12px; text-align: right; }

/* 发送：琥珀实心圆纸飞机，执行中变红色中断钮（两个 SVG 靠 .stop 切换） */
.send-btn {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  border: none; border-radius: var(--radius-round);
  color: var(--on-accent);
  line-height: 1;
  margin-left: 6px;
  transition: background 0.12s ease, transform 0.12s ease;
}
.send-btn:hover { background: var(--accent-hi); }
.send-btn:active { transform: scale(0.92); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.send-btn .ic-send { display: block; transform: translate(-1px, 1px); } /* 机头朝右上，视觉重心回正 */
.send-btn .ic-stop { display: none; }
.send-btn.stop { background: var(--red); color: var(--on-red); }
.send-btn.stop:hover { background: var(--red-hi); }
.send-btn.stop .ic-send { display: none; }
.send-btn.stop .ic-stop { display: block; }
/* 发送 ↔ 中断互换时，换上来的图标从小弹到原大（display 切回来就重播一次） */
.send-btn :is(.ic-send, .ic-stop) { animation: icon-pop var(--dur) var(--ease-out); }
@keyframes icon-pop { from { opacity: 0; scale: .4; } }

/* ---- 斜杠命令提示（commands.ts）：贴在输入框上方的候选列表，与 CLI 的命令补全同序 ---- */
.cmd-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 40;
  max-height: min(340px, 46vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px;
  background: var(--panel-solid);
  border: 1px solid var(--line); border-radius: calc(14px * var(--radius-scale));
  box-shadow: var(--shadow-lg);
}
.cmd-row {
  display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); align-items: baseline; gap: 4px 16px;
  padding: 6px 10px; border-radius: calc(9px * var(--radius-scale));
  cursor: pointer;
}
.cmd-row[aria-selected="true"] { background: var(--panel-2); }
.cmd-head { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; max-width: 46ch; }
.cmd-name { color: var(--text); font-size: 13px; white-space: nowrap; }
.cmd-name b { color: var(--amber); font-weight: 700; }
.cmd-row[aria-selected="true"] .cmd-name { color: var(--text-hi); }
.cmd-hint { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cmd-tag {
  flex: none; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  color: var(--muted); font-size: 10.5px; line-height: 16px;
}
.cmd-desc {
  color: var(--muted); font-size: 12.5px; line-height: 1.45; min-width: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.cmd-note { padding: 8px 10px 6px; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .cmd-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cmd-head { max-width: 100%; }
}
/* 「@」引用文件（mentions.ts）：同一个弹层，一行一个文件：图标、文件名、淡色的所在目录 */
.cmd-row.mention-row { display: flex; align-items: baseline; gap: 8px; }
.mention-icon { flex: none; align-self: center; color: var(--muted); }
.mention-row[aria-selected="true"] .mention-icon { color: var(--amber); }
.mention-name, .mention-dir { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-name { flex: 0 1 auto; max-width: 72%; color: var(--text); font-size: 13px; }
.mention-dir { flex: 1 1 0; color: var(--muted); font-size: 12px; }
:is(.mention-name, .mention-dir) b { color: var(--amber); font-weight: 700; }
.mention-row[aria-selected="true"] .mention-name { color: var(--text-hi); }

/* ---- /context 结果卡片（context-card.ts）：终端里那张格子图 + 类别图例 ---- */
.ctx-card { display: flex; flex-direction: column; gap: 10px; margin: 2px 0; }
.ctx-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 28px; }
.ctx-grid {
  flex: none; display: grid;
  grid-template-columns: repeat(var(--cols, 20), 11px); grid-auto-rows: 11px; gap: 4px;
}
.ctx-cell { border-radius: calc(3px * var(--radius-scale)); background: var(--c, var(--muted)); }
.ctx-cell[data-kind="free"] { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.ctx-cell[data-kind="buffer"] {
  background: repeating-linear-gradient(135deg, var(--line) 0 2px, transparent 2px 4px);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ctx-side { min-width: 0; flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.ctx-title { color: var(--text-hi); font-weight: 600; font-size: 15px; }
.ctx-model { color: var(--muted); font-size: 12px; }
.ctx-amount { color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ctx-over { color: var(--red); font-size: 12.5px; }
.ctx-legend-head { margin-top: 8px; color: var(--muted); font-size: 12px; font-style: italic; }
.ctx-legend { display: flex; flex-direction: column; gap: 3px; }
.ctx-row { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.ctx-row[data-kind="deferred"] { color: var(--muted); }
.ctx-swatch { flex: none; width: 10px; height: 10px; border-radius: calc(3px * var(--radius-scale)); background: var(--c); }
.ctx-swatch[data-kind="free"] { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.ctx-swatch[data-kind="buffer"] { background: repeating-linear-gradient(135deg, var(--line) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--line); }
.ctx-swatch[data-kind="deferred"] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.ctx-row-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-row-value { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctx-more { border-top: 1px solid var(--line-soft); padding-top: 6px; }
.ctx-more summary { cursor: pointer; color: var(--text); font-size: 13px; }
.ctx-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; max-height: 260px; overflow-y: auto; }
.ctx-item { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; min-width: 0; }
.ctx-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 12px; }
.ctx-item-note { flex: none; color: var(--muted); font-size: 11.5px; }
.ctx-item-tokens { margin-left: auto; flex: none; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .ctx-grid { grid-template-columns: repeat(var(--cols, 20), 9px); grid-auto-rows: 9px; gap: 3px; }
}

/* ---- /usage 结果卡片（usage-card.ts）：套餐各额度窗口的进度条 + 用量构成 ---- */
.usage-card { display: flex; flex-direction: column; gap: 14px; margin: 2px 0; max-width: 560px; }
.usage-card-head { display: flex; flex-direction: column; gap: 2px; }
.usage-card-title { color: var(--text-hi); font-weight: 600; font-size: 15px; }
.usage-card-sub { color: var(--muted); font-size: 12.5px; }
.usage-limits { display: flex; flex-direction: column; gap: 14px; }
.usage-limit { display: flex; flex-direction: column; gap: 6px; }
.usage-limit-head { display: flex; align-items: baseline; gap: 12px; font-size: 13.5px; min-width: 0; }
.usage-limit-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.usage-limit-value { margin-left: auto; flex: none; color: var(--text); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.usage-bar { height: 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--line) 75%, transparent); overflow: hidden; }
.usage-bar-fill { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--amber); }
.usage-limit[data-level="warning"] .usage-bar-fill { background: var(--warn); }
.usage-limit[data-level="critical"] .usage-bar-fill { background: var(--red); }
.usage-limit[data-level="critical"] .usage-limit-value { color: var(--red); }
.usage-limit-reset { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.usage-traits { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.usage-traits-title { color: var(--text-hi); font-weight: 600; font-size: 13.5px; }
.usage-traits-note { color: var(--muted); font-size: 12px; }
.usage-period { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.usage-period-head { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.usage-trait { display: flex; align-items: baseline; gap: 10px; font-size: 13px; min-width: 0; }
.usage-trait-pct { flex: none; width: 3.2em; text-align: right; color: var(--amber); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.usage-trait-text { min-width: 0; color: var(--text); }
.usage-trait-label { flex: none; color: var(--text); }
.usage-trait-tags { display: flex; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.usage-tag { padding: 0 6px; border-radius: var(--radius-pill); background: var(--panel-2); color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.usage-note { color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* 上下文压缩的分界：在回合里说明这里压缩过、压掉了多少 */
.chip.compact { display: inline-flex; align-items: center; gap: 6px; color: var(--amber); font-family: var(--sans); font-size: 12px; padding: 3px 0; }
.chip.compact svg { flex: none; }

/* ---- 上下文占用（context-meter.ts）：CLI 状态栏上下文条的网页版，环形进度 + 百分比 ---- */
.ctx-meter {
  flex: none; margin-left: auto; height: 28px; padding: 0 8px 0 6px;
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: var(--radius-pill);
  color: var(--muted); font: 500 12px/1 var(--mono); font-variant-numeric: tabular-nums;
  white-space: nowrap; cursor: default;
}
/* 显示时由它吃掉左侧的空白，模型胶囊紧挨在右边 */
.ctx-meter:not(.hidden) ~ .picker { margin-left: 0; }
.ctx-meter:hover { color: var(--text); background: var(--panel-2); }
.ctx-meter:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.ctx-meter svg { flex: none; display: block; transform: rotate(-90deg); }
.ctx-meter circle { fill: none; stroke-width: 3; }
.ctx-track { stroke: var(--line); }
.ctx-fill { stroke: var(--amber); stroke-dasharray: var(--ctx, 0) 100; }
.ctx-meter[data-level="warn"] .ctx-fill { stroke: var(--warn); }
.ctx-meter[data-level="critical"] { color: var(--red); }
.ctx-meter[data-level="critical"] .ctx-fill { stroke: var(--red); }

/* ---- 模型 / 思考强度选择胶囊 + 上弹菜单 ---- */
.picker { margin-left: auto; position: relative; min-width: 0; }
.pick-pill {
  max-width: 100%;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: none; border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 12.5px;
  padding: 8px 12px;
}
.pick-pill .t {
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Agent 图标与折叠箭头：不参与压缩，由 align-items 垂直居中 */
.pick-pill svg { flex: none; display: block; }
.pick-pill:hover { color: var(--text); background: var(--panel-2); }
.pick-menu {
  position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 40;
  width: 268px; max-height: 60vh; overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line); border-radius: calc(14px * var(--radius-scale));
  padding: 6px;
  box-shadow: var(--shadow-lg);
}
/* 悬停浮层：贴在面板左侧，展示某个属性的全部选项 */
.pick-fly {
  position: absolute; z-index: 41;
  width: 210px; max-height: 60vh; overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line); border-radius: calc(14px * var(--radius-scale));
  padding: 6px;
  box-shadow: var(--shadow-lg);
}
.pick-fly-h {
  color: var(--muted);
  font-size: 11px;
  padding: 5px 11px 6px;
}
/* Claude 面板底部的强度行：固定在面板底边，模型再多也不用滚到最下面才能找到。
 * 负外边距盖住面板内边距，滚动中的列表不会从它下面露出来。 */
.pick-foot {
  position: sticky; bottom: -6px; z-index: 1;
  margin: 5px -6px -6px; padding: 5px 6px 6px;
  border-top: 1px solid var(--line);
  background: var(--panel-solid);
}

/* 主面板行：模型 / 推理强度 → 悬停浮层 */
.pick-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left;
  background: none; border: none; border-radius: calc(9px * var(--radius-scale));
  color: var(--text);
  font-size: 13px;
  padding: 9px 11px;
}
.pick-row:hover, .pick-row.open { background: var(--panel-2); }
.pick-row .val { color: var(--muted); font-size: 12px; }
.pick-back {
  display: flex; justify-content: flex-start; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 11px 8px; margin-bottom: 4px;
  border-radius: 0;
}
.pick-back:hover { color: var(--text); }
.pick-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left;
  background: none; border: none; border-radius: calc(9px * var(--radius-scale));
  color: var(--text);
  font-size: 13px;
  padding: 7px 11px;
}
.pick-opt:hover { background: var(--panel-2); }
.pick-opt .lbl { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pick-opt .sub { color: var(--muted); font-size: 11px; }
.pick-opt .check { color: var(--amber); visibility: hidden; flex: none; }
.pick-opt.on .check { visibility: visible; }

/* 历史对话失败时留在同一状态位，停止转圈并给出唯一恢复动作。 */
#chat-loading.history-error { gap: 10px; }
#chat-loading.history-error #chat-loading-text { color: var(--text); }

/* ---- 空会话引导：品牌头像 + 问候 + 建议 pills ---- */
.chat-hero {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  padding: 20px;
  overflow-y: auto;
}
.hero-avatar .agent-avatar {
  width: 60px; height: 60px;
  border-radius: var(--radius-round);
  box-shadow: 0 0 44px color-mix(in srgb, var(--brand) 22%, transparent);
}
.chat-hero h2 {
  display: flex; align-items: center; justify-content: center;
  margin: 0;
  font-size: 26px; font-weight: 600; letter-spacing: 0.01em;
}
.hero-cursor {
  display: block; flex: none; overflow: hidden;
  width: 0.55em; height: 1.02em;
  margin-left: 8px;
  background: var(--accent); color: transparent;
  animation: blink 1.1s steps(1) infinite;
}
.hero-pills {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px;
  max-width: 620px;
  margin-top: 4px;
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 13.5px;
  padding: 9px 18px;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.hero-pill:hover { color: var(--text); border-color: var(--amber-dim); background: var(--panel); }
.hero-pill .hp-ico { font-size: 15px; }

/* ---- 窄屏：收窄留白、放宽气泡、防 iOS 聚焦缩放、引导 pills 改单列 ---- */
@media (max-width: 760px) {
  .chat-log { padding: 14px 12px 4px; gap: 12px; --fade-top: 20px; --fade-bottom: 10px; }
  .user-turn { max-width: 88%; }
  .user-avatar { display: none; }
  .user-actions .answer-copy { width: 34px; height: 34px; }
  .steer-msg { max-width: 88%; }
  .thread-bar { padding: 6px 8px 0; }
  .thread-cur { padding: 6px 10px; }
  .chat-network { min-height: 36px; padding-inline: 6px; gap: 5px; }
  .chat-network::before { top: 12px; bottom: 12px; }
  /* 窄屏历史面板与左侧菜单抽屉同宽 */
  .thread-panel { width: min(300px, 84vw); }
  .turn { gap: 9px; }
  .turn-avatar .agent-ico { width: 22px; height: 22px; }
  .chip { max-width: 100%; }
  .composer-wrap { padding: 4px 10px 12px; }
  .composer { border-radius: calc(20px * var(--radius-scale)); padding: 10px 10px 8px 12px; }
  /* iOS 聚焦时字号 <16px 会强制放大整页 */
  .composer textarea, .composer-marks { font-size: 16px; }
  .composer textarea { min-height: 32px; }
  .chat-hero { justify-content: flex-start; padding-top: 13vh; gap: 15px; }
  .chat-hero h2 { font-size: 21px; }
  .hero-avatar .agent-avatar { width: 52px; height: 52px; }
  .hero-pills { flex-direction: column; align-items: stretch; width: 100%; max-width: 420px; gap: 8px; }
  .hero-pill { justify-content: flex-start; padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .msg, .turn, .user-turn { animation: none; }
  .user-actions { transition: none; }
  .work-label, .turn.working .agent-ico { animation: none; }
  .icon-btn.rec { animation: none; }
  .hero-cursor { animation: none; }
  .msg.live-text.streaming:empty::after,
  .msg.live-text.streaming > :last-child::after,
  details.think.streaming .think-body::after { animation: none; }
  .send-btn, .composer, .hero-pill, .cb-caret, .chat-scroll-bottom { transition: none; }
  .thread-panel, .tp-scrim { transition: none; }
}
/* Message status: one quiet row above the input that names what happened and, when
 * the composer is blocked, carries the way out. data-tone colours the dot and each
 * row's mark; the list is flat and every row ends in its own actions. */
.chat-delivery, .delivery-item { --tone:var(--muted); }
.chat-delivery { margin:0 2px 6px; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
:is(.chat-delivery, .delivery-item)[data-tone="busy"],
:is(.chat-delivery, .delivery-item)[data-tone="attention"] { --tone:var(--amber); }
:is(.chat-delivery, .delivery-item)[data-tone="error"] { --tone:var(--red); }
:is(.chat-delivery, .delivery-item)[data-tone="done"] { --tone:var(--green); }
.delivery-header { display:flex; align-items:center; gap:2px; min-width:0; }
.delivery-toggle { display:flex; align-items:center; gap:8px; flex:1; min-width:0; min-height:32px; padding:4px 8px; border:0; border-radius:calc(8px * var(--radius-scale)); background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; transition:background var(--dur-fast) ease; }
.delivery-toggle:hover:not(:disabled) { background:var(--panel-2); }
.delivery-toggle:disabled { cursor:default; }
.delivery-dot { width:7px; height:7px; border-radius:50%; background:var(--tone); flex:none; }
.chat-delivery[data-tone="busy"] .delivery-dot { animation:delivery-pulse 1.6s ease-in-out infinite; }
@keyframes delivery-pulse { 50% { opacity:.3; } }
/* The title may be an error notice: it wraps rather than hiding behind an ellipsis.
 * The reason repeats in full in the open list, so the bar may cut it short. */
#chat-delivery-status { flex:0 1 auto; min-width:0; line-height:1.45; color:var(--text); }
.chat-delivery:is([data-tone="attention"], [data-tone="error"]) #chat-delivery-status { font-weight:500; }
#chat-delivery-status.error { color:var(--red); }
.delivery-header .delivery-reason { flex:1 1 0; color:var(--muted); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.delivery-header .delivery-reason::before { content:"·"; margin-right:8px; }
.delivery-count { flex:none; margin-left:auto; min-width:18px; height:18px; padding:0 5px; border-radius:var(--radius-pill); background:var(--panel-2); color:var(--muted); font-size:11px; line-height:18px; text-align:center; font-variant-numeric:tabular-nums; }
.delivery-chevron { flex:none; margin-left:auto; color:var(--muted); transition:transform var(--dur-fast) ease; }
.delivery-count:not(.hidden) + .delivery-chevron { margin-left:0; }
.delivery-toggle[aria-expanded="true"] .delivery-chevron { transform:rotate(180deg); }
.delivery-toggle:disabled .delivery-chevron { visibility:hidden; }
.delivery-quick { display:flex; flex:none; }
.delivery-quick:empty, .delivery-toggle[aria-expanded="true"] + .delivery-quick { display:none; }
.delivery-header .icon-btn { width:30px; height:30px; }
#chat-delivery-list { max-height:min(240px,28dvh); overflow:auto; overscroll-behavior:contain; margin:2px 0 4px; padding-top:2px; border-top:1px solid var(--line-soft); }
.delivery-item { display:grid; grid-template-columns:16px minmax(0,1fr) auto; column-gap:10px; align-items:start; padding:8px; }
.delivery-item + .delivery-item { border-top:1px solid var(--line-soft); }
.delivery-mark { display:flex; align-items:center; justify-content:center; height:20px; color:var(--tone); }
.delivery-mark:empty::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--tone); }
.delivery-item[data-tone="busy"] .delivery-mark::before { animation:delivery-pulse 1.6s ease-in-out infinite; }
.delivery-main { display:flex; flex-direction:column; gap:3px; min-width:0; }
.delivery-line { display:flex; flex-wrap:wrap; align-items:baseline; column-gap:8px; margin:0; line-height:20px; }
.delivery-label { color:var(--text); font-weight:500; }
.delivery-item[data-tone="quiet"] .delivery-label { font-weight:400; }
.delivery-text { display:block; width:100%; min-width:0; margin:0; padding:0; border:0; border-radius:calc(4px * var(--radius-scale)); background:none; color:var(--text); font:inherit; line-height:1.5; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.delivery-text:hover { color:var(--text-hi); }
.delivery-text.full { white-space:pre-wrap; max-height:120px; overflow:auto; }
.delivery-text.expired { white-space:normal; color:var(--muted); cursor:default; }
.delivery-settings { margin:0; font-size:11px; color:var(--muted); }
.delivery-actions { display:flex; align-items:center; gap:2px; margin-block:-4px; }
/* Compact actions: the primary one keeps its words and an amber tint, the rest
 * are the shared icon buttons with tooltips. */
:root .chat-delivery .btn.delivery-act:not(.action-icon) { min-height:28px; padding:0 10px; gap:5px; font-size:12px; font-weight:500; line-height:1; border-radius:calc(7px * var(--radius-scale)); }
:root .chat-delivery .btn.delivery-act:not(.action-icon) > svg { width:14px; height:14px; }
:root .chat-delivery .btn.delivery-act:not(.action-icon, .delivery-primary, .btn-danger) { background:transparent; border-color:transparent; color:var(--muted); }
:root .chat-delivery .btn.delivery-act:not(.action-icon, .delivery-primary, .btn-danger):hover:not(:disabled) { background:var(--panel-2); color:var(--text); }
/* 放弃发送：与「重试」同一行，淡红底与主操作的淡琥珀底对仗 */
:root .chat-delivery .btn.delivery-act.btn-danger:not(.action-icon) { background:color-mix(in srgb, var(--red) 10%, transparent); border-color:color-mix(in srgb, var(--red) 36%, transparent); color:var(--red-hi); }
:root .chat-delivery .btn.delivery-act.btn-danger:not(.action-icon):hover:not(:disabled) { background:color-mix(in srgb, var(--red) 18%, transparent); border-color:color-mix(in srgb, var(--red) 55%, transparent); }
:root .chat-delivery .btn.delivery-primary { background:color-mix(in srgb, var(--amber) 14%, transparent); border-color:color-mix(in srgb, var(--amber) 42%, transparent); color:var(--text); }
:root .chat-delivery .btn.delivery-primary > svg { color:var(--amber); }
:root .chat-delivery .btn.delivery-primary:hover:not(:disabled) { background:color-mix(in srgb, var(--amber) 22%, transparent); border-color:color-mix(in srgb, var(--amber) 60%, transparent); }
.delivery-quick .btn.delivery-primary { margin-inline:4px 2px; }
@media (min-width:761px) and (pointer:fine) {
  :root .delivery-actions .btn.action-icon { --action-size:28px; }
}
@media (max-width:760px) {
  /* A clipped reason ("服务…") says nothing; the open list shows it whole. */
  .delivery-header .delivery-reason { display:none; }
  /* Icon actions stay at the row's end; a worded action takes its own line. */
  .delivery-item:has(.delivery-act:not(.action-icon)) .delivery-actions { grid-column:2 / -1; flex-wrap:wrap; margin:6px 0 -2px; }
  .delivery-quick .btn.delivery-primary { padding:0 8px; }
}
@media (prefers-reduced-motion:reduce) {
  .delivery-chevron, .delivery-toggle { transition:none; }
  .chat-delivery[data-tone="busy"] .delivery-dot, .delivery-item[data-tone="busy"] .delivery-mark::before { animation:none; }
}

/* ---- Agent 的任务列表（features/chat/tasks.ts）：与消息确认区同样是一行可展开的条，
 * 一行写「任务 2/5 · 进行中的那项」，展开列出全部；进行中琥珀、全部完成绿。 ---- */
.chat-tasks { --tone:var(--muted); margin:0 2px 6px; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.chat-tasks[data-tone="busy"] { --tone:var(--amber); }
.chat-tasks[data-tone="done"] { --tone:var(--green); }
.tasks-toggle { display:flex; align-items:center; gap:8px; width:100%; min-width:0; min-height:32px; padding:4px 8px; border:0; border-radius:calc(8px * var(--radius-scale)); background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; transition:background var(--dur-fast) ease; }
.tasks-toggle:hover { background:var(--panel-2); }
.tasks-icon { flex:none; color:var(--tone); }
.tasks-count { flex:none; color:var(--text); font-weight:500; font-variant-numeric:tabular-nums; }
.tasks-current { flex:1 1 0; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tasks-current::before { content:"·"; margin-right:8px; }
.tasks-chevron { flex:none; margin-left:auto; color:var(--muted); transition:transform var(--dur-fast) ease; }
.tasks-toggle[aria-expanded="true"] .tasks-chevron { transform:rotate(180deg); }
.tasks-list { list-style:none; max-height:min(220px,26dvh); overflow:auto; overscroll-behavior:contain; margin:2px 0 4px; padding:4px 0 0; border-top:1px solid var(--line-soft); }
.task-item { display:grid; grid-template-columns:16px minmax(0,1fr) auto; column-gap:10px; align-items:start; padding:3px 8px; line-height:20px; }
.task-mark { display:flex; align-items:center; justify-content:center; height:20px; color:var(--green); }
.task-mark:empty::before { content:""; box-sizing:border-box; width:10px; height:10px; border-radius:50%; border:1.5px solid color-mix(in srgb, var(--muted) 80%, transparent); }
.task-item[data-status="in_progress"] .task-mark:empty::before { border-color:var(--amber); background:var(--amber); animation:delivery-pulse 1.6s ease-in-out infinite; }
.task-text { min-width:0; color:var(--text); }
.task-item[data-status="in_progress"] .task-text { color:var(--text-hi); font-weight:500; }
.task-item[data-status="completed"] .task-text { color:var(--muted); text-decoration:line-through; text-decoration-color:color-mix(in srgb, var(--muted) 55%, transparent); }
.task-wait { color:var(--muted); font-size:11px; white-space:nowrap; }
.task-more { padding:3px 8px 3px 34px; color:var(--muted); }
@media (prefers-reduced-motion:reduce) {
  .tasks-chevron, .tasks-toggle { transition:none; }
  .task-item[data-status="in_progress"] .task-mark:empty::before { animation:none; }
}

/* ---- Agent 的提问卡片（features/chat/questions.ts）：回合停下等用户选，
 * 等待作答时描一圈琥珀；结束后收成「问题 + 回答」的摘要。 ---- */
.question-card {
  margin: 8px 0; min-width: 0;
  border: 1px solid var(--line); border-radius: calc(12px * var(--radius-scale));
  background: var(--panel);
}
.question-card[data-state="pending"] {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.qa-head { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 12px; font-size: 12.5px; }
.qa-badge {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--panel-2) 80%, var(--accent) 20%);
  color: var(--accent); font-size: 11.5px; font-weight: 600;
}
.question-card[data-state="pending"] .qa-badge { animation: qa-pulse 1.6s var(--ease-move) infinite; }
@keyframes qa-pulse { 50% { opacity: .55; } }
.qa-state { margin-left: auto; min-width: 0; font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.question-card[data-state="answered"] .qa-state { color: var(--green); }
.question-card[data-state="skipped"] .qa-state,
.question-card[data-state="expired"] .qa-state,
.question-card[data-state="cancelled"] .qa-state,
.question-card[data-state="stale"] .qa-state { color: var(--warn); }
.qa-form, .qa-summary {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 2px 12px 12px; border-top: 1px solid var(--line-soft);
}
.qa-summary { gap: 4px; padding-top: 8px; }
/* 多道题：一排标签一次显示一题（ink.ts 的滑动底块），答过的打勾 */
.qa-tabs {
  align-self: flex-start; margin-top: 10px; overflow-x: auto; scrollbar-width: none;
}
.qa-tabs::-webkit-scrollbar { display: none; }
.qa-tab { display: inline-flex; align-items: center; gap: 5px; }
.qa-tab-mark { display: inline-grid; place-items: center; width: 12px; height: 12px; flex: none; }
.qa-tab:not(.done) .qa-tab-mark svg { display: none; }
.qa-tab:not(.done) .qa-tab-mark::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .7;
}
.qa-tab.done .qa-tab-mark { color: var(--green); }
.qa-panel { display: flex; flex-direction: column; min-width: 0; }
.qa-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.qa-group legend { padding: 0; margin-bottom: 4px; max-width: 100%; }
.qa-question {
  margin: 10px 0 0; color: var(--text); font-size: 13.5px; font-weight: 600; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.qa-header {
  display: inline-block; margin-right: 6px; padding: 0 7px; vertical-align: 1px;
  border-radius: var(--radius-pill); background: var(--panel-2);
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.qa-option {
  display: flex; align-items: flex-start; gap: 9px; min-width: 0;
  padding: 6px 10px; cursor: pointer;
  border: 1px solid var(--line-soft); border-radius: calc(8px * var(--radius-scale));
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.qa-option:hover { border-color: var(--line); background: var(--panel-2); }
.qa-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.qa-option:has(input:disabled) { cursor: default; opacity: .7; }
.qa-option > input[type="radio"], .qa-option > input[type="checkbox"] { flex: none; margin: 3px 0 0; }
.qa-option-text { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 1px; min-width: 0; }
.qa-label { color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.qa-desc { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.qa-other { align-items: center; }
.qa-other > span { flex: none; color: var(--text); font-size: 13px; }
.qa-other-input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; }
.qa-error { margin: 0; color: var(--red); font-size: 12px; }
.qa-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.qa-progress { margin-right: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.qa-line { margin: 0; min-width: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.qa-line .qa-header { vertical-align: 1px; }
.qa-q { color: var(--muted); }
.qa-answer { margin-left: 8px; color: var(--text); font-weight: 600; white-space: pre-wrap; }
.qa-note { margin: 0; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .qa-head { flex-wrap: wrap; row-gap: 4px; }
  .qa-state { flex-basis: 100%; margin-left: 0; text-align: left; }
  .qa-other { flex-wrap: wrap; }
  .qa-other-input { flex-basis: 100%; }
  .qa-actions .btn { flex: 1; }
}
