/* Textbook-style math on the about pages (KaTeX). Colour is inherited, so light and dark themes both work. */
.seo-page-section--content .katex {
    font-size: 1.2em;
    text-indent: 0;
}

.seo-page-section--content .katex-display {
    display: block;
    margin: 1.9em 0;
    padding: 0.6em 0.25em;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: center;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.seo-page-section--content .katex-display > .katex {
    max-width: none;
}

.seo-page-section--content p:has(> .katex-display:only-child) {
    margin-block: 0.4em;
}

.seo-page-section--content .katex-error {
    color: inherit;
    font-family: monospace;
}

@media (max-width: 600px) {
    .seo-page-section--content .katex-display {
        font-size: 0.95em;
        margin: 1.5em 0;
    }
}

/* The same textbook math in the FAQ answers, the steps and the intro of an app page. */
.seo-page-faq .katex,
.seo-steps .katex {
    font-size: 1.15em;
    text-indent: 0;
}

.seo-page-faq .katex-display {
    display: block;
    margin: 1.4em 0;
    padding: 0.4em 0.25em;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: center;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.seo-page-faq p:has(> .katex-display:only-child) {
    margin-block: 0.3em;
}

.seo-page-faq .katex-error {
    color: inherit;
    font-family: monospace;
}

/* Right-to-left pages: formulas always run left to right. */
.katex,
.katex-display {
    direction: ltr;
    unicode-bidi: isolate;
}