.reader-body {
  --reader-anchor-offset: 6.5rem;
  --reader-sidebar-sticky-top: 6.5rem;
  background: #f3efe7;
  overflow-x: clip;
}

/* The reader manages its own panel/sidebar width; reset the shared textbook
   page wrapper so long chapters cannot inherit landing-page constraints. */
.reader-body #main {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  overflow-x: clip;
}

.reader-body #main,
.reader-body #main *,
.reader-body #main *::before,
.reader-body #main *::after {
  box-sizing: border-box;
}

.book-entry {
  display: grid;
  gap: 1.5rem;
}

.book-entry__hero,
.book-entry__toc {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(28, 24, 19, 0.08);
  border-radius: 1.25rem;
  box-shadow: 0 14px 45px rgba(56, 47, 35, 0.08);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.book-entry__eyebrow {
  margin: 0 0 0.75rem;
  color: #8a5b2d;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.book-entry__title {
  max-width: 28ch;
  margin: 0;
  color: #111827;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
}

.book-entry__lede {
  max-width: 42rem;
  margin: 1.2rem 0 0;
  color: #53627a;
  font-size: 1.08rem;
  line-height: 1.65;
}

.book-entry__toc-header {
  margin-bottom: 1.25rem;
}

.book-entry__section-title {
  margin: 0;
  color: #111827;
  font-size: 1.55rem;
  font-weight: 800;
}

.book-entry__chapter-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-entry__chapter-link {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid rgba(18, 38, 66, 0.12);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  text-decoration: none;
}

.book-entry__chapter-link:hover,
.book-entry__chapter-link:focus-visible {
  border-color: rgba(36, 79, 144, 0.34);
  background: #fff;
}

.book-entry__chapter-order {
  color: #244f90;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.book-entry__chapter-title {
  color: #111827;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}

.book-entry__chapter-summary,
.book-entry__empty {
  color: #63708a;
  font-size: 0.95rem;
  line-height: 1.55;
}

.chapter-pdf-unavailable {
  display: grid;
  min-height: min(36rem, calc(100vh - 12rem));
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem) 0;
}

.chapter-pdf-unavailable__card {
  width: min(100%, 36rem);
  padding: clamp(1.75rem, 5vw, 3rem);
  border: 1px solid rgba(18, 38, 66, 0.12);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 54px rgba(56, 47, 35, 0.12);
  text-align: center;
}

.chapter-pdf-unavailable__icon {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 1.1rem;
  fill: none;
  stroke: #244f90;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.chapter-pdf-unavailable__eyebrow {
  margin: 0 0 0.65rem;
  color: #87613d;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.chapter-pdf-unavailable h1 {
  margin: 0;
  color: #10233f;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.12;
}

.chapter-pdf-unavailable__message {
  max-width: 31rem;
  margin: 1rem auto 0;
  color: #53627a;
  font-size: 1rem;
  line-height: 1.65;
}

.chapter-pdf-unavailable__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.chapter-pdf-unavailable__actions form { margin: 0; }

.chapter-pdf-unavailable__primary,
.chapter-pdf-unavailable__secondary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border: 1px solid #17385f;
  border-radius: 0.65rem;
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.chapter-pdf-unavailable__primary {
  background: #17385f;
  color: #fff;
}

.chapter-pdf-unavailable__primary:hover,
.chapter-pdf-unavailable__primary:focus-visible {
  background: #214a79;
  color: #fff;
}

.chapter-pdf-unavailable__secondary {
  border-color: rgba(23, 56, 95, 0.24);
  background: #fff;
  color: #17385f;
}

.chapter-pdf-unavailable__secondary:hover,
.chapter-pdf-unavailable__secondary:focus-visible {
  background: #f2f5f9;
  color: #17385f;
}

.chapter-pdf-unavailable__footnote {
  margin: 1.25rem 0 0;
  color: #718096;
  font-size: 0.82rem;
  line-height: 1.45;
}

.reader-shell {
  display: grid;
  gap: 2rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: visible;
}

.reader-sidebar,
.reader-panel {
  min-width: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(28, 24, 19, 0.08);
  border-radius: 1.25rem;
  box-shadow: 0 14px 45px rgba(56, 47, 35, 0.08);
  box-sizing: border-box;
}

/* Shared presentation contract: the paid reader and anonymous textbook
   preview both consume the reader sidebar/TOC layout, collapse, scroll-region,
   and fade-state classes below. Preview-specific states remain in
   textbook_preview.css. */
.reader-sidebar {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--reader-sidebar-sticky-top) - 1.5rem);
  padding: 1.5rem;
  /* Match the top inset from the navigation row's outer edge, while keeping
     expanded section content clear of the sidebar's rounded bottom edge. */
  padding-bottom: 1.15rem;
  position: sticky;
  top: var(--reader-sidebar-sticky-top);
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: auto;
  scrollbar-width: none;
}

.reader-sidebar::-webkit-scrollbar {
  display: none;
}

.reader-sidebar::after {
  content: none;
}

.reader-sidebar-header {
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
  margin: -1.5rem -1.5rem 0;
  padding: 1.15rem 1.5rem 0;
  border-radius: 1.25rem 1.25rem 0 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  transition: background-color 180ms ease;
}

.reader-sidebar-header::after {
  content: none;
}

.reader-chapter-switcher.is-open::after {
  opacity: 1;
}

.reader-current-chapter {
  padding: 0.15rem 0 0.9rem;
  border-bottom: 1px solid rgba(28, 24, 19, 0.08);
}

.reader-current-eyebrow {
  margin: 0 0 0.35rem;
  color: #87613d;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-transform: uppercase;
}

.reader-current-title {
  margin: 0;
  color: #10233f;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
}

.reader-print-chapter-control {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  gap: 0.55rem;
  min-height: 2.45rem;
  margin: 0.45rem 0 0 -0.55rem;
  padding: 0.4rem 0.6rem;
  border: 0;
  appearance: none;
  border-radius: 0.55rem;
  background: transparent;
  color: #173b68;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.reader-print-chapter-control:hover {
  background-color: rgba(36, 79, 144, 0.14) !important;
  color: #102f55;
}

.reader-print-chapter-control:focus-visible {
  outline: 2px solid #4776ad;
  outline-offset: 2px;
}

.reader-print-chapter-icon {
  display: block;
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
}

.reader-print-chapter-mobile-note {
  display: none;
}

@media screen and (max-width: 639px) and (pointer: coarse) and (hover: none) {
  .reader-print-chapter-control {
    display: none !important;
  }

  .reader-print-chapter-mobile-note {
    display: block;
    margin: 0.5rem 0 0;
    color: #526176;
    font-size: 0.84rem;
    line-height: 1.45;
  }
}

.reader-chapter-pdf-dialog {
  width: min(calc(100vw - 2rem), 31rem);
  max-width: 31rem;
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(36, 79, 144, 0.18);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.98);
  color: #12233d;
  box-shadow: 0 1.75rem 5rem rgba(10, 28, 52, 0.3);
  color-scheme: light;
}

.reader-chapter-pdf-dialog::backdrop {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.reader-chapter-pdf-dialog form { margin: 0; padding: 1.7rem; background: transparent; }
.reader-chapter-pdf-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem; }
.reader-chapter-pdf-eyebrow { margin: 0 0 0.3rem; color: #8b623f; font-size: 0.76rem; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; }
.reader-chapter-pdf-dialog h2 { margin: 0; color: #10233f; font-size: 1.55rem; line-height: 1.15; }
.reader-chapter-pdf-close { display: inline-grid; flex: 0 0 auto; place-items: center; width: 2.15rem; height: 2.15rem; padding: 0; border: 0; border-radius: 0.6rem; background: transparent; color: #526176; font-size: 1.65rem; line-height: 1; cursor: pointer; }
.reader-chapter-pdf-close:hover { background: rgba(36, 79, 144, 0.08); color: #173b68; }
.reader-chapter-pdf-close:focus-visible { outline: 0; background: rgba(36, 79, 144, 0.08); color: #173b68; box-shadow: inset 0 0 0 1px rgba(36, 79, 144, 0.2); }
.reader-chapter-pdf-intro { margin: 1.15rem 0 0.85rem; color: #526176; font-size: 0.95rem; line-height: 1.5; }
.reader-chapter-pdf-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0; padding: 0; border: 0; }
.reader-chapter-pdf-options legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.reader-chapter-pdf-options label { position: relative; display: flex; align-items: center; gap: 0.65rem; min-height: 4.4rem; padding: 0.85rem 0.95rem; border: 1px solid #ccd6e3; border-radius: 0.75rem; background: #fff; cursor: pointer; transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease; }
.reader-chapter-pdf-options label:hover { border-color: #8ca6c8; background: #f8fafd; }
.reader-chapter-pdf-options label:has(input:checked) { border-color: #244f90; background: #f3f7fc; box-shadow: 0 0 0 1px #244f90; }
.reader-chapter-pdf-options input { width: 1rem; height: 1rem; margin: 0; accent-color: #244f90; }
.reader-chapter-pdf-options span { display: grid; gap: 0.12rem; }
.reader-chapter-pdf-options strong { color: #162a47; font-size: 0.98rem; }
.reader-chapter-pdf-options small { color: #64748b; font-size: 0.78rem; }
.reader-chapter-pdf-note { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 0.82rem; line-height: 1.5; }
.reader-chapter-pdf-note a { color: #244f90; font-weight: 700; text-underline-offset: 0.16em; }
.reader-chapter-pdf-note a:hover { color: #173a68; }
.reader-chapter-pdf-acknowledgement { margin-top: 0.9rem; }
.reader-chapter-pdf-acknowledgement label { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.8rem 0.85rem; border: 1px solid #d7e0eb; border-radius: 0.7rem; background: #f8fafc; color: #334155; font-size: 0.84rem; line-height: 1.45; cursor: pointer; }
.reader-chapter-pdf-acknowledgement label:hover { border-color: #aebed1; background: #f5f8fc; }
.reader-chapter-pdf-acknowledgement input { flex: 0 0 auto; width: 1rem; height: 1rem; margin: 0.08rem 0 0; accent-color: #244f90; }
.reader-chapter-pdf-acknowledgement input:focus-visible { outline: 2px solid #4776ad; outline-offset: 2px; }
.reader-chapter-pdf-acknowledgement input[aria-invalid="true"] { outline: 2px solid #b42318; outline-offset: 2px; }
.reader-chapter-pdf-acknowledgement-error { margin: 0.45rem 0 0; color: #9f2d20; font-size: 0.78rem; line-height: 1.4; }
.reader-chapter-pdf-actions { display: flex; justify-content: flex-end; gap: 0.7rem; margin-top: 1.35rem; }
.reader-chapter-pdf-actions button { min-height: 2.7rem; padding: 0 1rem; border-radius: 0.65rem; font: inherit; font-size: 0.88rem; font-weight: 700; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.reader-chapter-pdf-cancel { border: 1px solid #cbd5e1; background: #fff; color: #244f90; }
.reader-chapter-pdf-cancel:hover { background: #f5f7fa; border-color: #aab8ca; }
.reader-chapter-pdf-submit { border: 1px solid #173a68; background: #173a68; color: #fff; }
.reader-chapter-pdf-submit:hover { border-color: #102f55; background: #102f55; }
.reader-chapter-pdf-submit:disabled { cursor: wait; opacity: 0.68; }
.reader-chapter-pdf-submit[data-reader-chapter-pdf-open]:disabled { border-color: #d4dce7; background: #dbe2eb; color: #8795a8; cursor: not-allowed; opacity: 1; }
.reader-chapter-pdf-error .reader-chapter-pdf-intro { margin-bottom: 0; }
.reader-chapter-pdf-support { margin: 1rem 0 0; color: #64748b; font-size: 0.82rem; line-height: 1.5; text-align: right; }
.reader-chapter-pdf-support a { color: #244f90; font-weight: 700; text-underline-offset: 0.16em; }
.reader-chapter-pdf-support a:hover { color: #173a68; }

@media (max-width: 34rem) {
  .reader-chapter-pdf-dialog form { padding: 1.3rem; }
  .reader-chapter-pdf-options { grid-template-columns: 1fr; }
  .reader-chapter-pdf-actions { flex-direction: column-reverse; }
  .reader-chapter-pdf-actions button { width: 100%; }
  .reader-chapter-pdf-support { text-align: center; }
}

.reader-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a5b2d;
}

.reader-book-title {
  margin: 0;
  padding-bottom: 0.6rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1e2533;
}

.reader-book-title::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 0.65rem;
  background: linear-gradient(to right, rgba(28, 24, 19, 0.08), rgba(28, 24, 19, 0.02));
}

.reader-chapter-title {
  margin: 0.55rem 0 0;
  font-size: 1rem;
  line-height: 1.35;
  color: #244f90;
}

.reader-chapter-switcher {
  position: relative;
  margin-top: 0.65rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(28, 24, 19, 0.08);
}

.reader-chapter-switcher::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.85rem;
  height: 1.85rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.8) 45%, rgba(255, 255, 255, 0));
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 160ms ease;
}

.reader-chapter-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #244f90;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  text-align: left;
}

.reader-chapter-trigger:hover {
  color: #173f78;
}

.reader-switcher-caret {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
  transition: transform 160ms ease;
}

.reader-chapter-switcher.is-open .reader-switcher-caret {
  transform: translateY(0.12rem) rotate(225deg);
}

.reader-chapter-popover {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  padding: 0 0.45rem;
  border-radius: 0.7rem;
  background: transparent;
  opacity: 0;
  scrollbar-width: none;
  transition: max-height 220ms ease, margin-top 200ms ease, padding 200ms ease, opacity 160ms ease, background-color 160ms ease;
}

.reader-chapter-popover::-webkit-scrollbar {
  display: none;
}

.reader-chapter-switcher.is-open .reader-chapter-popover {
  max-height: calc(100vh - var(--reader-sidebar-sticky-top) - 16rem);
  margin-top: 0.45rem;
  padding: 0.25rem 0.35rem 0.5rem;
  background: rgba(255, 255, 255, 0.52);
  opacity: 1;
  overflow-y: auto;
}

.reader-chapter-list {
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 0;
}

.reader-chapter-list li + li {
  margin-top: 0.25rem;
}

.reader-chapter-list a {
  display: grid;
  gap: 0.12rem;
  padding: 0.62rem 0.7rem;
  border-radius: 0.5rem;
  color: #37322c;
  text-decoration: none;
  background: transparent;
  transition: color 160ms ease, background-color 160ms ease;
}

.reader-chapter-list a:not(.is-current):hover {
  color: #244f90;
  background: rgba(36, 79, 144, 0.08);
}

.reader-chapter-list a.is-current {
  color: #173f78;
  background: #f0f7ff;
}

.reader-chapter-list-order {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a5b2d;
}

.reader-chapter-list-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.reader-chapter-list a.is-current .reader-chapter-list-title {
  font-weight: 700;
}

.reader-nav-group summary,
.reader-nav-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: 0.45rem;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.45rem 0;
  color: #87613d;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  list-style: none;
  text-transform: uppercase;
}

.reader-nav-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
}

.reader-nav-group summary::-webkit-details-marker {
  display: none;
}

.reader-nav-group[open] .reader-toc-caret,
.reader-nav-group.is-open .reader-toc-caret {
  transform: rotate(225deg);
}

.reader-nav-group .reader-toc-caret {
  justify-self: center;
}

.reader-nav-group--chapters {
  margin-top: 0;
  border-bottom: 1px solid rgba(28, 24, 19, 0.08);
}

.reader-toc ul {
  margin-top: 0.6rem;
}

.reader-nav-group--chapters:not(.is-open) [data-reader-sidebar-chapter-scroll-region] {
  display: none;
}

.reader-chapter-scroll-region {
  position: relative;
  min-height: 0;
}

/* The desktop sidebar itself stays fixed so the current chapter and section
   navigation remain available. Constrain only the expanded All chapters list
   so longer books keep native wheel/trackpad scrolling inside that list. */
.reader-sidebar [data-reader-sidebar-chapter-scroll] {
  max-height: min(18rem, calc(100vh - var(--reader-sidebar-sticky-top) - 13.75rem));
  overflow-y: auto;
  overscroll-behavior: auto;
  scrollbar-width: none;
}

.reader-sidebar [data-reader-sidebar-chapter-scroll]::-webkit-scrollbar {
  display: none;
}

.reader-sidebar.is-chapter-menu-open .reader-sidebar-header {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.reader-sidebar.is-chapter-menu-open {
  padding-bottom: 0.65rem;
}

.reader-sidebar.is-chapter-menu-open .reader-nav-group--chapters {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.reader-sidebar.is-chapter-menu-open [data-reader-sidebar-chapter-scroll] {
  height: 100%;
  max-height: none;
}

.reader-sidebar.is-chapter-menu-open [data-reader-sidebar-chapter-scroll-region] {
  flex: 1 1 auto;
  min-height: 0;
}

.reader-section-navigation {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  padding: 0;
  min-height: 0;
}

.reader-section-navigation:not(.is-open) {
  flex: 0 0 auto;
  padding-bottom: 0;
}

.reader-section-navigation.is-open .reader-toc-caret {
  transform: rotate(225deg);
}

.reader-section-navigation .reader-toc-caret {
  justify-self: center;
}

.reader-section-navigation:not(.is-open) .reader-toc-scroll-region {
  display: none;
}

.reader-toc-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  align-items: center;
  flex: 0 0 auto;
  min-height: 2.8rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0;
  border: 0;
  background: transparent;
  color: #87613d;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-align: left;
  text-transform: uppercase;
}

.reader-toc-scroll-region {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.reader-toc {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 0 0.2rem;
  overflow-y: auto;
  overscroll-behavior: auto;
  scrollbar-width: none;
}

/* Fade the scroll content itself instead of painting white overlays above it.
   This preserves the compact closed-state spacing while giving both scroll
   edges the same 2.75rem fade treatment. */
.reader-toc,
.reader-sidebar [data-reader-sidebar-chapter-scroll] {
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.reader-toc-scroll-region.has-overflow.is-scrolled-before-end:not(.is-scrolled-from-top) > .reader-toc,
.reader-chapter-scroll-region.has-overflow.is-scrolled-before-end:not(.is-scrolled-from-top) > [data-reader-sidebar-chapter-scroll] {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 2.75rem), rgba(0, 0, 0, 0.58) calc(100% - 1.925rem), rgba(0, 0, 0, 0.18) calc(100% - 0.935rem), rgba(0, 0, 0, 0.08) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 2.75rem), rgba(0, 0, 0, 0.58) calc(100% - 1.925rem), rgba(0, 0, 0, 0.18) calc(100% - 0.935rem), rgba(0, 0, 0, 0.08) 100%);
}

.reader-toc-scroll-region.has-overflow.is-scrolled-from-top:not(.is-scrolled-before-end) > .reader-toc,
.reader-chapter-scroll-region.has-overflow.is-scrolled-from-top:not(.is-scrolled-before-end) > [data-reader-sidebar-chapter-scroll] {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 0.935rem, rgba(0, 0, 0, 0.58) 1.925rem, #000 2.75rem, #000 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 0.935rem, rgba(0, 0, 0, 0.58) 1.925rem, #000 2.75rem, #000 100%);
}

.reader-toc-scroll-region.has-overflow.is-scrolled-from-top.is-scrolled-before-end > .reader-toc,
.reader-chapter-scroll-region.has-overflow.is-scrolled-from-top.is-scrolled-before-end > [data-reader-sidebar-chapter-scroll] {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 0.935rem, rgba(0, 0, 0, 0.58) 1.925rem, #000 2.75rem, #000 calc(100% - 2.75rem), rgba(0, 0, 0, 0.58) calc(100% - 1.925rem), rgba(0, 0, 0, 0.18) calc(100% - 0.935rem), rgba(0, 0, 0, 0.08) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 0.935rem, rgba(0, 0, 0, 0.58) 1.925rem, #000 2.75rem, #000 calc(100% - 2.75rem), rgba(0, 0, 0, 0.58) calc(100% - 1.925rem), rgba(0, 0, 0, 0.18) calc(100% - 0.935rem), rgba(0, 0, 0, 0.08) 100%);
}

.reader-toc::-webkit-scrollbar {
  display: none;
}

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

.reader-toc li + li {
  margin-top: 0.45rem;
}

.reader-toc a {
  color: #2f2a24;
  text-decoration: none;
  display: block;
  padding: 0.2rem 0.35rem 0.2rem 0.55rem;
  border-left: 2px solid transparent;
  border-radius: 0.45rem;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.reader-toc a:hover {
  color: #244f90;
  background: rgba(36, 79, 144, 0.08);
}

.reader-toc a.is-active {
  border-left-color: #244f90;
  color: #173f78;
  font-weight: 700;
  background: transparent;
}

.reader-panel {
  position: relative;
  overflow: visible;
  width: 100%;
  max-width: 100%;
}

.reader-mobile-bar,
.reader-drawer {
  display: none;
}

.reader-mobile-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #3f7fc3;
}

.reader-toc-mobile {
  display: none;
}

.reader-toc-mobile summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  padding: 0.15rem 0;
}

.reader-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.reader-toc-mobile-summary {
  position: relative;
  justify-content: center;
}

.reader-toc-mobile-label {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #3f7fc3;
}

.reader-toc-caret {
  display: inline-block;
  justify-self: end;
  width: 0.8rem;
  height: 0.8rem;
  border-right: 2px solid #244f90;
  border-bottom: 2px solid #244f90;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.reader-toc-mobile[open] .reader-toc-caret {
  transform: rotate(225deg);
}

.reader-toc-mobile nav {
  margin-top: 0.9rem;
}

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

.reader-toc-mobile li + li {
  margin-top: 0.45rem;
}

.reader-watermark {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  user-select: none;
  overflow: hidden;
}

.reader-watermark-screen {
  left: 0;
  right: 0;
}

/* A document-length foreground SVG keeps coverage independent of chapter
   length, without relying on background-image printing. */
.reader-watermark-pattern {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: rgba(220, 0, 0, 0.22);
  opacity: 0.62;
}

/* Identity typography is explicit on the SVG text nodes so <use> copies
   do not depend on descendant selector inheritance across browser engines. */

.reader-native-print-blocker {
  display: none;
}

.reader-content {
  position: relative;
  z-index: 1;
  min-width: 0;
  container-name: reader-content;
  container-type: inline-size;
  width: 100%;
  /* The reading measure expands with the desktop viewport, while retaining a
     bounded line length for sustained reading. */
  max-width: min(100%, clamp(52rem, 66vw, 60rem));
  margin: 0 auto;
  padding: 2rem 1.5rem 2.75rem;
  line-height: 1.65;
  color: #1f1b17;
  overflow-wrap: break-word;
}

.reader-content > :first-child {
  margin-top: 0;
}

.reader-content h1,
.reader-content h2,
.reader-content h3,
.reader-content h4 {
  /* Keep section hash targets clear of the sticky reader header/navigation. */
  scroll-margin-top: var(--reader-anchor-offset);
  line-height: 1.25;
  font-family: inherit;
}

.reader-content h1 {
  margin: 0 auto 0.95rem;
  padding: 0 0 0.85rem;
  max-width: 58rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #5a92cf;
  border: none;
  border-bottom: 2px solid rgba(36, 79, 144, 0.9);
}

.reader-content h2 {
  margin: 1.9rem 0 0.9rem;
  padding: 0;
  max-width: none;
  text-align: left;
  font-size: 1.6875rem;
  font-weight: 700;
  color: #233959;
  border: none;
}

.reader-content h1 + h2 {
  margin: 0 auto 1.15rem;
  padding: 0 0 0.9rem;
  max-width: 54rem;
  text-align: center;
  font-size: 2.25rem;
  line-height: 1.15;
  border-top: none;
  border-bottom: 2px solid rgba(36, 79, 144, 0.9);
}

/* Keep the paid reader's chapter heading and rules aligned with its prose. */
.reader-body .reader-content h1,
.reader-body .reader-content h1 + h2 {
  max-width: none;
}

.reader-content h3 {
  margin: 1.85rem 0 0.85rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: #4273b1;
}

.reader-content h4 {
  margin: 1.3rem 0 0.7rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: #233959;
}

/* Reusable compact heading for labels that name a complete figure or subfigure. */
.reader-content .figure-label-header {
  margin: 0;
  color: #1F2937;
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.25;
}

.reader-content p {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
}

.reader-content strong {
  font-weight: 600;
}

.reader-content ul,
.reader-content ol {
  margin: 0 0 1.25rem 1.75rem;
  padding-left: 1.35rem;
  list-style-position: outside !important;
}

.reader-content ul {
  list-style-type: disc !important;
}

.reader-content ol {
  list-style-type: decimal !important;
}

.reader-content li {
  display: list-item !important;
  margin: 0.35rem 0;
}

.reader-content li::marker {
  color: #1f1b17;
}

.reader-content li > p {
  margin-bottom: 0.25rem;
}

.reader-content .textbook-callout {
  margin: 1.25rem 0 1.5rem;
  padding: 1.25rem 1.45rem;
  border: 1px solid rgba(28, 24, 19, 0.12);
  background: #fdfaf4;
}

.reader-content .textbook-callout p {
  margin-bottom: 0.85rem;
}

/* The two cream callouts end in a paragraph or a list. Remove the final
   content margin so their bottom inset matches the top inset in the reader. */
.reader-body .reader-content .textbook-callout > :last-child,
.reader-body .reader-content .textbook-callout > :last-child > li:last-child {
  margin-bottom: 0;
}

.reader-content .textbook-callout ul {
  margin: 0 0 0 1.45rem;
  padding-left: 1.1rem;
}

.reader-content .textbook-callout li {
  margin: 0.45rem 0;
}

.reader-content img {
  display: block;
  width: auto;
  max-width: min(100%, 34rem);
  height: auto;
  margin: 1.25rem auto 0.5rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.reader-content .figure-panel-row {
  display: grid;
  width: min(100%, 50rem);
  gap: clamp(0.35rem, 2vw, 1rem);
  align-items: end;
  margin: 1.25rem auto 0.5rem;
}

.reader-content .figure-panel-row--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 38rem;
}

.reader-content .figure-panel-row--detail {
  max-width: 32.4rem;
}

/* Chapter 03 Figure 7: the fixed-width liner images are centered in equal grid
   panels, so their visible separation is controlled primarily by row width.
   This desktop cap makes the image-edge gap two-thirds of its prior value. */
@media (min-width: 761px) {
  .reader-content .figure-panel-row--ch03-liners {
    max-width: 25.018519rem;
    gap: clamp(0.155556rem, 0.888889vw, 0.444445rem);
  }
}

.reader-content .figure-panel-row--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reader-content .figure-panel-row--ch06-alignment {
  width: min(100%, 54rem);
  align-items: stretch;
  gap: clamp(0.5rem, 2vw, 1.25rem);
}

.reader-content .figure-panel-row__panel--ch06-alignment {
  display: grid;
  grid-template-rows: 20rem auto 1fr;
  min-width: 0;
  text-align: center;
}

.reader-content .figure-panel-row__panel--ch06-alignment .figure-panel-row__media {
  display: grid;
  align-items: end;
  justify-items: center;
  min-width: 0;
}

.reader-content .figure-panel-row__panel--ch06-alignment img {
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Measured lower-shoe spans after the current display composition are A=526px,
   B=534px, and C=534px. Scale each canvas from those visible-artwork widths. */
.reader-content .figure-panel-row--ch06-alignment img.figure-panel-row__image--ch06-posterior {
  width: 100%;
}

.reader-content .figure-panel-row--ch06-alignment img.figure-panel-row__image--ch06-anterior {
  width: 90.71%;
}

.reader-content .figure-panel-row--ch06-alignment img.figure-panel-row__image--ch06-socket-flexion {
  width: 86.82%;
}

/* Align the measured visible shoe bottoms, not just the unequal WebP canvases.
   Percent margins resolve from the shared panel width, so the correction scales
   with the three-column layout. */
@media (min-width: 761px) {
  .reader-content .figure-panel-row--ch06-alignment img.figure-panel-row__image--ch06-anterior {
    margin-bottom: -2.9%;
  }

  .reader-content .figure-panel-row--ch06-alignment img.figure-panel-row__image--ch06-socket-flexion {
    margin-bottom: 6.5%;
  }
}

.reader-content .figure-panel-row__panel--ch06-alignment h4,
.reader-content .figure-panel-row__panel--ch06-alignment p {
  margin: 0;
}

.reader-content .figure-panel-row__panel--ch06-alignment h4 {
  margin-top: -0.4rem;
  color: #1F2937;
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.05;
}

.reader-content .figure-panel-row--ch06-alignment-titles-only .figure-panel-row__panel--ch06-alignment {
  grid-template-rows: 20rem auto;
}

.reader-content .figure-panel-row__panel--ch06-alignment p {
  margin-top: 0.12rem;
  color: #1e2533;
  font-size: clamp(0.75rem, 1.7vw, 0.91rem);
  line-height: 1.35;
}

/*
 * Chapter 05 Figure 1 — base of support.
 *
 * v2 derives a matched display set from the approved v1 canvases. Conservative
 * measured artwork bounds receive an equal 3% intrinsic buffer: left 602×508,
 * center 706×810, and skeleton 386×1112. Each image therefore has its own
 * content-sized canvas rather than contributing unused source whitespace.
 */
.reader-content .figure-panel-row--base-of-support {
  /* Measured desktop canvas widths: 01-01 is 6% above its initial scale. */
  --bos-left-canvas-width: 10.67336rem;
  --bos-center-canvas-width: 12.51726rem; /* 10.67336rem × 706/602. */
  --bos-skeleton-canvas-width: 8.34761rem;
  --bos-visible-gap: 4.75rem; /* 76px at the 16px root token. */
  width: min(100%, 55rem);
  grid-template-columns: var(--bos-left-canvas-width) var(--bos-center-canvas-width) var(--bos-skeleton-canvas-width);
  column-gap: var(--bos-visible-gap);
  justify-content: center;
  align-items: end;
}

.reader-content .figure-panel-row img {
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.reader-content .figure-panel-row--base-of-support .figure-panel-row__panel {
  display: grid;
  min-width: 0;
  align-items: end;
  justify-items: center;
}

.reader-content .figure-panel-row--base-of-support .figure-panel-row__image--base-left {
  width: 100%;
}

.reader-content .figure-panel-row--base-of-support .figure-panel-row__image--base-center {
  width: 100%;
}

.reader-content .figure-panel-row--base-of-support .figure-panel-row__image--base-skeleton {
  width: 100%;
}

.reader-content .figure-panel-row--base-of-support .figure-panel-row__canvas--base-skeleton {
  position: relative;
  width: 100%;
}

.reader-content .figure-panel-row--base-of-support .figure-panel-row__canvas--base-skeleton .figure-panel-row__image--base-skeleton,
.reader-content .figure-panel-row--base-of-support .figure-panel-row__geometry--base-skeleton {
  display: block;
  width: 100%;
  height: auto;
}

.reader-content .figure-panel-row--base-of-support .figure-panel-row__geometry--base-skeleton {
  position: absolute;
  inset: 0;
}

.reader-content .figure-panel-row--base-of-support .figure-panel-row__geometry--base-skeleton-mobile {
  display: none;
}

@media (min-width: 761px) {
  /* Shared image bottom edge for the square left/center and portrait right canvases. */
  .reader-content .figure-panel-row--base-of-support > .figure-panel-row__panel {
    align-self: end;
  }
}

@media (max-width: 760px) {
  /*
   * Keep the three content-sized v2 panels inside the reader on one mobile row.
   */
  .reader-content .figure-panel-row--base-of-support {
    width: 100%;
    max-width: 100%;
    /* Override the shared 1.25rem figure separation for this compact row. */
    margin-top: 0.5rem;
    margin-left: 0;
    margin-right: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

  .reader-content .figure-panel-row--base-of-support .figure-panel-row__image--base-left {
    /* Halfway between the prior mobile scale and the desktop-relative scale. */
    width: 81.23%;
  }

  .reader-content .figure-panel-row--base-of-support .figure-panel-row__image--base-center {
    /* Halfway between the prior mobile scale and the desktop-relative scale. */
    width: 95.232%;
  }

  .reader-content .figure-panel-row--base-of-support .figure-panel-row__image--base-skeleton {
    width: 100%;
  }

  .reader-content .figure-panel-row--base-of-support .figure-panel-row__canvas--base-skeleton {
    /* 5% larger than the prior 72% mobile skeleton. */
    width: 75.6%;
    /* Equalize the visible outer left/right whitespace of the three-panel row. */
    transform: translateX(-16%);
    /* Align the measured visible skeleton bottom with the two base panels. */
    margin-bottom: -4%;
  }

  .reader-content .figure-panel-row--base-of-support .figure-panel-row__geometry--base-skeleton-desktop {
    display: none;
  }

  .reader-content .figure-panel-row--base-of-support .figure-panel-row__geometry--base-skeleton-mobile {
    display: block;
  }
}

/* Chapter 06 Figure 4: paired prosthetic/skeletal views for pylon placement,
   then single prosthetic views for angulation. A shared media height preserves
   comparable prosthetic scale despite the unequal source canvases. */
.reader-content .figure-panel-row--ch06-coronal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 54rem);
  align-items: stretch;
  gap: 1.75rem clamp(0.75rem, 3vw, 2rem);
}

.reader-content .figure-panel-row__panel--ch06-coronal {
  display: grid;
  grid-template-rows: 20rem auto 1fr;
  min-width: 0;
  text-align: center;
}

.reader-content .figure-panel-row__media--ch06-coronal {
  display: grid;
  align-items: end;
  justify-items: center;
  min-width: 0;
}

.reader-content .figure-panel-row__media--ch06-coronal-pair {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  column-gap: clamp(0.25rem, 1vw, 0.55rem);
}

.reader-content .figure-panel-row--ch06-coronal .figure-panel-row__media--ch06-coronal > img {
  width: auto;
  max-width: 100%;
  max-height: 20rem;
  height: auto;
  object-fit: contain;
}

.reader-content .figure-panel-row__panel--ch06-coronal h4,
.reader-content .figure-panel-row__panel--ch06-coronal p {
  margin: 0;
}

.reader-content .figure-panel-row__panel--ch06-coronal h4 {
  margin-top: -0.2rem;
  color: #1F2937;
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.05;
}

.reader-content .figure-panel-row__panel--ch06-coronal p {
  margin-top: 0.12rem;
  color: #1e2533;
  font-size: clamp(0.75rem, 1.7vw, 0.91rem);
  line-height: 1.35;
}

@media (max-width: 760px) {
  .reader-content .figure-panel-row--ch06-alignment {
    grid-template-columns: 1fr;
    width: min(100%, 22rem);
  }

  .reader-content .figure-panel-row__panel--ch06-alignment {
    /* Portrait figure canvases exceed 22rem at this width. Let the media row
       take its image height so embedded labels clear the panel heading. */
    grid-template-rows: auto auto auto;
  }

  /* On the one-column layout, pull the description into the white canvas
     buffer below the embedded lever labels without overlapping the artwork. */
  .reader-content .figure-panel-row__panel--ch06-alignment h4 {
    margin-top: -1.4rem;
    font-size: 16px;
  }

  .reader-content .figure-panel-row--ch06-alignment-titles-only .figure-panel-row__panel--ch06-alignment {
    grid-template-rows: auto auto;
  }

  .reader-content .figure-panel-row--ch06-coronal {
    grid-template-columns: 1fr;
    width: min(100%, 22rem);
    gap: 1.25rem;
  }

  .reader-content .figure-panel-row__panel--ch06-coronal {
    grid-template-rows: 16rem auto auto;
  }

  .reader-content .figure-panel-row--ch06-coronal .figure-panel-row__media--ch06-coronal > img {
    max-height: 16rem;
  }
}

.reader-content .figure-comparison,
.reader-content .figure-composite {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.25rem auto 0.5rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.reader-content .figure-single {
  display: block;
  width: auto;
  max-width: min(100%, 34rem);
  height: auto;
  margin: 1.25rem auto 0.5rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.reader-content .figure-single--diagram {
  max-width: min(100%, 9rem);
}

.reader-content .figure-single--ch06-tka-line {
  max-width: min(100%, 17rem);
}

.reader-content .figure-single--component-detail {
  max-width: min(100%, 24rem);
}

.reader-content .figure-single--terminal-device {
  max-width: min(100%, 14.5rem);
}

/* Split derivatives with a 3% buffer are a measured pair at every
 * viewport. Flex-end alignment keeps the sleeve and prosthesis artwork on
 * one baseline without altering either asset. */

.reader-content .ch03-fig09-mobile-pair {
  display: flex;
  width: min(100%, 26rem);
  margin: 1.25rem auto 0.25rem;
  align-items: flex-end;
  justify-content: center;
  gap: 17.287%;
}

.reader-content .ch03-fig09-mobile-pair__panel {
  display: block;
}

.reader-content .ch03-fig09-mobile-pair__panel > img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  max-width: none;
}

.reader-content .ch03-fig09-mobile-pair__panel--sleeve {
  flex: 0 0 15.16%;
  /* Measured against the right artwork's visible ground/contact boundary:
   * the sleeve artwork reaches 30px lower after canvas-end alignment.  This
   * 3.125rem compensation aligns visible artwork bottoms only; it does not
   * alter either immutable raster or the caption position. */
  margin-bottom: 3.125rem;
}

.reader-content .ch03-fig09-mobile-pair__panel--prosthesis {
  flex: 0 0 45.21%;
}

.reader-content .textbook-figure {
  width: min(100%, 54rem);
  margin: 1.5rem auto;
  color: #1e2533;
}

/* A Markdown directive such as `{{ textbook_figure:ch01-fig-01 | 22rem }}`
   sets this validated rem-only custom property. It scales the responsive
   artwork/container only; component live labels keep their fixed CSS-pixel
   size and percentage-based measured landmarks. The extra selector specificity
   deliberately overrides a fragment's default width without changing it. */
.reader-content .textbook-figure-width-override .textbook-figure,
.reader-content .textbook-figure-width-override .figure-panel-row {
  width: min(100%, var(--textbook-figure-width));
}

.reader-content .textbook-figure figcaption {
  width: 100%;
  margin-top: 0.35rem;
  color: #5e5448;
  font-size: 15px;
  font-style: italic;
  line-height: 1.55;
}

.reader-content .figure-single--myoelectric-hand {
  max-width: min(100%, 20rem);
}

.reader-content .figure-single--small-source {
  max-width: min(100%, 18rem);
}

/* Retain manufacturer photo pixels while letting an otherwise white studio
   canvas transition softly into the translucent reader panel. The fade begins
   inside the empty outer presentation buffer; do not use on artwork that
   reaches its canvas edge. */
.reader-content .figure-single--photo-edge-fade {
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}

/* A source-bound crop has a smaller left/top buffer. End the fade before its
   visible artwork rather than using the standard 7% presentation-buffer fade. */
.reader-content .figure-single--photo-edge-fade-source-bound {
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.12) 1.25%, rgba(0, 0, 0, 0.42) 3%, rgba(0, 0, 0, 0.76) 5.25%, #000 7%, #000 93%, rgba(0, 0, 0, 0.76) 94.75%, rgba(0, 0, 0, 0.42) 97%, rgba(0, 0, 0, 0.12) 98.75%, transparent 100%),
    linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.12) 1.25%, rgba(0, 0, 0, 0.42) 3%, rgba(0, 0, 0, 0.76) 5.25%, #000 7%, #000 93%, rgba(0, 0, 0, 0.76) 94.75%, rgba(0, 0, 0, 0.42) 97%, rgba(0, 0, 0, 0.12) 98.75%, transparent 100%);
  mask-image:
    linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.12) 1.25%, rgba(0, 0, 0, 0.42) 3%, rgba(0, 0, 0, 0.76) 5.25%, #000 7%, #000 93%, rgba(0, 0, 0, 0.76) 94.75%, rgba(0, 0, 0, 0.42) 97%, rgba(0, 0, 0, 0.12) 98.75%, transparent 100%),
    linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.12) 1.25%, rgba(0, 0, 0, 0.42) 3%, rgba(0, 0, 0, 0.76) 5.25%, #000 7%, #000 93%, rgba(0, 0, 0, 0.76) 94.75%, rgba(0, 0, 0, 0.42) 97%, rgba(0, 0, 0, 0.12) 98.75%, transparent 100%);
}

.reader-content .figure-single--ch01-lower-levels {
  max-width: min(100%, 32.5rem);
}

.reader-content .figure-single--ch01-upper-levels {
  max-width: min(100%, 46rem);
}

.reader-content .figure-single--gait-photo {
  width: min(100%, 15rem);
  max-width: none;
}

/* Markdown figures render as an image-only paragraph followed by an italic
   caption paragraph. Keep that pair visually connected without tightening
   ordinary image/content spacing elsewhere in the chapter. */
.reader-content p:has(> img:only-child):has(+ p > em:only-child) {
  margin-bottom: 0.25rem;
}

.reader-content p:has(> img:only-child):has(+ p > em:only-child) > img:only-child {
  margin-bottom: 0;
}

.reader-content .figure-panel-row:has(+ p > em:only-child),
.reader-content .figure-comparison:has(+ p > em:only-child),
.reader-content .figure-composite:has(+ p > em:only-child),
.reader-content .textbook-figure:has(+ p > em:only-child) {
  margin-bottom: 0.25rem;
}

/* The Figure 3 explanation block ends at the panel edge, unlike Figure 2's
   image canvas. Give its Markdown caption the same visual breathing room. */
.reader-content .figure-panel-row--ch06-alignment:has(+ p > em:only-child),
.reader-content .figure-panel-row--ch06-coronal:has(+ p > em:only-child) {
  margin-bottom: 1.5rem;
}

.reader-content .figure-comparison {
  max-width: min(100%, 32rem);
}

.reader-content .figure-composite--wide {
  max-width: min(100%, 48rem);
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.reader-content p em:only-child {
  color: #5e5448;
  font-size: 15px;
  line-height: 1.55;
}

.reader-content .reader-table-scroll {
  width: 100%;
  max-width: 100%;
}

.reader-content table {
  display: table;
  width: fit-content;
  max-width: 100%;
  table-layout: auto;
  overflow-x: visible;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: rgba(255, 255, 255, 0.8);
}

/* Markdown table captions are italic-only paragraphs immediately following
   their table. Keep the pair together without changing ordinary table spacing. */
.reader-content table:has(+ p > em:only-child) {
  margin-bottom: 0.25rem;
}

.reader-content .reader-table-scroll:has(+ p > em:only-child) table {
  margin-bottom: 0.25rem;
}

/* Supplementary table abbreviations are subordinate to the 15px italic
 * caption: upright, compact, and neutral while remaining readable. */
.reader-content p:has(> em:only-child):has(+ p.table-abbreviation-note) {
  margin-bottom: 0.375rem;
}

.reader-content p.table-abbreviation-note {
  margin: 0 0 2.5rem;
  color: #6B6B6B;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
}

.reader-content th,
.reader-content td {
  padding: 0.85rem;
  padding-left: 16px;
  border: 1px solid rgba(28, 24, 19, 0.12);
  text-align: left;
  vertical-align: top;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.reader-content tbody td {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.reader-content thead th {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  text-align: left;
  vertical-align: middle;
  font-weight: 600;
  line-height: 1.35;
  background: #f3ede1;
}

/* Reader-wide table hierarchy: a restrained outer perimeter frames the
 * standard inner grid without changing cell rhythm. */
.reader-content table {
  border: 1px solid rgba(28, 24, 19, 0.16);
}

.reader-content table > thead > tr:first-child > th {
  border-top-color: rgba(28, 24, 19, 0.16);
}

.reader-content table > thead > tr > th:first-child,
.reader-content table > tbody > tr > td:first-child {
  border-left-color: rgba(28, 24, 19, 0.16);
}

.reader-content table tr > :last-child {
  border-right-color: rgba(28, 24, 19, 0.16);
}

.reader-content table > tbody > tr:last-child > td {
  border-bottom-color: rgba(28, 24, 19, 0.16);
}

.reader-content .table-cell--numeric {
  text-align: center;
}

.reader-content .table-nowrap {
  white-space: nowrap;
}

.reader-content .reader-table--ch04-comparison th:first-child,
.reader-content .reader-table--ch04-comparison td:first-child {
  width: 22%;
  white-space: nowrap;
}

/* Multi-row manufacturer groups retain the standard internal table rule;
 * explicit manufacturer starts and ends own the stronger, same-width divider. */
.reader-content .reader-table--ch04-partial-hand-manufacturers tbody tr.table-row--continuation > td:first-child {
  border-left-color: rgba(28, 24, 19, 0.12);
}

.reader-content .reader-table--ch04-partial-hand-manufacturers tbody tr.table-row--manufacturer-start > td {
  border-top: 1px solid rgba(28, 24, 19, 0.18);
}

.reader-content .reader-table--ch04-partial-hand-manufacturers tbody tr.table-row--manufacturer-end > td,
.reader-content .reader-table--ch04-partial-hand-manufacturers tbody td[rowspan] {
  border-bottom: 1px solid rgba(28, 24, 19, 0.18);
}

.reader-content .reader-table--ch06-alignment th:nth-child(-n + 2),
.reader-content .reader-table--ch06-alignment td:first-child {
  white-space: nowrap;
}

/* Chapter 5 Table 4 keeps its source/PDF separators on larger screens. */
.reader-content .reader-table--gait-muscle-activation .reader-muscle-mobile-break {
  display: none;
}

/* Model breaks are a phone reading aid; desktop keeps the authored line. */
.reader-content .reader-model-mobile-break {
  display: none;
}

.reader-content .reader-mobile-header-break {
  display: none;
}

.reader-content .reader-mobile-header-label {
  display: none;
}

.reader-content .reader-mobile-note-break {
  display: none;
}

.reader-page-nav {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 40%);
  justify-content: space-between;
  gap: 0.5rem;
  max-width: min(100%, clamp(52rem, 66vw, 60rem));
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
}

.reader-page-nav-link {
  position: relative;
  display: grid;
  gap: 0.22rem;
  align-content: start;
  align-self: stretch;
  min-width: 0;
  width: 100%;
  padding: 0.6rem 0.5rem;
  border-radius: 0.5rem;
  background: transparent;
  color: #1e2533;
  text-decoration: none;
  transition: background-color 160ms ease;
}

.reader-page-nav-link:hover,
.reader-page-nav-link:focus-visible {
  background: rgba(36, 79, 144, 0.055);
}

.reader-page-nav-link:focus-visible {
  outline: 2px solid #244f90;
  outline-offset: 2px;
}

.reader-page-nav-next {
  grid-column: 2;
  justify-self: end;
  text-align: right;
}

.reader-page-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-transform: uppercase;
  color: #87613d;
  white-space: nowrap;
}

.reader-page-nav-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  color: #244f90;
}

.reader-page-nav.is-condensed {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reader-page-nav.is-condensed .reader-page-nav-title {
  display: block;
  min-width: 0;
  width: 100%;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  visibility: hidden;
}

.reader-page-nav.is-condensed .reader-page-nav-link:hover .reader-page-nav-title,
.reader-page-nav.is-condensed .reader-page-nav-link:focus-visible .reader-page-nav-title {
  visibility: visible;
}

@media (min-width: 980px) {
  /* Desktop review: allocate room for the initial wide-screen labels while
     letting the columns and text wrap as the reading area narrows. */
  .reader-content .reader-table--ch02-timeline th:first-child {
    width: 24%;
  }

  .reader-content .reader-table--ch02-timeline th:nth-child(2) {
    width: 22%;
  }

  .reader-content .reader-table--ch02-contractures th:first-child {
    width: 30%;
  }

  .reader-content .reader-desktop-line {
    display: block;
  }

  .reader-content .reader-table--ch04-socket-designs th:nth-child(3) {
    width: 26%;
  }

  .reader-content td:has(> .reader-factor-label) {
    width: 10.5rem;
  }

  @container reader-content (min-width: 44rem) {
    .reader-factor-label {
      white-space: nowrap;
    }
  }

  /* Balance the outer gutters and panel gap while retaining the original
     24px content padding and capped reading measure. Narrower desktop
     panels allow the text to reflow within that minimum white inset. */
  .reader-body #main {
    padding-inline: 2rem;
  }

  .reader-body .reader-shell {
    gap: 1.75rem;
  }

  .reader-shell {
    grid-template-columns: 18rem minmax(0, 1fr);
  }
}

@media (max-width: 979px) {
  .reader-body {
    --reader-anchor-offset: 6.25rem;
  }

  .reader-body #main {
    padding: 1rem clamp(0.75rem, 3vw, 1rem) 1.5rem;
  }

  .reader-shell {
    gap: 1rem;
    width: 100%;
  }

  .reader-sidebar {
    position: static;
    display: none;
  }

  .reader-mobile-bar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 2.55rem;
    padding: 1rem 1rem 0.35rem;
    border-radius: 1.25rem 1.25rem 0 0;
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
  }

  .reader-drawer {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    pointer-events: none;
  }

  .reader-drawer-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(31, 27, 23, 0);
    cursor: pointer;
    transition: background-color 180ms ease;
  }

  .reader-drawer-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: min(22rem, 86vw);
    min-height: 0;
    overflow: hidden;
    padding: 1.15rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
    background: #fffaf2;
    box-shadow: 18px 0 46px rgba(31, 27, 23, 0.18);
    transform: translateX(-100%);
    transition: transform 210ms ease;
  }

  .reader-drawer.is-open {
    pointer-events: auto;
  }

  .reader-drawer.is-open .reader-drawer-backdrop {
    background: rgba(31, 27, 23, 0.24);
  }

  .reader-drawer.is-navigating .reader-drawer-backdrop {
    background: rgba(31, 27, 23, 0);
    transition: none;
  }

  .reader-drawer.is-open .reader-drawer-panel {
    transform: translateX(0);
  }

  .reader-drawer-open {
    overflow: hidden;
  }

  .reader-drawer-current-chapter {
    flex: 0 0 auto;
    margin: 0 0 0.75rem;
    padding: 0 0 0.8rem;
    border-bottom: 1px solid rgba(28, 24, 19, 0.08);
  }

  .reader-drawer-current-eyebrow {
    margin: 0 0 0.3rem;
    color: #87613d;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .reader-drawer-current-title {
    margin: 0;
    color: #10233f;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.35;
  }

  .reader-drawer-navigation {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .reader-drawer-group + .reader-drawer-group {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(28, 24, 19, 0.08);
  }

  .reader-drawer-group {
    flex: 0 0 auto;
    min-height: 0;
  }

  .reader-drawer-group.is-open {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .reader-drawer-group-trigger {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.75rem;
    gap: 0.45rem;
    align-items: center;
    width: 100%;
    padding: 0.15rem 0;
    border: 0;
    background: transparent;
    color: #87613d;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.14em;
  }

  .reader-drawer-group.is-open .reader-toc-caret {
    transform: rotate(225deg);
  }

  .reader-drawer-group .reader-toc-caret {
    justify-self: center;
  }

  .reader-drawer-scroll-region {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .reader-drawer-scroll {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
  }

  .reader-drawer-scroll::-webkit-scrollbar {
    display: none;
  }

  .reader-drawer-group:not(.is-open) .reader-drawer-scroll-region {
    display: none;
  }

  .reader-drawer-chapters .reader-chapter-list {
    padding: 0.8rem 0 0.2rem;
  }

  .reader-drawer-toc ul {
    margin: 0;
    padding: 0.8rem 0 0.2rem;
    list-style: none;
  }

  .reader-drawer-scroll-region.has-overflow.is-scrolled-before-end:not(.is-scrolled-from-top) > .reader-drawer-scroll {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 2.75rem), rgba(0, 0, 0, 0.58) calc(100% - 1.925rem), rgba(0, 0, 0, 0.18) calc(100% - 0.935rem), rgba(0, 0, 0, 0.08) 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 2.75rem), rgba(0, 0, 0, 0.58) calc(100% - 1.925rem), rgba(0, 0, 0, 0.18) calc(100% - 0.935rem), rgba(0, 0, 0, 0.08) 100%);
  }

  .reader-drawer-scroll-region.has-overflow.is-scrolled-from-top:not(.is-scrolled-before-end) > .reader-drawer-scroll {
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 0.935rem, rgba(0, 0, 0, 0.58) 1.925rem, #000 2.75rem, #000 100%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 0.935rem, rgba(0, 0, 0, 0.58) 1.925rem, #000 2.75rem, #000 100%);
  }

  .reader-drawer-scroll-region.has-overflow.is-scrolled-from-top.is-scrolled-before-end > .reader-drawer-scroll {
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 0.935rem, rgba(0, 0, 0, 0.58) 1.925rem, #000 2.75rem, #000 calc(100% - 2.75rem), rgba(0, 0, 0, 0.58) calc(100% - 1.925rem), rgba(0, 0, 0, 0.18) calc(100% - 0.935rem), rgba(0, 0, 0, 0.08) 100%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 0.935rem, rgba(0, 0, 0, 0.58) 1.925rem, #000 2.75rem, #000 calc(100% - 2.75rem), rgba(0, 0, 0, 0.58) calc(100% - 1.925rem), rgba(0, 0, 0, 0.18) calc(100% - 0.935rem), rgba(0, 0, 0, 0.08) 100%);
  }

  .reader-drawer-toc li + li {
    margin-top: 0.45rem;
  }

  .reader-drawer-toc a {
    display: block;
    padding: 0.35rem 0.45rem 0.35rem 0.65rem;
    border-left: 2px solid transparent;
    border-radius: 0.45rem;
    color: #2f2a24;
    text-decoration: none;
  }

  .reader-drawer-toc a:hover {
    color: #244f90;
    background: rgba(36, 79, 144, 0.08);
  }

  .reader-drawer-toc a.is-active {
    border-left-color: #244f90;
    color: #173f78;
    font-weight: 700;
    background: transparent;
  }

  .reader-content {
    padding: 0 1rem 2rem;
    max-width: none;
    margin: 0 auto;
  }

  .reader-content h1 {
    display: none;
  }

  .reader-content h2 {
    font-size: 1.45rem;
    text-align: left;
  }

  .reader-content h1 + h2 {
    padding: 0.65rem 0 0.65rem;
    font-size: clamp(1.55rem, 8vw, 1.85rem);
    text-align: left;
    margin-top: 0;
    border-top: 2px solid rgba(36, 79, 144, 0.9);
    overflow-wrap: anywhere;
  }

  .reader-content p,
  .reader-content li {
    overflow-wrap: break-word;
  }

  /* Compact two-line figure and table captions on narrow readers. Apply the
   * metric to the paragraph (not only its inline em) so it overrides the
   * reader body's inherited 1.65 line-height. */
  .reader-content p:has(> em:only-child),
  .reader-content .textbook-figure figcaption {
    font-size: 15px;
    line-height: 1.3;
  }

  /* Figure 5's embedded figure style uses a negative bottom margin that
     brings its following caption into the artwork on phones. */
  .reader-content .textbook-figure--ch06-socket-pressure-responsive {
    margin-bottom: -0.5rem !important;
  }

  .reader-content .reader-table-scroll {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .reader-content .reader-table-scroll table {
    width: 100%;
    max-width: none;
    white-space: normal;
  }

  /* Three-or-more-column tables need an actual table box wider than the
     viewport. Cell min-widths alone overflow a 100%-wide table in Safari,
     leaving its right edge outside the scrollable area. */
  .reader-content .reader-table-scroll table.reader-table--columns-3 {
    width: max(100%, 42rem);
  }

  /* Keep the Chapter 2 timeline phase narrow enough for its two-line final
     label while the activity column remains readable in the scroll area. */
  .reader-content .reader-table-scroll table.reader-table--ch02-timeline {
    table-layout: fixed;
  }

  /* Chapter 3 Table 5 can size to its actual labels after mobile-only model
     breaks; the generic 42rem minimum leaves excess space in every column. */
  .reader-content .reader-table-scroll table.reader-table--k3-manufacturers {
    width: max-content;
  }

  .reader-content .reader-table-scroll table.reader-table--k3-manufacturers tr > :first-child {
    min-width: 10rem;
  }

  .reader-content .reader-table-scroll table.reader-table--columns-4 {
    width: max(100%, 52rem);
  }

  /* Chapter 1 Tables 2–4 need less width than the general minimum above.
     Let their content set the scrollable width so surplus space does not
     accumulate in the first column. */
  .reader-content .reader-table-scroll table.reader-table--ch01-levels,
  .reader-content .reader-table-scroll table.reader-table--ch01-length {
    width: max-content;
  }

  /* Size these named tables to their cell content instead of allocating the
     generic 42rem three-column minimum as unused column space. */
  .reader-content .reader-table-scroll table.reader-table--ch05-gait-parameters,
  .reader-content .reader-table-scroll table.reader-table--gait-muscle-activation {
    width: max-content;
  }

  .reader-content .reader-table-scroll table.reader-table--ch05-gait-parameters tr > :nth-child(2),
  .reader-content .reader-table-scroll table.reader-table--ch05-gait-parameters tr > :nth-child(3) {
    width: auto;
    min-width: 0;
    white-space: nowrap;
  }

  .reader-content .reader-table-scroll table.reader-table--gait-muscle-activation tr > * {
    padding-right: 0.3rem;
    padding-left: 0.3rem;
  }

  /* Retain a real scrollable box while assigning the third column only the
     space its intervention text needs. */
  .reader-content .reader-table-scroll table.reader-table--ch06-knee-valgus {
    width: max(100%, 38rem);
    table-layout: fixed;
  }

  .reader-content .reader-table-scroll table.reader-table--ch06-knee-valgus thead th:nth-child(3) {
    width: 13.5rem;
  }

  /* Long recommendation tables remain legible as two columns on phones. */
  .reader-content .reader-table-scroll table.reader-table--longform {
    width: max(100%, 34rem);
  }

  .reader-content .reader-table-scroll .reader-table--k3-manufacturers tr > *,
  .reader-content .reader-table-scroll .reader-table--ch05-gait-parameters tr > *,
  .reader-content .reader-table-scroll .reader-table--ch06-knee-valgus tr > :nth-child(3) {
    padding-right: 0.3rem;
    padding-left: 0.3rem;
  }

  .reader-content .reader-table-scroll .reader-table--ch06-alignment tr > :nth-child(3) {
    width: 13rem;
    min-width: 13rem;
    padding-right: 0.25rem;
    padding-left: 0.25rem;
  }

  .reader-content .reader-table--gait-muscle-activation .reader-muscle-desktop-separator {
    display: none;
  }

  .reader-content .reader-table--gait-muscle-activation .reader-muscle-mobile-break {
    display: inline;
  }

  .reader-content .reader-model-mobile-break {
    display: inline;
  }

  .reader-content .reader-mobile-header-break {
    display: inline;
  }

  .reader-content .reader-desktop-header-label {
    display: none;
  }

  .reader-content .reader-mobile-header-label {
    display: inline;
  }

  .reader-content .reader-mobile-note-break {
    display: inline;
  }

  .reader-content .reader-mobile-phrase-nowrap {
    white-space: nowrap;
  }

  /* Let the outside right stroke paint beyond the accepted table width. */
  .reader-content .reader-table-scroll:has(> table.reader-table--ch01-reamputation) {
    overflow: visible;
  }

  .reader-content .reader-table-scroll table.reader-table--ch01-reamputation {
    position: relative;
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(28, 24, 19, 0.16);
    border-right: 0;
  }

  .reader-content .reader-table-scroll table.reader-table--ch01-reamputation::after {
    content: "";
    position: absolute;
    /* Include the table's top and bottom border thickness at both corners. */
    top: -1px;
    bottom: -1px;
    right: -1px;
    border-right: 1px solid rgba(28, 24, 19, 0.16);
    pointer-events: none;
  }

  /* The table owns the other three outside edges; cells own the inner lines. */
  .reader-content .reader-table-scroll table.reader-table--ch01-reamputation tr > * {
    border: 0;
    border-right: 1px solid rgba(28, 24, 19, 0.12);
    border-bottom: 1px solid rgba(28, 24, 19, 0.12);
  }

  .reader-content .reader-table-scroll table.reader-table--ch01-reamputation tr > :last-child {
    border-right: 0;
  }

  .reader-content .reader-table-scroll table.reader-table--ch01-reamputation tbody tr:last-child > * {
    border-bottom: 0;
  }

  .reader-content .reader-table--ch01-reamputation tbody td:first-child {
    white-space: nowrap;
  }

  /* Table 8's authored <br> tags delimit bullets. Keep each bullet itself
     on one line and let the table scroll horizontally. */
  .reader-content .reader-table-scroll table.reader-table--ch06-limb-discrepancy {
    width: max-content;
  }

  .reader-content .reader-table--ch06-limb-discrepancy td {
    white-space: nowrap;
  }

  .reader-content .reader-model-desktop-separator {
    display: none;
  }

  .reader-content .reader-level-parenthetical-nowrap,
  .reader-content .reader-mobile-level-parenthetical {
    white-space: nowrap;
  }

  .reader-content .reader-mobile-level-parenthetical {
    display: block;
  }

  .reader-content .reader-table-scroll th {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    text-align: left;
    text-wrap: balance;
    vertical-align: middle;
  }

  .reader-content .reader-table-scroll th.reader-table-heading--explicit-lines {
    white-space: nowrap;
  }

  .reader-content .reader-table-scroll td {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }

  .reader-content .reader-table-scroll td.reader-table-column--numeric,
  .reader-content .reader-table-scroll td.table-cell--numeric {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
  }

  .reader-content .reader-table-scroll table:not(.reader-table--columns-2) .reader-table-heading--compact {
    white-space: nowrap;
  }

  .reader-content .reader-table-scroll .reader-table--columns-2 th.reader-table-column--numeric.reader-table-heading--compact {
    white-space: nowrap;
  }

  .reader-content .reader-table-scroll .reader-table-column--numeric {
    width: 1%;
  }

  .reader-content .reader-table-scroll table:not(.reader-table--columns-2) .reader-table-column--regular:not(.reader-table-column--numeric) {
    min-width: 12.5rem;
  }

  .reader-content .reader-table-scroll table:not(.reader-table--columns-2) .reader-table-column--wide:not(.reader-table-column--numeric) {
    min-width: 14rem;
  }

  .reader-content .reader-table-scroll table:not(.reader-table--columns-2) .reader-table-column--extra-wide:not(.reader-table-column--numeric) {
    min-width: 16rem;
  }

  .reader-content .reader-table-scroll table.reader-table--columns-3.reader-table--ch02-timeline tr > :nth-child(2) {
    width: 11rem;
    min-width: 11rem;
  }

  /* Preserve the explicit second line for the parenthetical labels in
     Table 2 and the two-line level names in Table 3. Their widths are based
     on body cells, not just the shorter "Amputation Level" header. */
  .reader-content .reader-table-scroll table.reader-table--columns-3.reader-table--ch01-levels tr > :first-child {
    width: 15.75rem;
    min-width: 15.75rem;
  }

  .reader-content .reader-table-scroll table.reader-table--columns-3.reader-table--ch01-upper-levels tr > :first-child {
    width: 17.25rem;
    min-width: 17.25rem;
  }

  .reader-content .reader-table-scroll table.reader-table--columns-4.reader-table--ch01-length tr > :first-child {
    width: 6rem;
    min-width: 6rem;
  }

  /* Table 4's two descriptive headers need their own reading width; the
     generic balanced-header cap otherwise wraps both prematurely. */
  .reader-content .reader-table-scroll table.reader-table--ch01-length tr > :nth-child(3) {
    width: 14rem;
    min-width: 14rem;
    max-width: none;
  }

  .reader-content .reader-table-scroll table.reader-table--ch01-length tr > :nth-child(4) {
    width: 10rem;
    min-width: 10rem;
    max-width: none;
  }

  .reader-content .reader-table--ch01-length th:nth-child(3),
  .reader-content .reader-table--ch01-length th:nth-child(4) {
    white-space: nowrap;
  }

  .reader-content .reader-table-scroll th.reader-table-column--numeric[style*="--reader-header-line-ch"] {
    width: calc((var(--reader-header-line-ch) * 0.82ch) + 1rem);
    min-width: calc((var(--reader-header-line-ch) * 0.82ch) + 1rem);
    max-width: calc((var(--reader-header-line-ch) * 0.82ch) + 1rem);
  }

  /* Use the widest currently displayed line in each column, plus the same
     cell padding. The script restores the original rules if text reflows. */
  .reader-content .reader-table-scroll table.reader-table--measured-width {
    width: var(--reader-measured-width) !important;
    min-width: 0 !important;
    table-layout: fixed;
  }

  .reader-content .reader-table-scroll table.reader-table--measured-width tr > * {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .reader-content h3 {
    font-size: 1.08rem;
  }

  .reader-content h4 {
    font-size: 1.05rem;
  }

  .reader-content img {
    max-width: 100%;
  }

  /* Figure 9 narrow-reader correction: preserve the measured artwork gap
   * while compensating for unequal transparent padding in the two assets. */
  .reader-content .ch03-fig09-mobile-pair {
    position: relative;
    left: 1.25%;
  }

  .reader-page-nav {
    max-width: 100%;
    padding: 0 0.5rem 1.5rem;
  }

  .reader-watermark {
    left: 1rem;
    right: 1rem;
  }

}

/* A narrow desktop window still needs the desktop reading inset. Keep the
   compact 16px inset for touch devices rather than tying it to width alone. */
@media screen and (max-width: 979px) and (hover: hover) and (pointer: fine) {
  .reader-body .reader-content,
  .reader-body .reader-mobile-bar {
    padding-inline: 1.5rem;
  }
}

@media print {
  @page {
    margin: 0.65in;
  }

  .reader-body {
    background: #fff;
  }

  .reader-body > :not(.textbook-site-main),
  .reader-body .textbook-site-main > :not(.reader-native-print-blocker) {
    display: none !important;
  }

  .reader-chapter-pdf-dialog::backdrop {
    display: none !important;
  }

  .reader-body .textbook-site-main {
    display: block !important;
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  .reader-native-print-blocker {
    display: block !important;
    max-width: 36rem;
    margin: 0.35in auto 0;
    padding-top: 0.22in;
    border-top: 2px solid #315f9d;
    color: #152947;
    font-family: Arial, Helvetica, sans-serif;
  }

  .reader-native-print-eyebrow {
    margin: 0 0 0.14in;
    color: #8a603b;
    font-size: 10pt;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .reader-native-print-blocker h1 {
    margin: 0 0 0.18in;
    font-size: 22pt;
    line-height: 1.15;
  }

  .reader-native-print-blocker p:last-child {
    margin: 0;
    color: #42536c;
    font-size: 11pt;
    line-height: 1.55;
  }
}
