.aaa-chat-thread {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
    margin-block-end: 1rem;
}
.aaa-chat-bubble {
    min-width: 0;
    padding: .75rem 1rem;
    border: 1px solid #dbe4ee;
    border-radius: .75rem;
    background: #f8fafc;
    color: #12233f;
}
.aaa-chat-bubble.is-customer { background: #dbeafe; }
.aaa-chat-speaker { display: block; margin-block-end: .3rem; font-size: .86em; }
.aaa-chat-plain, .aaa-support-message {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    text-align: start;
}
aaa-chat-answer {
    display: block;
    min-width: 0;
    max-width: 100%;
    font: inherit;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: start;
    container-type: inline-size;
}
aaa-chat-answer :where(p, ul, ol, pre, blockquote, table, h1, h2, h3, h4, h5, h6) {
    margin: 0;
}
aaa-chat-answer > * + *, aaa-chat-answer li > p + p { margin-block-start: .55em; }
aaa-chat-answer :is(ul, ol) { padding: 0; padding-inline-start: 1.6em; list-style-position: outside; }
aaa-chat-answer ul { list-style-type: disc; }
aaa-chat-answer ol { list-style-type: decimal; }
aaa-chat-answer li + li, aaa-chat-answer li > :is(ul, ol) { margin-block-start: .2em; }
aaa-chat-answer li > ul { list-style-type: circle; }
aaa-chat-answer :is(h1, h2, h3, h4, h5, h6) {
    color: inherit;
    font: inherit;
    font-size: 1.06em;
    font-weight: 700;
    line-height: 1.35;
}
aaa-chat-answer strong { font-weight: 700; }
aaa-chat-answer a { color: #0b4b78; text-decoration: underline; text-underline-offset: .15em; }
aaa-chat-answer a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
aaa-chat-answer blockquote { border-inline-start: .2em solid #b4c9db; padding-inline-start: .75em; }
aaa-chat-answer code {
    font-family: ui-monospace, monospace;
    font-size: .92em;
    background: #eaf0f5;
    border-radius: .25em;
    padding-inline: .18em;
}
aaa-chat-answer pre {
    background: #eaf0f5;
    border-radius: .4em;
    padding: .6em .75em;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    direction: ltr;
    text-align: start;
}
aaa-chat-answer pre code { white-space: inherit; padding: 0; }
aaa-chat-answer table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .94em; }
aaa-chat-answer :is(th, td) {
    border: 1px solid #cbd5e1;
    padding: .3em .4em;
    text-align: start;
    white-space: normal;
    vertical-align: top;
}
aaa-chat-answer th { background: #eaf0f5; font-weight: 700; }
@container (max-width: 24rem) {
    aaa-chat-answer :is(th, td) { padding: .25em .18em; }
}

/* Ticket threads (customer and staff views): a Customer Care answer is formatted like the chat;
   the bubble's pre-wrap is for literal customer and staff text only. */
.sd-msg__t.is-formatted { white-space: normal; }
.sd-msg__t.is-formatted aaa-chat-answer { line-height: 1.6; }
.sd-msg__t.is-formatted aaa-chat-answer a { word-break: break-word; overflow-wrap: anywhere; }
.sd-msg__t[dir="auto"] { text-align: start; unicode-bidi: plaintext; }
