/* 小赵与用户为唯一对话身份；执行节点使用无头像的过程卡。 */
.ai-drawer { width: min(560px, 100vw); }
@media (min-width:1440px) { body:has(#aiDrawer.is-open) .workbench-shell { padding-right:560px; } }
.ai-drawer .assistant-messages { --chat-avatar-size:36px; --chat-avatar-gap:12px; --chat-gutter:calc(var(--chat-avatar-size) + var(--chat-avatar-gap)); padding:20px; gap:20px; min-height:0; background:#fbfcfe; scrollbar-gutter:stable; }
.ai-drawer .assistant-context-stack { padding:8px 18px; background:#fff; }
.ai-drawer .assistant-context-panel { padding:8px 12px; border:0; background:#f5f7fb; }
.ai-drawer .assistant-context-head { display:none; }
.ai-drawer .assistant-context-meta { display:flex; gap:24px; margin:0; }
.ai-drawer .assistant-context-meta > span { font-size:11px; }
.ai-drawer .assistant-context-meta strong { font-size:12px; }
.ai-drawer .assistant-brand-icon { width:30px; height:30px; background:#e9edff; color:#4055b5; border-radius:12px; font-size:17px; font-weight:700; }
.ai-drawer .assistant-head-copy > strong { font-size:16px; }
.ai-drawer .assistant-head-copy .assistant-tagline { display:block; font-size:11px; color:#68768c; margin-top:3px; }
.ai-drawer .assistant-head-copy .assistant-execution-detail { max-width:300px; font-size:11px; }
.ai-drawer .message.chat-message { display:grid; grid-template-columns:var(--chat-avatar-size) minmax(0,1fr) var(--chat-avatar-size); column-gap:var(--chat-avatar-gap); row-gap:0; padding:0; background:transparent; border:0; max-width:100%; width:100%; align-items:start; font-size:13px; line-height:1.7; }
.chat-avatar { display:grid; place-items:center; grid-column:1; grid-row:1; width:var(--chat-avatar-size); height:var(--chat-avatar-size); border-radius:10px; background:#e9edff; color:#4055b5; font-size:14px; font-weight:700; }
.chat-avatar[data-speaker="user"] { background:#e8eef2; color:#52667a; }
.chat-message-main { grid-column:2; grid-row:1; min-width:0; width:100%; max-width:100%; }
.chat-message-author { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.message .chat-message-author strong { color:#27364c; font-size:12px; }
.chat-message-author > span { font-size:10px; color:#7b889a; }
.chat-message-content { border:1px solid #e4e9f1; background:white; border-radius:0 12px 12px 12px; padding:12px 14px; overflow-wrap:anywhere; }
.chat-message.user .chat-avatar { grid-column:3; }
.chat-message.user .chat-message-author { justify-content:flex-end; }
.chat-message.user .chat-message-content { background:#edf3ff; border-color:#dce6fc; border-radius:12px 0 12px 12px; }
.chat-message-content p + p { margin-top:8px; }
.chat-message-content ul { margin:8px 0; padding-left:20px; }
.chat-message-content code { padding:1px 4px; border-radius:3px; background:#f0f3f8; }
.chat-long-content > summary { cursor:pointer; font-size:12px; line-height:1.7; }
.chat-long-content > summary span { display:block; margin-top:5px; color:#315ac0; font-size:11px; }
.chat-long-content[open] > summary { margin-bottom:12px; }
.chat-tree { overflow-x:auto; font:12px/1.75 ui-monospace,monospace; margin:0; white-space:pre; }
.chat-table-wrap { overflow-x:auto; max-width:100%; margin:6px 0; }
.chat-table-wrap table { border-collapse:collapse; width:100%; font-size:12px; }
.chat-table-wrap th,.chat-table-wrap td { padding:8px 10px; text-align:left; border:1px solid #dfe5ef; min-width:90px; }
.chat-table-wrap th { background:#f2f5fb; color:#536079; }
.chat-production { min-width:0; width:calc(100% - var(--chat-gutter) - var(--chat-gutter)); margin-inline:var(--chat-gutter); border:1px solid #dfe5ef; border-radius:12px; background:#fff; padding:14px; }
.ai-drawer .message.recovery { width:calc(100% - var(--chat-gutter) - var(--chat-gutter)); margin-inline:var(--chat-gutter); }
.chat-production > header { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.chat-production > header > div { display:grid; gap:2px; }
.chat-production strong { font-size:13px; }
.chat-eyebrow { color:#77859a; font-size:10px; letter-spacing:1px; }
.chat-progress-count { background:#edf2fb; color:#496287; border-radius:6px; font-size:11px; padding:4px 7px; white-space:nowrap; }
.chat-progress-current { font-size:12px; color:#5b6f8d; line-height:1.7; margin:10px 0 12px; }
.chat-steps { display:grid; gap:7px; }
.chat-step { border:1px solid #e6ebf3; border-radius:9px; background:#fcfdff; }
.chat-step > summary { display:flex; align-items:center; gap:8px; list-style:none; padding:10px; cursor:pointer; }
.chat-step > summary::-webkit-details-marker { display:none; }
.chat-step > summary::after { content:'⌄'; color:#96a2b4; font-size:12px; }
.chat-step[open] > summary::after { content:'⌃'; }
.chat-step-marker { display:grid; place-items:center; width:22px; height:22px; flex:0 0 22px; border-radius:50%; color:#7a8aa0; background:#eef2f7; font-size:11px; }
.chat-step-heading { display:grid; gap:2px; flex:1; min-width:0; }
.chat-step-heading strong { font-size:12px; overflow-wrap:anywhere; }
.chat-step-robot { color:#7b8799; font-size:10px; }
.chat-step-status { font-size:10px; color:#7b8799; flex:0 0 auto; }
.chat-step[data-status="completed"] .chat-step-marker { color:#168069; background:#e2f4ed; }
.chat-step[data-status="completed"] .chat-step-status { color:#168069; }
.chat-step[data-status="running"],.chat-step[data-status="retrying"],.chat-step[data-status="reworking"] { border-color:#becff6; background:#f7faff; }
.chat-step[data-status="running"] .chat-step-marker { background:#315ac0; color:white; }
.chat-step[data-status="candidate"],.chat-step[data-status="waiting_input"],.chat-step[data-status="need_confirmation"],.chat-step[data-status="waiting_confirmation"] { border-color:#eed8aa; background:#fffcf5; }
.chat-step[data-status="failed"],.chat-step[data-status="blocked"] { border-color:#edc9c9; background:#fffafa; }
.chat-step-body { padding:0 12px 12px 40px; font-size:12px; color:#68758a; line-height:1.7; }
.chat-step-materials { display:flex; flex-wrap:wrap; gap:5px; margin-top:9px; align-items:center; }
.chat-step-materials > span:first-child { width:100%; color:#7b8799; font-size:10px; }
.chat-artifact { border:1px solid #e2e8f1; padding:3px 7px; background:#fff; border-radius:5px; color:#4b5f7e; font-size:11px; }
.chat-step .chat-result-button { min-height:28px; margin-top:10px; padding:3px 9px; font-size:11px; font-weight:500; color:#315ac0; border:1px solid #cbd7ef; background:white; }
.chat-step-time { margin-top:9px; font-size:10px; color:#8a95a6; }
.chat-step-error { margin-top:7px; color:#b44141; overflow-wrap:anywhere; }
.chat-event-log { margin-top:12px; font-size:11px; color:#69778e; }
.chat-event-log summary { cursor:pointer; }
.chat-event-log p { margin-top:8px; border-left:2px solid #e2e8f1; padding-left:9px; white-space:pre-wrap; overflow-wrap:anywhere; }
.ai-drawer .assistant-composer { max-height:38vh; padding:12px 18px 16px; }
.ai-drawer .composer-shell textarea { height:78px; min-height:70px; max-height:180px; font-size:13px; }
@media (max-width:600px) {
  .ai-drawer { top:0; height:100dvh; }
  .ai-drawer .assistant-messages { --chat-avatar-size:32px; --chat-avatar-gap:8px; padding:12px; }
  .chat-production { padding:11px; }
  .chat-step-body { padding-left:12px; }
  .ai-drawer .assistant-head-copy .assistant-execution-detail { max-width:190px; }
}

@media (min-width:1440px) and (max-width:1800px) {
  body:has(#aiDrawer.is-open) .robot-result-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body:has(#aiDrawer.is-open) .production-matrix-head { align-items:stretch; flex-direction:column; }
  body:has(#aiDrawer.is-open) .production-reconciliation { min-width:0; width:100%; }
}

.ai-drawer .assistant-title-role { display:inline; font-size:12px; font-weight:500; color:#738096; }
.assistant-project-info { display:flex; flex-wrap:wrap; gap:8px 24px; }
.assistant-project-info > span { min-width:0; font-size:11px; color:#738096; }
.assistant-project-info > span:first-child { flex:1 1 180px; }
.assistant-project-info strong { display:block; margin-top:3px; font-size:12px; color:#27364c; overflow-wrap:anywhere; }
/* Real round receipts share the conversation palette and collapse naturally on mobile. */
.chat-round-outputs { margin: 10px 0; min-width: 0; }
.chat-round-outputs [data-round-output] { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chat-round-outputs small { grid-column: 1 / -1; overflow-wrap: anywhere; color: var(--muted); }
@media(max-width:480px) { .chat-round-outputs [data-round-output] { grid-template-columns: minmax(0, 1fr); } }
.chat-input-report { min-width: 0; margin: 8px 0; }
.chat-input-report [data-input-field] { display: grid; grid-template-columns: 100px minmax(0,1fr) auto; gap: 5px 8px; border-bottom: 1px solid var(--line); padding: 8px 0; overflow-wrap: anywhere; }
.chat-input-report details { grid-column: 1 / -1; color: var(--muted); }
.chat-input-report blockquote { margin: 6px 0; white-space: pre-wrap; }
@media(max-width:480px) { .chat-input-report [data-input-field] { grid-template-columns: minmax(0,1fr); } }

.assistant-mascot-icon{display:block;width:100%;height:100%;object-fit:contain}.ai-drawer-toggle>.assistant-mascot-icon{width:26px;height:26px;flex:none}.chat-avatar[data-speaker="xiaozhao"]{background:transparent}.ai-drawer .assistant-brand-icon{background:transparent}

.chat-input-report{margin-top:12px}.chat-input-report>summary{cursor:pointer;color:#52658b;font-size:12px;line-height:1.6;padding:8px 0}.chat-input-report[open]>summary{margin-bottom:8px}
