.book-reader {
  --book-paper: #fffdf8;
  --book-paper-edge: #e8dfcf;
  --book-ink: var(--ink, #2c2a26);
  --book-muted: var(--muted, #6f6a5e);
  --book-accent: var(--accent, #a34d28);
  --book-wash: #f1ebdd;
  max-width: 1120px;
  margin: 0 auto;
  color: var(--book-ink);
}

/* Only the reader needs room for its index; shared site widths stay unchanged. */
.content:has(.book-reader) { max-width: 1120px; }

.book-masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0 0 13px;
  border-bottom: 1px solid var(--line);
}
.book-home {
  color: var(--book-ink);
  text-decoration: none;
  font: 600 0.92rem Georgia, "Times New Roman", serif;
  letter-spacing: .015em;
}
.book-home span { color: var(--book-accent); padding: 0 .18rem; }
.book-masthead-actions { display: flex; align-items: center; gap: 1rem; }
.book-progress-label { color: var(--book-muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.book-contents-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--book-ink);
  background: var(--card);
  font-size: .88rem;
  text-decoration: none;
}
.book-contents-trigger:hover { border-color: var(--book-accent); color: var(--book-accent); }
.book-progress-track {
  height: 3px;
  overflow: hidden;
  margin: 0 0 1.45rem;
  background: var(--book-paper-edge);
}
.book-progress-track span {
  display: block;
  height: 100%;
  background: var(--book-accent);
  transition: width .35s ease;
}
.book-layout { display: grid; grid-template-columns: 215px minmax(0, 1fr); align-items: start; gap: clamp(1.2rem, 3.5vw, 3.6rem); }
.book-index {
  max-height: min(76vh, 760px);
  overflow-y: auto;
  position: sticky;
  top: 94px;
  padding: 4px 8px 14px 0;
  scrollbar-color: var(--book-paper-edge) transparent;
  scrollbar-width: thin;
}
.book-index-kicker, .book-eyebrow, .book-small-label {
  margin: 0;
  color: var(--book-accent);
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.5;
  text-transform: uppercase;
}
.book-index-kicker { margin-bottom: 13px; }
.book-index-link {
  display: block;
  padding: 7px 9px;
  color: var(--book-ink);
  font-size: .86rem;
  text-decoration: none;
  border-radius: 5px;
}
.book-index-link:hover, .book-index-chapter:hover { background: var(--book-wash); }
.book-index-part { margin: 18px 0 0; }
.book-index-part h2 {
  margin: 0 0 5px;
  padding: 0 8px;
  color: var(--book-muted);
  font: 600 .8rem/1.35 Georgia, "Times New Roman", serif;
}
.book-index-part h2 span { display: block; color: var(--book-accent); font: 700 .63rem/1.5 sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.book-index-chapter {
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr);
  align-items: baseline;
  gap: 5px;
  padding: 6px 8px;
  color: var(--book-ink);
  font-size: .78rem;
  line-height: 1.35;
  text-decoration: none;
  border-radius: 5px;
}
.book-index-chapter[aria-current="page"] { background: #f3e9da; color: var(--accent-dark); }
.book-index-number { color: var(--book-muted); font-size: .69rem; font-variant-numeric: tabular-nums; }
.book-index-title { min-width: 0; }
.book-index-chapter .book-badge { grid-column: 2; justify-self: start; }
.book-index-dot { width: 5px; height: 5px; align-self: center; border-radius: 50%; background: #72806a; }
.book-index-chapter.is-in-progress .book-index-dot { background: #c6bba7; }
/* Native pan-y owns undecided contacts without a cancelling touchmove guard.
   Horizontal turns use Pointer Events; preserve native pinch zoom as well. */
.book-stage { min-width: 0; perspective: 1500px; touch-action: pan-y pinch-zoom; }
.book-page { min-width: 0; scroll-margin-top: 170px; }
.book-page[hidden] { display: none !important; }
.book-paper {
  touch-action: pan-y pinch-zoom;
  position: relative;
  min-height: 580px;
  padding: clamp(28px, 5vw, 66px) clamp(24px, 6vw, 82px) 28px;
  background: var(--book-paper);
  border: 1px solid var(--book-paper-edge);
  border-radius: 3px 10px 10px 3px;
  box-shadow: 0 2px 5px rgba(69, 52, 29, .035), 8px 12px 28px rgba(69, 52, 29, .055), inset 8px 0 12px -12px rgba(69, 52, 29, .3);
}
.book-page-heading { margin-bottom: 2rem; }
.book-page .book-page-heading > h1:focus,
.book-page .book-cover > h1:focus,
.book-page .book-end > h1:focus {
  outline: none;
}
.book-page-heading h1, .book-cover h1, .book-end h1 {
  max-width: 20ch;
  margin: .45rem 0 .75rem;
  color: #302a22;
  font: 400 clamp(2.05rem, 4.5vw, 3.45rem)/1.08 Georgia, "Times New Roman", serif;
  overflow-wrap: anywhere;
}
.book-heading-note { margin: .6rem 0 0; color: var(--book-muted); }
.book-chapter-number {
  display: block;
  margin-bottom: .55rem;
  color: var(--book-accent);
  font: 700 .72rem/1.4 sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.book-chapter-subtitle {
  max-width: 58ch;
  margin: 0;
  color: var(--book-muted);
  font: 1.05rem/1.55 Georgia, "Times New Roman", serif;
}
.book-cover { min-height: 435px; display: flex; flex-direction: column; align-items: flex-start; }
.book-cover-rule { display: block; width: 54px; height: 2px; margin: 1.45rem 0 1.1rem; background: var(--book-accent); }
.book-cover h1 { font-size: clamp(2.65rem, 6.4vw, 4.65rem); max-width: 13ch; margin: 0 0 1.1rem; }
.book-cover .book-subtitle {
  max-width: 52ch;
  margin: 0;
  color: #655b4d;
  font: 1.08rem/1.6 Georgia, "Times New Roman", serif;
}
.book-author { margin: 1.35rem 0 1.7rem; color: var(--book-ink); font-size: .95rem; }
.book-framework { border-top: 1px solid var(--book-paper-edge); padding-top: 14px; max-width: 57ch; }
.book-framework p { margin: 5px 0 0; color: var(--book-muted); font-size: .83rem; line-height: 1.6; }
.book-small-label { display: block; font-size: .65rem; }
.book-availability { margin: 1.35rem 0 .7rem; color: var(--book-muted); font-size: .87rem; }
.book-start { margin-left: 0; }
.book-start span { padding-left: .55rem; }
.book-page-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  margin-top: 3rem;
  padding-top: 16px;
  border-top: 1px solid var(--book-paper-edge);
}
.book-page-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--book-ink);
  text-decoration: none;
  font-size: .87rem;
  line-height: 1.35;
}
.book-page-nav a:hover { color: var(--book-accent); }
.book-page-nav a > span:first-child:not(:last-child) { color: var(--book-accent); font-size: 1.12rem; }
.book-page-nav .book-nav-next { justify-self: end; text-align: right; }
.book-page-nav small { display: block; margin-bottom: 3px; color: var(--book-muted); font-size: .68rem; letter-spacing: .04em; }
.book-skip-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  background: #f7f0e5;
  border-left: 2px solid var(--book-accent);
  color: #615545;
  font-size: .85rem;
}
.book-skip-note + .book-nav-next { grid-column: 2; }
.book-preface { max-width: 43ch; margin: 1rem 0 5rem; color: #4a4136; font: var(--book-preface-size, 1.02rem)/var(--book-preface-height, 1.78) Georgia, "Times New Roman", serif; }
.book-contents-groups { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; }
.book-contents-part { margin: 0 0 1.55rem; }
.book-contents-part h2 { margin: 0 0 .65rem; color: #473d31; font: 600 1rem/1.35 Georgia, "Times New Roman", serif; }
.book-contents-part h2 span { display: block; margin-bottom: 2px; color: var(--book-accent); font: 700 .65rem/1.5 sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.book-contents-part ol { list-style: none; padding: 0; margin: 0; }
.book-contents-part li + li { border-top: 1px solid #eee7da; }
.book-contents-part li a { display: grid; grid-template-columns: 1.65rem minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 9px 0; color: var(--book-ink); font-size: .82rem; line-height: 1.35; text-decoration: none; }
.book-contents-part li a:hover .book-contents-title { color: var(--book-accent); text-decoration: underline; text-underline-offset: 3px; }
.book-contents-number { color: var(--book-muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.book-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 7px; background: #e9eee4; color: #4b6343; font-size: .62rem; font-weight: 600; white-space: nowrap; }
.book-badge.is-pending { background: #f2eee6; color: #766d5d; }
.book-special-pages { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--book-paper-edge); font-size: .85rem; }
.book-essay-list { display: grid; gap: 12px; max-width: 62ch; }
.book-essay-card {
  position: relative;
  display: block;
  padding: 18px 45px 18px 19px;
  border: 1px solid var(--book-paper-edge);
  border-radius: 7px;
  color: var(--book-ink);
  background: #fffefa;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}
.book-essay-card:hover { transform: translateY(-2px); border-color: #c9b89d; background: #fffaf0; }
.book-essay-label { display: block; margin-bottom: 5px; color: var(--book-accent); font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.book-essay-title { display: block; font: 1.08rem/1.4 Georgia, "Times New Roman", serif; }
.book-essay-arrow { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--book-accent); font-size: 1.15rem; }
.book-essay-owner-tools { display: flex; justify-content: flex-end; margin: -1rem 0 1rem; }
.book-essay-owner-tools a, .book-essay-edit { color: var(--book-muted); font-size: .78rem; text-decoration: underline; text-decoration-color: #c9b89d; text-underline-offset: 3px; }
.book-essay-owner-tools a:hover, .book-essay-edit:hover { color: var(--book-accent); }
.book-essay {
  min-width: 0;
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem);
  padding: 0 0 clamp(2.3rem, 5vw, 3.6rem);
  border-bottom: 1px solid var(--book-paper-edge);
  overflow-wrap: anywhere;
}
.book-essay-heading { margin-bottom: 1.9rem; }
.book-essay-heading .book-essay-label { margin: 0 0 .7rem; }
.book-essay-heading .book-essay-title {
  max-width: 23ch;
  margin: 0;
  color: #302a22;
  font: 400 clamp(1.8rem, 4vw, 2.8rem)/1.12 Georgia, "Times New Roman", serif;
  overflow-wrap: anywhere;
}
.book-essay-subtitle { max-width: 58ch; margin: .8rem 0 0; color: var(--book-muted); font: 1.05rem/1.55 Georgia, "Times New Roman", serif; }
.book-essay-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 1rem; }
.book-essay-substack { color: var(--book-muted); font-size: .76rem; text-decoration: underline; text-decoration-color: #c9b89d; text-underline-offset: 3px; }
.book-essay-substack:hover { color: var(--book-accent); }
.book-essay-body {
  max-width: 68ch;
  color: #40392f;
  font: var(--book-body-size, 1.02rem)/var(--book-body-height, 1.78) Georgia, "Times New Roman", serif;
  overflow-wrap: anywhere;
}
.book-essay-body > :first-child { margin-top: 0; }
.book-essay-body > :last-child { margin-bottom: 0; }
.book-essay-body p { margin: 0 0 1.2em; }
.book-essay-body h2, .book-essay-body h3 { margin: 1.9em 0 .65em; color: #302a22; font: 400 1.45rem/1.25 Georgia, "Times New Roman", serif; }
.book-essay-body h3 { font-size: 1.2rem; }
.book-essay-body blockquote { margin: 1.5em 0; padding: .2em 0 .2em 1.1em; border-left: 2px solid var(--book-accent); color: #655b4d; font-style: italic; }
.book-essay-body ul, .book-essay-body ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.book-essay-body li + li { margin-top: .35em; }
.book-essay-body img, .book-essay-body video, .book-essay-body iframe { display: block; max-width: 100%; height: auto; margin: 1.5rem auto; }
.book-essay-body iframe { width: 100%; aspect-ratio: 16 / 9; }
.book-essay-body table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.book-essay-body th, .book-essay-body td { padding: .45rem .6rem; border: 1px solid var(--book-paper-edge); text-align: left; }
.book-essay-fallback { margin-bottom: 12px; }
.book-essay-fallback .book-essay-edit { display: inline-block; margin: 8px 0 0 4px; }
.book-editor, .book-admin { --book-paper: #fffdf8; --book-paper-edge: #e8dfcf; --book-ink: var(--ink, #2c2a26); --book-muted: var(--muted, #6f6a5e); --book-accent: var(--accent, #a34d28); --book-wash: #f1ebdd; max-width: 850px; margin: 0 auto; color: var(--book-ink); }
.book-editor-back, .book-admin-back { display: inline-block; margin-bottom: 1.5rem; color: var(--book-muted); font-size: .85rem; text-decoration: none; }
.book-editor-back:hover, .book-admin-back:hover { color: var(--book-accent); }
.book-editor-header, .book-admin-header { margin-bottom: 2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--book-paper-edge); }
.book-editor-header h1, .book-admin-header h1 { margin: .4rem 0 .6rem; color: #302a22; font: 400 clamp(2rem, 5vw, 3rem)/1.1 Georgia, "Times New Roman", serif; }
.book-editor-header > p:last-child, .book-admin-header > p:last-child { max-width: 55ch; margin: 0; color: var(--book-muted); line-height: 1.6; }
.book-editor-error { margin: 0 0 1rem; padding: 12px 14px; border-left: 3px solid #a34d28; background: #f7eee6; color: #6d321d; }
.book-editor-form { display: grid; gap: 9px; }
.book-draft-recovery { margin-bottom: 1.5rem; padding: 16px; border: 1px solid var(--book-paper-edge); background: var(--book-paper); border-radius: 4px; }
.book-draft-recovery h2 { margin: 0 0 .5rem; font: 1.25rem Georgia, "Times New Roman", serif; }
.book-draft-recovery p, .book-draft-recovery label { font-size: .85rem; line-height: 1.6; }
.book-draft-recovery input { width: auto; margin-right: .4rem; }
.book-draft-recovery button { min-height: 42px; margin: 0 .5rem .5rem 0; padding: 8px 14px; border: 1px solid var(--book-accent); border-radius: 3px; background: var(--book-paper); color: var(--book-accent); cursor: pointer; font: inherit; }
.book-draft-recovery button:disabled { opacity: .5; cursor: not-allowed; }
.book-editor-form label { margin-top: 12px; color: var(--book-ink); font-size: .82rem; font-weight: 700; }
.book-editor-form input, .book-editor-form textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--book-paper-edge); border-radius: 4px; background: var(--book-paper); color: var(--book-ink); font: 1rem/1.55 Georgia, "Times New Roman", serif; }
.book-editor-form input:focus, .book-editor-form textarea:focus { outline: 2px solid #c9b89d; outline-offset: 2px; }
.book-editor-form textarea { min-height: 22rem; resize: vertical; font-size: .93rem; }
.book-editor-help { max-width: 70ch; margin: 0 0 3px; color: var(--book-muted); font-size: .83rem; line-height: 1.55; }
.book-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 1rem; }
.book-editor-save, .book-admin-actions button { min-height: 42px; padding: 9px 16px; border: 1px solid var(--book-accent); border-radius: 3px; background: var(--book-accent); color: #fffdf8; font-family: inherit; font-size: .9rem; font-weight: 600; line-height: 1.2; cursor: pointer; }
.book-editor-save:hover, .book-admin-actions button:hover { background: #813b20; border-color: #813b20; }
.book-editor-actions a, .book-admin-actions > a { color: var(--book-muted); font-size: .84rem; text-decoration: underline; text-underline-offset: 3px; }
.book-admin-list { border-top: 1px solid var(--book-paper-edge); }
.book-admin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1.2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--book-paper-edge); }
.book-admin-essay { min-width: 0; }
.book-admin-essay h2 { margin: 0; color: #302a22; font: 400 1.1rem/1.35 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; }
.book-admin-meta { margin: .25rem 0 0; color: var(--book-muted); font-size: .77rem; }
.book-admin-status { display: grid; gap: 4px; }
.book-admin-status-label { color: var(--book-muted); font-size: .68rem; }
.book-admin-status-value { color: #4b6343; font-size: .82rem; font-weight: 700; }
.book-admin-status-value.is-pending { color: var(--book-accent); }
.book-admin-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 14px; }
.book-admin-actions form { margin: 0; }
.book-admin-actions button { min-height: 36px; padding: 7px 11px; font-size: .78rem; }
.book-admin-empty { padding: 1.5rem; border: 1px solid var(--book-paper-edge); background: #faf6ed; color: var(--book-muted); }
.book-admin-empty p { margin: .35rem 0; font-size: .9rem; }
.book-admin-empty .book-admin-empty-title { color: var(--book-ink); font: 1.2rem Georgia, "Times New Roman", serif; }
.book-preview { max-width: 54ch; padding: 19px 21px; border: 1px solid var(--book-paper-edge); border-radius: 7px; background: #faf6ed; }
.book-preview .book-small-label { margin-top: 13px; color: var(--book-muted); }
.book-preview p:last-child { margin: 5px 0 0; color: #50483c; font: 1.05rem/1.65 Georgia, "Times New Roman", serif; }
.book-end { min-height: 420px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.book-end h1 { max-width: 14ch; margin-bottom: 0; }
.book-end > p { color: var(--book-muted); }
.book-end .book-end-contents { margin: .6rem 0 1rem; }
.book-end .book-follow { margin-top: 1.5rem; font-size: .9rem; }
.book-cover-nav { grid-template-columns: 1fr; }
.book-cover-nav .book-nav-previous { justify-self: start; }
.book-live-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.book-turn-layer {
  position: fixed;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}
.book-stage.is-book-stage-turning { overflow-anchor: none; }
@property --book-fold-stop {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}
.book-turn-destination-shadow {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(135deg, transparent 35%, rgba(55, 37, 15, .27) 49%, rgba(55, 37, 15, .08) 54%, transparent 68%);
}
.book-turn-destination-page {
  position: absolute !important;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  max-height: none;
  margin: 0 !important;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 3px 10px 10px 3px;
  box-shadow: none;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-forward .book-turn-destination-shadow {
  animation: book-destination-shadow-forward 650ms ease-out both;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-back .book-turn-destination-shadow {
  background: linear-gradient(45deg, transparent 35%, rgba(55, 37, 15, .27) 49%, rgba(55, 37, 15, .08) 54%, transparent 68%);
  animation: book-destination-shadow-back 650ms ease-out both;
}
.book-turn-sheet {
  position: relative;
  display: block;
  margin: 0;
  pointer-events: none !important;
  transform-style: preserve-3d;
  perspective: 1400px;
  overflow: visible !important;
}
.book-turn-plane {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  box-shadow: 0 7px 19px rgba(69, 52, 29, .12), inset 8px 0 12px -12px rgba(69, 52, 29, .3);
}
.book-turn-flat {
  z-index: 1;
  clip-path: polygon(0 0, 100% 0, 100% 92%, 92% 100%, 0 100%);
}
.is-book-turn-back .book-turn-flat {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8% 100%, 0 92%);
}
.book-turn-flat::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(var(--book-fold-angle-forward),
    transparent calc(var(--book-fold-stop) - 3%),
    rgba(69, 52, 29, .32) calc(var(--book-fold-stop) - 1.5%),
    rgba(255, 253, 248, .98) calc(var(--book-fold-stop) - .25%),
    transparent calc(var(--book-fold-stop) + .6%));
}
.is-book-turn-back .book-turn-flat::before {
  background: linear-gradient(var(--book-fold-angle-back),
    transparent calc(var(--book-fold-stop) - 3%),
    rgba(69, 52, 29, .32) calc(var(--book-fold-stop) - 1.5%),
    rgba(255, 253, 248, .98) calc(var(--book-fold-stop) - .25%),
    transparent calc(var(--book-fold-stop) + .6%));
}
.book-turn-sheet.is-book-turning .book-turn-flat::before { animation: book-fold-crease 650ms ease-out both; }
@keyframes book-fold-crease {
  0% { --book-fold-stop: 100%; opacity: 0; }
  24% { --book-fold-stop: 76%; opacity: 1; }
  50% { --book-fold-stop: 50%; opacity: 1; }
  76% { --book-fold-stop: 26%; opacity: .85; }
  100% { --book-fold-stop: 0%; opacity: 0; }
}
.book-turn-flap {
  z-index: 2;
  transform-style: preserve-3d;
  backface-visibility: visible;
}
.book-turn-flap .book-turn-sheet-content { backface-visibility: hidden; transform: translateZ(.1px); }
.book-turn-flap::before,
.book-turn-flap::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  content: "";
  pointer-events: none;
  opacity: 0;
  backface-visibility: hidden;
}
.book-turn-flap::before {
  background: linear-gradient(135deg,
    transparent 47%,
    rgba(69, 52, 29, .10) 48.5%,
    rgba(69, 52, 29, .34) 49.4%,
    rgba(255, 253, 248, .92) 50%,
    rgba(255, 253, 248, .58) 50.6%,
    rgba(69, 52, 29, .16) 51.5%,
    transparent 53%);
  background-size: 300% 300%;
  box-shadow: inset 0 0 20px rgba(69, 52, 29, .12);
}
.book-turn-flap::after {
  background: linear-gradient(138deg, #e8dfcf 0%, #f7f0e4 34%, #fffdf8 56%, #e8dfcf 100%);
  border: 1px solid rgba(128, 103, 70, .28);
  box-shadow: inset 0 0 28px rgba(69, 52, 29, .19), 0 8px 20px rgba(69, 52, 29, .18);
}
.book-turn-sheet-content { overflow: visible; }
.book-turn-sheet.is-book-turn-forward { transform-origin: 100% 100%; }
.book-turn-sheet.is-book-turn-back { transform-origin: 0 100%; }
.book-turn-sheet.is-book-turn-forward.is-book-turning {
  animation: book-paper-fold-forward 650ms ease-out both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning {
  animation: book-paper-fold-back 650ms ease-out both;
}
.book-turn-sheet.is-book-turning .book-turn-flat {
  animation: book-flat-forward 650ms ease-out both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning .book-turn-flat {
  animation-name: book-flat-back;
}
.book-turn-sheet.is-book-turning .book-turn-flap {
  transform-origin: 100% 100%;
  animation: book-flap-forward 650ms ease-out both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning .book-turn-flap {
  transform-origin: 0 100%;
  animation-name: book-flap-back;
}
.book-turn-sheet.is-book-turn-forward.is-book-turning .book-turn-flap::before {
  animation: book-fold-ridge-forward 650ms ease-out both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning .book-turn-flap::before {
  background-image: linear-gradient(45deg,
    transparent 47%,
    rgba(69, 52, 29, .10) 48.5%,
    rgba(69, 52, 29, .34) 49.4%,
    rgba(255, 253, 248, .92) 50%,
    rgba(255, 253, 248, .58) 50.6%,
    rgba(69, 52, 29, .16) 51.5%,
    transparent 53%);
  animation: book-fold-ridge-back 650ms ease-out both;
}
.book-turn-sheet.is-book-turn-forward.is-book-turning .book-turn-flap::after {
  transform: rotateY(180deg);
  transform-origin: 50% 50%;
  animation: book-flap-backside 650ms ease-out both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning .book-turn-flap::after {
  transform: rotateY(180deg);
  transform-origin: 50% 50%;
  animation: book-flap-backside 650ms ease-out both;
}
.book-page.is-book-turn-fade { animation: book-fade .16s ease both; }
@keyframes book-flat-forward {
  0% { clip-path: polygon(0 0, 100% 0, 100% 92%, 92% 100%, 0 100%); }
  24% { clip-path: polygon(0 0, 100% 0, 100% 52%, 52% 100%, 0 100%); }
  50% { clip-path: polygon(0 0, 100% 0, 100% 0, 0 100%, 0 100%); }
  76% { clip-path: polygon(0 0, 52% 0, 0 52%, 0 52%, 0 52%); }
  100% { clip-path: polygon(0 0, 0 0, 0 0, 0 0, 0 0); }
}
@keyframes book-flat-back {
  0% { clip-path: polygon(0 0, 100% 0, 100% 100%, 8% 100%, 0 92%); }
  24% { clip-path: polygon(0 0, 100% 0, 100% 100%, 48% 100%, 0 52%); }
  50% { clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%); }
  76% { clip-path: polygon(100% 0, 48% 0, 100% 52%, 100% 52%, 100% 52%); }
  100% { clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 0, 100% 0); }
}
@keyframes book-flap-forward {
  0% { clip-path: polygon(100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%); transform: rotate3d(1, -1, 0, 0deg); }
  24% { clip-path: polygon(100% 52%, 100% 100%, 52% 100%, 52% 100%, 52% 100%); transform: translate(-4%, -4%) rotate3d(1, -1, 0, -28deg); }
  50% { clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 100%, 0 100%); transform: translate(-18%, -18%) rotate3d(1, -1, 0, -72deg); }
  76% { clip-path: polygon(52% 0, 100% 0, 100% 100%, 0 100%, 0 52%); transform: translate(-40%, -40%) rotate3d(1, -1, 0, -132deg); }
  100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 100%); transform: translate(-80%, -80%) rotate3d(1, -1, 0, -178deg); opacity: 0; }
}
@keyframes book-flap-back {
  0% { clip-path: polygon(0 100%, 0 100%, 0 100%, 0 100%, 0 100%); transform: rotate3d(1, 1, 0, 0deg); }
  24% { clip-path: polygon(0 52%, 0 100%, 48% 100%, 48% 100%, 48% 100%); transform: translate(4%, -4%) rotate3d(1, 1, 0, 28deg); }
  50% { clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 100%, 100% 100%); transform: translate(18%, -18%) rotate3d(1, 1, 0, 72deg); }
  76% { clip-path: polygon(48% 0, 0 0, 0 100%, 100% 100%, 100% 52%); transform: translate(40%, -40%) rotate3d(1, 1, 0, 132deg); }
  100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 100%); transform: translate(80%, -80%) rotate3d(1, 1, 0, 178deg); opacity: 0; }
}
@keyframes book-paper-fold-forward {
  0%, 99% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes book-paper-fold-back {
  0%, 99% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes book-flap-backside {
  0%, 18% { opacity: 0; }
  43%, 75% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes book-fold-ridge-forward {
  0% { opacity: .18; background-position: 100% 100%; }
  22% { opacity: .95; background-position: 78% 78%; }
  58% { opacity: 1; background-position: 38% 38%; }
  100% { opacity: 0; background-position: 0 0; }
}
@keyframes book-fold-ridge-back {
  0% { opacity: .18; background-position: 0 100%; }
  22% { opacity: .95; background-position: 22% 78%; }
  58% { opacity: 1; background-position: 62% 38%; }
  100% { opacity: 0; background-position: 100% 0; }
}
@keyframes book-destination-shadow-forward {
  0% { opacity: 0; transform: translate(-18%, 18%) scale(.72); }
  50% { opacity: .82; transform: translate(0, 0) scale(1); }
  78% { opacity: .38; transform: translate(-8%, -8%) scale(1.05); }
  100% { opacity: 0; transform: translate(-20%, -20%) scale(1.1); }
}
@keyframes book-destination-shadow-back {
  0% { opacity: 0; transform: translate(18%, 18%) scale(.72); }
  50% { opacity: .82; transform: translate(0, 0) scale(1); }
  78% { opacity: .38; transform: translate(8%, -8%) scale(1.05); }
  100% { opacity: 0; transform: translate(20%, -20%) scale(1.1); }
}
/* A single readable 3D sheet avoids browser-dependent clipped fold faces. */
.book-paper.has-book-edge-pointer { cursor: pointer; }
.book-turn-layer { perspective: 1400px; }
.book-turn-sheet { perspective: none; backface-visibility: hidden; }
.book-turn-sheet.is-book-turn-forward { transform-origin: 100% 50%; }
.book-turn-sheet.is-book-turn-back { transform-origin: 0 50%; }
.book-turn-flat,
.is-book-turn-back .book-turn-flat { clip-path: none; }
.book-turn-sheet.is-book-turning .book-turn-flat,
.book-turn-sheet.is-book-turning .book-turn-flat::before { animation: none; }
.book-turn-flat::before {
  background: linear-gradient(to left, rgba(69, 52, 29, .12), transparent 28%);
}
.book-turn-sheet {
  overflow: visible !important;
  transform-style: preserve-3d;
  backface-visibility: visible;
}
.book-turn-flat {
  backface-visibility: hidden;
}
/* The reverse face is a clean sheet of paper, never a second mirrored copy
   of the outgoing text. It is revealed only as the page turns away. */
.book-turn-sheet::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(115, 91, 59, .28);
  border-radius: 3px 10px 10px 3px;
  background: linear-gradient(108deg, #ded3c0 0%, #f0e8d9 24%, #f8f3e9 51%, #e8dece 100%);
  box-shadow: inset 0 0 28px rgba(69, 52, 29, .19);
  transform: rotateY(180deg);
  backface-visibility: hidden;
}
/* A narrow, lit ridge travels with the fold. Only transform and opacity move,
   keeping both tap turns and paused pointer scrubbing on the same timeline. */
.book-turn-sheet::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(69, 52, 29, .05) 43%,
    rgba(69, 52, 29, .31) 48.8%, rgba(255, 253, 248, .96) 50%,
    rgba(255, 253, 248, .58) 51%, rgba(69, 52, 29, .12) 56%, transparent 62%);
  transform: translateX(100%) skewY(-1deg);
  backface-visibility: hidden;
}
.book-turn-sheet.is-book-turn-forward.is-book-turning {
  animation: book-sheet-forward 450ms ease-out both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning {
  animation: book-sheet-back 450ms ease-out both;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-forward .book-turn-destination-shadow {
  animation-duration: 450ms;
  animation-timing-function: linear;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-back .book-turn-destination-shadow {
  animation-duration: 450ms;
  animation-timing-function: linear;
}
.book-turn-sheet.is-book-turn-forward.is-book-turning::before {
  animation: book-ridge-forward 450ms ease-out both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning::before {
  animation: book-ridge-back 450ms ease-out both;
}
@keyframes book-sheet-forward {
  0% { transform: rotateY(0deg) rotateX(0deg) scaleX(1); opacity: 1; }
  24% { transform: rotateY(-24deg) rotateX(2deg) scaleX(.985); opacity: 1; }
  50% { transform: rotateY(-62deg) rotateX(4deg) scaleX(.955); opacity: 1; }
  78% { transform: rotateY(-101deg) rotateX(2deg) scaleX(.98); opacity: 1; }
  100% { transform: rotateY(-110deg) rotateX(0deg) scaleX(1); opacity: 0; }
}
@keyframes book-sheet-back {
  0% { transform: rotateY(0deg) rotateX(0deg) scaleX(1); opacity: 1; }
  24% { transform: rotateY(24deg) rotateX(-2deg) scaleX(.985); opacity: 1; }
  50% { transform: rotateY(62deg) rotateX(-4deg) scaleX(.955); opacity: 1; }
  78% { transform: rotateY(101deg) rotateX(-2deg) scaleX(.98); opacity: 1; }
  100% { transform: rotateY(110deg) rotateX(0deg) scaleX(1); opacity: 0; }
}
@keyframes book-ridge-forward {
  0% { opacity: 0; transform: translateX(100%) skewY(-1deg); }
  20% { opacity: .72; }
  50% { opacity: 1; transform: translateX(0) skewY(1deg); }
  78% { opacity: .62; }
  100% { opacity: 0; transform: translateX(-100%) skewY(-1deg); }
}
@keyframes book-ridge-back {
  0% { opacity: 0; transform: translateX(-100%) skewY(1deg); }
  20% { opacity: .72; }
  50% { opacity: 1; transform: translateX(0) skewY(-1deg); }
  78% { opacity: .62; }
  100% { opacity: 0; transform: translateX(100%) skewY(1deg); }
}
.book-contents-dialog {
  width: min(440px, 92vw);
  max-width: none;
  height: min(100dvh, 900px);
  max-height: none;
  margin: 0 0 0 auto;
  padding: 20px 22px;
  border: 0;
  border-left: 1px solid var(--book-paper-edge);
  background: var(--book-paper);
  color: var(--book-ink);
  box-shadow: -16px 0 48px rgba(41, 31, 18, .16);
  overflow: hidden;
}
.book-contents-dialog[open] { animation: book-drawer-in .24s ease-out both; }
.book-contents-dialog::backdrop { background: rgba(39, 34, 26, .42); }
@keyframes book-drawer-in { from { opacity: .5; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.book-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--book-paper-edge); padding-bottom: 12px; }
.book-dialog-header h2 { margin: 0; color: var(--book-ink); font: 400 1.65rem/1.2 Georgia, "Times New Roman", serif; }
.book-dialog-close { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--book-ink); font: inherit; cursor: pointer; }
.book-dialog-close span { font-size: 1.2rem; line-height: 1; }
.book-dialog-index { height: calc(100% - 58px); overflow: auto; padding: 12px 4px 24px 0; }
.book-dialog-index .book-index-chapter { grid-template-columns: 1.8rem minmax(0, 1fr); }
.book-dialog-index .book-badge { grid-column: 2; justify-self: start; }

@media (max-width: 760px) {
  .book-layout { display: block; }
  .book-index { display: none; }
  .book-paper { min-height: 510px; padding: clamp(26px, 7vw, 42px) clamp(20px, 6vw, 34px) 22px; }
  .book-contents-groups { grid-template-columns: 1fr; }
  .book-page-heading h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .book-page { scroll-margin-top: 150px; }
  .book-admin .book-admin-row { grid-template-columns: minmax(0, 1fr) auto; }
  .book-admin .book-admin-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 480px) {
  .book-masthead { align-items: flex-start; }
  .book-masthead-actions { align-items: flex-end; flex-direction: column-reverse; gap: 2px; }
  .book-progress-label { font-size: .74rem; }
  .book-contents-trigger { min-height: 34px; padding: 4px 11px; }
  .book-page-nav { gap: 6px; }
  .book-page-nav a { font-size: .78rem; }
  .book-contents-part li a { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .book-contents-part .book-badge { grid-column: 2; justify-self: start; }
  .book-availability { max-width: 26ch; }
  .book-admin .book-admin-row { grid-template-columns: 1fr; gap: .75rem; }
  .book-admin .book-admin-actions { grid-column: auto; }
  .book-essay-links { gap: 8px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-contents-dialog[open] { animation: book-fade .16s ease both; }
  .book-progress-track span, .book-essay-card { transition: none; }
  .book-turn-sheet.is-book-turning { animation: book-turn-reduced .16s ease both !important; }
  .book-turn-sheet.is-book-turning::before, .book-turn-sheet.is-book-turning::after,
  .book-turn-destination-shadow { animation: none !important; }
  .book-turn-sheet.is-book-turning::before, .book-turn-sheet.is-book-turning::after { opacity: 0 !important; }
  @keyframes book-fade { from { opacity: .55; } to { opacity: 1; } }
  @keyframes book-turn-reduced { from { opacity: 1; } to { opacity: 0; } }
}

/* Owner essay revision history */
.book-history {
  --book-paper: #fffdf8;
  --book-paper-edge: #e8dfcf;
  --book-ink: var(--ink, #2c2a26);
  --book-muted: var(--muted, #6f6a5e);
  --book-accent: var(--accent, #a34d28);
  max-width: 1080px;
  margin: 0 auto;
  color: var(--book-ink);
}
.book-history-back { display: inline-block; margin-bottom: 1.5rem; color: var(--book-muted); font-size: .85rem; text-decoration: none; }
.book-history-back:hover, .book-history-footer a:hover, .book-editor-tools a:hover { color: var(--book-accent); }
.book-history-header { margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--book-paper-edge); }
.book-history-header h1 { margin: .4rem 0 .55rem; color: #302a22; font: 400 clamp(2rem, 5vw, 3rem)/1.1 Georgia, "Times New Roman", serif; }
.book-history-essay-title { margin: .3rem 0; font: 1.2rem/1.4 Georgia, "Times New Roman", serif; }
.book-history-essay-subtitle { margin: .2rem 0 0; color: var(--book-muted); font: .98rem/1.5 Georgia, "Times New Roman", serif; }
.book-editor-tools { margin: -1rem 0 1.4rem; }
.book-editor-tools a { color: var(--book-muted); font-size: .83rem; text-decoration: underline; text-decoration-color: #c9b89d; text-underline-offset: 3px; }
.book-history-warning { margin: 1.4rem 0 2rem; padding: 14px 17px; border-left: 3px solid var(--book-accent); background: #f7eee6; color: #60412f; }
.book-history-warning h2 { margin: 0 0 .35rem; color: #53311f; font: 600 1rem/1.35 Georgia, "Times New Roman", serif; }
.book-history-warning p { max-width: 82ch; margin: 0; font-size: .88rem; line-height: 1.6; }
.book-history-differences { margin: 0 0 1.5rem; }
.book-history-differences > h2 { margin: 0 0 .7rem; color: #302a22; font: 400 1.35rem/1.3 Georgia, "Times New Roman", serif; }
.book-history-diff-list { display: grid; gap: 8px; }
.book-history-diff { padding: 12px 14px; border: 1px solid var(--book-paper-edge); background: #faf6ed; }
.book-history-diff h3, .book-history-source h3 { margin: 0 0 6px; color: var(--book-accent); font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; }
.book-history-diff pre, .book-history-source pre { max-width: 100%; margin: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: #40392f; font: .83rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.book-history-diff p { margin: 0; color: var(--book-muted); font-size: .84rem; }
.book-history-select { margin: 0 0 1.7rem; padding: 15px 17px; border: 1px solid var(--book-paper-edge); background: #faf6ed; }
.book-history-select fieldset { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 18px; margin: 0; padding: 0; border: 0; }
.book-history-select legend { margin-bottom: 10px; color: #302a22; font: 400 1.2rem/1.3 Georgia, "Times New Roman", serif; }
.book-history-select-fields { display: grid; flex: 1 1 440px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.book-history-select label { display: grid; gap: 5px; color: var(--book-muted); font-size: .75rem; font-weight: 700; }
.book-history-select select { width: 100%; min-width: 0; min-height: 40px; padding: 7px 9px; border: 1px solid var(--book-paper-edge); border-radius: 3px; background: var(--book-paper); color: var(--book-ink); font-family: inherit; font-size: .88rem; line-height: 1.4; }
.book-history-select select:focus, .book-history-select button:focus-visible, .book-history-restore button:focus-visible, .book-history-confirm input:focus-visible { outline: 2px solid #c9b89d; outline-offset: 2px; }
.book-history-select button, .book-history-restore button { min-height: 40px; padding: 8px 13px; border: 1px solid var(--book-accent); border-radius: 3px; background: var(--book-accent); color: #fffdf8; font-family: inherit; font-size: .83rem; font-weight: 600; line-height: 1.25; cursor: pointer; }
.book-history-select button:hover, .book-history-restore button:hover { background: #813b20; border-color: #813b20; }
.book-history-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.book-history-version { min-width: 0; padding: clamp(17px, 3vw, 25px); border: 1px solid var(--book-paper-edge); background: var(--book-paper); box-shadow: 0 2px 8px rgba(69, 52, 29, .035); }
.book-history-version-header { min-height: 112px; margin-bottom: 1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--book-paper-edge); }
.book-history-version-header h2 { margin: .35rem 0; color: #302a22; font: 400 clamp(1.25rem, 2.4vw, 1.8rem)/1.2 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; }
.book-history-version-header > p:not(.book-small-label) { margin: .3rem 0; color: var(--book-muted); font: .95rem/1.5 Georgia, "Times New Roman", serif; }
.book-history-version-label { display: inline-block; margin-top: .45rem; color: var(--book-muted); font-size: .72rem; }
.book-history-source { margin: 1rem 0; }
.book-history-source pre { min-height: 1.5em; padding: 10px 11px; border: 1px solid #eee7da; background: #fffefa; }
.book-history-source:last-of-type pre { min-height: 12rem; }
.book-history-restore { display: grid; gap: 12px; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--book-paper-edge); }
.book-history-confirm { display: flex; align-items: flex-start; gap: 8px; color: #60412f; font-size: .8rem; line-height: 1.45; }
.book-history-confirm input { flex: 0 0 auto; margin: .15rem 0 0; accent-color: var(--book-accent); }
.book-history-restore button { justify-self: start; }
.book-history-footer { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--book-paper-edge); }
.book-history-footer a { color: var(--book-muted); font-size: .84rem; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .book-history-comparison { grid-template-columns: 1fr; }
  .book-history-version-header { min-height: 0; }
  .book-history-select fieldset { align-items: stretch; }
  .book-history-select button { justify-self: start; }
}
@media (max-width: 480px) {
  .book-history-select-fields { grid-template-columns: 1fr; }
  .book-history-select fieldset { display: grid; }
}

/* Font controls are deliberately reader-scoped; owner tools retain their site typography. */
.book-reader .book-cover h1,
.book-reader .book-cover .book-subtitle,
.book-reader .book-cover .book-author { font-family: var(--book-font-cover, Georgia, "Times New Roman", serif); }
.book-reader .book-end h1,
.book-reader .book-end > p { font-family: var(--book-font-end, Georgia, "Times New Roman", serif); }
.book-reader #contents .book-page-heading h1,
.book-reader .book-dialog-header h2,
.book-reader #contents .book-heading-note,
.book-reader .book-index-link,
.book-reader .book-index-chapter,
.book-reader .book-contents-part li a,
.book-reader .book-special-pages { font-family: var(--book-font-contents, Georgia, "Times New Roman", serif); }
.book-reader .book-index-part h2,
.book-reader .book-contents-part h2 { font-family: var(--book-font-parts, Georgia, "Times New Roman", serif); }
.book-reader .book-part-title { font-family: var(--book-font-parts, Georgia, "Times New Roman", serif); }
.book-reader #preface .book-page-heading h1,
.book-reader .book-preface { font-family: var(--book-font-preface, Georgia, "Times New Roman", serif); }
.book-reader .book-page-heading h1,
.book-reader .book-essay-heading .book-essay-title,
.book-reader .book-chapter-subtitle,
.book-reader .book-essay-subtitle { font-family: var(--book-font-headings, Georgia, "Times New Roman", serif); }
.book-reader .book-essay-body,
.book-reader .book-essay-body h2,
.book-reader .book-essay-body h3 { font-family: var(--book-font-body, Georgia, "Times New Roman", serif); }
.book-reader .book-eyebrow,
.book-reader .book-end > .book-eyebrow,
.book-reader .book-part-label,
.book-reader .book-small-label,
.book-reader .book-index-kicker,
.book-reader .book-chapter-number,
.book-reader .book-essay-label,
.book-reader .book-badge,
.book-reader .book-index-part h2 span,
.book-reader .book-contents-part h2 span { font-family: var(--book-font-labels, sans-serif); }

/* Inline preview text is kept separate from the reader and inherits no reader font variables. */
.book-admin .book-font-preview {
  margin: -2px 0 10px;
  padding: 9px 11px;
  border-left: 2px solid var(--book-paper-edge);
  color: var(--book-muted);
  font-size: .88rem;
  line-height: 1.5;
}

/* Turn geometry: a single flat leaf rotates around the left spine. */
.book-turn-layer {
  perspective: 1400px;
  transform-style: preserve-3d;
}
.book-turn-destination-page {
  overflow: hidden;
  padding: 0 !important;
  box-shadow: none;
}
.book-turn-destination-page > .book-turn-sheet-content {
  overflow: hidden;
}
.book-turn-destination-shadow {
  z-index: 2;
  background: linear-gradient(90deg, transparent 70%, rgba(55, 37, 15, .08) 83%,
    rgba(55, 37, 15, .24) 96%, transparent 100%);
  transform: translateX(0);
}
.book-turn-sheet {
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  perspective: none;
  backface-visibility: visible;
}
.book-turn-sheet.is-book-turn-forward { transform-origin: 0 50%; }
.book-turn-sheet.is-book-turn-back { transform-origin: 0 50%; }
.book-turn-flat,
.is-book-turn-back .book-turn-flat {
  clip-path: none;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 3px 12px rgba(69, 52, 29, .11);
}
.book-turn-flat::before { display: none; }
.book-turn-sheet::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(115, 91, 59, .22);
  border-radius: 3px 10px 10px 3px;
  background: var(--book-paper, #fffdf8);
  box-shadow: inset 0 0 12px rgba(69, 52, 29, .05);
  transform: rotateY(180deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book-turn-sheet::before {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: 12px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(69, 52, 29, .2) 48%,
    rgba(255, 253, 248, .82) 72%, rgba(69, 52, 29, .1));
  transform: translateX(0);
  backface-visibility: hidden;
}
.book-turn-sheet.is-book-turn-forward.is-book-turning {
  animation: book-sheet-forward 450ms ease-out both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning {
  animation: book-sheet-back 450ms ease-out both;
}
.book-turn-sheet.is-book-turn-forward.is-book-turning::before {
  animation: book-ridge-forward 450ms ease-out both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning::before {
  animation: book-ridge-back 450ms ease-out both;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-forward .book-turn-destination-shadow,
.book-turn-layer.is-book-turning.is-book-turn-layer-back .book-turn-destination-shadow {
  animation: book-destination-shadow-forward 450ms linear both;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-back .book-turn-destination-shadow {
  animation-name: book-destination-shadow-back;
}
@keyframes book-sheet-forward {
  0% { transform: rotateY(0deg); opacity: 1; }
  100% { transform: rotateY(-180deg); opacity: 1; }
}
@keyframes book-sheet-back {
  0% { transform: rotateY(-180deg); opacity: 1; }
  100% { transform: rotateY(0deg); opacity: 1; }
}
@keyframes book-ridge-forward {
  0%, 100% { opacity: 0; transform: translateX(0); }
  18%, 76% { opacity: .85; transform: translateX(0); }
}
@keyframes book-ridge-back {
  0%, 100% { opacity: 0; transform: translateX(0); }
  18%, 76% { opacity: .85; transform: translateX(0); }
}
@keyframes book-destination-shadow-forward {
  0% { opacity: 0; transform: translateX(0); }
  25% { opacity: .35; transform: translateX(-20%); }
  40% { opacity: .65; transform: translateX(-60%); }
  50% { opacity: .7; transform: translateX(-100%); }
  75% { opacity: .35; transform: translateX(-170%); }
  100% { opacity: 0; transform: translateX(-200%); }
}
@keyframes book-destination-shadow-back {
  0% { opacity: 0; transform: translateX(-200%); }
  25% { opacity: .35; transform: translateX(-170%); }
  50% { opacity: .7; transform: translateX(-100%); }
  60% { opacity: .65; transform: translateX(-60%); }
  75% { opacity: .35; transform: translateX(-20%); }
  100% { opacity: 0; transform: translateX(0); }
}

/* Retired bottom-up presentation. No page turn may use these rules.
   Kept isolated while historical selectors above are consolidated separately. */
@media not all {
/* Motion update: a horizontal bottom-up curl, not a left-spine plane turn.
   The clipped outgoing snapshot and destination share one 650ms timeline, so
   WAAPI currentTime scrubbing follows the exact same crease as tap navigation.
   Only the slim curl is articulated in 3D; text is never mirrored or rotated. */
.book-reader {
  --book-turn-duration: 650ms;
}
.book-turn-layer {
  perspective: none !important;
  transform: none !important;
  transform-style: flat;
  overflow: hidden;
  isolation: isolate;
}
.book-turn-destination-page {
  z-index: 1;
  overflow: hidden;
  padding: 0 !important;
  border-radius: 3px 10px 10px 3px;
  box-shadow: none;
  transform: none !important;
  clip-path: inset(0 0 0 0);
}
.book-turn-destination-page > .book-turn-sheet-content {
  overflow: hidden;
}
.book-turn-sheet {
  z-index: 3;
  overflow: hidden !important;
  perspective: none !important;
  backface-visibility: visible;
  animation: none !important;
}
.book-turn-sheet.is-book-turn-forward.is-book-turning {
  /* Stable first animation on the root sheet for legacy scrub timing hooks. */
  animation: book-sheet-forward var(--book-turn-duration) ease-out both !important;
}
.book-turn-sheet.is-book-turn-back.is-book-turning {
  animation: book-sheet-back var(--book-turn-duration) ease-out both !important;
}
.book-turn-flat {
  z-index: 1;
  overflow: hidden !important;
  clip-path: inset(0 0 0 0);
  box-shadow: 0 3px 12px rgba(69, 52, 29, .09);
  backface-visibility: visible;
  transform: none !important;
}
.book-turn-flat::before,
.book-turn-sheet::before,
.book-turn-sheet::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}
.book-turn-destination-shadow {
  z-index: 2;
  top: calc(100% - var(--book-turn-curl-height));
  bottom: auto;
  height: var(--book-turn-curl-height);
  background: linear-gradient(to bottom, rgba(59, 43, 22, .3), rgba(59, 43, 22, .12) 45%, transparent);
  opacity: 0;
  transform: none;
}
.book-turn-layer.is-book-turn-layer-forward .book-turn-destination-page {
  clip-path: none;
}
.book-turn-layer.is-book-turn-layer-back .book-turn-destination-page {
  clip-path: none;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-forward .book-turn-destination-page {
  animation: none;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-back .book-turn-destination-page {
  animation: none;
}
.book-turn-sheet.is-book-turn-forward.is-book-turning .book-turn-flat {
  animation: book-front-recede-forward var(--book-turn-duration) cubic-bezier(.25, .62, .2, 1) both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning .book-turn-flat {
  animation: book-front-recede-back var(--book-turn-duration) cubic-bezier(.25, .62, .2, 1) both;
}
.book-turn-curl {
  position: absolute;
  z-index: 4;
  left: 0;
  width: 100%;
  height: var(--book-turn-curl-height, 48px);
  border: 0;
  background: none;
  box-shadow: none;
  perspective: 1200px;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.book-turn-curl::after {
  content: none;
}
.book-turn-curl-facet {
  position: absolute;
  right: 0;
  left: 0;
  display: block;
  transform-origin: 50% 0;
  background-color: var(--book-paper, #fffdf8);
  background-image: linear-gradient(180deg, rgba(92, 66, 31, var(--book-fold-shade-start)),
    rgba(92, 66, 31, var(--book-fold-shade-end)));
  border-left: 1px solid rgba(115, 91, 59, .18);
  border-right: 1px solid rgba(115, 91, 59, .18);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book-turn-sheet.is-book-turn-forward .book-turn-curl {
  top: calc(100% - var(--book-turn-curl-height, 48px));
}
.book-turn-sheet.is-book-turn-back .book-turn-curl {
  top: 0;
}
.book-turn-sheet.is-book-turn-forward.is-book-turning .book-turn-curl {
  animation: book-curl-forward var(--book-turn-duration) cubic-bezier(.25, .62, .2, 1) both;
}
.book-turn-sheet.is-book-turn-back.is-book-turning .book-turn-curl {
  animation: book-curl-back var(--book-turn-duration) cubic-bezier(.25, .62, .2, 1) both;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-forward .book-turn-destination-shadow,
.book-turn-layer.is-book-turning.is-book-turn-layer-back .book-turn-destination-shadow {
  animation: book-fold-shadow-forward var(--book-turn-duration) cubic-bezier(.25, .62, .2, 1) both;
}
.book-turn-layer.is-book-turning.is-book-turn-layer-back .book-turn-destination-shadow {
  top: 0;
  animation-name: book-fold-shadow-back;
}
@keyframes book-destination-reveal-forward {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes book-destination-reveal-back {
  from { clip-path: inset(100% 0 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes book-front-recede-forward {
  from { clip-path: inset(0 0 0 0); }
  to { clip-path: inset(0 0 100% 0); }
}
@keyframes book-front-recede-back {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes book-curl-forward {
  0% { transform: translateY(0); opacity: 0; }
  8% { transform: translateY(calc(var(--book-turn-travel) * -.08)); opacity: 1; }
  48% { transform: translateY(calc(var(--book-turn-travel) * -.48)); opacity: 1; }
  92% { transform: translateY(calc(var(--book-turn-travel) * -.92)); opacity: 1; }
  100% { transform: translateY(calc(var(--book-turn-travel) * -1)); opacity: 0; }
}
@keyframes book-curl-back {
  0% { transform: translateY(0); opacity: 0; }
  8% { transform: translateY(calc(var(--book-turn-travel) * .08)); opacity: 1; }
  48% { transform: translateY(calc(var(--book-turn-travel) * .48)); opacity: 1; }
  92% { transform: translateY(calc(var(--book-turn-travel) * .92)); opacity: 1; }
  100% { transform: translateY(var(--book-turn-travel)); opacity: 0; }
}
@keyframes book-fold-shadow-forward {
  0% { opacity: 0; transform: translateY(0); }
  48% { opacity: .65; transform: translateY(calc(var(--book-turn-travel) * -.48)); }
  100% { opacity: 0; transform: translateY(calc(var(--book-turn-travel) * -1)); }
}
@keyframes book-fold-shadow-back {
  0% { opacity: 0; transform: translateY(0); }
  48% { opacity: .65; transform: translateY(calc(var(--book-turn-travel) * .48)); }
  100% { opacity: 0; transform: translateY(var(--book-turn-travel)); }
}
@keyframes book-sheet-forward {
  from { transform: translateZ(0); opacity: 1; }
  to { transform: translateZ(0); opacity: 1; }
}
@keyframes book-sheet-back {
  from { transform: translateZ(0); opacity: 1; }
  to { transform: translateZ(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .book-turn-layer.is-book-turning .book-turn-destination-page,
  .book-turn-sheet.is-book-turning .book-turn-flat,
  .book-turn-sheet.is-book-turning .book-turn-curl,
  .book-turn-layer.is-book-turning .book-turn-destination-shadow {
    animation-duration: 1ms !important;
  }
}
}
