/* Base readability tweaks */
.md-typeset {
  font-size: 0.78rem;
}

.md-typeset pre,
.md-typeset pre code {
  font-size: 0.72rem;
}

/* Table styling */
.md-typeset__table {
  display: block !important;
  width: fit-content !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.md-typeset table:not([class]) {
  display: table;
  width: auto !important;
  max-width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
  font-size: 0.68rem;
}

.md-typeset table:not([class]) th {
  min-width: 3.5rem;
}

.md-typeset table:not([class]) > thead > tr > th,
.md-typeset table:not([class]) > tbody > tr > td {
  padding: 0.45em 0.55em;
}

/* Long console outputs scroll */
.md-typeset pre {
  overflow-x: auto;
}

/* Equations wider than text column */
.md-typeset .arithmatex {
  overflow-x: auto;
  overflow-y: hidden;
}

/* Footer bottom citation bar (fixed bottom #483D8B) */
.md-footer-meta__inner {
  display: flex !important;
  justify-content: center !important;
  text-align: center !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

.md-copyright {
  color: #ffffff !important;
  width: 100% !important;
  text-align: center !important;
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.25 !important;
  margin: 0 !important;
}

.md-footer-meta {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 100 !important;
  background-color: #483D8B !important;
  padding: 4px 0 !important;
}

.md-main__inner {
  margin-bottom: 50px !important;
}

/* Hide top logo */
.md-header__button.md-logo {
  display: none !important;
}

/* Navigation headers */
.md-nav--primary > label.md-nav__title {
  display: block !important;
  text-align: center !important;
  justify-content: center !important;
  font-size: 0 !important;
}

.md-nav--primary > label.md-nav__title::after {
  content: "Contents";
  display: block !important;
  text-align: center !important;
  font-size: 0.85rem !important;
  font-weight: bold !important;
  color: #483D8B !important;
}

.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link,
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__container > .md-nav__link {
  font-weight: 700;
}

.md-nav--secondary > .md-nav__title {
  display: block !important;
  text-align: center !important;
  justify-content: center !important;
  font-size: 0 !important;
}

.md-nav--secondary > .md-nav__title::after {
  content: "Subparts";
  display: block !important;
  text-align: center !important;
  font-size: 0.85rem !important;
  font-weight: bold !important;
  color: #483D8B !important;
}

.md-typeset .center {
  text-align: center;
}

h1 {
  margin-top: 1.3em !important;
  margin-bottom: 0em !important;
}

mjx-container[jax="CHTML"][display="true"],
mjx-container[display="true"] {
  margin: 0.2em 0 !important;
  padding: 0 !important;
}

.md-sidebar__scrollwrap {
  padding-bottom: 45px !important;
}

/* Command block */
.md-typeset .mw-cmd {
  border: 1px solid #cccccc;
  border-radius: 6px;
  background-color: #f7f7f7;
  padding: 0.55rem 0.8rem;
  margin: 0.8rem 0;
}
.md-typeset .mw-cmd > br {
  line-height: 1.7;
}

/* Yellow highlight */
mark {
  background-color: #ffff00 !important;
  color: #000000 !important;
  padding: 0.1em 0.3em;
  border-radius: 2px;
}

.md-typeset img {
  max-width: 100%;
  height: auto;
}

/* Page top: Previous page / Next page buttons */
.mw-pager {
  display: flex !important;
  gap: 0.5rem !important;
  margin: 0 0 1.1rem !important;
  font-size: 0.68rem !important;
  line-height: 1.35 !important;
}

.mw-pager__link {
  flex: 1 1 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.1rem !important;
  min-width: 0 !important;
  padding: 0.35rem 0.6rem !important;
  border: 1px solid var(--md-default-fg-color--lightest) !important;
  border-radius: 6px !important;
  background-color: var(--md-default-bg-color) !important;
  color: var(--md-default-fg-color) !important;
  text-decoration: none !important;
  transition: border-color 0.15s, background-color 0.15s !important;
}

.mw-pager__link--next {
  text-align: right !important;
}

.mw-pager__link--none {
  visibility: hidden !important;
}

.mw-pager__link:hover {
  border-color: var(--md-accent-fg-color) !important;
  background-color: var(--md-default-fg-color--lightest) !important;
}

.mw-pager__dir {
  font-weight: 700 !important;
  color: var(--md-primary-fg-color) !important;
}

.mw-pager__title {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  opacity: 0.85 !important;
}
