.assistant-rich-text {
  position: relative;
  margin-top: 9px;
  color: var(--ink);
  font-size: 0.8125rem;
  font-family: var(--font-ui);
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.assistant-rich-text > :first-child { margin-top: 0; }
.assistant-rich-text > :last-child { margin-bottom: 0; }
.assistant-rich-text p { margin: 0 0 11px; font: inherit; }
.assistant-rich-text h2,
.assistant-rich-text h3,
.assistant-rich-text h4,
.assistant-rich-text h5 {
  margin: 17px 0 7px;
  color: #123c3a;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.assistant-rich-text ul,
.assistant-rich-text ol { margin: 8px 0 13px; padding-left: 21px; }
.assistant-rich-text li { padding-left: 2px; }
.assistant-rich-text li + li { margin-top: 6px; }
.assistant-rich-text li::marker { color: var(--aqua-deep); font-weight: 800; }
.assistant-rich-text strong { color: #123c3a; font-weight: 800; }
.assistant-rich-text a { color: var(--aqua-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.assistant-rich-text code {
  border: 1px solid rgba(11, 137, 133, 0.15);
  border-radius: 5px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.65);
  font: 600 0.9em/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.assistant-rich-text pre {
  max-width: 100%;
  margin: 10px 0 13px;
  padding: 12px;
  overflow-x: auto;
  border-radius: 8px;
  background: #123c3a;
  color: #f4fbfa;
  white-space: pre-wrap;
}

.assistant-rich-text pre code { border: 0; padding: 0; background: transparent; color: inherit; }
.assistant-rich-text blockquote {
  margin: 10px 0 13px;
  padding: 8px 11px;
  border-left: 3px solid var(--aqua-deep);
  border-radius: 0 7px 7px 0;
  background: rgba(255, 255, 255, 0.54);
  color: #3f5d5a;
}

.assistant-table-wrap { max-width: 100%; margin: 10px 0 13px; overflow-x: auto; }
.assistant-rich-text table { width: 100%; border-collapse: collapse; background: rgba(255, 255, 255, 0.48); font-size: 0.6875rem; }
.assistant-rich-text th,
.assistant-rich-text td { padding: 7px 8px; border: 1px solid rgba(11, 137, 133, 0.16); text-align: left; vertical-align: top; }
.assistant-rich-text th { color: #123c3a; background: rgba(11, 137, 133, 0.08); font-weight: 800; }

.assistant-rich-text.is-streaming::after {
  display: inline-block;
  width: 5px;
  height: 14px;
  margin-left: 3px;
  border-radius: 3px;
  background: var(--aqua-deep);
  vertical-align: -2px;
  content: "";
  animation: assistant-caret 0.85s ease-in-out infinite;
}

@keyframes assistant-caret { 50% { opacity: 0.22; } }
@media (prefers-reduced-motion: reduce) { .assistant-rich-text.is-streaming::after { animation: none; } }
