.message.assistant .chat-process-host {
  width: min(300px, 78vw);
  max-width: 100%;
}

.proc-block {
  color: #6b6560;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

.proc-row {
  width: fit-content;
  max-width: 100%;
  min-height: 30px;
  margin-bottom: 6px;
  padding: 6px 11px 6px 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  color: inherit;
  background: #f3f0ec;
  border: 0;
  border-radius: 20px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}

.proc-row:hover { background: #edeae6; }
.proc-expanded + .proc-row { border-top: 0; }
.proc-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--coral); line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.proc-icon-svg { width: 15px; height: 15px; display: block; }
.proc-text { flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #6b6560; font-size: 11.5px; }
.proc-name { color: #6b6560; font-size: 11.5px; font-weight: 400; }
.proc-time { color: #b8b2ab; font-size: 10px; }
.proc-expanded {
  display: none;
  padding: 4px 5px 10px 6px;
  color: #b8b2ab;
  background: transparent;
  border-top: 0;
  font-size: 12px;
  line-height: 1.75;
}
.proc-expanded.show { display: block; }
.thought-text { color: #b8b2ab; font-style: italic; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.proc-expanded .field-label { margin-top: 9px; margin-bottom: 3px; color: #a09890; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.proc-expanded .field-label:first-child { margin-top: 0; }
.proc-expanded .field-value {
  padding: 5px 8px;
  color: #2c2825;
  background: rgba(0, 0, 0, .06);
  border-radius: 6px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.proc-expanded .result-ok { color: #6a9e6a; }
.proc-expanded .result-err { color: #c9655a; }

@keyframes process-pulse-fade { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes process-blink { 0%, 100% { opacity: 0; } 40%, 60% { opacity: 1; } }
.proc-row.running { cursor: default; }
.proc-row.running .proc-icon { animation: process-pulse-fade 1.4s infinite; }
.blink-dots span { animation: process-blink 1.4s infinite; }
.blink-dots span:nth-child(2) { animation-delay: .2s; }
.blink-dots span:nth-child(3) { animation-delay: .4s; }

@media (max-width: 520px) {
  .message.assistant .chat-process-host { width: min(440px, 82vw); }
}

@media (prefers-reduced-motion: reduce) {
  .proc-row { transition: none; }
  .proc-row.running .proc-icon, .blink-dots span { animation: none; }
}
/* Agent events use the same compact capsule language as legacy tool progress. */
.agent-timeline-host { width: 100%; max-width: 100%; display: grid; gap: 6px; min-width: 0; }
.agent-text-segment { margin: 0; }
.agent-thought-row { width: min(142px, 82vw); max-width: 100%; color: #a09890; background: transparent; border-radius: 0; overflow: visible; }
.agent-thought-row summary { width: 100%; height: 30px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; background: #f3f0ec; border-radius: 999px; cursor: pointer; list-style: none; white-space: nowrap; overflow: hidden; }
.agent-thought-row summary::-webkit-details-marker { display: none; }
.agent-thought-row summary:hover { background: #edeae6; }
.agent-thought-row .proc-icon { width: 14px; height: 14px; color: var(--coral); }
.agent-thought-row .proc-icon-svg { width: 13px; height: 13px; }
.agent-thought-row .proc-name { flex: 1 1 auto; width: auto; display: inline-block; color: #6b6560; font-size: 12px; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-thought-row[open] { border-radius: 0; }
.agent-thought-row .thought-text { display: none; width: min(315px, 82vw); max-width: 100%; padding: 7px 0 2px 0; color: #b8b2ab; font-size: 11.5px; font-style: italic; line-height: 1.68; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-thought-row[open] .thought-text { display: block; }
.agent-tool-capsule { width: min(142px, 82vw); max-width: 100%; margin-bottom: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #6b6560; font-size: 12px; overflow: visible; }
.agent-tool-capsule summary { width: 100%; height: 30px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; background: #f3f0ec; border-radius: 999px; cursor: pointer; list-style: none; user-select: none; white-space: nowrap; overflow: hidden; }
.agent-tool-capsule summary::-webkit-details-marker { display: none; }
.agent-tool-capsule summary:hover { background: #edeae6; }
.agent-tool-capsule .proc-text { display: inline-block; color: #6b6560; font-size: 12px; line-height: 1.2; }
.agent-tool-capsule summary .proc-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-tool-capsule .proc-icon { width: 14px; height: 14px; color: var(--coral); }
.agent-tool-capsule .proc-icon-svg { width: 13px; height: 13px; }
.agent-tool-capsule .proc-status { margin-left: 0; }
.agent-tool-details { display: none; width: min(315px, 82vw); max-width: 100%; min-width: 0; padding: 7px 0 2px 0; color: #948c84; font-size: 11.5px; font-style: normal; line-height: 1.68; }
.agent-tool-capsule[open] { border-radius: 0; }
.agent-tool-capsule[open] .agent-tool-details { display: grid; gap: 4px; }
.agent-tool-detail { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.agent-tool-detail > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-tool-detail small { color: #c9655a; overflow-wrap: anywhere; }
.proc-status-svg { width: 8px; height: 8px; display: block; }
.agent-tool-capsule .proc-status {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  display: inline-grid;
  place-items: center;
  color: #aaa29a;
  opacity: .82;
}
.agent-tool-capsule .tool-status-icon {
  width: 10px;
  height: 10px;
  flex-basis: 10px;
  color: #7f9a7d;
  opacity: .72;
}
.agent-tool-capsule .proc-status.err { color: #bd7a73; }
.agent-tool-capsule.status-running .proc-icon { animation: process-pulse-fade 1.4s infinite; }
.agent-tool-capsule.status-running .proc-name::after { content: "..."; }
.agent-tool-running { cursor: default; color: #6b6560; }
.agent-tool-running .proc-icon { animation: process-pulse-fade 1.4s infinite; }
.agent-run-status { margin: 0; color: var(--muted); font-size: 12px; }
.agent-run-status.status-waiting,.agent-run-status.status-waiting_for_nini,.agent-run-status.status-waiting_for_external,.agent-run-status.status-continue_later { color: #92743f; }
.agent-run-status.status-partial,.agent-run-status.status-failed { color: #a85b51; }
.agent-run-status.status-interrupted { color: #7d746c; }
.agent-card-host:empty { display: none; }
