.comment {
  display: flex;
  gap: 0.625rem;
}

/* PDS's avatar gradient tokens do not reach the canvas, so the circle carries its own
 * size and a plain ground for the fallback to sit on. */
.avatar,
.agentAvatar {
  flex: none;
  width: 1.625rem;
  height: 1.625rem;
  overflow: hidden;
  border-radius: 50%;
}

.avatar {
  background: var(--pds-color-surface-default-secondary, oklch(0.943 0 0));
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agentAvatar {
  display: grid;
  place-items: center;
  background: var(--pds-color-foreground-default, oklch(0.2178 0 0));
  color: #fff;
}

.agentAvatar svg {
  width: 0.75rem;
  height: 0.75rem;
}

.body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.author {
  font-size: 0.8125rem;
  font-weight: var(--pds-typography-fw-semibold, 600);
}

.agentBadge {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.375rem;
  background: var(--pds-color-badge-silver-muted-background, oklch(0.943 0 0));
  color: var(--pds-color-badge-silver-muted-foreground, oklch(0.3211 0 0));
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  font-weight: var(--pds-typography-fw-semibold, 600);
  line-height: 1.25;
}

.time {
  flex: none;
  color: var(--pds-color-foreground-default-secondary, oklch(0.5103 0 0));
  font-size: 0.75rem;
  white-space: nowrap;
}

.text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-wrap: pretty;
}

.mention {
  display: inline-flex;
  align-items: center;
  gap: 0.1875rem;
  padding: 0 0.375rem 0 0.25rem;
  background: var(--pds-color-surface-default-secondary, oklch(0.943 0 0));
  border: 1px solid var(--pds-color-border-default, oklch(0.925 0 0));
  border-radius: 0.25rem;
  font-weight: var(--pds-typography-fw-semibold, 600);
  line-height: 1.4;
  vertical-align: baseline;
  white-space: nowrap;
}

.mention svg {
  width: 0.625rem;
  height: 0.625rem;
}

/* An agent at work: a purple dot that breathes, beside a line saying whose request it
 * is on. Failure is the same line, gone quiet. */
.activity {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--pds-color-foreground-default-secondary, oklch(0.5103 0 0));
}

.pulse {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--p1-agent-accent, oklch(0.55 0.2 300));
  border-radius: 50%;
  animation: comment-pulse 2.4s ease-in-out infinite;
}

.working .agentAvatar {
  background: var(--p1-agent-accent, oklch(0.55 0.2 300));
}

.failed {
  color: var(--pds-color-foreground-danger, oklch(0.5 0.2 25));
}

@keyframes comment-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}
