/* Agent status (shown while a question is in flight) and the sources panel under each answer. Tokens only. */

.agent-status {
  margin: 12px 0 30px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.agent-status-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.agent-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid var(--edge-strong);
  border-radius: var(--r-md);
  color: var(--ember);
}
.agent-status-icon .icon {
  width: 16px;
  height: 16px;
}
.agent-status-label {
  color: var(--text);
  font-weight: 500;
}
.agent-status-detail,
.agent-status-time {
  color: var(--muted);
}
.agent-status-time {
  margin-left: auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* A loading indicator may loop only while its request is in flight: .is-active is removed the moment it ends. */
.agent-status.is-active .agent-status-label {
  background: linear-gradient(90deg, var(--muted) 0%, var(--text) 50%, var(--muted) 100%) 0 0 / 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: agent-status-shimmer calc(var(--dur-5) * 2) linear infinite;
}
@keyframes agent-status-shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -100% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .agent-status.is-active .agent-status-label {
    animation: none;
    background: none;
    color: var(--text);
  }
}
body.motion-off .agent-status.is-active .agent-status-label {
  animation: none;
  background: none;
  color: var(--text);
}

.agent-status-trail {
  list-style: none;
  margin: 8px 0 0 36px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.agent-status-trail:empty {
  display: none;
}
.agent-status-trail li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.agent-status-trail .icon {
  width: 14px;
  height: 14px;
  color: var(--jade);
}
.agent-status-seconds {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* ---- Sources read for an answer ---- */
.answer-sources {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.answer-timing {
  margin: 0;
  font-size: 12px;
  color: var(--ink-subtle);
}
/* Specific on purpose: `.reply ul` and `.reply li` style the answer's own lists and would otherwise indent these. */
.reply .answer-source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.reply .answer-source {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  background: var(--surface-deep);
}
.answer-source-logo {
  width: 20px;
  height: 20px;
  flex: none;
}
.answer-source-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.answer-source-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.answer-source-count {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.reply .answer-source[data-state='error'] {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
.reply .answer-source[data-state='error'] .answer-source-count {
  color: var(--danger);
}
