/* Approved recording-inspired presentation; driven only by real SSE events. */
.chat-whale-message { gap: 16px; }
.message-row.ai.chat-whale-message { flex-direction: row; }
.message-row.ai.chat-whale-message .message-avatar { display: flex; width: 30px; height: 30px; margin-top: 7px; background: none; border-radius: 0; }
.chat-whale-message .message-avatar img { width: 30px; height: 30px; object-fit: contain; }
.agent-activity { --trace-muted: #707070; --trace-log: #f7f7f8; --trace-ink: #303030; --trace-dot: #171717; --trace-dot-light: #ddd; margin: 0 0 18px; min-width: 0; color: var(--trace-ink); font-weight: 400; font-size: 16px; line-height: 26px; }
.chat-active-run-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.agent-activity-thinking { margin: 0 0 12px; }
.agent-activity summary { display: flex; align-items: center; gap: 10px; min-height: 44px; width: fit-content; max-width: 100%; cursor: pointer; list-style: none; border-radius: 4px; color: var(--trace-muted); font-weight: 400; font-size: 16px; line-height: 24px; }
.agent-activity summary::-webkit-details-marker { display: none; }
.agent-activity summary:hover { color: var(--trace-ink); background: transparent; }
.agent-activity summary:focus-visible, .agent-activity pre:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.agent-activity-summary > .fa-lightbulb { flex: 0 0 18px; font-size: 15px; text-align: center; }
.agent-activity-phase { font: inherit; }
.agent-activity-chevron { font-size: 9px; transform: rotate(-90deg); transition: transform 160ms ease-out; flex-shrink: 0; }
.agent-activity details[open] > summary > .agent-activity-chevron { transform: rotate(0); }
.agent-activity-overview { padding: 4px 0 2px 28px; font-size: 14px; line-height: 22px; color: var(--trace-muted); overflow-wrap: anywhere; }
.agent-activity-overview p { margin: 0; font: inherit; line-height: inherit; }
.agent-activity-overview .agent-activity-note { margin-top: 4px; }
.agent-activity-counts { font-variant-numeric: tabular-nums; }
.agent-activity-list { margin: 0; padding: 0; }
.agent-activity-step { margin: 12px 0 8px; min-width: 0; }
.agent-activity-tool-summary > .fa-terminal { width: 16px; height: 16px; display: grid; place-items: center; font-size: 9px; border: 1px solid currentColor; border-radius: 3px; flex-shrink: 0; }
.agent-activity-step-name { overflow-wrap: anywhere; min-width: 0; }
.agent-activity-step-status { font-size: 12px; white-space: nowrap; }
.agent-activity-tool-body { margin: 4px 0 0 8px; padding-left: 18px; border-left: 1px solid var(--line); min-width: 0; }
.agent-activity-log { padding: 12px; margin: 0 0 12px; background: var(--trace-log); border-radius: 12px; border: 0; box-shadow: none; min-width: 0; }
.agent-activity-log-label { font-size: 14px; line-height: 22px; font-weight: 500; margin-bottom: 10px; }
.agent-activity-log pre { margin: 0; padding: 0; max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--trace-ink); font: 14px/22px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.agent-activity-step[data-state='failed'] .agent-activity-step-status, .agent-activity[data-state='failed'] .agent-activity-phase { color: #9c3c40; }
.agent-activity-pending { padding: 8px 0; height: 32px; }
.agent-thinking-orbit { width: 11px; height: 11px; display: inline-block; position: relative; overflow: hidden; vertical-align: baseline; margin: 0 4px; border-radius: 50%; background: linear-gradient(90deg, var(--trace-dot) 50%, var(--trace-dot-light) 50%); }
.agent-thinking-orbit::before { content: ''; position: absolute; inset: 0; border-radius: 50%; animation: whale-thinking-flip 1200ms linear infinite; }
.agent-activity[data-busy='false'] .agent-thinking-orbit::before { animation: none; }
.message-row.is-generating:has(.agent-activity[data-output='true']) .message-bubble:not([hidden])::after { content: ''; display: inline-block; width: 11px; height: 11px; margin-left: 5px; border-radius: 50%; background: linear-gradient(90deg, #171717 50%, #ddd 50%); animation: whale-stream-flip 1200ms linear infinite; }
@keyframes whale-thinking-flip {
  0%, 100% { transform: scaleX(1); background: var(--trace-dot); }
  24.99% { transform: scaleX(0); background: var(--trace-dot); }
  25% { transform: scaleX(0); background: var(--trace-dot-light); }
  50% { transform: scaleX(1); background: var(--trace-dot-light); }
  74.99% { transform: scaleX(0); background: var(--trace-dot-light); }
  75% { transform: scaleX(0); background: var(--trace-dot); }
}
@keyframes whale-stream-flip { to { transform: rotateY(360deg); } }
.agent-interaction { margin: 0 0 16px; padding: 14px 0 14px 16px; border-left: 3px solid #c8913e; font-size: 14px; line-height: 1.7; }
.agent-interaction-heading { margin: 0 0 8px; font-size: 13px; color: #99601e; font-weight: 600; }
.agent-interaction-heading i { margin-right: 8px; }
.agent-interaction p { margin: 0 0 8px; }
.agent-interaction pre { max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.agent-interaction-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.agent-interaction-actions button { border: 1px solid #dce1e4; border-radius: 6px; padding: 7px 10px; background: #fff; font: inherit; font-size: 12px; color: #39434a; cursor: pointer; }
.agent-interaction-actions button:first-child { background: #edf5f2; color: #246c60; border-color: #cfdfd9; }
.agent-interaction-actions button:hover { filter: brightness(.96); }
.agent-interaction-actions button:disabled { opacity: .5; cursor: wait; }
.agent-interaction-actions button:focus-visible { outline: 2px solid #267d76; outline-offset: 2px; }
.agent-interaction-actions i { margin-right: 6px; }

:root[data-theme='dark'] .agent-activity { --trace-muted: #b3b4bb; --trace-log: #2d2e34; --trace-ink: #e7e7eb; --trace-dot: #e7e7eb; --trace-dot-light: #676972; }
:root[data-theme='dark'] .agent-activity-step[data-state='failed'] .agent-activity-step-status,
:root[data-theme='dark'] .agent-activity[data-state='failed'] .agent-activity-phase { color: #ffb0b0; }
:root[data-theme='dark'] .agent-interaction-heading { color: #e4ba7b; }
:root[data-theme='dark'] .agent-interaction-actions button { background: #30383d; border-color: #526067; color: #e0e9e6; }
@supports (interpolate-size: allow-keywords) {
  .agent-activity details { interpolate-size: allow-keywords; }
  .agent-activity details::details-content { block-size: 0; opacity: 0; overflow: clip; transition: block-size 200ms ease-out, opacity 160ms ease-out, content-visibility 200ms allow-discrete; }
  .agent-activity details[open]::details-content { block-size: auto; opacity: 1; }
}
@media (max-width: 600px) {
  .chat-whale-message { gap: 10px; }
  .message-row.ai.chat-whale-message .message-avatar, .chat-whale-message .message-avatar img { width: 24px; height: 28px; }
  .agent-activity summary { font-size: 15px; gap: 8px; }
  .agent-activity-tool-body { padding-left: 12px; }
  .agent-activity-log { padding: 10px; }
  .agent-activity-log pre { font-size: 13px; line-height: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .agent-activity *, .agent-activity *::before, .agent-activity details::details-content,
  .message-row.is-generating .message-bubble::after { animation: none !important; transition: none !important; }
}
