/* Message interactions, shared by employee and group chats. */
.chat-time-divider{align-self:center;text-align:center;font-size:11px;line-height:1.4;color:#969aa4;padding:3px 10px;margin:5px 0;flex:none}.chat-time-divider time{font:inherit}.chat-message-actions{display:flex;gap:12px;align-items:center;padding-top:0;margin:0;height:0;min-height:0;position:relative;top:3px;align-items:flex-start;opacity:0;transition:opacity .12s}.msg:hover .chat-message-actions,.msg:focus-within .chat-message-actions{opacity:1}.chat-message-actions button{font-size:11px;border:0;background:transparent;color:#8b909a;padding:2px 0;min-height:22px}.chat-message-actions button:hover{color:#3c5ce7}.msg.me .chat-message-actions{justify-content:flex-end}.message-quote{display:block;width:100%;margin:0 0 9px;padding:9px 11px;border:0;border-left:3px solid #c6cddd;border-radius:6px;background:#f0f2f5;text-align:left;color:#7e8592;font-size:12px;white-space:normal}.message-quote b{display:block;margin-bottom:3px;font-size:11px;color:#6e7581}.message-quote span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.message-quote:hover{background:#e9edf4}.composer-reply{display:flex;align-items:center;gap:10px;margin-bottom:8px;padding:8px 12px;border-left:3px solid #c3cadd;background:#f4f5f7;border-radius:7px;color:#79818e;font-size:12px}.composer-reply .quote-source{flex:1;min-width:0;padding:0;border:0;background:transparent;text-align:left;color:inherit}.composer-reply .quote-source b{display:block;font-size:11px;color:#65707e;margin-bottom:2px}.composer-reply .quote-source span{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.composer-reply .quote-close{padding:3px 7px;border:0;background:transparent;flex:none}.message-highlight .bubble,.message-highlight>.message-body{animation:message-emphasis 2s ease-out}@keyframes message-emphasis{0%,40%{box-shadow:0 0 0 3px #d7e4ff;background:#f1f6ff}100%{box-shadow:0 0 0 0 transparent}}.message-stamp{cursor:default}.chat .msg .message-body>small.message-stamp{color:#9298a2}.chat .msg .message-stamp time{margin-left:5px;font-size:10px;color:#a6abb4}.chat .me .message-stamp time{margin-left:0}.jump-latest{max-width:calc(100% - 32px)}
@media(hover:none),(max-width:760px){.chat-message-actions{opacity:1;gap:18px;height:32px;min-height:32px;top:0;padding-top:4px}.chat-message-actions button{min-height:28px;padding:4px 2px}.composer-reply{padding:8px 10px}.chat-time-divider{font-size:10px}}@media(prefers-reduced-motion:reduce){.message-highlight .bubble,.message-highlight>.message-body{animation:none;outline:2px solid #d7e4ff}.chat-message-actions{transition:none}}
.message-receipt{display:flex;align-items:center;justify-content:flex-end;gap:4px;margin-top:4px;font-size:10px;line-height:15px;color:#989fa9;min-height:15px}.message-receipt[data-receipt-state=read]{color:#789393}.receipt-check{font-size:10px;letter-spacing:-3px;margin-right:3px}.chat .message-send-state{font-size:10px;line-height:15px;min-height:15px;color:#989fa9;text-align:right;margin-top:4px}.message-send-state.send-pending::before{content:'';display:inline-block;width:8px;height:8px;margin-right:5px;border:1px solid #b6bdc6;border-top-color:transparent;border-radius:50%;animation:chat-send-spin .8s linear infinite}.chat .message-send-state.send-failed{color:#b86559}.chat-presence{display:flex;align-items:center;gap:7px;flex-wrap:wrap;align-self:flex-start;color:#8c949f;font-size:14px;line-height:20px;min-height:24px;padding:0 0 2px;background:none;max-width:100%;margin:0 0 0 var(--chat-author-width)}.chat-presence button{font-size:10px;line-height:18px;padding:0 5px;border:0;background:transparent;color:#969da7}.chat-presence button:hover{color:#64717e;background:#eceff2}.chat-typing-dots{display:inline-flex;align-items:center;gap:3px;height:16px;flex:none;padding:0 2px}.chat-typing-dots i{display:block;width:4px;height:4px;border-radius:50%;background:currentColor;animation:chat-typing-bounce 1.2s ease-in-out infinite}.chat-typing-dots i:nth-child(2){animation-delay:.15s}.chat-typing-dots i:nth-child(3){animation-delay:.3s}.presence-indicator{width:6px;height:6px;border-radius:50%;background:#b4bac2;flex:none}.message-enter{animation:chat-message-enter .22s ease-out both}@keyframes chat-message-enter{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@keyframes chat-typing-bounce{0%,60%,100%{opacity:.4;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}@keyframes chat-send-spin{to{transform:rotate(360deg)}}
@media(max-width:760px){.chat-presence{margin-left:var(--chat-author-width);font-size:14px}.message-receipt{font-size:10px}}
@media(prefers-reduced-motion:reduce){.message-enter,.chat-typing-dots i,.message-send-state.send-pending::before{animation:none}.chat-typing-dots i{opacity:.7}}
/* Delivery/read receipts retain their own row without a second author-sized gap. */
.chat-focused .message-receipt,.chat-focused .chat .message-send-state{font-size:10px;line-height:12px;min-height:12px;margin-top:2px}

.message-receipt.receipt-changed{animation:chat-receipt-change .2s ease-out both}@keyframes chat-receipt-change{from{opacity:.35;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.message-receipt.receipt-changed{animation:none}}

/* Empty conversation metadata must not reserve a second header line. */
.conversation-heading #agent-subtitle:empty{display:none}

/* Desktop messages keep a readable measure even beside task and attachment cards. */
html.wepre-desktop-chat .chat-focused .chat { --chat-message-gap: 24px; }
html.wepre-desktop-chat .chat-focused .chat .msg {
  width: 100%; max-width: 100%; gap: 12px;
}
html.wepre-desktop-chat .chat-focused .chat .msg > .message-avatar {
  margin-top: 0; border-radius: 6px;
}
html.wepre-desktop-chat .chat-focused .chat .msg > .message-body {
  flex: 0 1 auto; width: fit-content; min-width: 0;
  max-width: min(640px, calc(80% - var(--chat-avatar-size) - 12px));
}
html.wepre-desktop-chat .chat-focused .chat .msg > .message-body > .bubble {
  width: fit-content; max-width: 100%; min-width: 0; min-height: 40px;
  padding: 9px 13px; border-radius: 7px; overflow-wrap: anywhere;
}
html.wepre-desktop-chat .chat-focused .chat .msg.me > .message-body > .bubble { margin-left: auto; }
html.wepre-desktop-chat .chat-focused .chat .msg > .message-body > .bubble::before {
  top: 14px; width: 8px; height: 8px;
}
html.wepre-desktop-chat .chat-focused .chat .msg > .message-body > :is(.ask-card,.chat-delivery,.revision-card) {
  max-width: 100%; border-radius: 8px; box-shadow: none;
}
html.wepre-desktop-chat .chat-focused .chat .msg .ask-card { overflow-wrap: anywhere; }
html.wepre-desktop-chat .chat-focused .chat .msg .ask-card header > div { min-width: 0; }
html.wepre-desktop-chat .chat-focused .chat .msg .ask-card h3 { overflow-wrap: anywhere; }
@media(max-width:760px) {
  html.wepre-desktop-chat .chat-focused .chat { --chat-message-gap: 20px; }
  html.wepre-desktop-chat .chat-focused .chat .msg > .message-body {
    max-width: calc(100% - var(--chat-avatar-size) - 28px);
  }
}

.partner-environment-badge{display:inline-block;margin:0;max-width:min(280px,38%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;border:1px solid #dce5e0;border-radius:5px;background:#f5f8f6;color:#548171;padding:3px 7px;font-size:12px;cursor:pointer}.partner-environment-badge:hover{background:#eaf3ee}.group-result-image[role=button]{cursor:zoom-in}.group-result-image[role=button]:focus-visible{outline:2px solid #198568;outline-offset:-2px}

/* 066-7 单聊头部一行布局：伙伴昵称与「工具·模型」chip 同一行（昵称在左、chip 紧随其后，与群聊头部一致）；昵称过长时 chip 省略。 */
.chat-focused .header .conversation-heading{display:flex;flex-wrap:wrap;align-items:center;column-gap:8px;min-width:0}
.chat-focused .header .conversation-heading>h1{flex:0 0 auto;max-width:62%;min-width:0;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.chat-focused .header .conversation-heading>.partner-environment-badge{flex:0 1 auto;min-width:0}
.chat-focused .header .conversation-heading>#agent-subtitle{flex:0 0 100%;min-width:0}

/* Composer status line (#chat-status): sits above the input box, aligned with the
   composer edges; 28px row; subdued color via --sub. */
:root{--sub:#8c949f}
.chat-status{display:flex;align-items:center;gap:8px;height:28px;line-height:28px;margin:0 0 4px;padding:0;color:var(--sub);font-size:12px;white-space:nowrap;overflow:hidden}
.chat-status[hidden]{display:none}
.chat-status .chat-typing-dots{display:inline-flex;align-items:center;gap:3px;height:28px;flex:none;padding:0 2px}
.chat-status .chat-typing-dots i{display:block;width:4px;height:4px;border-radius:50%;background:currentColor;animation:chat-typing-bounce 1.2s ease-in-out infinite}
.chat-status .chat-typing-dots i:nth-child(2){animation-delay:.15s}
.chat-status .chat-typing-dots i:nth-child(3){animation-delay:.3s}
.chat-status .chat-status-text{min-width:0;overflow:hidden;text-overflow:ellipsis}
.chat-status .chat-status-stage{font-style:normal;opacity:.85;margin-left:2px}
.chat-status button{flex:none;font-size:11px;line-height:18px;padding:0 6px;border:0;background:transparent;color:var(--sub);border-radius:6px}
.chat-status button:hover{color:#64717e;background:#eceff2}
@media(prefers-reduced-motion:reduce){.chat-status .chat-typing-dots i{animation:none;opacity:.7}}

/* 066-13 (zcode) Deliverable attachment card: a deliverables list, visually
   decoupled from chat bubbles. White surface, 1px border, 10px radius. */
.hh-message-attachments{min-width:0}
.hh-deliverables{width:min(100%,480px);box-sizing:border-box;display:flex;flex-direction:column;margin-top:9px;padding:4px 0;border:1px solid #e3e8ee;border-radius:10px;background:#fff;box-shadow:0 1px 3px #1a2b2210}
.hh-deliverables a{text-decoration:none}
.hh-deliverable-row{display:flex;align-items:center;gap:10px;min-width:0;padding:8px 12px;color:inherit}
.hh-deliverable-row+.hh-deliverable-row,.hh-deliverables-more+.hh-deliverable-row,.hh-deliverable-row+.hh-deliverables-more{border-top:1px solid #eef1f5}
.hh-deliverable-row:hover{background:#f7f9fc}
.hh-deliverable-icon{flex:none;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:7px;background:#eef3fb;color:#4a6fa5;font-size:9px;font-weight:700;letter-spacing:.4px}
.hh-deliverable-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.hh-deliverable-name{font-size:13px;font-weight:500;line-height:17px;color:#1d2530;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hh-deliverable-meta{font-size:11px;line-height:14px;color:#8a93a1}
.hh-deliverable-view{flex:none;font-size:12px;line-height:16px;color:#3a77c5;padding:2px 2px}
.hh-deliverable-row:hover .hh-deliverable-view{text-decoration:underline}
.hh-deliverables-more{border-top:1px solid #eef1f5}
.hh-deliverables-more>summary{list-style:none;cursor:pointer;padding:7px 12px;font-size:11px;color:#7c8698}
.hh-deliverables-more>summary::-webkit-details-marker{display:none}
.hh-deliverables-more>summary:hover{color:#3a77c5;background:#f7f9fc}
.hh-deliverables-more[open]>summary{color:#4a5568}
.hh-deliverables-extra{display:flex;flex-direction:column}
.hh-deliverables-more[open] .hh-deliverables-extra{border-top:1px solid #eef1f5}

/* 066-13 layering: delivered rounds get a light green left rail, failures a
   light red one, so success / failure / review cards read at a glance. */
.chat .chat-delivery.delivery-surface--success{border-left:3px solid #b7e4c7}
.chat .msg .run-failure{border-left:3px solid #eec2bc}

/* 066-14 (zcode) Inline work card: live status dot, progress bar with
   indeterminate stripes / determinate width, all animated in place. */
.inline-work-status{display:inline-flex;align-items:center;gap:7px;min-width:0}
.inline-work-dot{position:relative;flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent,#197e66)}
.inline-work-dot::after{content:'';position:absolute;inset:-4px;border:1px solid var(--accent,#197e66);border-radius:50%;animation:inline-work-pulse 1.8s ease-out infinite}
@keyframes inline-work-pulse{0%{transform:scale(.55);opacity:.85}75%,100%{transform:scale(1.65);opacity:0}}
.inline-work-card .revision-head{margin-bottom:2px}
.inline-work-bar{height:4px;margin-top:9px;border-radius:3px;background:#e4e9e7;overflow:hidden}
.inline-work-bar-fill{display:block;height:100%;border-radius:inherit;background:var(--accent,#197e66);transition:width .45s ease}
.inline-work-bar[data-bar-mode=indeterminate] .inline-work-bar-fill{width:42%;background:repeating-linear-gradient(-55deg,var(--accent,#197e66) 0 6px,color-mix(in srgb,var(--accent,#197e66) 55%,#fff) 6px 12px);animation:inline-work-slide 1.15s linear infinite}
.inline-work-bar[data-bar-paused] .inline-work-bar-fill{animation:none;background:color-mix(in srgb,var(--accent,#197e66) 45%,#e4e9e7)}
@keyframes inline-work-slide{from{transform:translateX(-130%)}to{transform:translateX(330%)}}
@media(prefers-reduced-motion:reduce){.inline-work-dot::after,.inline-work-bar[data-bar-mode=indeterminate] .inline-work-bar-fill{animation:none}}
