/* docs-math.css — make display math in docs scrollable and responsive */
.math-block {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0.5rem;
  margin: 0.5rem 0;
}

/* KaTeX and MathJax display elements */
.math-block .katex-display,
.katex-display,
.mjx-block,
.MathJax_Display,
.katex {
  max-width: 100%;
  display: block;
}

/* Try to avoid breaking the layout; allow KaTeX container to shrink */
.katex { white-space: normal; }
.katex .base { white-space: normal; }
.mjx-chtml { max-width: 100%; }

/* Small visual hint for scrollable areas */
.math-block::-webkit-scrollbar { height: 8px; }
.math-block::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 4px; }

/* Keep inline math unaffected */
.katex .katex-html, .katex .katex-mathml, .MathJax_inline { white-space: nowrap; }
