.rsm-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
/* Letter reveal is driven by Web Animations; unanimated text stays fully opaque. */
.rsm-append { opacity: 1; }

/* StreamingMarkdown: neutral defaults that inherit your font and colors. Override freely. */
.rsm-markdown { line-height: 1.7; overflow-wrap: anywhere; }
.rsm-markdown > :first-child { margin-top: 0; }
.rsm-markdown > :last-child { margin-bottom: 0; }
.rsm-markdown p, .rsm-markdown ul, .rsm-markdown ol, .rsm-markdown blockquote, .rsm-markdown pre, .rsm-markdown .rsm-table { margin: 0 0 1em; }
.rsm-markdown h1, .rsm-markdown h2, .rsm-markdown h3, .rsm-markdown h4, .rsm-markdown h5, .rsm-markdown h6 { margin: 1.2em 0 .5em; line-height: 1.3; }
.rsm-markdown ul, .rsm-markdown ol { padding-left: 1.5em; }
.rsm-markdown li > ul, .rsm-markdown li > ol { margin: .25em 0; }
.rsm-markdown li.rsm-task { list-style: none; margin-left: -1.3em; }
.rsm-markdown li.rsm-task > input { margin: 0 .5em 0 0; vertical-align: -.1em; }
.rsm-markdown blockquote { padding-left: 1em; border-left: 3px solid color-mix(in srgb, currentColor 25%, transparent); opacity: .85; }
.rsm-markdown code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; padding: .1em .3em; border-radius: 4px; background: color-mix(in srgb, currentColor 9%, transparent); }
.rsm-markdown pre { padding: .9em 1em; overflow-x: auto; border-radius: 8px; background: color-mix(in srgb, currentColor 7%, transparent); line-height: 1.5; }
.rsm-markdown pre code { padding: 0; background: none; font-size: .85em; white-space: pre; }
.rsm-markdown hr { border: 0; border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent); margin: 1.5em 0; }
.rsm-markdown .rsm-table { overflow-x: auto; }
.rsm-markdown table { border-collapse: collapse; }
.rsm-markdown th, .rsm-markdown td { padding: .4em .8em; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); text-align: left; }
.rsm-markdown [data-align=center] { text-align: center; }
.rsm-markdown [data-align=right] { text-align: right; }
.rsm-markdown a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.rsm-markdown .rsm-math-display { margin: 0 0 1em; overflow-x: auto; overflow-y: hidden; text-align: center; }
/* TeX source: shown while a display formula is still arriving, or when no renderer is set. */
.rsm-markdown .rsm-math-pending, .rsm-markdown .rsm-math:not(:has(> *)) { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; white-space: pre-wrap; opacity: .75; }
.rsm-markdown .rsm-math-pending { text-align: left; }

/* WAAPI decoration is also disabled/cancelled by the reduced-motion listener. */
@media (prefers-reduced-motion: reduce) {
  .rsm-text, .rsm-markdown, .rsm-append { animation: none !important; transition: none !important; scroll-behavior: auto; opacity: 1; }
}
