:host {
    display: inline;
}

/* Display math owns its own line and scrolls sideways rather than widening
   the chat bubble, the same treatment tables get. */
:host([display='true']) {
    display: block;
    margin: 10px 0;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: center;
}

.biel-math--display {
    display: block;
}

/* The TeX source, shown until MathJax has converted it. */
.biel-math__source {
    font-family: var(--biel-code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: 0.95em;
    opacity: 0.75;
    white-space: nowrap;
}

.biel-math__source--hidden {
    display: none;
}

.biel-math__output--empty {
    display: none;
}

/* MathJax sizes its container from the surrounding font, and its own
   stylesheet is copied into this shadow root at render time. */
.biel-math__output mjx-container {
    max-width: 100%;
}

.biel-math__output mjx-container[display='true'],
.biel-math__output mjx-container[jax][display='true'] {
    margin: 0;
}

.biel-math__output svg {
    max-width: 100%;
}

:host([display='true']) .biel-math__output::-webkit-scrollbar {
    height: 8px;
}
