/* Holy Bible — site styles. Mobile first, no framework. */

@font-face {
  font-family: "Cookie";
  src: url("fonts/Cookie-Regular.woff2") format("woff2");
  font-display: block;  /* preloaded; never swap fonts in the header */
}

:root {
  --bg: #fbf7ef;
  --surface: #ffffff;
  --surface-2: #f4ede0;
  --fg: #1f1a17;
  --muted: #6b625a;
  --border: #e7dccb;
  --brand: #5a2f21;
  --brand-ink: #ffffff;
  --link: #8a3b1e;
  --gold: #e9a91c;
  --mark: #fff1c7;
  --xref: #2f6f86;
  --shadow: 0 1px 2px rgba(60, 35, 20, .06), 0 4px 16px rgba(60, 35, 20, .06);
  --radius: 12px;
  --fs: 19px;
  --dur-fast: .15s;
  --dur: .22s;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, Cambria, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #16120f;
  --surface: #1f1a16;
  --surface-2: #29221c;
  --fg: #ece5da;
  --muted: #a89c8e;
  --border: #3a3029;
  --brand: #f2c14e;
  --brand-ink: #1b140f;
  --link: #f0b45a;
  --gold: #f2c14e;
  --mark: #4a3a17;
  --xref: #7cc3d8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

html[data-theme="sepia"] {
  --bg: #f4ecd8;
  --surface: #fbf5e6;
  --surface-2: #ece0c4;
  --fg: #3b2f22;
  --muted: #7a6a55;
  --border: #e0d1b0;
  --brand: #6b3a24;
  --brand-ink: #fff8ea;
  --link: #8a3b1e;
  --mark: #f1dc9c;
  --xref: #2f6170;
  color-scheme: light;
}

* { box-sizing: border-box; }

/* Always reserve the scrollbar's space so short and long pages line up (no sideways jump) */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; overflow-y: scroll; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; font-family: var(--serif); font-weight: 600; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); margin: .2em 0 .1em; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }

.muted { color: var(--muted); }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { left: 8px; }

/* ------------------------------------------------------------ header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);   /* solid: translucent/blurred headers re-render on every navigation */
  border-bottom: 1px solid var(--border);
}
.top-in {
  max-width: 1120px; margin: 0 auto; padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--brand); flex-shrink: 0;
}
.brand img { display: block; }
.brand span { font-family: "Cookie", cursive; font-size: 1.9rem; line-height: 1; padding-top: 2px; }
.top-nav { display: flex; gap: 14px; margin-left: 6px; }
.top-nav a { color: var(--fg); text-decoration: none; font-size: .95rem; }
.top-nav a:hover { color: var(--link); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* Catholic · Protestant · Protestant KJV (0.9.0). Each button is as wide as its own label (label widths measured in
   Chrome in em, plus a little for other browsers' text rendering, plus --cs-pad on each side); the sliding thumb takes
   the position and width of the chosen one. */
.canon-switch {
  --cs-pad: 10px;
  --cs-w1: calc(4.15em + 2 * var(--cs-pad));
  --cs-w2: calc(5.2em + 2 * var(--cs-pad));
  --cs-w3: calc(7.45em + 2 * var(--cs-pad));
  position: relative; display: inline-grid; grid-template-columns: var(--cs-w1) var(--cs-w2) var(--cs-w3);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--surface);
  font: 600 .78rem/1 var(--sans);
}
.canon-switch::before {
  content: ""; position: absolute; top: 2px; bottom: 2px; left: 2px; width: var(--cs-w1);
  border-radius: 999px; background: var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform var(--dur) var(--ease), width var(--dur) var(--ease), background-color var(--dur) ease;
}
html[data-canon="protestant"]:not([data-tr="kjv"]) .canon-switch::before { transform: translateX(var(--cs-w1)); width: var(--cs-w2); }
html[data-tr="kjv"] .canon-switch::before { transform: translateX(calc(var(--cs-w1) + var(--cs-w2))); width: var(--cs-w3); }
.canon-switch button {
  position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted);
  font: inherit; padding: 7px 0; border-radius: 999px; cursor: pointer; text-align: center;
  white-space: nowrap; transition: color var(--dur) ease;
}
.canon-switch button:hover { color: var(--fg); }
/* narrow screens: one button with a menu (see "header menu (☰)" for the width where it takes over) */
.canon-menu { position: relative; display: none; }
.canon-btn { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px 0 13px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--brand); color: var(--brand-ink); font: 600 .78rem/1 var(--sans); cursor: pointer; white-space: nowrap; }
.canon-btn svg, .canon-btn .dd-chev { fill: none; stroke: currentColor; color: inherit; opacity: .9; flex-shrink: 0; }
.canon-btn[aria-expanded="true"] .dd-chev { transform: rotate(180deg); }
.canon-btn .cb-p, .canon-btn .cb-k, .canon-btn .cb-c { display: none; }
html[data-canon="protestant"]:not([data-tr="kjv"]) .canon-btn .cb-p, html[data-tr="kjv"] .canon-btn .cb-k,
html[data-canon="catholic"]:not([data-tr="kjv"]) .canon-btn .cb-c { display: inline; }
html[data-canon="protestant"]:not([data-tr="kjv"]) [data-set-canon="protestant"],
html[data-tr="kjv"] [data-set-canon="kjv"],
html[data-canon="catholic"]:not([data-tr="kjv"]) [data-set-canon="catholic"] { color: var(--brand-ink); }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--fg); cursor: pointer;
}
.icon-btn svg { fill: currentColor; stroke: currentColor; }
/* Theme button shows the current mode (system / light / dark) */
.icon-btn .ico {
  transform-origin: 12px 12px; transform-box: view-box;
  transition: opacity var(--dur) ease, transform var(--dur) var(--ease);
}
html:not([data-theme-mode="system"]) .icon-btn .i-system,
html:not([data-theme-mode="light"]) .icon-btn .i-light,
html:not([data-theme-mode="sepia"]) .icon-btn .i-sepia,
html:not([data-theme-mode="dark"]) .icon-btn .i-dark { opacity: 0; transform: rotate(-90deg) scale(.5); }

.theme-menu { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 168px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); transform-origin: top right;
  animation: hb-pop var(--dur) var(--ease);
}
.menu.closing { animation: hb-pop-out .12s ease-in forwards; }
/* menus with one chosen option (theme, ☰, sleep timer, voice, dropdowns): items are 36px rows and a highlight
   slides behind the chosen one. JS sets --sel (index) and --sel-on (0/1); see syncRadio in site.js. */
.menu.radio::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: 4px; height: 36px; border-radius: 8px; pointer-events: none;
  background: var(--surface-2); opacity: var(--sel-on, 0);
  transform: translateY(calc(var(--sel, 0) * 36px)); transition: transform var(--dur) var(--ease), opacity var(--dur) ease;
}
.menu.radio > button, .menu.radio > a, .player .menu.radio > button {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; margin: 0;
  padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--fg);
  font: 500 .9rem/1 var(--sans); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.menu.radio > button span, .menu.radio > a span { overflow: hidden; text-overflow: ellipsis; }
.menu.radio > button:hover, .menu.radio > a:hover, .player .menu.radio > button:hover { color: var(--link); background: transparent; }
.menu.radio > :focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.menu.radio > a[aria-current="page"] { font-weight: 700; color: var(--brand); }
.menu.radio.scroll { max-height: min(324px, 55vh); overflow-y: auto; overscroll-behavior: contain; }
.theme-menu .menu button svg { fill: currentColor; stroke: currentColor; flex-shrink: 0; }
.menu button .ck { margin-left: auto; fill: none; opacity: 0; transform: scale(.6); transition: opacity var(--dur) ease, transform var(--dur) var(--ease); }
.menu button[aria-checked="true"] { font-weight: 700; color: var(--brand); }
.menu button[aria-checked="true"] .ck { opacity: 1; transform: none; }

.hide-sm { display: none; }
@media (min-width: 720px) { .hide-sm { display: inline; } }
@media (max-width: 560px) {
  .top-nav, .hide-xs { display: none; }
  .top-in { padding: 8px 12px; gap: 8px; }
  .brand span { font-size: 1.65rem; }
  .canon-switch { --cs-pad: 9px; }
}
@media (max-width: 452px) { .brand span { display: none; } }   /* measured with the Bible menu showing "Protestant" */
@media (max-width: 481px) { html[data-tr="kjv"] .brand span { display: none; } }   /* … and "Protestant KJV" (0.9.0) */
@media (max-width: 340px) { .canon-btn .cb-kp { display: none; } }   /* the button says just "KJV" on the narrowest screens */

/* ------------------------------------------------------------ page */
.page {
  flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px 16px 40px;
}
.main { max-width: 720px; margin: 0 auto; min-width: 0; }
.rail { display: none; }

@media (min-width: 1180px) {
  /* Text always centred; the sidebar ad lives in the right-hand margin */
  .page.has-rail {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr);
    max-width: none; padding-left: 16px; padding-right: 32px; /* sidebar ad keeps clear of the scrollbar */
  }
  .page.has-rail .main { grid-column: 2; margin: 0; width: 100%; }
  .page.has-rail .rail { display: block; grid-column: 3; padding: 24px 0 0 clamp(40px, calc(5vw - 16px), 72px); min-width: 0; }
  .rail .ad { max-width: 300px; min-width: 160px; }
  .rail .sticky { position: sticky; top: 80px; }
  /* With a sidebar ad on screen, keep the reading column free of ads */
  .page.has-rail .main .ad { display: none; }
}

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }

.btn {
  display: inline-block; background: var(--brand); color: var(--brand-ink);
  padding: 10px 16px; border-radius: 999px; text-decoration: none; font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }

/* ------------------------------------------------------------ chapter */
.ch-head { margin-bottom: 6px; }
.ch-head .sub { margin: 0; color: var(--muted); font-size: .92rem; }
.ch-tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 12px; }

.picker { flex: 1 1 auto; }
.picker summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); padding: 6px 12px;
  border-radius: 999px; font-size: .88rem; font-weight: 600;
}
.picker summary::-webkit-details-marker { display: none; }
.picker summary::after, .apoc-section summary::after {
  content: "▾"; color: var(--muted); display: inline-block; transition: transform var(--dur) var(--ease);
}
.picker[open] summary::after, .apoc-section[open] summary::after { transform: rotate(180deg); }
.picker .grid { margin-top: 10px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.grid a {
  display: grid; place-items: center; height: 40px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border); color: var(--fg);
  text-decoration: none; font-variant-numeric: tabular-nums; font-size: .92rem;
}
.grid a:hover { border-color: var(--link); color: var(--link); }
.grid a.cur { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.grid.big { margin: 18px 0; }


.canon-note {
  background: var(--surface-2); border-left: 3px solid var(--gold);
  padding: 10px 14px; border-radius: 8px; font-size: .92rem; margin: 16px 0;
}

.text {
  font-family: var(--serif); font-size: var(--fs); line-height: var(--lh, 1.75);
  margin: 20px 0 8px; hyphens: auto; overflow-wrap: break-word;
}
.text .v { margin: 0 0 .45em; padding: 2px 6px; margin-left: -6px; margin-right: -6px; border-radius: 6px; }
.text .v:target, .text .v:has(span:target) { background: var(--mark); }
.vn {
  font: 700 .62em var(--sans); color: var(--muted); text-decoration: none;
  vertical-align: .35em; margin-right: .1em; letter-spacing: .02em;
}
.vn:hover { color: var(--link); }
.m { font: 600 .62em var(--sans); line-height: 0; margin-left: 1px; }
.m a { text-decoration: none; color: var(--link); }
.m.x a { color: var(--xref); }

html[data-lh="compact"] { --lh: 1.55; }
html[data-lh="relaxed"] { --lh: 2.05; }
html[data-font="sans"] .text { font-family: var(--sans); }
html[data-layout="para"] .text .v { display: inline; margin: 0; padding: 2px 1px; }

.pager { display: flex; gap: 10px; margin: 28px 0; }
.pager > * { flex: 1 1 0; min-width: 0; }
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  text-decoration: none; color: var(--fg); box-shadow: var(--shadow);
}
.pager a:hover { border-color: var(--link); }
.pager small { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.pager span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager .next { text-align: right; }

.notes { font-size: .9rem; color: var(--fg); border-top: 1px solid var(--border); margin-top: 24px; }
.notes h2 { font-size: 1.05rem; font-family: var(--sans); margin: 18px 0 8px; }
.notes ol { list-style: none; padding: 0; margin: 0; }
.notes li { padding: 5px 6px; border-radius: 6px; margin: 0 -6px; }
.notes li:target { background: var(--mark); }
.notes .back { font-weight: 700; text-decoration: none; margin-right: 4px; }
.notes .vref { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }

/* ------------------------------------------------------------ read aloud */
.listen-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 11px;
  border: 1px solid var(--brand); border-radius: 999px; background: var(--brand); color: var(--brand-ink);
  font: 600 .88rem var(--sans); cursor: pointer;
}
.listen-btn svg { fill: currentColor; }
.listen-btn path { transform-origin: 12px 12px; transform-box: view-box; transition: opacity var(--dur) ease, transform var(--dur) var(--ease); }
.listen-btn .i-pause, .listen-btn.playing .i-play { opacity: 0; transform: scale(.4); }
.listen-btn.playing .i-pause { opacity: 1; transform: none; }
.listen-btn span { display: inline-block; min-width: 3.6em; text-align: left; }
.listen-btn:hover { filter: brightness(1.08); }

.text .v.speaking { background: var(--mark); }

.player {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 40;
  width: min(720px, calc(100% - 16px)); transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .22); animation: hb-up .26s var(--ease);
}
.player.closing { animation: hb-down .16s ease-in forwards; }
.pl-in { display: flex; align-items: center; gap: 4px; padding: 6px 8px; }
.player button {
  display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--fg); cursor: pointer;
}
.player button:hover { background: var(--surface-2); }
.player button svg { fill: currentColor; stroke: currentColor; }
.player .pl-main { width: 44px; height: 44px; background: var(--brand); color: var(--brand-ink); }
.player .pl-main:hover { background: var(--brand); filter: brightness(1.08); }
.pl-main .i-play, .player.playing .pl-main .i-pause { display: block; }
.pl-main .i-pause, .player.playing .pl-main .i-play { display: none; }
.pl-info { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.2; padding: 0 6px; }
.pl-info b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-info span { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-info a { font-weight: 600; }
.player .pl-rate { width: auto; min-width: 44px; padding: 0 8px; font: 700 .82rem var(--sans); font-variant-numeric: tabular-nums; }
body.has-player .foot { padding-bottom: 84px; }
@media (max-width: 560px) {
  .player .pl-voice .dd-btn { max-width: 96px; }
  .player .pl-skip { display: none; }
}
@keyframes hb-up { from { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes hb-down { to { opacity: 0; transform: translate(-50%, 16px); } }

/* ------------------------------------------------------------ book */
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.facts div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.ch-list { list-style: none; padding: 0; margin: 0; }
.ch-list a { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--fg); }
.ch-list a:hover b { color: var(--link); }
.ch-list b { display: block; font-family: var(--serif); }
.ch-list span { color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------ home */
.hero { padding: 18px 0 4px; }
.lead { font-size: 1.08rem; color: var(--fg); }
.continue a { font-weight: 600; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cards a {
  display: block; height: 100%; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--fg); box-shadow: var(--shadow);
}
.cards a:hover { border-color: var(--link); }
.cards b { display: block; font-family: var(--serif); font-size: 1.05rem; }
.cards span { color: var(--muted); font-size: .85rem; }

.books-head h2 { margin-bottom: .25rem; }
.canon-hint { margin-top: 0; font-size: .9rem; }
.cols { display: grid; gap: 0 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.booklist { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 16px; }
.booklist li { break-inside: avoid; }
.booklist a {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 2px;
  border-bottom: 1px solid var(--border); text-decoration: none; color: var(--fg);
}
.booklist a:hover { color: var(--link); }
.booklist a span { margin-left: auto; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.booklist .dc a::after, .tag {
  content: "DC"; font: 700 .62rem/1 var(--sans); color: var(--brand-ink); background: var(--gold);
  padding: 3px 4px; border-radius: 4px; align-self: center; order: 1;
}
html[data-theme="dark"] .booklist .dc a::after, html[data-theme="dark"] .tag { color: #1b140f; }
.booklist .dc a span { order: 2; }
@media (max-width: 419px) { .booklist { column-gap: 12px; } .booklist a { font-size: .9rem; gap: 0 6px; flex-wrap: wrap; } .booklist .dc a::after { padding: 3px 3px; } }
.apoc-section { margin-top: 18px; }
.apoc-section summary { list-style: none; cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.apoc-section summary .muted { font-family: var(--sans); font-size: .82rem; font-weight: 400; }
.apoc-section .booklist { margin-top: 8px; }

/* Canon visibility (URLs never change, only lists and navigation) */
html[data-canon="protestant"] .booklist .dc,
html[data-canon="protestant"] .apoc-section,
html[data-canon="protestant"] .only-c,
html[data-canon="catholic"] .only-p { display: none; }

/* ------------------------------------------------------------ prose pages */
.prose { font-size: 1.02rem; }
.prose h2 { font-size: 1.3rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 12px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose blockquote { margin: 1em 0; padding: .5em 1em; border-left: 3px solid var(--gold); background: var(--surface-2); border-radius: 6px; }
.prose li { margin: .25em 0; }

/* ------------------------------------------------------------ ads */
.ad { margin: 22px 0; text-align: center; min-height: 120px; }
.ad-chapter_top { min-height: 0; }
.ad ins.adsbygoogle { display: block; }
/* chapter_top: fixed 320×100 banner (AdSense: exact size set by CSS) so the text starts on the first screen */
.ad-chapter_top ins.adsbygoogle { display: inline-block; width: 320px; height: 100px; }
/* after the quiz: well away from the answer buttons */
.ad-after-quiz { margin-top: 40px; }
.ad-label { display: block; font: 600 .62rem var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-preview {
  display: grid; place-items: center; min-height: 250px; border: 2px dashed var(--border);
  border-radius: 10px; color: var(--muted); font: 600 .8rem var(--sans); background: var(--surface);
}
.ad-chapter_top .ad-preview { min-height: 100px; width: 320px; max-width: 100%; margin: 0 auto; }
.rail .ad-preview { min-height: 600px; }
.rail .ad { margin-top: 0; }

/* ------------------------------------------------------------ footer */
.foot { border-top: 1px solid var(--border); background: var(--surface); font-size: .88rem; color: var(--muted); }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 20px 16px 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.foot a { color: var(--fg); }
.foot p { margin: 4px 0; }

.print-src { display: none; }
@media print {
  @page { margin: 16mm 15mm; }
  html, body { background: #fff !important; color: #000 !important; }
  html { color-scheme: light !important; }
  html[data-theme] .text .v.hl-yellow { background: #fde9a4 !important; } html[data-theme] .text .v.hl-green { background: #cdeec3 !important; }
  html[data-theme] .text .v.hl-blue { background: #cfe5f7 !important; } html[data-theme] .text .v.hl-pink { background: #f8d3e0 !important; }
  html[data-theme] .text .v.hl-orange { background: #fbd9b6 !important; }
  .plan-ctl { display: none !important; }
  .pd-check input { accent-color: #444; }
  .top, .foot, .rail, .ad, .pager, .crumbs, .ch-tools, .player, .sheet, .nudge, .toast, .menu, .search-ov,
  .share-modal, .img-modal, .acc-modal, .fn-pop, .continue, .hero-search, .votd-act, .today-check, .today-hint,
  .saved-tools, .saved-colors, .saved-tabs, .saved-actions, .saved-account, .sv-del, .plan-btns, .plan-progress,
  .quiz, .quiz-start, .quiz-best, #canon-ask, [data-listen], .listen-btn, .print-btn, .btn, .btn-ghost, .icon-btn, noscript { display: none !important; }
  .page, .page.has-rail { display: block !important; max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .main, .page.has-rail .main { max-width: none !important; width: auto !important; margin: 0 !important; animation: none !important; }
  * { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; }
  body, .main, .text, .prose, .readable, h1, h2, h3, p, li, blockquote, dd, dt { color: #000 !important; }
  .card, .cards a, .cards li, blockquote, .kv, .faq-q, .today, .votd, .notes, .saved-list li { background: #fff !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .text { font-size: 12pt !important; line-height: 1.55 !important; }
  .text .vn, sup { color: #555 !important; }
  .text .v.speaking { background: none !important; }
  .text .v[class*="hl-"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  blockquote, .kv, .faq-q h2, .cards li, .plan-days li, .saved-list li, .quiz-answers li, .notes li { break-inside: avoid; page-break-inside: avoid; }
  details.quiz-answers > summary { list-style: none; font-weight: 700; }
  .plan-days li { padding: 3px 0 !important; }
  .print-src { display: block; margin-top: 28px; padding-top: 8px; border-top: 1px solid #999; font: 9pt/1.4 var(--sans); color: #444 !important; }
}

/* ------------------------------------------------------------ shared controls */
html:not(.js) .needs-js { display: none !important; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  font: 600 .9rem var(--sans); text-decoration: none; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--link); color: var(--link); }
.btn-ghost.danger.armed { border-color: #c0392b; color: #c0392b; }
.btn { border: 0; font: 600 .95rem var(--sans); cursor: pointer; }
body.no-scroll, html:has(body.no-scroll) { overflow: hidden; }

/* segmented control with a sliding thumb (--i = selected index, set by JS) */
.seg { --n: 2; --i: 0; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 3px; border-radius: 10px; background: var(--surface-2); }
.seg-3 { --n: 3; } .seg-4 { --n: 4; }
.seg::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / var(--n)); border-radius: 8px; background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14); transform: translateX(calc(var(--i) * 100%));
  transition: transform var(--dur) var(--ease);
}
.seg button { position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted);
  font: 600 .8rem var(--sans); padding: 7px 4px; border-radius: 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button[aria-pressed="true"] { color: var(--fg); }

/* ------------------------------------------------------------ header search button */
.tools .icon-btn { text-decoration: none; }
#search-btn svg { fill: none; }

/* ------------------------------------------------------------ reading settings (Aa) */
.reader-menu { position: relative; }
.aa-btn {
  display: grid; place-items: center; height: 34px; width: 50px; padding: 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--fg); cursor: pointer;
}
.aa-btn svg { display: block; fill: currentColor; font-family: var(--serif); }
.aa-btn[aria-expanded="true"] { border-color: var(--link); }
.aa-panel { width: min(320px, calc(100vw - 24px)); padding: 12px; right: 0; }
.opt-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 8px; margin: 6px 0; }
.opt-label { font: 600 .78rem var(--sans); color: var(--muted); }
.stepper { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.stepper button { border: 0; background: var(--surface); color: var(--fg); font: 700 .9rem var(--sans); height: 30px; border-radius: 8px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.stepper output { min-width: 44px; text-align: center; font: 600 .85rem var(--sans); font-variant-numeric: tabular-nums; }
.ch-tools .listen-btn { margin-left: auto; }

/* ------------------------------------------------------------ verse marks */
.text .v { cursor: pointer; transition: background-color .35s ease, box-shadow .2s ease; }
.text .v.sel { box-shadow: inset 0 -2px 0 var(--link); background: color-mix(in srgb, var(--link) 7%, transparent); }
.text .v.hl-yellow { background: #fde9a4; } .text .v.hl-green { background: #cdeec3; }
.text .v.hl-blue { background: #cfe5f7; } .text .v.hl-pink { background: #f8d3e0; }
.text .v.hl-orange { background: #fbd9b6; }
html[data-theme="dark"] .text .v.hl-yellow { background: #5a4a14; } html[data-theme="dark"] .text .v.hl-green { background: #24432a; }
html[data-theme="dark"] .text .v.hl-blue { background: #1f3a52; } html[data-theme="dark"] .text .v.hl-pink { background: #4f2535; }
html[data-theme="dark"] .text .v.hl-orange { background: #563419; }
.text .v.is-bm .vn { color: var(--link); }
.text .v.is-bm .vn::before {
  content: ""; display: inline-block; width: .55em; height: .8em; margin-right: .2em; vertical-align: -.05em;
  background: var(--link); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}
.v-note {
  display: block; margin: .35em 0 .2em; padding: 6px 10px; border-left: 3px solid var(--gold); border-radius: 6px;
  background: var(--surface); font: italic .8em/1.5 var(--sans); color: var(--muted); cursor: default; white-space: pre-wrap;
}
html[data-layout="para"] .text .v-note { display: inline-block; margin: 0 .3em; padding: 0 .5em; }

/* ------------------------------------------------------------ bottom sheet (verse actions) */
.sheet {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 45;
  width: min(560px, calc(100% - 16px)); transform: translateX(-50%); padding: 10px 12px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .24); animation: hb-up .24s var(--ease);
}
.sheet.closing { animation: hb-down .16s ease-in forwards; }
body.has-player .sheet { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 70px); }
.sh-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sh-ref { font: 700 .95rem var(--sans); }
.sh-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--fg); cursor: pointer; }
.sh-x svg { stroke: currentColor; }
.sh-colors { display: flex; gap: 10px; margin: 10px 0; }
.dot { width: 30px; height: 30px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; padding: 0; display: grid; place-items: center;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) ease; }
.dot:hover { transform: scale(1.08); }
.dot.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--fg); }
.dot-yellow { background: #f6d55c; } .dot-green { background: #8fd18a; } .dot-blue { background: #8cc0ea; }
.dot-pink { background: #f19bbb; } .dot-orange { background: #f4ad6c; }
.dot-none { background: var(--surface-2); color: var(--muted); }
.dot-none svg { stroke: currentColor; }
.sh-acts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.sh-acts button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border: 0; border-radius: 12px;
  background: transparent; color: var(--fg); font: 600 .72rem var(--sans); cursor: pointer;
}
.sh-acts button:hover, .sh-acts button.on { background: var(--surface-2); }
.sh-acts button.on { color: var(--link); }
.sh-acts svg { stroke: currentColor; fill: none; }
.sh-acts button[data-sh="bookmark"].on svg path { fill: currentColor; }
.sh-note { margin-top: 8px; }
.sh-note textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--bg); color: var(--fg); font: .92rem/1.45 var(--sans); resize: vertical; }
.sh-note-btns { display: flex; gap: 8px; margin-top: 8px; }
.sh-note:not([hidden]) { animation: hb-reveal var(--dur) var(--ease); }

/* ------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; top: 72px; z-index: 60; transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 999px; font: 600 .86rem var(--sans);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2); transition: opacity .2s ease, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ search overlay */
.search-ov {
  position: fixed; inset: 0; z-index: 70; background: rgba(20, 14, 10, .45);
  display: flex; justify-content: center; align-items: flex-start; padding: 70px 12px 12px;
  animation: hb-fade .16s ease;
}
.search-ov.closing { animation: hb-out .14s ease forwards; }
.sov-box { width: min(620px, 100%); background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; animation: hb-pop .2s var(--ease); }
.sov-form { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.sov-form svg { stroke: var(--muted); flex-shrink: 0; }
.sov-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: 1.05rem var(--sans); }
.sov-form input::-webkit-search-cancel-button { display: none; }
.sov-x { border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); border-radius: 6px; font: 600 .72rem var(--sans); padding: 4px 7px; cursor: pointer; }
.sov-list { list-style: none; margin: 0; padding: 6px; }
.sov-list:empty { display: none; }
.sov-list a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--fg); text-decoration: none; }
.sov-list a.on { background: var(--surface-2); }
.sov-list a.go b { color: var(--link); }
.sov-hint { margin: 0; padding: 12px 16px 16px; color: var(--muted); font-size: .88rem; }
kbd { font: 600 .78rem var(--sans); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--surface-2); }

/* ------------------------------------------------------------ search page / hero search */
.search-form { display: flex; gap: 8px; margin: 14px 0; }
.search-form input {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--fg); font: 1rem var(--sans); box-shadow: var(--shadow);
}
.search-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.search-opts { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: .9rem; color: var(--muted); }
.search-canon { margin-left: auto; }
#search-status { margin: 14px 0 6px; }
.go-ref { display: inline-block; margin-right: 8px; font-weight: 700; }
.results { list-style: none; padding: 0; margin: 0; }
.results li { padding: 12px 0; border-bottom: 1px solid var(--border); animation: hb-fade .2s ease; }
.results a { font: 700 .9rem var(--sans); text-decoration: none; }
.results p { margin: 4px 0 0; font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
#search-more { margin: 16px 0; }
.search-tips { margin-top: 30px; font-size: .92rem; color: var(--muted); }
.search-tips h2 { font-size: 1rem; font-family: var(--sans); color: var(--fg); }

/* ------------------------------------------------------------ home: verse of the day, canon question */
.votd { margin: 18px 0 8px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); animation: hb-fade .3s ease; }
.votd h2 { margin: 0 0 8px; font-size: 1rem; font-family: var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.votd h2 small { font-size: .9em; text-transform: none; letter-spacing: 0; }
.votd blockquote { margin: 0; }
.votd-t { margin: 0; font: 1.25rem/1.6 var(--serif); }
.votd footer { margin-top: 8px; font-size: .92rem; }
.votd-r { font-weight: 700; }
.votd-act { display: flex; gap: 8px; margin-top: 12px; }
.canon-ask { margin: 8px 0 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); animation: hb-reveal .25s var(--ease); }
.canon-ask.closing { animation: hb-out .2s ease forwards; }
.canon-ask p { margin: 0 0 10px; }
.canon-ask-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.book-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-ghost.done { color: var(--link); border-color: var(--link); cursor: default; }

/* ------------------------------------------------------------ verse image */
.img-modal { position: fixed; inset: 0; z-index: 75; background: rgba(15, 10, 8, .6); display: grid; place-items: center; padding: 16px; animation: hb-fade .16s ease; }
.img-modal.closing { animation: hb-out .15s ease forwards; }
.im-box { width: min(440px, 100%); background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); animation: hb-pop .22s var(--ease); }
.im-box canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; }
.im-styles { display: flex; gap: 10px; justify-content: center; margin: 12px 0; }
.im-styles button { width: 34px; height: 34px; border-radius: 999px; border: 2px solid var(--border); cursor: pointer; transition: transform var(--dur-fast) var(--ease); }
.im-styles button.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--fg); }
.im-box.story { width: min(330px, 100%); }
.im-box { transition: width var(--dur, .22s) var(--ease); }
.im-box .im-stage { position: relative; width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; transition: aspect-ratio var(--dur, .22s) var(--ease); }
.im-box.story .im-stage { aspect-ratio: 9 / 16; }
.im-box .im-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; opacity: 0; transition: opacity var(--dur, .22s) ease; }
.im-box .im-stage canvas.shown { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .im-box, .im-box .im-stage, .im-box .im-stage canvas { transition: none; } }
.im-format { display: flex; gap: 8px; justify-content: center; margin: 0 0 12px; }
.im-format button { padding: 6px 16px; border-radius: 999px; border: 0.5px solid var(--border); background: transparent; color: inherit; font: 14px var(--sans); cursor: pointer; }
.im-format button.on { background: var(--surface-2); border-color: var(--border-strong); font-weight: 600; }
.im-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------ saved page */
.saved-tabs { max-width: 460px; margin: 14px 0; }
.saved-list { list-style: none; padding: 0; margin: 0; }
.saved-list li { padding: 12px 14px; margin: 10px 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left-width: 4px; animation: hb-fade .2s ease; }
.saved-list li.closing { animation: hb-out .18s ease forwards; }
.saved-list li.hl-yellow { border-left-color: #f6d55c; } .saved-list li.hl-green { border-left-color: #8fd18a; }
.saved-list li.hl-blue { border-left-color: #8cc0ea; } .saved-list li.hl-pink { border-left-color: #f19bbb; }
.saved-list li.hl-orange { border-left-color: #f4ad6c; }
.sv-head { display: flex; align-items: center; gap: 8px; }
.sv-head a { font-weight: 700; text-decoration: none; }
.sv-tag { font: 600 .68rem var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); padding: 2px 7px; border-radius: 999px; }
.sv-del { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.sv-del:hover { background: var(--surface-2); color: var(--fg); }
.sv-del svg { stroke: currentColor; }
.sv-text { margin: 6px 0 0; font-family: var(--serif); line-height: 1.55; }
.sv-note { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--gold); background: var(--surface-2); border-radius: 6px; font-size: .9rem; white-space: pre-wrap; }
.empty { color: var(--muted); padding: 20px 0; }
.saved-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }


/* ------------------------------------------------------------ account */
.ok-dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; background: #2e9d57; box-shadow: 0 0 0 3px color-mix(in srgb, #2e9d57 25%, transparent); vertical-align: middle; }
.btn-ghost.small { padding: 4px 10px; font-size: .8rem; }
.small { font-size: .85rem; }
.bad { color: #b03a2e; }
html[data-theme="dark"] .bad { color: #f08a7e; }
.acc-btn .acc-dot { fill: #2e9d57; opacity: 0; transform: scale(.3); transform-origin: 19px 5px; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
html.signed-in .acc-btn .acc-dot { opacity: 1; transform: none; }
.acc-box { width: min(400px, 100%); }
.acc-body { margin-top: 8px; }
.acc-body > p { margin: 8px 0; line-height: 1.5; }
.acc-opt { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 44px; margin: 10px 0 0; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--fg); font: 600 .95rem var(--sans); cursor: pointer; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.acc-opt:hover { border-color: var(--link); color: var(--link); }
.acc-pk-note { margin: 6px 0 0; line-height: 1.45; }                 /* passkeys belong to the email account (0.9.3) */
.acc-opt + .acc-pk-note { text-align: center; }
.acc-opt svg, .acc-keys svg { stroke: currentColor; flex-shrink: 0; }
.acc-gsi { display: flex; align-items: center; justify-content: center; height: 44px; margin-top: 12px; overflow: hidden; }
.acc-gsi-in { width: 100%; max-width: 400px; height: 44px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .18s ease; }
.acc-gsi.ready .acc-gsi-in { opacity: 1; }
.acc-gsi.failed { display: none; }
.acc-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--muted); font-size: .85rem; }
.acc-or::before, .acc-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.acc-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.acc-form input { height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--fg); font: 1rem var(--sans); }
.acc-form input:focus { outline: 2px solid var(--link); outline-offset: 1px; }
.acc-form input[name="code"] { font: 700 1.4rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .35em; text-align: center; }
.acc-form .btn { height: 44px; border-radius: 999px; }
.acc-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 12px; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--link); font: 600 .88rem var(--sans); cursor: pointer; }
.acc-dev { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.acc-msg { font-size: .9rem; animation: hb-reveal var(--dur) var(--ease); }
.acc-who { word-break: break-all; }
.acc-sync { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.acc-h { margin: 18px 0 6px; font: 700 .8rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.acc-keys { list-style: none; margin: 0 0 8px; padding: 0; }
.acc-keys li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.acc-keys li span { flex: 1; display: flex; flex-direction: column; }
.acc-keys small { color: var(--muted); }
.acc-tip { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); animation: hb-reveal var(--dur) var(--ease); }
.acc-tip p { margin: 0 0 4px; }
.acc-tip .acc-row { justify-content: flex-start; margin-top: 8px; }
.acc-links { margin-top: 14px; }
.acc-theme { display: none; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.acc-theme .opt-label { display: block; margin-bottom: 6px; }
/* very small screens: the theme selector moves into the account panel */
@media (max-width: 374px) {
  .tools .theme-menu { display: none; }
  .acc-theme { display: block; }
}
.saved-account { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 16px 0 18px; padding: 14px 18px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.saved-account p { margin: 0; }

/* ------------------------------------------------------------ share panel */
.share-modal { position: fixed; inset: 0; z-index: 80; background: rgba(15, 10, 8, .5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: hb-fade .16s ease; }
.share-modal.closing { animation: hb-out .15s ease forwards; }
.shr-box { width: min(380px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: hb-pop .2s var(--ease); }
.shr-head { display: flex; align-items: center; justify-content: space-between; }
.shr-head b { font: 700 1.35rem var(--sans); }

.shr-img img { display: block; width: 140px; height: 140px; margin: 0 auto 12px; border-radius: 12px; object-fit: cover; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.shr-img-btns { display: flex; flex-direction: column; gap: 8px; }
.shr-img-btns .btn, .shr-img-btns .btn-ghost { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 999px; }
.shr-img-btns svg, .im-btns svg { stroke: currentColor; fill: none; }
.shr-img-btns [hidden] { display: none; }
.shr-sub { margin: 16px 0 8px; color: var(--muted); font-size: .85rem; text-align: center; }
.im-btns .btn { display: inline-flex; align-items: center; gap: 8px; }
.shr-what { margin: 2px 0 12px; color: var(--muted); font-size: .9rem; }
.shr-link { display: flex; align-items: center; gap: 8px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); }
.shr-link .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; flex-shrink: 0; font-size: .85rem; }
.shr-link .btn svg { stroke: currentColor; }
.shr-link .sw { display: inline-grid; text-align: center; }
.shr-link .sw > span, .shr-link .sw::after { grid-area: 1 / 1; }
.shr-link .sw::after { content: attr(data-w); visibility: hidden; }
.shr-link input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--muted); font: .85rem var(--sans); }
.shr-list { list-style: none; margin: 10px 0 0; padding: 0; }
.shr-list a, .shr-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--fg); font: 500 1rem var(--sans); text-decoration: none; cursor: pointer; text-align: left; }
.shr-list a:hover, .shr-list button:hover, .shr-list a:focus-visible { background: var(--surface-2); }
.shr-list svg { stroke: currentColor; fill: none; flex-shrink: 0; }
.shr-list [data-shr="more"] svg { fill: currentColor; stroke: none; }
@media (max-width: 560px) {
  .share-modal { align-items: flex-end; padding: 0; }
  .shr-box { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); animation: hb-up-sheet .24s var(--ease); }
  .share-modal.closing .shr-box { animation: hb-down-sheet .15s ease-in forwards; }
}
@keyframes hb-up-sheet { from { transform: translateY(40px); opacity: .4; } }
@keyframes hb-down-sheet { to { transform: translateY(40px); opacity: 0; } }
/* ------------------------------------------------------------ reading plans */
.plans { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.plans small { display: block; margin-top: 8px; color: var(--muted); font-size: .8rem; }
.plan-ctl { margin: 16px 0; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.plan-progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.plan-progress span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .35s var(--ease); }
.plan-status { margin: 10px 0; font-size: .9rem; }
.plan-who { margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
.plan-who b { color: var(--fg); }
/* a plan for another Bible than the chosen one: no progress controls, just the readings (0.9.1) */
.plan.other .plan-ctl, .plan.other .pd-check { display: none; }
.plan-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-days { list-style: none; padding: 0; margin: 0; }
.plan-days li { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-bottom: 1px solid var(--border); border-radius: 8px; transition: background-color .3s ease; }
.plan-days li.today { background: var(--mark); }
.plan-days li.done .pd-r a { color: var(--muted); }
.pd-n { flex: 0 0 64px; font: 600 .82rem var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.pd-r { font-family: var(--serif); }
.pd-r a { text-decoration: none; }
.pd-r a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ motion
   Fast (150–250 ms), ease-out, only on things that change state. The text itself never moves. */
a, button, summary, .cards a, .pager a, .grid a, .booklist a, .ch-list a {
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease), text-decoration-color var(--dur-fast) ease;
}
.cards a:hover, .pager a:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(60, 35, 20, .08), 0 10px 24px rgba(60, 35, 20, .10); }
.grid a:hover { transform: translateY(-1px); }
button:active, .grid a:active, .cards a:active, .pager a:active, .btn:active { transform: scale(.97); }
.booklist a:hover span { color: var(--link); }

/* verse / footnote highlight fades in */
.text .v, .notes li { transition: background-color .5s ease; }

/* menus (chapter picker, apocrypha) */
.picker[open] .grid, .apoc-section[open] .booklist { animation: hb-reveal var(--dur) var(--ease); }

/* things that appear after a canon switch */
html.canon-anim .booklist .dc, html.canon-anim .apoc-section,
html.canon-anim .only-c, html.canon-anim .only-p { animation: hb-reveal var(--dur) var(--ease); }
.pager b.swap { animation: hb-fade var(--dur) ease; }
.continue:not([hidden]) { animation: hb-fade var(--dur) ease; }

/* theme switch: colours glide instead of snapping (class is added for ~300 ms by JS) */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .28s ease, color .28s ease, border-color .28s ease,
              fill .28s ease, stroke .28s ease, box-shadow .28s ease !important;
}

/* page-to-page navigation: no cross-document view transition. While one runs, Chrome makes the new page
   ignore clicks for ~0.3 s, so a quick click on a link was lost (it felt like links needed two clicks).
   A plain fade-in of the content gives the same feel and never blocks clicks. */
@view-transition { navigation: none; }
@media (prefers-reduced-motion: no-preference) { .main { animation: hb-fade .2s ease both; } }
/* the overlay of same-page swaps (text size, layout) must not swallow clicks either */
::view-transition { pointer-events: none; }
/* same-page swaps (text size, layout): plain cross-fade */
html.vt-swap::view-transition-old(root) { animation: hb-out .16s ease both; }
html.vt-swap::view-transition-new(root) { animation: hb-fade .16s ease both; }

@keyframes hb-pop { from { opacity: 0; transform: translateY(-4px) scale(.96); } }
@keyframes hb-pop-out { to { opacity: 0; transform: translateY(-4px) scale(.96); } }
@keyframes hb-reveal { from { opacity: 0; transform: translateY(-4px); } }
@keyframes hb-fade { from { opacity: 0; } }
@keyframes hb-out { to { opacity: 0; } }
@keyframes hb-in { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* ------------------------------------------------------------ header menu (☰) */
.top-nav a[data-nav] { white-space: nowrap; }
.nav-more { position: relative; display: none; }
.nav-menu { left: 0; right: auto; transform-origin: top left; min-width: 190px; }
/* links that don't fit move into the ☰ menu, last first; below that the Bible switch becomes one button with a menu.
   Widths measured in Chrome for the 7 links and the Catholic · Protestant · Protestant KJV switch, with at least 15px
   to spare (0.9.0: the switch is 22px wider than the 0.6.0 one, so every width moved up by 23px). */
@media (max-width: 1033px) { .top-nav a[data-nav="6"] { display: none; } .nav-more { display: block; } }
@media (max-width: 1020px) { .top-nav a[data-nav="5"] { display: none; } }
@media (max-width: 973px) { .top-nav a[data-nav="4"] { display: none; } }
@media (max-width: 912px) { .top-nav a[data-nav="3"] { display: none; } }
@media (max-width: 819px) { .top-nav a[data-nav="2"] { display: none; } }
@media (max-width: 755px) { .top-nav a[data-nav="1"] { display: none; } }
@media (max-width: 702px) { .nav-more { display: block; } .top-nav { display: none; } }
@media (max-width: 641px) { .canon-switch { display: none; } .canon-menu { display: block; } }
@media (max-width: 430px) {
  .top-in, .tools { gap: 5px; }
  .top-in { padding-left: 10px; padding-right: 10px; }
  .tools .icon-btn { width: 34px; height: 34px; }
  .canon-switch { --cs-pad: 8px; }
}
@media (max-width: 340px) {
  .top-in .brand img { width: 26px; height: 26px; }
  .canon-switch { --cs-pad: 6px; font-size: .74rem; }
  .canon-switch button { padding: 6px 0; }
}

/* ------------------------------------------------------------ explore content */
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cards small { display: block; margin-top: 6px; color: var(--muted); font-size: .78rem; }
/* quiz list: "Your quizzes" (0.9.2) — summary line and filters under the title, your best score on each card */
.yq { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 2px 0 16px; }
.yq-sum { margin: 0; font-size: .92rem; color: var(--muted); }
.yq-sum b { color: var(--fg); }
.yq-f { display: flex; gap: 8px; margin-left: auto; }
.yq .dd[hidden] { display: none; }
.cards small.qmeta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cards small.qmeta > span { font-size: inherit; color: inherit; }      /* same size as the line on other cards */
.cards small.qmeta > .qs { color: var(--link); font-weight: 700; white-space: nowrap; }
.cards small.qmeta > .qs[hidden] { display: none; }
.quiz-cards li.qf-off { display: none; }
.dd-menu .dd-n { margin-left: auto; color: var(--muted); font-weight: 500; font-size: .8rem; font-variant-numeric: tabular-nums; }
.dd-menu .dd-n:empty { display: none; }
.dd-menu .dd-n:not(:empty) + .ck { margin-left: 4px; }
.dd-val .dd-short { display: none; }
@media (max-width: 560px) {
  .yq-f { margin-left: 0; }
  .dd-val .dd-long { display: none; }
  .dd-val .dd-short { display: inline; }
}
.chips { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--fg); text-decoration: none; font-size: .9rem; transition: border-color var(--dur) ease, color var(--dur) ease; }
.chips a:hover { border-color: var(--link); color: var(--link); }
.ref-list { list-style: none; padding: 0; margin: 8px 0; columns: 2 180px; }
.ref-list li { margin: 0 0 6px; break-inside: avoid; }
.kv { margin: 10px 0; padding: 12px 16px; border-left: 3px solid var(--gold); background: var(--surface); border-radius: 8px; font-family: var(--serif); }
.kv p { margin: 0 0 6px; line-height: 1.6; }
.kv footer, .tv footer { font-family: var(--sans); font-size: .85rem; }
.story-read { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.story-read .btn, .story-read .btn-ghost { text-decoration: none; }
.page-story section, .page-character section, .topic section { margin-top: 26px; }
.quiz-cta { padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.quiz-cta h2 { margin-top: 0; }
.explore { margin: 22px 0 0; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: .92rem; }
.explore p { margin: 4px 0; }
.explore span { display: inline-block; min-width: 150px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.home-x { margin: 30px 0; }
.home-x .more { margin: 10px 0 0; font-weight: 600; }
.home-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.home-duo h2 { margin-top: 0; }
.chip-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chip-filter button { border: 1px solid var(--border); background: var(--surface); color: var(--fg); border-radius: 999px; padding: 6px 12px;
  font: 600 .82rem var(--sans); cursor: pointer; transition: background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease; }
.chip-filter button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.char-cards li.cf-hide { display: none; }
.topic-verses { list-style: none; padding: 0; margin: 16px 0; counter-reset: tv; }
.tv { margin: 0 0 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.tv blockquote { margin: 0; font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; }
.tv blockquote p { margin: 0 0 6px; }
.tv-act { display: flex; gap: 6px; margin-top: 8px; }

/* ------------------------------------------------------------ quiz */
.quiz { margin: 18px 0; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); min-height: 120px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.quiz-bar { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.quiz-bar span { display: block; height: 100%; background: var(--brand); transition: width .3s var(--ease); }
.quiz-q { font: 700 1.2rem/1.4 var(--serif); margin: 0 0 14px; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opts button { text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--fg);
  font: 1rem var(--sans); cursor: pointer; transition: border-color var(--dur) ease, background-color var(--dur) ease; }
.quiz-opts button:hover:not(:disabled) { border-color: var(--link); }
.quiz-opts button:disabled { cursor: default; }
.quiz-opts button.right { border-color: #2e9d57; background: color-mix(in srgb, #2e9d57 14%, var(--bg)); }
.quiz-opts button.wrong { border-color: #c0392b; background: color-mix(in srgb, #c0392b 12%, var(--bg)); }
.quiz-ex { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); animation: hb-reveal var(--dur) var(--ease); }
.quiz-ex b.ok { color: #2e9d57; } .quiz-ex b.no { color: #c0392b; }
html[data-theme="dark"] .quiz-ex b.ok { color: #6fd08f; } html[data-theme="dark"] .quiz-ex b.no { color: #f08a7e; }
.quiz-next { margin-top: 14px; display: flex; justify-content: flex-end; }
.quiz-score { text-align: center; padding: 10px 0; }
.quiz-score .big { font: 700 3rem/1 var(--serif); color: var(--brand); margin: 6px 0; }
.quiz-score .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.quiz-anim { animation: hb-reveal var(--dur) var(--ease); }
.quiz-answers { margin: 20px 0; }
.quiz-answers summary { cursor: pointer; font-weight: 600; }
.quiz-answers li { margin: 0 0 12px; }
.quiz-answers p { margin: 2px 0; }

/* ------------------------------------------------------------ footnote / cross-reference pop-up */
.fn-pop { position: absolute; z-index: 40; width: min(360px, calc(100vw - 24px)); padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); font-size: .92rem; line-height: 1.5;
  animation: hb-pop var(--dur) var(--ease); }
.fn-pop.closing { animation: hb-pop-out .12s ease-in forwards; }
.fn-pop .fp-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.fn-pop .fp-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; }
.fn-pop .fp-x svg { stroke: currentColor; }
.fn-pop .fp-v { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-family: var(--serif); }
.fn-pop .fp-v a { font-family: var(--sans); font-weight: 600; font-size: .85rem; }
.fn-pop .fp-v p { margin: 4px 0 0; }

/* ------------------------------------------------------------ sign-in reminder */
.nudge { position: fixed; z-index: 60; width: min(340px, calc(100vw - 24px)); top: 64px; right: 16px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 12px 34px rgba(0, 0, 0, .2); font-size: .92rem; line-height: 1.5;
  opacity: 0; transform: translateY(-10px); transition: opacity .22s ease, transform .26s var(--ease); }
.nudge.on { opacity: 1; transform: none; }
.nudge.out { opacity: 0; transform: none; transition: opacity .2s ease; }
.nudge p { margin: 0 34px 0 0; }
.nudge .ng-x { position: absolute; top: 10px; right: 10px; }
.nudge .ng-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.nudge .ng-never { margin-left: auto; border: 0; background: none; color: var(--muted); font: .78rem var(--sans); text-decoration: underline; cursor: pointer; padding: 4px 0; }
@media (max-width: 560px) {
  .nudge { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; right: 12px; width: auto; transform: translateY(16px); }
}
@media (prefers-reduced-motion: reduce) { .nudge, .nudge.on { transform: none; } }

/* ------------------------------------------------------------ reading settings and Listen on stories, characters, topics, quiz */
.page-tools { margin-top: 12px; }
.readable { font-family: var(--serif); font-size: var(--fs); line-height: var(--lh, 1.75); }
html[data-font="sans"] .readable { font-family: var(--sans); }
.readable h2 { font-size: 1.2em; }
.topic-verses.readable .tv blockquote { font-size: 1em; line-height: inherit; }
[data-read] .speaking { background: var(--mark); border-radius: 6px; box-shadow: 0 0 0 4px var(--mark); transition: background-color .3s ease; }
.page-quiz .quiz { font-size: calc(var(--fs) * .88); }
.page-quiz .quiz-q { font-size: 1.2em; }
.page-quiz .quiz-opts button { font-size: 1em; }
html[data-font="sans"] .page-quiz .quiz-q { font-family: var(--sans); }
.page-tools { justify-content: flex-end; }

/* ------------------------------------------------------------ Bible FAQ */
.faq-toc { columns: 2 260px; column-gap: 28px; padding-left: 1.3em; margin: 6px 0 22px; font: .95rem/1.5 var(--sans); }
.faq-toc li { break-inside: avoid; margin: 0 0 6px; }
.faq-q { scroll-margin-top: 76px; border-top: 1px solid var(--border); padding-top: 6px; margin-top: 18px; }
.faq-q h2 { margin-top: 14px; }

/* ------------------------------------------------------------ home: today's reading */
.today { margin: 14px 0 8px; padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.today:not([hidden]) { animation: hb-fade var(--dur) ease; }
.today h2 { margin: 0 0 6px; font-size: 1rem; font-family: var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.today h2 small { font-size: .9em; text-transform: none; letter-spacing: 0; }
.today-row + .today-row { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.today-meta { margin: 0; font: .9rem var(--sans); color: var(--muted); }
.today-meta a { color: inherit; font-weight: 600; }
.today-links { margin: 4px 0 0; font: 600 1.2rem/1.5 var(--serif); }
.today-links .sep { color: var(--muted); margin: 0 .45em; font-weight: 400; }
.today-check { margin-top: 10px; font: .92rem var(--sans); }
.today-row.done .today-links a { color: var(--muted); }
.today-hint { margin: 8px 0 0; font: .88rem var(--sans); }

/* ------------------------------------------------------------ Listen: sleep timer */
.pl-sleep-wrap { position: relative; flex-shrink: 0; }
.player .pl-sleep { width: auto; min-width: 38px; padding: 0 10px; display: inline-flex; gap: 5px; font: 700 .8rem var(--sans); font-variant-numeric: tabular-nums; }
.player .pl-sleep.on { color: var(--brand); background: var(--surface-2); }
.pl-sleep-t:empty { display: none; }
.pl-sleep-menu { top: auto; bottom: calc(100% + 10px); right: -40px; transform-origin: bottom right; min-width: 176px; }
@media (max-width: 560px) { .pl-sleep-menu { right: -90px; } }

/* ------------------------------------------------------------ Saved: search, sort and color filter */
.saved-tools { display: flex; gap: 8px; margin: 14px 0 0; }
.sv-tag.sv-bible { text-transform: none; letter-spacing: 0; font-size: .74rem; }
.saved-q { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--fg); font: 1rem var(--sans); }
.saved-q:focus { outline: 2px solid var(--link); outline-offset: 1px; }
@media (max-width: 560px) { .saved-tools { flex-wrap: wrap; } .saved-q { flex: 1 1 100%; } }   /* search on its own line, then Bible and Sort */
.saved-colors { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.saved-colors:not([hidden]) { animation: hb-fade var(--dur) ease; }
.saved-colors .dot { width: 26px; height: 26px; }
.saved-colors .sc-all { height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--fg); font: 600 .82rem var(--sans); cursor: pointer; }
.saved-colors .sc-all[aria-pressed="true"] { border-color: var(--fg); }
.saved-count { margin: 0 0 4px; font: .85rem var(--sans); min-height: 1.2em; }

/* ------------------------------------------------------------ print button */
.print-btn { width: 40px; color: var(--fg); }
.print-btn svg { font-family: inherit; }
.page-tools .print-btn:only-child { margin-left: auto; }
/* on the narrowest phones the chapter tools would wrap to a second line: drop Print there (the browser menu still prints) */
@media (max-width: 379px) { .ch-tools .print-btn:not(:only-child) { display: none; } }

/* ------------------------------------------------------------ dropdowns (.dd): same look as the theme menu */
.dd { position: relative; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.dd-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; max-width: 100%; padding: 0 12px 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--fg); font: 500 .9rem var(--sans); cursor: pointer; }
.dd-btn:hover { border-color: var(--link); }
.dd-btn[aria-expanded="true"] { border-color: var(--link); }
.dd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { flex-shrink: 0; fill: none; stroke: currentColor; color: var(--muted); transition: transform var(--dur) var(--ease); }
.dd-btn[aria-expanded="true"] .dd-chev { transform: rotate(180deg); }
.dd-menu { min-width: 100%; width: max-content; max-width: min(300px, calc(100vw - 24px)); }
.dd-menu.dd-left { left: 0; right: auto; transform-origin: top left; }
.dd-menu.dd-up { top: auto; bottom: calc(100% + 10px); transform-origin: bottom right; }
.search-scope { display: inline-flex; align-items: center; gap: 8px; }
.player .pl-voice .dd-btn { width: auto; height: 34px; max-width: 160px; padding: 0 10px 0 12px; font-size: .8rem; display: inline-flex; border-radius: 999px; }
.player .pl-voice .dd-btn:hover { background: var(--surface); }
.pl-voice[hidden] { display: none; }

/* ------------------------------------------------------------ note box: character counter */
.sh-note-btns { align-items: center; }
.sh-count { order: 3; margin-left: auto; font: .78rem var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.sh-count.near { color: #b26a00; } .sh-count.full { color: #c0392b; font-weight: 700; }
html[data-theme="dark"] .sh-count.near { color: #f0b45a; } html[data-theme="dark"] .sh-count.full { color: #ff8a80; }

/* ------------------------------------------------------------ search popup: link to the search page */
.sov-page { display: flex; flex-direction: column; gap: 2px; padding: 11px 16px 13px; border-top: 1px solid var(--border);
  color: var(--fg); text-decoration: none; font: 600 .92rem var(--sans); }
.sov-page::after { content: ""; }
.sov-page span::after { content: " →"; color: var(--link); }
.sov-page small { font-weight: 400; font-size: .8rem; color: var(--muted); }
.sov-page:hover span, .sov-page:focus-visible span { color: var(--link); }
.menu.radio .ck { flex-shrink: 0; stroke: currentColor; }

/* Listen player: voice as a text dropdown on wide screens, as an icon on phones (the title needs the room) */
.player .pl-voice .dd-ico { display: none; fill: currentColor; stroke: currentColor; }
@media (max-width: 560px) {
  .player .pl-voice .dd-btn { width: 38px; height: 38px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .player .pl-voice .dd-btn[aria-expanded="true"] { background: var(--surface-2); }
  .player .pl-voice .dd-ico { display: block; }
  .player .pl-voice .dd-val, .player .pl-voice .dd-chev { display: none; }
  .pl-voice-menu, #pl-voice-menu { right: -44px; }
  .player .pl-sleep.on { padding: 0 8px; }
}
@media (max-width: 400px) {
  .player .pl-sleep .pl-sleep-t { display: none; }
  .player .pl-sleep.on { padding: 0; width: 38px; }
  .player .pl-rate { min-width: 36px; padding: 0 4px; }
}

/* ------------------------------------------------------------ checkboxes: one style for the whole site (the reading plans' look)
   Wrap each one as <label class="chk"><input type="checkbox"><span>Text</span></label> so box and text are centred. */
input[type="checkbox"] { width: 20px; height: 20px; margin: 0; flex-shrink: 0; vertical-align: middle; accent-color: var(--brand); cursor: pointer; }
.chk { display: inline-flex; align-items: center; gap: 10px; line-height: 1.3; cursor: pointer; }
.chk > span { min-width: 0; }
.pd-check { gap: 0; }

/* ------------------------------------------------------------ World English Bible / King James Version */
/* data-tr says which text is shown; .tr-web / .tr-kjv hold the text of each, .web-only is content
   that has no KJV edition yet (stories, characters and quizzes quote the World English Bible). */
html[data-tr="kjv"] .tr-web, html:not([data-tr="kjv"]) .tr-kjv, html[data-tr="kjv"] .web-only { display: none; }
.cr-k, .cr-b { display: none; }
html[data-tr="kjv"] .cr-w { display: none; }
html[data-tr="kjv"]:not([data-page-tr="kjv"]) .cr-b,
html[data-page-tr="kjv"] .cr-k { display: inline; }
.canon-note .btn-ghost.small { margin-left: 6px; vertical-align: baseline; }

/* Psalm titles ("A Psalm by David...") and the Hebrew letters of Psalm 119: part of the text, not verses */
.text .ps-title { margin: 0 0 .6em; font-style: italic; font-size: .9em; color: var(--muted); line-height: 1.5; }
.text .ps-letter { margin: 1.2em 0 .4em; font: 600 .78rem/1.2 var(--sans); letter-spacing: .08em; color: var(--muted); }
.text .ps-letter:first-child { margin-top: 0; }
.text .ps-title.speaking, .text .ps-letter.speaking { color: var(--fg); background: var(--mark); }
