/* Buyer pages: library, prayers, reader, thank-you, lost link, errors.
   Rubric Brown, matching the sales page. Rules from the brief: body text 20px+,
   big headings, buttons 48px+ tall and full width on phones, plain-word labels,
   no icon without a label. */

@font-face { font-family: 'Cardo'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/cardo-400.woff2') format('woff2'); }
@font-face { font-family: 'Cardo'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/cardo-700.woff2') format('woff2'); }
@font-face { font-family: 'Cardo'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/cardo-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/literata-400-700.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --paper: #f5efe6;   /* warm parchment */
  --card: #fbf8f3;    /* buttons and boxes: a shade lighter, never pure white */
  --ink: #2a1d17;
  --soft: #5a4a40;
  --rust: #8a3f22;
  --rust-dark: #6f3119;
  --rule: #e2d6c6;
  --tint: #ede3d5;
  --focus: #1f5fd1;
  --head: 'Cardo', Georgia, 'Times New Roman', serif;
  --text: 'Literata', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

/* 131.25% = 21px at the default setting, and grows if the buyer has chosen
   larger text. Everything below is in rem, so nothing is under 20px except
   the small print at 0.875rem (18px). */
html { font-size: 131.25%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.6 var(--text); }
h1, h2, h3 { font-family: var(--head); font-weight: 400; line-height: 1.15; margin: 0; }
p { margin: 0 0 16px; }
a { color: var(--rust); text-underline-offset: 0.18em; }
a:hover { color: var(--rust-dark); }
a:focus-visible, button:focus-visible, audio:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Buttons and tools: two quick taps (Bigger, Bigger) mean two presses, not
   Safari's double-tap zoom. Pinch zoom still works everywhere; the viewport
   never limits it. */
button, .button, .tool, .prayer, .toc-entry, .to-library, .book-toc a { touch-action: manipulation; }

/* Name at the top, as on the sales page. */
.site { text-align: center; padding: 20px 16px 16px; border-bottom: 1px solid var(--rule); }
.site .name { color: var(--rust); font: 700 0.875rem/1.2 var(--text); letter-spacing: 0.1em; text-transform: uppercase; }

main { max-width: 32rem; margin: 0 auto; padding: 36px 16px 64px; }
main.wide { max-width: 44rem; }

h1 { font-size: 2.1rem; text-align: center; margin-bottom: 12px; }
h2 { font-size: 1.5rem; }
.lead { font-size: 1.1rem; line-height: 1.5; text-align: center; }
.center { text-align: center; }
.soft { color: var(--soft); }
.note { color: var(--soft); }
.small { font-size: 0.95rem; color: var(--soft); }

/* The cross between two rules. */
.ornament { display: flex; align-items: center; gap: 14px; color: var(--rust); width: min(220px, 60%); margin: 8px auto 22px; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.ornament .cross { width: 14px; height: 20px; }

/* Big buttons. Library buttons: a dark-brown outline with a rust icon.
   .primary: solid rust, for the one main action on a page. */
.actions { display: grid; gap: 14px; margin: 28px 0 32px; }
.button {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 76px; padding: 14px 18px;
  border: 2px solid var(--ink); border-radius: 8px; background: var(--card); color: var(--ink);
  text-decoration: none; font-family: var(--text); cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}
.button:hover { background: var(--tint); color: var(--ink); }
.button:active { transform: translateY(1px); }
.button .icon { flex: none; width: 34px; height: 34px; color: var(--rust); }
.button .words { display: block; }
.button .label { display: block; font-weight: 700; font-size: 1.1rem; line-height: 1.25; }
.button .hint { display: block; font-size: 0.95rem; line-height: 1.35; color: var(--soft); margin-top: 2px; text-wrap: pretty; }
.button.primary { background: var(--rust); border-color: var(--rust); color: #fff; justify-content: center; text-align: center; }
.button.primary:hover { background: var(--rust-dark); border-color: var(--rust-dark); }
.button.primary .icon, .button.primary .hint { color: #fff; }
.button.primary:has(.icon) { justify-content: flex-start; text-align: left; }
button.button { font-size: 1rem; }

/* Library page, "Keep a copy": the downloads. Quieter than the main buttons
   above (thin lighter outline, no fill, smaller words), still easy to tap. */
.keep { margin: 0 0 32px; }
.keep h2 { font-size: 1.4rem; text-align: center; margin-bottom: 4px; }
.keep-note { margin: 0 0 14px; text-align: center; color: var(--soft); font-size: 0.95rem; }
.keep .actions { gap: 12px; margin: 0; }
.keep .button { min-height: 60px; padding: 8px 16px; gap: 14px; border-width: 1px; border-color: var(--soft); background: transparent; }
.keep .button:hover { background: var(--tint); }
.keep .button .icon { width: 28px; height: 28px; }
.keep .button .label { font-size: 1rem; }

.foot-note { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--rule); text-align: center; color: var(--soft); }
.foot-note p { margin-bottom: 10px; }

/* The way back to the library: same words, same place, on every inner page. */
.to-library { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; text-decoration: none; }
.to-library::before { content: "\2190\00a0"; }
.to-library:hover { text-decoration: underline; }
.page-top { margin: -16px 0 8px; }
.page-bottom { text-align: center; }

/* ---------- Prayers: each row is its own play button ---------- */
/* overflow-anchor: prayers.js puts a tapped prayer just below the top bar
   itself; without this, some browsers nudge the page again when the
   "Playing" line appears in it, and the prayer slides under the bar. */
.prayers { list-style: none; margin: 8px 0 32px; padding: 0; display: grid; gap: 12px; overflow-anchor: none; }
.prayer {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 16px;
  min-height: 80px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: 8px;
  background: var(--card); color: var(--ink); text-decoration: none;
  transition: background-color 150ms ease;
}
.prayer:hover { background: var(--tint); color: var(--ink); }
.prayer .play {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; background: var(--rust); color: #fff;
}
.prayer .play svg { width: 26px; height: 26px; }
.prayer .when-playing { display: none; }
.prayer.is-playing .when-playing { display: block; }
.prayer.is-playing .when-stopped { display: none; }
.prayer .day { display: block; color: var(--rust); font-size: 0.875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.3; }
.prayer .title { display: block; font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.prayer .pnote { display: block; font-size: 0.95rem; line-height: 1.35; color: var(--soft); }
.prayer .state { display: block; font-size: 0.95rem; color: var(--soft); }
.prayer .state:empty { display: none; }
.prayer .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: transparent; }
.prayer .progress span { display: block; height: 100%; width: 0; background: var(--rust); }
/* The one that's playing (or paused): rust, so it's obvious which it is. */
.prayer.is-current { background: var(--rust); border-color: var(--rust); color: #fff; }
.prayer.is-current .play { background: var(--card); color: var(--rust); }
.prayer.is-current .state, .prayer.is-current .day { color: #fff; }
.prayer.is-current .pnote { display: none; }
.prayer.is-current .progress { background: rgba(255, 255, 255, 0.3); }
.prayer.is-current .progress span { background: var(--card); }

/* The words under a tapped prayer, to read along: joined to the card above. */
.prayer[aria-expanded="true"] { border-radius: 8px 8px 0 0; }
.prayer-text {
  padding: 22px 20px 6px; border: 2px solid var(--rust); border-top: 0; border-radius: 0 0 8px 8px;
  background: var(--card);
}
.prayer-text .verse { margin: 0 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.prayer-text blockquote { margin: 0; }
.prayer-text blockquote p { margin: 0 0 8px; font: italic 400 1.2rem/1.45 var(--head); }
.prayer-text figcaption { color: var(--rust); font-weight: 700; font-size: 0.95rem; }
.prayer-text > p { font-size: 1.05rem; line-height: 1.6; margin: 0 0 20px; }
@media (max-width: 520px) {
  .prayer-text { padding: 20px 16px 4px; }
}

/* The bar at the top of the prayers page: the reader's bar (below), right
   under the name like the reader's, with Back to top on the right. */
main:has(> .top-bar) { padding-top: 0; }
.top-bar + h1 { margin-top: 28px; }
.to-top { margin-left: auto; text-decoration: none; }
.to-top:hover { color: var(--ink); }
.to-top span { color: var(--rust); font-size: 1.1rem; }
/* Back to top moves keyboard focus to the title; no box drawn around it. */
h1[tabindex="-1"]:focus { outline: none; }
/* A prayer reached with the keyboard stops below the bar, not under it.
   (A tapped prayer is placed below it by prayers.js.) */
html:has(.top-bar) { scroll-padding-top: calc(max(48px, 1.6rem) + 33px); }

/* ---------- Book reader ---------- */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main.wide:has(.reader) { padding-top: 0; }

/* One toolbar that stays at the top while reading: Library and Contents on
   the left, the page in the middle, text size on the right. The prayers page
   has the same bar (.top-bar): Library on the left, Back to top on the right. */
.reader-bar, .top-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin: 0 -16px; padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.reader-tools { flex: 1; display: flex; align-items: center; gap: 12px; }
.reader-tools[hidden], .resume[hidden], .reader-msg[hidden], .tool[hidden] { display: none; }
.page-status { flex: 1; margin: 0; color: var(--soft); font-size: 0.95rem; text-align: center; white-space: nowrap; }
.zoom { display: flex; gap: 8px; }
/* The toolbar's buttons: Contents, Smaller, Bigger, and Close in the list. */
.zoom button, .tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 8px;
  background: var(--card); color: var(--ink); font: 700 0.95rem/1 var(--text); cursor: pointer;
}
.zoom button:hover, .tool:hover { background: var(--tint); }
.tool-icon { flex: none; width: 22px; height: 22px; color: var(--rust); }
/* At the smallest or biggest size: still readable, just plainly not pressable. */
.zoom button:disabled { border-color: var(--rule); background: transparent; color: var(--soft); cursor: default; }

.reader-msg { margin: 24px 0; text-align: center; }

/* While the book opens, only "Opening the book…" shows. The download button
   and the way back below wait until the pages are there (then they sit at
   the end of the book), or until the book can't open (then the button sits
   right under that message). reader.mjs sets data-ready; reader-watchdog.js
   sets data-failed. Without JavaScript, the copy in <noscript> shows. */
.reader:not([data-ready]):not([data-failed]) ~ .actions,
.reader:not([data-ready]):not([data-failed]) ~ .page-bottom { display: none; }

/* The switch between the book's two views: "Text view" in the PDF reader's
   bar, "Page view" in Text view's. A link that looks like the bar's buttons. */
a.tool { text-decoration: none; }
a.tool:hover { color: var(--ink); }
.view-switch { flex: none; }

/* Phones: Library, the page count and the view switch on one line;
   Contents and the size buttons below, sharing the width. The tools join
   the bar's own rows (display: contents) so the page count can sit up top. */
@media (max-width: 520px) {
  .reader-bar { gap: 6px 8px; }
  .reader-tools { display: contents; }
  .reader-bar > .to-library { order: 1; }
  .page-status {
    order: 2; flex: 1 1 0; min-width: 0;
    font-size: 0.875rem; line-height: 1.15; white-space: normal; text-align: right; text-wrap: balance;
  }
  .view-switch ~ .reader-tools .page-status { text-align: center; }
  .view-switch { order: 3; padding: 8px 12px; }
  .reader-bar::after { content: ""; order: 4; flex-basis: 100%; margin-bottom: -6px; }
  .reader-tools .tool { order: 5; }
  .zoom { order: 6; }
  .reader-tools .tool, .zoom button { flex: 1 1 auto; gap: 6px; padding: 8px; }
  .reader-tools .tool-icon { width: 18px; height: 18px; }
  .zoom { flex: 2 1 auto; gap: 6px; }
}
/* Text view on phones and small tablets: two calm rows. "Library" and
   "Page view" on top; Contents, Smaller and Bigger below. Where you are in
   the book isn't written in the bar here (the chapter titles and the
   Contents list show it); it is on wider screens, where it fits on one row.
   56em: the one row needs about 850px at the normal text size, and an em
   breakpoint grows with a larger text setting in the browser. */
@media (max-width: 56em) {
  .text-bar { gap: 6px 8px; }
  .text-bar .reader-tools { display: contents; }
  .text-bar .page-status { display: none; }
  .text-bar > .to-library { order: 1; }
  .text-bar .view-switch { order: 3; margin-left: auto; }
  .text-bar::after { content: ""; order: 4; flex-basis: 100%; margin-bottom: -6px; }
  .text-bar .reader-tools .tool { order: 5; }
  .text-bar .zoom { order: 6; margin-left: auto; }
}

/* Narrow phones: the icon goes so the three buttons still fit on one line.
   With a view switch on the top line, the page count moves to a line of its
   own under the buttons, where it fits without wrapping. */
@media (max-width: 374px) {
  .reader-tools .tool-icon { display: none; }
  .reader-bar .view-switch { margin-left: auto; }
  .view-switch ~ .reader-tools .page-status { order: 7; flex-basis: 100%; white-space: nowrap; }
}
@media (max-width: 335px) {
  .reader-tools .tool, .zoom button { padding: 8px 6px; font-size: 0.875rem; }
}

/* ---------- Contents list (the reader's "Contents" button) ---------- */
/* A panel in the middle on bigger screens; the whole screen on phones. */
.contents {
  width: min(36rem, calc(100% - 32px)); max-height: calc(100% - 48px); padding: 0; overflow: hidden; /* only the list scrolls */
  border: 0; border-radius: 10px; background: var(--paper); color: var(--ink);
  box-shadow: 0 18px 50px rgba(42, 29, 23, 0.35);
}
.contents[open] { display: flex; flex-direction: column; }
.contents::backdrop { background: rgba(42, 29, 23, 0.55); }
.contents-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 16px 10px 20px; border-bottom: 1px solid var(--rule); background: var(--paper);
}
.contents-head h2 { font-size: 1.6rem; }
.contents-head .tool { min-width: 7rem; }
/* position: relative keeps the hidden screen-reader words inside the scrolling list. */
.contents-body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 28px; }
.contents-hint { margin: 0 4px 8px; color: var(--soft); font-size: 0.95rem; }
.toc, .toc ul { list-style: none; margin: 0; padding: 0; }
.toc-part h3 { margin: 20px 4px 4px; font-size: 1.25rem; line-height: 1.25; text-wrap: balance; }
.toc-part-l {
  display: block; margin-bottom: 2px; color: var(--rust); font: 700 0.875rem/1.3 var(--text);
  letter-spacing: 0.06em; text-transform: uppercase;
}
/* Each line is one big button: number, title, page. */
.toc-entry {
  display: grid; grid-template-columns: 2rem 1fr auto; align-items: baseline; gap: 4px 10px;
  width: 100%; min-height: 56px; padding: 12px 10px 12px 6px;
  border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: none;
  color: var(--ink); font: 400 1rem/1.35 var(--text); text-align: left; cursor: pointer;
}
.toc-entry:hover { background: var(--tint); }
/* In Text view the lines are links (to places in the text): same look. */
a.toc-entry, a.toc-entry:hover { color: var(--ink); text-decoration: none; }
.toc-entry:focus-visible { outline-offset: -3px; }
.toc-n { color: var(--rust); font-weight: 700; text-align: right; }
.toc-t { text-wrap: pretty; }
.toc-pg { color: var(--soft); font-size: 0.95rem; }
.toc-entry[aria-current] { background: var(--tint); box-shadow: inset 5px 0 0 var(--rust); }
.toc-entry[aria-current] .toc-t { font-weight: 700; }
.toc-here { display: block; margin-top: 2px; color: var(--rust-dark); font-size: 0.875rem; font-weight: 700; }
@media (max-width: 520px) {
  .contents { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border-radius: 0; }
  .contents-head { padding-left: 16px; }
  .contents-body { padding: 8px 12px 28px; }
}

/* Pages run edge to edge on phones; "Bigger" makes them wider than the
   screen, and this strip then scrolls sideways. */
.pages { overflow-x: auto; margin: 12px -16px 8px; -webkit-overflow-scrolling: touch; }
.page { margin: 0 auto 12px; background: var(--card); box-shadow: 0 0 0 1px var(--rule); }
.page canvas { display: block; width: 100%; height: 100%; }

/* "Welcome back": when the reader reopens where they stopped, this sits just
   above that page, at the top of the screen, until they move on. Gold and
   bordered so it's seen at a glance. */
.resume {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  max-width: 36rem; margin: 0 auto 12px; padding: 14px 16px;
  border-left: 6px solid var(--rust); border-radius: 6px; background: #efe2cc;
}
.resume p { flex: 1 1 14rem; margin: 0; font-size: 1.05rem; line-height: 1.45; }
.resume strong { color: var(--rust-dark); }
.resume .tool { background: var(--card); }
@media (max-width: 520px) {
  .resume { margin: 0 12px 12px; }
}

/* ---------- Text view: the book as web text ---------- */
/* Set like the PDF: parchment, Literata for reading, Cardo for titles,
   verses and the prayer, rust for chapter numbers and verse references.
   Everything inside .book is in em, so Smaller and Bigger (text-view.js,
   --text-size) grow it all together, and the words rewrap to the screen
   instead of running off the side. */
main.wide:has(> .reader-bar) { padding-top: 0; }
/* text-view.js keeps the place itself as the words grow and rewrap, so the
   browser's own adjusting (scroll anchoring) is turned off here. */
html:has(.book) { scroll-padding-top: 9rem; overflow-anchor: none; }
.book {
  max-width: 34em; margin: 0 auto; padding-top: 4px;
  font-size: calc(var(--text-size, 1) * 1rem); line-height: 1.65;
  overflow-wrap: break-word;
}
/* At the biggest sizes a phone fits only a few words to a line: a long word
   is split where a dictionary would split it, with a hyphen. */
.text-big .book { -webkit-hyphens: auto; hyphens: auto; }
.book p { margin: 0 0 1em; }
.book a { color: var(--rust); }
.book h2[tabindex="-1"]:focus { outline: none; }

/* Each part of the book starts below a rule, as each starts a new page in the PDF. */
.book section { margin-top: 2.6em; padding-top: 2.4em; border-top: 1px solid var(--rule); }
.book section:first-child { margin-top: 0; padding-top: 1.6em; border-top: 0; }

/* The cover, as the PDF opens: the width of the words on phones, a book's
   size on bigger screens. Its width and height are on the image, so its
   space is kept while it loads; the brown shows until it arrives. */
/* Fixed space above the cover, so Smaller and Bigger don't move it. */
.book section.cover { padding-top: 1.6rem; }
.book .cover img {
  display: block; width: 100%; max-width: min(100%, 24rem); height: auto; margin: 0 auto;
  border-radius: 3px; background: #3b2a20;
  box-shadow: 0 2px 4px rgba(42, 29, 23, 0.18), 0 12px 32px rgba(42, 29, 23, 0.16);
}

.book .dedication { padding: 2.2em 0 1.4em; text-align: center; }
.book .dedication p { max-width: 18em; margin: 0 auto; font: italic 400 1.25em/1.45 var(--head); text-wrap: balance; }

/* Chapter and part openers: "CHAPTER 1" in rust capitals, then the title. */
.book .opener { margin: 0 0 1.1em; }
/* Titles grow a little less than the words, so at the biggest sizes a phone
   still fits more than one word of a title to a line. */
.book h2 { font: 400 min(1.9em, 1.05em + 0.85rem)/1.15 var(--head); text-wrap: balance; }
.book .kicker {
  display: block; margin-bottom: 0.6em; color: var(--rust);
  font: 400 0.46em/1.2 var(--text); letter-spacing: 0.16em; text-transform: uppercase;
}

/* The verse under a title: in italics between two rules, its reference below. */
.book .verse { margin: 0 0 1.4em; padding: 0.8em 0 0.7em; border-top: 1px solid #cdbca7; border-bottom: 1px solid #cdbca7; }
.book .verse blockquote { margin: 0; }
.book .verse p { margin: 0 0 0.35em; font: italic 400 1.15em/1.45 var(--head); }
.book .ref, .book .verse figcaption { color: var(--rust); }

/* The first letter of a chapter, large and rust, as in the PDF (where the browser can). */
@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
  .book p.first::first-letter {
    -webkit-initial-letter: 3; initial-letter: 3;
    margin-right: 0.1em; color: var(--rust); font-family: var(--head);
  }
  .text-big .book p.first::first-letter { -webkit-initial-letter: 2; initial-letter: 2; }
}

.book h3 { margin: 1.8em 0 0.55em; font: 700 min(1.3em, 1.05em + 0.25rem)/1.25 var(--head); text-wrap: balance; }
.book ol { margin: 0 0 1em; padding-left: 1.7em; }
.book li { margin: 0 0 0.45em; padding-left: 0.2em; }
.book li::marker { font-weight: 700; }
.book .question { margin: 1.5em 0 0.4em; }
.book .question + p { margin-top: 0; }
/* The prayer at the end of each chapter, in italics. */
.book .pray { font: italic 400 1.15em/1.55 var(--head); }
/* LORD as the King James prints it: a capital L, then small capitals. */
.book .sc { font-variant-caps: all-small-caps; letter-spacing: 0.03em; }

/* "Try this": a box, as in the PDF. */
.book .try {
  margin: 1.6em 0 1.8em; padding: 1em 1.1em 0.3em;
  border: 2px solid var(--soft); border-radius: 6px; background: var(--card);
}
.book .try-head { margin: 0 0 0.7em; font: 700 1.1em/1.35 var(--text); text-wrap: balance; }
.book .try-label { color: var(--rust); }

/* Contents, as on the PDF's contents pages: each part's name in small rust
   capitals over its title, each chapter's number in rust beside its title
   (above it on phones and at big sizes). Every row is one big link. */
.book .book-toc, .book .book-toc ul, .book .book-toc li { list-style: none; margin: 0; padding: 0; }
.book .book-toc { container-type: inline-size; }
.book .book-toc a {
  display: block; padding: 0.6em 0.3em; border-bottom: 1px solid var(--rule);
  color: var(--ink); text-decoration: none; line-height: 1.35; text-wrap: pretty;
}
.book .book-toc a:hover { background: var(--tint); }
.book .book-toc > li:first-child > a { border-top: 1px solid var(--rule); }
.book .book-toc li.book-toc-part { margin-top: 1em; }
.book .book-toc-part > a { padding: 0.65em 0.3em; text-align: center; font: 700 1.15em/1.3 var(--head); text-wrap: balance; }
.book .book-toc-part > a .book-toc-label {
  display: block; margin-bottom: 0.15em; color: var(--rust);
  font: 400 0.76em/1.3 var(--text); letter-spacing: 0.14em; text-transform: uppercase;
}
.book .book-toc-part li .book-toc-label { display: block; color: var(--rust); font-size: 0.875em; font-weight: 700; }
@container (min-width: 26em) {
  .book .book-toc-part li a { display: grid; grid-template-columns: 6.2em 1fr; gap: 0 0.5em; align-items: baseline; }
}

/* Scripture index: one plain list, book by book (two columns, as in the
   PDF, would mean scrolling down the whole first one and back up). Each
   chapter name is a link; the space above and below it is part of the tap. */
.book .index-book h3 { margin: 1.1em 0 0.2em; font-size: 1.15em; }
.book .index-book ul { list-style: none; margin: 0; padding: 0; }
.book .index-book li { margin: 0; padding: 0.3em 0; line-height: 1.5; }
.book .index-book a { padding: 0.4em 0; }

/* "Welcome back", when it sits in the text: it grows with the words, though
   not all the way, so at the biggest sizes it doesn't fill the screen. */
.book .resume { margin: 0 0 1.4em; font-size: 1rem; -webkit-hyphens: manual; hyphens: manual; }
.book .resume p { font-size: calc(min(var(--text-size, 1), 1.65) * 1.05rem); }

@media (max-width: 520px) {
  .book .try { padding: 0.9em 0.85em 0.2em; }
  .book ol { padding-left: 1.5em; }
}

/* ---------- Lost-link form ---------- */
.lost-link { display: grid; gap: 12px; margin: 24px 0 28px; }
.lost-link label { font-weight: 700; }
.lost-link input {
  width: 100%; min-height: 64px; padding: 12px 16px; border: 2px solid var(--ink); border-radius: 8px;
  background: var(--card); color: var(--ink); font: 1.1rem/1.3 var(--text);
}
