/* Keep figures inside the content column at every viewport.
   Quarto stamps computed figures with explicit pixel width/height attributes
   (e.g. width="934"), which overflow the ~750 px book column on a desktop and
   overflow badly on a phone, producing a horizontal scrollbar on the whole
   page. Letting the image scale down and recover its own aspect ratio fixes
   this for every figure in the book, generated or static. */
figure img,
img.figure-img,
.quarto-figure img,
.cell-output-display img {
  max-width: 100%;
  height: auto;
}

/* Wide content that genuinely cannot shrink scrolls inside its own box rather
   than dragging the page sideways. */
.cell-output-display > table,
.table-responsive {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* Long display equations cannot line-wrap, so on a narrow screen they push the
   whole page sideways. Give each one its own scroll box instead. */
mjx-container[display="true"],
math[display="block"],
.MathJax_Display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
}
