/* Wide display math that cannot be line-broken (aligned blocks, arrays)
   scrolls inside its own box instead of widening the whole page. */
.md-typeset div.arithmatex {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.md-typeset div.arithmatex > mjx-container[display="true"] {
  margin: 0.6em 0;
}

/* Never let content push the page wider than the viewport. */
.md-content__inner {
  overflow-wrap: break-word;
}

@media screen and (max-width: 44.984375em) {
  /* Slightly smaller display math on phones so more of it fits. */
  .md-typeset div.arithmatex {
    font-size: 0.92em;
  }

  /* Reclaim horizontal space taken by list indentation. */
  .md-typeset ol,
  .md-typeset ul {
    margin-left: 1.2em;
  }

  .md-typeset ol ol,
  .md-typeset ul ol,
  .md-typeset ol ul {
    margin-left: 0.8em;
  }
}

/* Math inside table cells stays on one line; the table scrolls instead. */
.md-typeset table:not([class]) td .arithmatex,
.md-typeset table:not([class]) th .arithmatex {
  white-space: nowrap;
}

/* Math in the table of contents / nav: match link text size. */
.md-nav__link mjx-container {
  font-size: 100% !important;
}
