/* Mathematical notation in chat messages, rendered locally with KaTeX. */
.message-content .math-render {
    color: inherit;
    max-width: 100%;
}

.message-content .math-inline {
    display: inline-block;
    vertical-align: -0.16em;
    margin: 0 0.08em;
}

.message-content .math-display {
    display: block;
    width: 100%;
    margin: 0.75em 0;
    padding: 0.35em 0.15em;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.message-content .math-render .katex {
    color: inherit;
    font-size: 1.04em;
}

.message-content .math-display .katex-display {
    min-width: max-content;
    margin: 0;
}

.message-content .math-display::-webkit-scrollbar {
    height: 5px;
}

.message-content .math-display::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.45);
}

@media (max-width: 768px) {
    .message-content .math-display {
        margin: 0.6em 0;
        padding: 0.25em 0;
    }

    .message-content .math-render .katex {
        font-size: 0.98em;
    }
}
