
:root {
  --bg: #efeeea;
  --surface: #ffffff;
  --sunken: #f5f4f0;
  --line: #e5e3dc;
  --line-soft: #efedE6;
  --ink: #111110;
  --muted: #6c6a64;
  --faint: #9a978f;
  --mint: #8ae7c6;
  --mint-soft: #e3f7ef;
  --mint-deep: #0a7355;
  --mint-line: #bfe9d9;
  --on-mint: #0e2119;
  --ink-soft: #3d3b37;
  --line-strong: #cfccc2;
  --surface-hover: #fcfcfa;
  --glass: rgba(255,255,255,.86);
  --glass-strong: rgba(255,255,255,.92);
  --btn-dark-bg: #111110;
  --btn-dark-fg: #ffffff;
  --btn-dark-hover: #2c2b28;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --arabic: "Noto Naskh Arabic", "Scheherazade New", "Traditional Arabic", "Segoe UI", serif;
  --shadow: 0 1px 2px rgba(17,17,16,.04), 0 8px 24px rgba(17,17,16,.05);
}

/* ---------- dark theme ---------- */
:root[data-theme="dark"] {
  --bg: #14130f;
  --surface: #201e18;
  --sunken: #1b1a14;
  --line: #34322a;
  --line-soft: #2a2820;
  --line-strong: #47443a;
  --ink: #ece8df;
  --ink-soft: #cdc9bf;
  --muted: #a6a196;
  --faint: #79756b;
  --mint-soft: #163329;
  --mint-deep: #74e3bf;
  --mint-line: #2d5648;
  --surface-hover: #26241d;
  --glass: rgba(26,25,20,.82);
  --glass-strong: rgba(20,19,15,.9);
  --btn-dark-bg: #ece8df;
  --btn-dark-fg: #17160f;
  --btn-dark-hover: #d7d3c8;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.5);
}
:root[data-theme="dark"] .result-ver.is-uu { color: #e6c078; background: #332a17; border-color: #574929; }

* { box-sizing: border-box; }
/* An author `display` rule outranks the UA stylesheet's [hidden] { display: none },
   so cards filtered out by the search box would stay on screen without this. */
[hidden] { display: none !important; }
/* Both bars are sticky: the floating nav is ~90px tall, the controls sit under
   it, so anchored verses need to clear both. */
html { scroll-behavior: smooth; scroll-padding-top: 168px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
a { color: inherit; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; padding: 14px 20px; }
.pillnav {
  max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 16px;
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 8px 8px 20px; box-shadow: var(--shadow);
}
/* Lift the nav's tappable children into their own layer so the sticky bar's
   backdrop-filter can't intercept taps on iOS Safari. */
.pillnav a, .pillnav button { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.01em; text-decoration: none; }
.dot { width: 15px; height: 15px; border-radius: 50%; background: var(--mint); box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 1px var(--mint-deep); }
.navlinks { display: flex; gap: 4px; margin-left: auto; }
.navlink { padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); text-decoration: none; }
.navlink:hover { background: var(--sunken); color: var(--ink); }
.themetoggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.themetoggle:hover { color: var(--ink); border-color: var(--line-strong); }
.themetoggle .theme-ico::before { content: "\263E"; }
:root[data-theme="dark"] .themetoggle .theme-ico::before { content: "\2600\FE0E"; }

/* ---------- shell ---------- */
.shell {
  max-width: 1080px; margin: 0 auto 56px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 30px;
  /* clip, not hidden: `overflow: hidden` would make this a scroll container
     and kill position:sticky on the controls bar inside. */
  overflow: clip;
  box-shadow: var(--shadow);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  border-radius: 999px; padding: 12px 22px; font-size: 15px; font-weight: 550;
  border: 1px solid transparent; transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--btn-dark-bg); color: var(--btn-dark-fg); }
.btn-dark:hover { background: var(--btn-dark-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* ---------- hero ---------- */
.hero { padding: 76px 6% 60px; text-align: center; border-bottom: 1px solid var(--line-soft); }
.badge {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted);
  background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 6px 15px;
}
.badge-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.hero h1 {
  margin: 26px auto 0; max-width: 18ch; font-size: clamp(2rem, 5.2vw, 3.4rem);
  line-height: 1.1; letter-spacing: -.035em; font-weight: 700; text-wrap: balance;
}
.hl { background: var(--mint); color: var(--on-mint); border-radius: 14px; padding: 0 .22em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.epigraph {
  margin: 26px auto 0; max-width: 62ch; padding: 0;
  font-family: var(--serif); font-size: 1.06rem; line-height: 1.6; color: var(--ink-soft);
}
.epigraph p { margin: 0 0 2px; }
.epigraph .clause { color: var(--ink); }
.epigraph cite {
  display: block; margin-top: 14px; font: 500 13px var(--sans); font-style: normal;
  letter-spacing: .04em; color: var(--faint);
}
.epigraph cite a { color: var(--mint-deep); text-decoration: none; }
.epigraph cite a:hover { text-decoration: underline; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line-soft); background: var(--sunken);
}
.stats div { padding: 24px 10px; text-align: center; border-right: 1px solid var(--line-soft); }
.stats div:last-child { border-right: 0; }
.stats strong { display: block; font-size: 1.5rem; letter-spacing: -.03em; }
.stats span { font-size: 12.5px; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 62px 6%; border-bottom: 1px solid var(--line-soft); }
.section:last-of-type { border-bottom: 0; }
.section-head { text-align: center; margin-bottom: 34px; }
.tag {
  display: inline-block; font-size: 12px; letter-spacing: .04em; color: var(--muted);
  background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px;
}
.section-head h2 { margin: 16px 0 8px; font-size: clamp(1.5rem, 3.2vw, 2.1rem); letter-spacing: -.03em; }
.section-head p { margin: 0; color: var(--muted); }
.section-head a { color: var(--mint-deep); font-weight: 500; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }
.disclosure {
  margin-top: 16px; font: inherit; font-size: 13.5px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 9px 20px;
}
.disclosure:hover { border-color: var(--line-strong); color: var(--ink); }
.disclosure[aria-expanded="true"] { background: var(--mint-soft); border-color: var(--mint-line); color: var(--mint-deep); }
.filter {
  margin-top: 22px; width: min(420px, 100%); font: inherit; font-size: 15px;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--sunken); color: var(--ink);
}
.filter:focus { outline: none; border-color: var(--mint-deep); background: var(--surface); }

/* ---------- chapter grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px 17px;
  background: var(--surface); transition: transform .13s ease, border-color .13s ease, background .13s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface-hover); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-num {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 999px; background: var(--mint-soft); color: var(--mint-deep);
  font-size: 13px; font-weight: 650;
}
.card-ini { font-size: 12px; color: var(--mint-deep); letter-spacing: .02em; }
.card-name { font-weight: 600; letter-spacing: -.01em; }
.card-ar { font-family: var(--arabic); font-size: 1.15rem; color: var(--muted); line-height: 1.7; }
.card-meta { font-size: 12.5px; color: var(--faint); }

/* Chapter layout toggle: tiles (default grid) vs. list (rows) */
.grid-toolbar { display: flex; justify-content: flex-end; margin: 2px 0 14px; }
.grid.is-list { grid-template-columns: 1fr; gap: 8px; }
.grid.is-list .card { flex-direction: row; align-items: center; gap: 16px; padding: 11px 18px; border-radius: 14px; }
.grid.is-list .card:hover { transform: none; }
/* promote .card-top's children into the row so initials can sit AFTER the title */
.grid.is-list .card-top { display: contents; }
.grid.is-list .card-num  { order: 1; }
.grid.is-list .card-name { order: 2; flex: 0 1 auto; }
.grid.is-list .card-ini  { order: 3; }
.grid.is-list .card-ar   { order: 4; flex: 0 0 auto; margin-left: auto; }
.grid.is-list .card-meta { order: 5; flex: 0 0 auto; min-width: 172px; text-align: right; }
@media (max-width: 600px) {
  /* Stack each list row: number on the left, the full title on its own line,
     with the verse / revelation-order meta directly beneath it. */
  .grid.is-list .card {
    display: grid; grid-template-columns: auto 1fr;
    column-gap: 14px; row-gap: 2px; align-items: center;
  }
  .grid.is-list .card-num  { grid-row: 1 / span 2; align-self: center; }
  .grid.is-list .card-name { grid-column: 2; grid-row: 1; }
  .grid.is-list .card-meta { grid-column: 2; grid-row: 2; margin: 0; min-width: 0; text-align: left; }
  .grid.is-list .card-ar,
  .grid.is-list .card-ini  { display: none; }
}

.empty { text-align: center; color: var(--muted); }
.searchstate { margin: 12px 0 0; font-size: 13px; color: var(--faint); }
.searchscope { margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.searchscope button { white-space: nowrap; }
.searchopts { margin-top: 12px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ---------- search results ---------- */
.result-group { margin-bottom: 30px; }
.result-group:last-child { margin-bottom: 0; }
.result-group h3 {
  margin: 0 0 10px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); display: flex; align-items: center; gap: 9px;
}
.result-group h3 span {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; font-size: 11.5px; letter-spacing: 0; color: var(--muted);
}
.result-group h3 .match-badge {
  background: var(--mint-soft); border-color: var(--mint-line); color: var(--mint-deep);
}
.result {
  display: grid; grid-template-columns: 84px 62px 1fr; gap: 14px; align-items: baseline;
  padding: 12px 16px; text-decoration: none; border: 1px solid transparent;
  border-radius: 14px; transition: background .12s ease, border-color .12s ease;
}
.result:hover { background: var(--sunken); border-color: var(--line); }
.result-kind { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.result-ref {
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--mint-deep);
}
.result-text { font-family: var(--serif); font-size: .98rem; line-height: 1.55; }
.result-ar { font-family: var(--arabic); font-size: 1.3rem; line-height: 2; text-align: right; }
.result-text mark { background: var(--mint); color: var(--on-mint); border-radius: 4px; padding: 0 2px; }
.result-more { margin: 8px 0 0 16px; font-size: 12.5px; color: var(--faint); }
.show-more {
  margin: 12px 0 0 16px; font: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 8px 18px;
}
.show-more:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-hover); }
.show-more-rem { color: var(--faint); font-size: 12px; margin-left: 6px; }
@media (max-width: 700px) {
  .result { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- appendix list ---------- */
.list { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.listrow {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  text-decoration: none; border-bottom: 1px solid var(--line-soft);
}
.listrow:last-child { border-bottom: 0; }
.listrow:hover { background: var(--sunken); }
.listrow-num { min-width: 30px; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.listrow-title { font-weight: 500; }
.infocard {
  border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px;
  background: var(--sunken); color: var(--muted); max-width: 74ch; margin: 0 auto;
}
.infocard p { margin: 0 0 12px; } .infocard p:last-child { margin: 0; }
.infocard strong { color: var(--ink); font-weight: 600; }
.editions { list-style: none; margin: 16px 0 14px; padding: 0; }
.editions li { margin: 0 0 14px; padding-left: 15px; border-left: 2px solid var(--mint); }
.editions li:last-child { margin-bottom: 0; }
.edition-name { color: var(--ink); font-weight: 600; }
.edition-date {
  margin-left: 9px; font-size: 12px; font-weight: 600; letter-spacing: .03em;
  font-variant-numeric: tabular-nums; color: var(--mint-deep);
  background: var(--mint-soft); border-radius: 999px; padding: 2px 9px;
}
.edition-desc { display: block; margin-top: 4px; }
code { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .9em; }

/* ---------- chapter header ---------- */
.chapter-head { padding: 62px 6% 34px; text-align: center; border-bottom: 1px solid var(--line-soft); }
.eyebrow { margin: 0; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.chapter-head h1 { margin: 12px 0 6px; font-size: clamp(1.9rem, 4.6vw, 2.9rem); letter-spacing: -.035em; }
/* Outranks the right-aligned .ar rule further down. */
.chapter-head .title-ar { margin: 0; font-size: 1.6rem; color: var(--muted); text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted);
  background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.chip strong { color: var(--ink); font-weight: 600; }
.chip-mint { background: var(--mint-soft); border-color: var(--mint-line); color: var(--mint-deep); }
.chip-mint strong { color: var(--mint-deep); }
.chip-quiet { color: var(--faint); }
.ini-ar { font-family: var(--arabic); font-size: 1.05rem; letter-spacing: .12em; }

/* ---------- controls ---------- */
.controls {
  position: sticky; top: 90px; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center;
  padding: 14px 6%; background: var(--glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.segmented { display: inline-flex; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.segmented button, .pilltoggle {
  font: inherit; font-size: 13.5px; cursor: pointer; border-radius: 999px;
  padding: 7px 16px; border: 1px solid transparent; background: transparent; color: var(--muted);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.toggles { display: inline-flex; gap: 8px; }
.pilltoggle { border-color: var(--line); background: var(--surface); }
.pilltoggle[aria-pressed="true"] { background: var(--mint-soft); border-color: var(--mint-line); color: var(--mint-deep); }

/* ---------- verses ---------- */
.verses { padding: 10px 6% 54px; }
.v { display: grid; grid-template-columns: 92px 1fr; gap: 4px 20px; padding: 22px 0; border-bottom: 1px solid var(--line-soft); }
.v:last-child { border-bottom: 0; }
.vnum {
  display: inline-block; text-decoration: none; font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--mint-deep); background: var(--mint-soft);
  border-radius: 999px; padding: 4px 11px; margin-top: 3px;
}
.vnum:hover { background: var(--mint); color: var(--on-mint); }
.vbody { display: grid; gap: 12px; }
.en { margin: 0; font-family: var(--serif); font-size: 1.09rem; line-height: 1.62; }
.ar { margin: 0; font-family: var(--arabic); font-size: 1.45rem; line-height: 2.05; text-align: right; }
.subtitle {
  grid-column: 1 / -1; margin: 34px 0 8px; text-align: center;
  font-size: 1.2rem; font-weight: 650; letter-spacing: -.01em; line-height: 1.35;
  color: var(--mint-deep);
}
.footnote {
  grid-column: 2; margin-top: 14px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--sunken); padding: 16px 20px; font-size: .92rem; color: var(--ink-soft);
}
.footnote-tag {
  display: inline-block; margin-bottom: 8px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--faint);
}
.footnote-body pre { white-space: pre-wrap; font-size: .85em; margin: 8px 0; }
.footnote a { color: var(--mint-deep); }

@media (min-width: 1000px) {
  .verses[data-view="both"] .vbody { grid-template-columns: 1fr 1fr; align-items: start; gap: 26px; }
}
.verses[data-view="english"] .ar, .verses[data-view="arabic"] .en { display: none; }
.verses[data-footnotes="off"] .footnote, .verses[data-subtitles="off"] .subtitle { display: none; }
/* English translation switch (Masjid Tucson vs UniversalUnity.org) */
body[data-translation="tucson"] .en-uu,
body[data-translation="uu"] .en-tucson,
body[data-translation="tucson"] .subtitle-uu,
body[data-translation="uu"] .subtitle-tucson,
body[data-translation="tucson"] .footnote-uu,
body[data-translation="uu"] .footnote-tucson,
body[data-translation="tucson"] .ttl-uu,
body[data-translation="uu"] .ttl-tucson { display: none; }
/* UU.org footnotes are placed in document order (per the UU.org sequence) as
   flow blocks between verses, not nested in a verse's grid like Tucson's. */
.verses > .footnote-uu { margin: 16px 0 6px; }
@media (min-width: 861px) { .verses > .footnote-uu { margin-left: 112px; } }
/* Search result version badge */
.result-ver { display:inline-block; margin-left:8px; font-size:10.5px; font-weight:600;
  letter-spacing:.03em; text-transform:uppercase; color:var(--mint-deep);
  background:var(--mint-soft); border:1px solid var(--mint-line); border-radius:999px; padding:1px 7px;
  vertical-align:middle; }
.result-ver.is-uu { color:#8a5a00; background:#fbf1dd; border-color:#efd9a8; }

/* ---------- chapter nav + prose ---------- */
.chapter-nav { display: flex; justify-content: space-between; gap: 12px; padding: 0 6% 54px; }
.prose { padding: 34px 6% 56px; max-width: 78ch; margin: 0 auto; font-size: 1.02rem; }
.prose h1 { font-size: 1.7rem; letter-spacing: -.02em; }
.prose h2, .prose h3 { letter-spacing: -.02em; margin-top: 1.8em; }
.prose a { color: var(--mint-deep); }
.prose table { border-collapse: collapse; margin: 18px 0; font-size: .92rem; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: 5px 10px; }
.prose .appsource { color: var(--faint); font-size: .9rem; }
.prose img { max-width: 100%; height: auto; }
.missing-figure {
  display: inline-block; margin: 6px 0; padding: 6px 13px; border-radius: 999px;
  border: 1px dashed var(--line); background: var(--sunken);
  color: var(--faint); font-size: 12.5px; font-family: var(--sans);
}

/* ---------- index to the Quran ---------- */
.ix-controls {
  position: sticky; top: 90px; z-index: 10; text-align: center;
  padding: 12px 6% 14px; background: var(--glass-strong);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.azbar { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.az {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--mint-deep); background: var(--mint-soft); border: 1px solid var(--mint-line);
}
.az:hover { background: var(--mint); color: var(--on-mint); }
.az-off { color: var(--faint); background: var(--sunken); border-color: var(--line); }
.ix-controls .filter { margin-top: 12px; }
.ix-body { max-width: 74ch; }
.ix-letter {
  margin: 30px 0 10px; padding-bottom: 6px; font-size: 1.6rem; letter-spacing: -.02em;
  color: var(--mint-deep); border-bottom: 1px solid var(--line);
}
.ix-letter:first-child { margin-top: 6px; }
.ix { margin: 0 0 12px; font-size: .98rem; line-height: 1.6; }
.ix-t { font-weight: 650; color: var(--ink); }
.ix ul { margin: 4px 0 0; padding-left: 22px; }
.ix li { margin: 2px 0; color: var(--muted); }
.ix a { color: var(--mint-deep); text-decoration: none; font-variant-numeric: tabular-nums; }
.ix a:hover { text-decoration: underline; }
.ix-empty { text-align: center; color: var(--muted); }
@media (max-width: 640px) {
  .ix-controls { position: static; padding: 12px 7%; }
  .az { min-width: 34px; height: 34px; }
}

/* ---------- footer ---------- */
.foot { padding: 30px 6% 34px; border-top: 1px solid var(--line-soft); background: var(--sunken); color: var(--faint); font-size: 13px; }
.foot p { margin: 0 0 4px; }

@media (max-width: 860px) {
  .navlinks { display: none; }
  .v { grid-template-columns: 1fr; gap: 10px; }
  .footnote { grid-column: 1; }
  .shell { border-radius: 22px; }
}

/* ---------- phones / touch ---------- */
@media (max-width: 640px) {
  /* Only the top bar stays sticky now, so anchored verses just clear it. */
  html { scroll-padding-top: 96px; }
  .topbar { padding: 10px 12px; }
  .pillnav { gap: 10px; padding: 7px 7px 7px 16px; }

  /* Tighter vertical rhythm so content isn't buried under generous desktop padding */
  .hero { padding: 44px 7% 38px; }
  .section { padding: 40px 7%; }
  .chapter-head { padding: 40px 7% 26px; }
  .verses { padding: 6px 7% 40px; }
  .chapter-nav { padding: 0 7% 40px; }
  .prose { padding: 26px 7% 44px; }
  .foot { padding: 26px 7% 30px; }

  /* The controls bar wraps to ~200px on a phone; keep it in flow (not sticky)
     so it doesn't permanently occupy a quarter of the screen while reading. */
  .controls { position: static; padding: 12px 7%; gap: 10px; }

  /* Roomier tap targets (min ~44px) for the pill controls */
  .segmented button, .pilltoggle, .disclosure, .show-more {
    min-height: 42px; padding-top: 10px; padding-bottom: 10px;
  }
  .segmented { gap: 3px; }
  .themetoggle { width: 42px; height: 42px; font-size: 16px; }
  .vnum { padding: 6px 12px; }

  /* 16px inputs prevent iOS from zooming in on focus */
  .filter { font-size: 16px; }

  /* Chapter prev/next stack full-width for easier tapping */
  .chapter-nav { flex-direction: column; }
  .chapter-nav a { width: 100%; justify-content: center; text-align: center; }
}

/* ---------- front-matter verse block + signoff ---------- */
.prose .frontmatter-verses {
  margin: 24px 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--mint);
  font-family: var(--serif); color: var(--ink-soft);
}
.prose .frontmatter-verses p { margin: 0 0 8px; }
.prose .frontmatter-verses p:last-child { margin: 0; }
.prose .signoff { margin-top: 30px; font-weight: 600; color: var(--ink); }
.prose .signoff span { display: block; margin-top: 2px; font-weight: 400; font-size: .92rem; color: var(--muted); }

/* ---------- front-matter / appendix "next page" link ---------- */
.page-next { display: flex; justify-content: flex-end; padding: 6px 6% 46px; }
.page-next .btn { max-width: 100%; }
@media (max-width: 640px) {
  .page-next { padding: 6px 7% 38px; }
  .page-next .btn { width: 100%; justify-content: center; }
}

/* Appendix pages: highlight which appendix via a bigger, bold kicker */
.eyebrow-appendix { font-size: 1rem; font-weight: 700; letter-spacing: .08em; color: var(--mint-deep); }
