.md-grid {
  max-width: 90rem;
}

.manuscript-title,
.latexml-manuscript {
  width: 100%;
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
}

.latexml-manuscript {
  --manuscript-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --formalized-number-color: #365f66;
}

[data-md-color-scheme="slate"] .latexml-manuscript {
  --formalized-number-color: #8aadb2;
}

.md-typeset .manuscript-title {
  margin-right: auto;
  margin-bottom: 1.5rem;
  margin-left: auto;
  color: var(--md-typeset-color);
  font-family: system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 450;
  line-height: 1.18;
}

.latexml-manuscript .ltx_document {
  color: var(--md-typeset-color);
  font-family: var(--manuscript-serif);
  font-size: 16.5px;
  font-kerning: normal;
  line-height: 1.62;
  max-width: none;
}

.latexml-manuscript .ltx_document a {
  color: var(--md-typeset-a-color);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.12em;
}

.latexml-manuscript .ltx_title_section,
.latexml-manuscript .ltx_title_appendix,
.latexml-manuscript .ltx_title_bibliography {
  margin: 2.55rem 0 1rem;
  padding-bottom: 0.26rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  color: var(--md-typeset-color);
  font-family: system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 730;
  line-height: 1.22;
}

.latexml-manuscript .ltx_title_subsection {
  margin: 1.6rem 0 0.7rem;
  color: var(--md-typeset-color);
  font-family: system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 720;
  line-height: 1.25;
}

.latexml-manuscript .ltx_title_paragraph {
  margin: 1.15rem 0 0.18rem;
  color: var(--md-typeset-color);
  font-family: system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 720;
  line-height: 1.3;
}

.latexml-manuscript .ltx_p {
  margin: 0.78rem 0;
}

.latexml-manuscript .ltx_graphics {
  max-width: 100%;
  height: auto;
}

.latexml-manuscript .manuscript-math-source {
  display: contents;
}

.latexml-manuscript .manuscript-equation-reference mjx-c {
  font-family: var(--manuscript-serif);
  font-style: normal;
}

.latexml-manuscript table.ltx_equation {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.latexml-manuscript table.ltx_equation td {
  background: transparent;
  border: 0;
}

.latexml-manuscript table.ltx_eqn_table tr.ltx_align_baseline > td.ltx_eqn_cell {
  vertical-align: baseline;
}

.latexml-manuscript table.ltx_eqn_table td.ltx_eqn_eqno {
  vertical-align: middle;
}

.latexml-manuscript .ltx_eqn_eqno,
.latexml-manuscript .ltx_tag_equation {
  user-select: none;
  -webkit-user-select: none;
}

.latexml-manuscript .formalized-equation-number {
  color: var(--formalized-number-color);
  cursor: help;
}

.latexml-manuscript .ltx_ref[href^="#S"][href*=".E"] {
  font-family: var(--manuscript-serif);
  font-style: normal;
}

@media screen and (max-width: 44.984375em) {
  .manuscript-title {
    font-size: 1.55rem;
  }

  .latexml-manuscript .ltx_document {
    font-size: 15.5px;
  }
}

/* Manuscript changes use the same colours in prose, math and figures. */
.latexml-manuscript {
  --diff-add: #0b6e2e;
  --diff-del: #b3261e;
}

[data-md-color-scheme="slate"] .latexml-manuscript {
  --diff-add: #85d5a2;
  --diff-del: #ffaaa3;
}

.latexml-manuscript .diff-add {
  color: var(--diff-add) !important;
  background: color-mix(in srgb, var(--diff-add) 12%, transparent);
}

.latexml-manuscript .diff-del {
  color: var(--diff-del) !important;
  background: color-mix(in srgb, var(--diff-del) 12%, transparent);
  text-decoration: line-through;
}

.latexml-manuscript :is(img, object).diff-add {
  outline: 3px solid var(--diff-add);
  outline-offset: 3px;
}

.latexml-manuscript :is(img, object).diff-del {
  outline: 3px solid var(--diff-del);
  outline-offset: 3px;
  opacity: 0.6;
}

/* MathJax retains MathML colours as inline styles. Preserve dark-mode contrast. */
[data-md-color-scheme="slate"] .latexml-manuscript :is([mathcolor="#0B6E2E"], [style*="color: rgb(11, 110, 46)"], [style*="color: #0B6E2E"]) {
  color: var(--diff-add) !important;
}

[data-md-color-scheme="slate"] .latexml-manuscript :is([mathcolor="#B3261E"], [style*="color: rgb(179, 38, 30)"], [style*="color: #B3261E"]) {
  color: var(--diff-del) !important;
}

.latexml-manuscript .manuscript-diff-summary {
  margin-bottom: 2rem;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}
