.bubble:has(.chat-markdown){min-width:0;max-width:100%}
/* Compact typesetting inside existing bubbles; no composer or bubble geometry changes. */
.bubble .chat-markdown{white-space:normal;line-height:inherit;min-width:0;overflow-wrap:break-word}
.chat-markdown :is(p,ul,ol,blockquote,pre,h1,h2,h3,h4,h5,h6,hr,.md-table-scroll){margin:0}
.chat-markdown>*+*{margin-top:.4em}
.chat-markdown :is(ul,ol){padding-left:1.35em}.chat-markdown li+li{margin-top:.12em}.chat-markdown li>p+p{margin-top:.3em}.chat-markdown li>:is(ul,ol){margin-top:.15em}
.chat-markdown :is(h1,h2,h3,h4,h5,h6){font-size:1.08em;line-height:1.5;font-weight:600}.chat-markdown :is(h4,h5,h6){font-size:1em}
.chat-markdown strong{font-weight:650}.chat-markdown blockquote{padding-left:.7em;border-left:2px solid currentColor;opacity:.82}.chat-markdown blockquote>*+*{margin-top:.3em}
.chat-markdown a{color:inherit;text-decoration:underline;text-underline-offset:3px;overflow-wrap:break-word}
.chat-markdown code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.86em;background:#80808018;border-radius:4px;padding:.08em .25em}
.chat-markdown pre{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;background:#80808012;border-radius:9px;padding:.6em .75em;white-space:pre;line-height:1.5;tab-size:2}.chat-markdown pre code{padding:0;background:none;white-space:pre;border-radius:0}
.chat-markdown hr{border:0;border-top:1px solid #8885}.chat-markdown .md-table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}.chat-markdown table{border-collapse:collapse;font-size:.9em}.chat-markdown :is(td,th){border:1px solid #8885;padding:.25em .5em;text-align:left}.chat-markdown th{font-weight:600}.md-image-label{opacity:.7;font-size:.9em}.chat-markdown.md-plain{white-space:pre-wrap}

/* Chinese closing punctuation stays with its preceding character. Text is untouched. */
.bubble .chat-markdown,.bubble .quoted-message{line-break:strict;word-break:normal;overflow-wrap:break-word}
.chat-markdown pre,.chat-markdown pre code{line-break:auto;word-break:normal;overflow-wrap:normal}
