body {
  box-sizing: border-box;
  background: #fffff8;
  font-family: 'Iowan Old Style', serif;
  line-height: 1.4;
  padding: 0 10px;
  max-width: 720px;
  margin: 50px 0 50px 10%;
  counter-reset: sidenote-counter;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

img.centered {
  display: block;
  margin-inline: auto;
}

figure {
  margin: 1.5em 0;
}

.figure-half img {
  display: block;
  max-width: 50%;
  margin-inline: auto;
}

figcaption {
  margin-top: 0.5em;
}

caption {
  caption-side: bottom;
  margin-top: 0.5em;
  text-align: left;
}

pre {
  overflow-x: auto;
  padding: 0.75em;
  background: #f4f1e8;
}

mjx-container[display="true"] {
  overflow-x: auto;
  overflow-y: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 1em 0;
}

table.comparison {
  table-layout: auto;
  font-size: 0.9em;
}

th,
td {
  text-align: left;
  vertical-align: top;
}

.comparison th,
.comparison td {
  border-bottom: 1px solid #d8d2c0;
  padding: 0.35em 0.5em;
  overflow-wrap: anywhere;
}

th:first-child,
td:first-child {
  width: 145px;
}

.comparison th:first-child,
.comparison td:first-child {
  width: auto;
}

.toc h2 {
  font-size: 1.17em;
  margin-bottom: 0.5em;
}

.toc ul {
  padding-left: 1.25em;
}

.toc a {
  color: inherit;
}

.sidenote {
  width: 260px;
  margin-right: -300px;
  margin-bottom: 1.25em;
  float: right;
  clear: right;
  line-height: 1.4;
  position: relative;
}

.sidenote-number {
  counter-increment: sidenote-counter;
  cursor: pointer;
}

.sidenote-number::after,
.sidenote::before {
  font-size: 0.8em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.sidenote-number::after {
  content: counter(sidenote-counter);
  top: -0.5em;
  left: 0.1em;
}

.sidenote-number-consecutive::after {
  content: ", " counter(sidenote-counter);
}

.sidenote::before {
  content: counter(sidenote-counter) " ";
  top: -0.5em;
}

input.margin-toggle {
  display: none;
}

.print-citations {
  display: none;
}

@media (max-width: 1359px) {
  .sidenote {
    display: none;
  }

  .margin-toggle:checked + .sidenote {
    display: block;
    float: none;
    clear: both;
    width: auto;
    margin: 1em 0 1.25em;
    padding-left: 1em;
    border-left: 1px solid;
  }
}

@media (min-width: 1200px) {
  body.has-toc {
    margin-left: 25%;
  }

  .toc {
    position: fixed;
    top: 50px;
    left: 30px;
    width: 260px;
    max-height: calc(100vh - 100px);
    overflow: auto;
  }

  .toc h2 {
    margin-top: 0;
  }

  .toc ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
  }

  .toc li {
    margin: 0 0 0.5em;
  }

  .toc a {
    color: #666;
    text-decoration: none;
  }

  .toc a:hover,
  .toc a:focus {
    color: inherit;
    text-decoration: none;
  }

  h2,
  h3 {
    scroll-margin-top: 2rem;
  }
}

@media (max-width: 650px) {
  body {
    margin: 25px 0 40px;
  }

  .figure-half img {
    max-width: 100%;
  }

  table.comparison {
    display: block;
    overflow-x: auto;
  }

  .comparison th,
  .comparison td {
    white-space: nowrap;
  }
}

@media print {
  body.has-toc {
    margin-left: 10%;
  }

  .toc {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
  }

  .toc h2 {
    margin-top: 1em;
  }

  .toc ul {
    list-style: disc;
    margin: 1em 0;
    padding-left: 40px;
  }

  .toc li {
    margin: 0;
  }

  .toc a {
    color: inherit;
    text-decoration: none;
  }

  .sidenote {
    display: none !important;
  }

  .print-citations {
    display: block;
    margin-top: 3em;
  }

  .print-citations h2 {
    font-size: 1.17em;
  }

  .print-citations li {
    margin-bottom: 0.5em;
    break-inside: avoid;
  }
}
