:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-deep: #f4f2ee;
  --card: #faf8f4;
  --surface: #ffffff;
  --field: #faf9f7;
  --bar-bg: rgba(255, 255, 255, 0.94);
  --ink: #111111;
  --ink-soft: #4d463a;
  --ink-faint: #7b7262;
  --oxblood: #8b2a1d;
  --gold: #96700f;
  --gold-soft: #f0e4c4;
  --hairline: rgba(17, 17, 17, 0.16);
  --hairline-soft: rgba(17, 17, 17, 0.08);
  --select: rgba(233, 210, 150, 0.55);
  --hl: rgba(233, 217, 174, 0.32);
  --red: #b0261c;
  --v-hover: rgba(233, 217, 174, 0.22);
  --v-hover-strong: rgba(233, 217, 174, 0.5);
  --shadow: rgba(17, 17, 17, 0.14);

  /* the reader's highlighter colors (data-mark on a verse) */
  --mark-yellow: rgba(255, 214, 64, 0.5);
  --mark-green: rgba(120, 200, 110, 0.4);
  --mark-blue: rgba(100, 165, 245, 0.36);
  --mark-pink: rgba(245, 125, 170, 0.36);
  --mark-purple: rgba(170, 130, 235, 0.38);

  /* the scripture face: sans (system UI, like Bible Gateway) or serif */
  --read-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --read-serif: Georgia, "Times New Roman", serif;
  --read-font: var(--read-sans);
  --read-size: 1.2rem;
  --read-lh: 1.66;
  --read-wt: 400;

  /* one hue per kind of resource: the margin rules and card labels */
  --k-places: #a97d1c;
  --k-maps: #2b7a8a;
  --k-people: #5f7134;
  --k-walks: #8b2a1d;
  --k-doctrine: #2f4b7c;
  --k-sermons: #6a4c7a;
  --k-writing: #7b5a2e;
  --k-topics: #9a6b3c;
  --k-creeds: #3b5a86;
  --k-art: #8a5a2b;
  --k-video: #9c3d54;
  --k-lang: #4f6f3a;

  --bar-h: 3.4rem;
  --side-w: 25rem;
}

:root[data-font="serif"] { --read-font: var(--read-serif); --read-size: 1.34rem; --read-lh: 1.72; --read-wt: 450; }

/* dark: set on <html> by the inline script in index.html (system default, or the toggle) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161513;
  --paper-deep: #1e1d1a;
  --card: #1f1e1b;
  --surface: #23221f;
  --field: #1f1e1b;
  --bar-bg: rgba(22, 21, 19, 0.94);
  --ink: #ece8e1;
  --ink-soft: #bdb5a7;
  --ink-faint: #8f877a;
  --oxblood: #e38a78;
  --gold: #d6ad4c;
  --gold-soft: #4a3f22;
  --hairline: rgba(236, 232, 225, 0.18);
  --hairline-soft: rgba(236, 232, 225, 0.09);
  --select: rgba(214, 173, 76, 0.17);
  --hl: rgba(214, 173, 76, 0.12);
  --red: #f08a7a;
  --v-hover: rgba(214, 173, 76, 0.1);
  --v-hover-strong: rgba(214, 173, 76, 0.22);
  --shadow: rgba(0, 0, 0, 0.5);
  --mark-yellow: rgba(235, 190, 40, 0.3);
  --mark-green: rgba(100, 190, 95, 0.28);
  --mark-blue: rgba(90, 150, 240, 0.3);
  --mark-pink: rgba(240, 110, 160, 0.28);
  --mark-purple: rgba(165, 125, 240, 0.32);

  --k-places: #d6ad4c;
  --k-maps: #62b4c4;
  --k-people: #a2b86c;
  --k-walks: #e38a78;
  --k-doctrine: #86a3d8;
  --k-sermons: #b996ca;
  --k-writing: #c9a06a;
  --k-topics: #d4a476;
  --k-creeds: #8fadd9;
  --k-art: #d19e68;
  --k-video: #e28199;
  --k-lang: #98bd7e;
}

/* the shared site bar, recoloured to match (its own dark variant also pins it fixed) */
:root[data-theme="dark"] .appnav { background: rgba(20, 20, 20, 0.96); border-bottom-color: #2c2c2c; }
:root[data-theme="dark"] .appnav-brand { color: #e8e4dc; }
:root[data-theme="dark"] .appnav-crumb, :root[data-theme="dark"] .appnav-links a, :root[data-theme="dark"] .appnav-toggle { color: #a8a29e; }
:root[data-theme="dark"] .appnav-crumb .sep { color: #57534e; }
:root[data-theme="dark"] .appnav-crumb .cur { color: #ececec; }
:root[data-theme="dark"] .appnav-toggle { border-color: #3a3833; }
:root[data-theme="dark"] .appnav-links a:hover, :root[data-theme="dark"] .appnav-links a.active, :root[data-theme="dark"] .appnav-crumb a:hover { color: #9db0ff; }
:root[data-theme="dark"] .appnav-menu { background: rgba(28, 28, 28, 0.98); border-color: #2c2c2c; }
:root[data-theme="dark"] .appnav-menu a { color: #a8a29e; }
:root[data-theme="dark"] .appnav-group-label { color: #78716c; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-padding-top: calc(var(--appnav-h, 0px) + var(--bar-h) + 1rem); }

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
}

a { color: var(--oxblood); }
button { font: inherit; color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 1.2rem;
  padding: 1.1rem 1.6rem 0.9rem;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.9rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.wordmark em { font-style: italic; font-weight: 400; color: var(--oxblood); }

.tagline {
  order: 3;
  flex: 1 1 18rem;
  min-width: 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 44rem;
}

/* the account: Sign in, or the reader's picture and a menu, top right */
.mast-acct { order: 4; flex: none; position: relative; margin-left: auto; align-self: center; }
.mast-acct[hidden] { display: none; }
.acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2rem;
  padding: 0 0.85rem 0 0.7rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.acct-btn:hover { border-color: var(--ink-soft); }
.acct-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.acct-btn.is-in { padding: 0; width: 2rem; justify-content: center; overflow: hidden; }
.acct-face { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.acct-initial { display: inline-flex; align-items: center; justify-content: center; color: var(--paper); background: var(--oxblood); font-size: 0.95rem; }
.acct-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 90;
  min-width: 15rem;
  padding: 0.7rem 0.4rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 10px 28px var(--shadow);
}
.acct-menu[hidden] { display: none; }
.acct-who { padding: 0 0.6rem; line-height: 1.35; }
.acct-who strong { display: block; font-size: 0.95rem; }
.acct-who span { font-size: 0.82rem; color: var(--ink-faint); }
.acct-note { margin: 0.4rem 0.6rem 0.5rem; font-size: 0.8rem; font-style: italic; color: var(--ink-soft); }
.acct-menu a, .acct-menu button {
  display: block;
  width: 100%;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  border-top: 1px solid var(--hairline-soft);
  cursor: pointer;
}
.acct-menu a:hover, .acct-menu button:hover { color: var(--oxblood); background: var(--card); }

/* ---------- toolbar ---------- */

.bar {
  position: sticky;
  top: var(--appnav-h, 0px);
  z-index: 50;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.6rem;
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hairline);
}

.pick {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.pick:hover, .pick[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.pick .chev { font-size: 0.7em; font-weight: 400; }

.step { display: inline-flex; }
.step-btn {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  font-family: var(--sans);
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
}
.step-btn:hover { background: var(--gold-soft); color: var(--oxblood); }
.step-btn[aria-disabled="true"] { opacity: 0.25; pointer-events: none; }

.go { position: relative; flex: 1 1 14rem; max-width: 26rem; }
.go input {
  width: 100%;
  padding: 0.42rem 0.8rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.go input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 12px 32px var(--shadow);
  padding: 0.3rem;
}
.suggest li {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.3;
}
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--gold-soft); }
.suggest .s-title { display: block; font-size: 0.98rem; }
.suggest .s-sub { display: block; font-size: 0.8rem; color: var(--ink-soft); font-style: italic; }
.suggest .s-empty { color: var(--ink-faint); font-style: italic; cursor: default; }
.suggest .s-empty:hover { background: none; }

.seg {
  display: inline-flex;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  overflow: hidden;
  flex: none;
}
.seg button {
  padding: 0.28rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ink-soft);
}
.seg button + button { border-left: 1px solid var(--hairline); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button:not([aria-pressed="true"]):hover { color: var(--oxblood); }

.seg button:disabled { opacity: 0.4; cursor: default; }

/* translation pickers and the settings button */
.tr-pick, .settings-btn {
  flex: none;
  height: 1.95rem;
  padding: 0 0.7rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}
.tr-pick { appearance: none; -webkit-appearance: none; padding-right: 1.5rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 0.75rem center, right 0.5rem center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat; }
.tr-par:has(option[value=""]:checked) { color: var(--ink-soft); }
.tr-pick:hover, .settings-btn:hover, .settings-btn[aria-expanded="true"] { border-color: var(--ink-soft); }
.tr-pick:focus-visible, .settings-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.settings-btn { display: inline-flex; align-items: center; gap: 0.35rem; }
.settings-btn .chev { font-size: 0.7em; }
.settings-btn .set-icon { display: none; font-weight: 600; }

/* the settings panel */
.settings {
  position: fixed;
  z-index: 66;
  width: min(18rem, calc(100vw - 16px));
  max-height: calc(100vh - var(--appnav-h, 0px) - var(--bar-h) - 24px);
  overflow-y: auto;
  padding: 0.9rem 1.1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 14px 36px var(--shadow);
}
.settings[hidden] { display: none; }
.set-title {
  margin: 0.9rem 0 0.4rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.set-title:first-child, .settings > p.set-title:first-of-type { margin-top: 0; }
.settings .seg { display: flex; }
.set-par { display: none; }
.set-par .tr-pick, .settings .set-wide { width: 100%; text-align: left; }
.settings .seg button { flex: 1; padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.set-note { margin-top: 0.3rem; font-size: 0.85rem; font-style: italic; color: var(--ink-faint); }
.set-opts { list-style: none; }
.set-opts label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
  font-size: 1.05rem;
  cursor: pointer;
}
.set-opts input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--oxblood); flex: none; }
.set-aside { margin-left: auto; font-size: 0.8rem; font-style: italic; color: var(--ink-faint); }
.set-offline .set-title { margin-top: 0.9rem; }
.set-offline .set-note { margin: 0 0 0.5rem; }
.set-btn {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.7rem;
  font-size: 0.95rem;
  text-align: left;
  background: var(--field);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  cursor: pointer;
}
.set-btn:hover { border-color: var(--ink-soft); }
a.set-btn { color: var(--ink); text-decoration: none; }
.set-btn:disabled { cursor: default; color: var(--ink-soft); }
.set-btn[hidden] { display: none; }

.bar-link {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.bar-link + .bar-link { margin-left: 0.9rem; }
.bar-link:hover, .bar-link[aria-current="page"] { color: var(--oxblood); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- book & chapter picker ---------- */

.picker {
  position: fixed;
  top: calc(var(--appnav-h, 0px) + var(--bar-h));
  left: 0;
  right: 0;
  z-index: 55;
  max-height: calc(100vh - var(--appnav-h, 0px) - var(--bar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.4rem 2.4rem;
  padding: 1.2rem 1.6rem 1.6rem;
  background: var(--surface);
  border-bottom: 1px solid var(--ink);
  box-shadow: 0 18px 40px var(--shadow);
}
.picker[hidden] { display: none; }

.picker-books { columns: 2 16rem; column-gap: 1.8rem; }
.pb-group { break-inside: avoid; margin-bottom: 0.9rem; }
.pb-label {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.pb-list { display: flex; flex-wrap: wrap; gap: 0.1rem 0.2rem; }
.pb-list button {
  padding: 0.12rem 0.45rem;
  font-size: 0.98rem;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink);
}
.pb-list button:hover { background: var(--gold-soft); }
.pb-list button[aria-current="true"] { background: var(--ink); color: var(--paper); }

.picker-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr));
  gap: 0.3rem;
}
.chapter-grid a {
  position: relative;
  display: grid;
  place-items: center;
  height: 2.2rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--field);
}
.chapter-grid a:hover { border-color: var(--oxblood); color: var(--oxblood); }
.chapter-grid a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.picker-back { display: none; }

/* ---------- page grid ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  gap: 0 3rem;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.6rem;
}
.page[hidden] { display: none; }

/* ---------- the text ---------- */

.reader {
  width: 100%;
  max-width: 40rem;
  justify-self: center;
  padding: 2.2rem 0 32vh;
}

.ch-head { text-align: center; margin-bottom: 1.8rem; }
.ch-book {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.ch-num {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 3.4rem;
  line-height: 1.05;
  color: var(--ink);
}

.text {
  position: relative;
  font-family: var(--read-font);
  font-size: var(--read-size);
  font-weight: var(--read-wt);
  line-height: var(--read-lh);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first;
}

.v {
  position: relative;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.text.lines .v { display: block; padding: 0.06rem 0.35rem 0.06rem 2.3rem; margin: 0 -0.35rem 0.28rem 0; }
.text.lines .vn {
  position: absolute;
  left: 0;
  top: 0.42rem;
  width: 1.8rem;
  text-align: right;
}
.text.prose { text-align: justify; hyphens: auto; }
.text.prose .v { display: inline; padding: 0.1rem 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.text.prose .vn { margin: 0 0.18rem 0 0.3rem; vertical-align: 0.45em; }

/* listening: a button in the bar */
.listen {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 1.95rem;
  padding: 0 0.75rem 0 0.6rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}
.listen:hover { border-color: var(--ink-soft); color: var(--oxblood); }
.listen:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.listen[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.listen-icon { flex: none; }

/* Share: only from the home screen, where there is no address bar to share from */
.share-btn {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.95rem;
  height: 1.95rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}
.share-btn:hover { border-color: var(--ink-soft); color: var(--oxblood); }
.share-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.share-btn.is-done { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.standalone .share-btn { display: inline-flex; }
/* on phones the toolbar has no room, so it sits at the end of the masthead */
.share-mast { margin-left: auto; align-self: center; }
.standalone .share-mast { display: none; }
.listen[aria-pressed="true"] .wave { animation: wave 1.4s ease-in-out infinite; }
.listen[aria-pressed="true"] .wave-2 { animation-delay: 0.25s; }
@keyframes wave { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.player {
  position: fixed;
  left: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 76;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: min(25rem, calc(100vw - 2rem));
  padding: 0.45rem 0.6rem 0.45rem 0.45rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  box-shadow: 0 10px 28px var(--shadow);
}
.player[hidden] { display: none; }
.player-btn {
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.8rem;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.player-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.player-title {
  font-family: var(--sans);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.player-title:hover { color: var(--oxblood); }
.player.is-error .player-title { color: var(--oxblood); font-style: italic; }
.player-seek { width: 100%; height: 1rem; margin: 0; accent-color: var(--oxblood); cursor: pointer; }
.player-time { flex: none; font-family: var(--sans); font-size: 0.75rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.player-close {
  flex: none;
  width: 1.8rem;
  height: 1.8rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.player-close:hover { color: var(--oxblood); background: var(--gold-soft); }

/* page options */
.text.no-nums .vn { display: none; }
.text.no-nums.lines .v, .text.no-nums.parallel .v { padding-left: 0.35rem; }
.text.no-heads .sec-head, .text.no-heads .sec-inline { display: none; }
.text.red-letter .wj { color: var(--red); }
.fn { display: none; }
.text.show-notes .fn {
  display: inline;
  padding: 0 0.12em;
  font-family: var(--sans);
  font-size: 0.6em;
  font-weight: 600;
  line-height: 0;
  vertical-align: 0.55em;
  color: var(--oxblood);
  cursor: pointer;
}
.text.show-notes .fn:hover, .text.show-notes .fn:focus-visible { text-decoration: underline; outline: none; }
.ch-notes { display: none; }
.text.show-notes + .ch-notes {
  display: block;
  list-style: none;
  margin: 2rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.ch-notes li { display: flex; gap: 0.5rem; padding: 0.2rem 0; }
.ch-notes .fn-back { flex: none; min-width: 1.4rem; font-family: var(--sans); font-size: 0.85rem; font-weight: 600; color: var(--oxblood); text-decoration: none; }
.ch-notes .fn-ref { flex: none; min-width: 2.6rem; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-faint); }

/* two translations side by side, verse by verse */
.page.is-parallel { max-width: 92rem; }
.page.is-parallel .reader { max-width: 64rem; }
.text.parallel .v {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 1.6rem;
  padding: 0.25rem 0.35rem 0.25rem 2.3rem;
  margin: 0 -0.35rem 0.3rem 0;
}
.text.parallel .vn { position: absolute; left: 0; top: 0.62rem; width: 1.8rem; text-align: right; }
.text.parallel .pcell-1 { padding-left: 1.2rem; border-left: 1px solid var(--hairline-soft); margin-left: -0.8rem; }
.par-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 1.6rem;
  position: sticky;
  top: calc(var(--appnav-h, 0px) + var(--bar-h));
  z-index: 5;
  margin: 0 0 0.6rem;
  padding: 0.45rem 0 0.4rem 2.3rem;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.par-head span + span { padding-left: 0.4rem; }

.vn {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--gold);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.vn:hover { color: var(--oxblood); }

.v:hover { background-color: var(--v-hover); }
.v.is-hl { background-color: var(--hl); }
.v.is-hover { background-color: var(--v-hover-strong); }
.v.is-selected { background-color: var(--select); }
/* highlights: a layer of highlighter over the selection tint, and a rule
   under the selected verse so it still shows through the color */
.v[data-mark] { background-image: linear-gradient(var(--mark), var(--mark)); }
.v[data-mark="yellow"] { --mark: var(--mark-yellow); }
.v[data-mark="green"] { --mark: var(--mark-green); }
.v[data-mark="blue"] { --mark: var(--mark-blue); }
.v[data-mark="pink"] { --mark: var(--mark-pink); }
.v[data-mark="purple"] { --mark: var(--mark-purple); }
.v[data-mark].is-selected { box-shadow: inset 0 -2px 0 var(--gold); }
.v.is-flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background-color: rgba(31, 63, 217, 0.22); } 100% { background-color: transparent; } }

.v-missing { font-style: italic; color: var(--ink-faint); font-size: 0.92em; }

/* the BSB's section headings */
.sec-head {
  display: block;
  margin: 1.5rem 0 0.55rem;
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  text-align: left;
}
.text .sec-head:first-child { margin-top: 0; }
/* 0: the Psalter's five books · 1: a section · 2: a subsection · 3: a label */
.sec-head.sec-0 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.2rem; }
.sec-head.sec-0 + .sec-head { margin-top: 0.2rem; }
.sec-head.sec-2 { font-size: 1.02rem; font-style: italic; font-weight: 500; margin-top: 1.1rem; }
.sec-head.sec-3 { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; font-variant: small-caps; color: var(--ink-soft); margin: 0.9rem 0 0.3rem; }
.sec-inline {
  display: block;
  margin: 0.4rem 0 0.1rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant: small-caps;
  color: var(--ink-soft);
}
.text.prose .sec-inline { display: inline; margin: 0 0.3rem; }
.v-missing q { font-style: normal; color: var(--ink-soft); }

/* margin rules: one per passage a resource is tagged with */
.rules { position: absolute; top: 0; bottom: 0; right: -1.9rem; width: 1.6rem; pointer-events: none; }
.rule {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: var(--k, var(--gold));
  opacity: 0.45;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.15s, width 0.15s;
}
.rule::before { content: ""; position: absolute; inset: -2px -5px; }
.rule.is-active { opacity: 0.9; }
.rule.is-hover { opacity: 1; width: 5px; }

.ch-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--sans);
  font-size: 0.95rem;
}
.ch-foot a { color: var(--ink-soft); text-decoration: none; }
.ch-foot a:hover { color: var(--oxblood); }
.ch-foot a:empty { visibility: hidden; }
#foot-prev::before { content: "‹ "; }
#foot-next::after { content: " ›"; }

.side .loading { padding: 0.8rem 0; text-align: left; font-size: 0.9rem; }

.loading, .error {
  padding: 3rem 0;
  text-align: center;
  font-style: italic;
  color: var(--ink-faint);
}
.error button {
  margin-left: 0.5rem;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--ink-soft);
  background: none;
  cursor: pointer;
  font-style: normal;
}

/* ---------- the sidebar ---------- */

.side {
  position: sticky;
  top: calc(var(--appnav-h, 0px) + var(--bar-h));
  height: calc(100vh - var(--appnav-h, 0px) - var(--bar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.6rem 0.3rem 3rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.side-head { margin-bottom: 1rem; }
.side-head h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.2;
  margin-top: 0.15rem;
}
.now {
  margin-top: 0.35rem;
  font-size: 0.98rem;
  font-style: italic;
  color: var(--ink-soft);
}
.now b { font-style: normal; font-weight: 600; color: var(--ink); }

/* which sources to show: one checkbox each */
.sources-filter { margin: 0.2rem 0 0.4rem; }
.vp .sources-filter { margin-top: 1rem; }
.sources-filter > summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.55rem;
  padding: 0.5rem 0.1rem;
  font-size: 0.96rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--hairline-soft);
  border-bottom: 1px solid var(--hairline-soft);
  list-style: none;
  cursor: pointer;
}
.sources-filter > summary::-webkit-details-marker { display: none; }
.sources-filter > summary::before {
  content: "▸";
  font-size: 0.85em;
  color: var(--ink-faint);
  transition: transform 0.15s;
}
.sources-filter[open] > summary::before { transform: rotate(90deg); }
.sources-filter > summary:hover .sf-label { color: var(--oxblood); }
.sf-label {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.sf-state { font-style: italic; }
.sf-hidden { margin-left: auto; font-style: italic; color: var(--oxblood); }
.sf-body { padding: 0.45rem 0 0.5rem; border-bottom: 1px solid var(--hairline-soft); }
.sf-list { list-style: none; }
.sf-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.17rem 0;
  font-size: 0.93rem;
  line-height: 1.25;
  cursor: pointer;
}
.sf-list input { margin: 0; accent-color: var(--oxblood); flex: none; }
.sf-swatch { flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--k, var(--gold)); }
.sf-name { flex: 1; }
.sf-list label.is-empty .sf-name { color: var(--ink-faint); }
.sf-list input:not(:checked) ~ .sf-name { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--hairline); }
.sf-list input:not(:checked) ~ .sf-swatch { opacity: 0.35; }
.sf-count {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}
.sf-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1rem; margin-top: 0.45rem; }
.sf-actions button {
  padding: 0;
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--oxblood);
  background: none;
  border: 0;
  cursor: pointer;
}
.sf-actions button:hover { text-decoration: underline; }
.sf-note { margin-left: auto; font-size: 0.76rem; font-style: italic; color: var(--ink-faint); }

.side-section { margin-top: 1.4rem; }
.side-section > summary, .side-section > h3 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 0.6rem;
  list-style: none;
  cursor: default;
}
.side-section > summary { cursor: pointer; }
.side-section > summary::-webkit-details-marker { display: none; }
.side-section > summary::after { content: "▾"; margin-left: auto; font-size: 0.9em; transition: transform 0.15s; }
.side-section:not([open]) > summary::after { transform: rotate(-90deg); }
.side-section .count {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.side-empty { font-size: 1rem; font-style: italic; color: var(--ink-faint); line-height: 1.45; }

.res {
  position: relative;
  padding: 0.6rem 0.75rem 0.65rem 0.9rem;
  margin-bottom: 0.55rem;
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  border-left: 3px solid var(--k, var(--gold));
  border-radius: 3px;
  transition: opacity 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.res.is-dim { opacity: 0.55; }
.res.is-dim .res-note { display: none; }
.res.is-active { opacity: 1; box-shadow: 0 4px 14px var(--shadow); }
.res.is-hover { box-shadow: 0 0 0 1px var(--k, var(--gold)), 0 4px 14px var(--shadow); opacity: 1; }
.res.compact { padding: 0.4rem 0.7rem 0.45rem 0.8rem; margin-bottom: 0.35rem; }

.res-app {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--k, var(--gold));
}
.res-app .res-group { font-weight: 400; letter-spacing: 0.08em; color: var(--ink-faint); text-align: right; }
.res-title {
  display: block;
  margin-top: 0.12rem;
  font-family: var(--sans);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
}
a.res-title:hover { color: var(--oxblood); text-decoration: underline; text-underline-offset: 3px; }
a.res-title .ext { font-weight: 400; font-size: 0.8em; color: var(--ink-faint); margin-left: 0.2rem; }
.res.compact .res-title { font-size: 1rem; font-weight: 500; }
.res-meta { margin-top: 0.1rem; font-size: 0.94rem; font-style: italic; color: var(--ink-soft); line-height: 1.3; }
.res-note { margin-top: 0.3rem; font-size: 1.02rem; line-height: 1.48; color: var(--ink-soft); }
.res-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.7rem; margin-top: 0.35rem; }
.res-ref {
  padding: 0;
  font-family: var(--sans);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-bottom: 1px dotted var(--ink-faint);
  cursor: pointer;
  text-decoration: none;
}
.res-ref:hover { color: var(--oxblood); border-bottom-color: var(--oxblood); }
.res-ref.is-static { border-bottom: 0; cursor: default; color: var(--ink-faint); font-style: italic; }
.res-ref.is-static:hover { color: var(--ink-faint); }
.res-lock { font-size: 0.75rem; color: var(--ink-faint); font-style: italic; }
.res-link { font-size: 0.86rem; font-style: italic; color: var(--ink-soft); }
.res-link:hover { color: var(--oxblood); }

.res--places { --k: var(--k-places); }
.res--people { --k: var(--k-people); }
.res--walks { --k: var(--k-walks); }
.res--doctrine { --k: var(--k-doctrine); }
.res--maps { --k: var(--k-maps); }
.res--topics { --k: var(--k-topics); }
.res--creeds { --k: var(--k-creeds); }
.res--art { --k: var(--k-art); }
.res--video { --k: var(--k-video); }
.res--lang { --k: var(--k-lang); }
.res--sermons { --k: var(--k-sermons); }
.res--writing { --k: var(--k-writing); }

.more {
  margin-top: 0.2rem;
  padding: 0.2rem 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--oxblood);
  background: none;
  border: 0;
  cursor: pointer;
}
.more:hover { text-decoration: underline; }

/* chips: topics, people, places */
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem 0.35rem; margin-bottom: 0.4rem; }
.chip {
  padding: 0.12rem 0.55rem 0.16rem;
  font-size: 0.86rem;
  line-height: 1.3;
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.chip:hover { color: var(--oxblood); border-color: var(--k-topics); background: var(--v-hover-strong); }
.chip--person:hover { border-color: var(--k-people); }
.chip--place:hover { border-color: var(--k-maps); }

/* the places map */
.place-map {
  height: 210px;
  margin: 0.1rem 0 0.55rem;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: #eef0ec;
  z-index: 0;
}
.place-map .leaflet-control-attribution { font-size: 9px; }
.map-area {
  font-family: var(--sans);
  font-size: 12px;
  font-style: italic;
  color: #1d5f6b;
  white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.map-area > span { display: inline-block; transform: translate(-50%, -50%); }
.leaflet-tooltip span { color: #5c5240; font-size: 11px; }

/* Hebrew and Greek, word by word */
.words { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem 0.45rem; margin-bottom: 0.55rem; }
.word {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.8rem;
  padding: 0.4rem 0.5rem 0.45rem;
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  border-radius: 4px;
  text-align: center;
  line-height: 1.2;
}
.w-orig { font-size: 1.45rem; line-height: 1.15; font-family: "Gentium Plus", "Times New Roman", serif; font-weight: 500; color: var(--ink); }
/* Greek in a serif with polytonic accents (Times New Roman has them); Hebrew in its own face */
.words--rtl .w-orig { font-size: 1.65rem; font-weight: 400; font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", serif; }
.w-tr { margin-top: 0.1rem; font-size: 0.88rem; font-style: italic; color: var(--ink-soft); }
.w-gloss { font-size: 0.94rem; color: var(--ink); max-width: 10rem; }
.w-gloss--mark { font-size: 0.8rem; font-style: italic; color: var(--ink-faint); }
.word--arc { border-style: dashed; }
.w-strongs {
  margin-top: 0.15rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--k-lang);
  text-decoration: none;
}
.w-strongs:hover { text-decoration: underline; }

.xr-votes {
  margin-left: 0.2rem;
  font-size: 0.62rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* a card with a picture: Doré's engravings */
.res.has-img { display: flow-root; }
.res-img { float: right; margin: 0.1rem 0 0.3rem 0.6rem; }
.res-img img {
  display: block;
  width: 92px;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--paper-deep);
}

/* sermons: a plain list, newest first */
.sermons { list-style: none; }
.sermons li { padding: 0.35rem 0; border-bottom: 1px solid var(--hairline-soft); line-height: 1.3; }
.sermons li:last-child { border-bottom: 0; }
.sermons .s-name { font-size: 1.02rem; color: var(--ink); text-decoration: none; }
.sermons a.s-name:hover { color: var(--oxblood); text-decoration: underline; }
.sermons .s-when { display: block; font-size: 0.86rem; color: var(--ink-faint); font-style: italic; }
.sermons .s-when a { color: var(--ink-soft); }

.tools { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.96rem; }
.tools a { color: var(--ink-soft); }
.tools a:hover { color: var(--oxblood); }

/* ---------- verse panel ---------- */

.vp-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.vp-back {
  padding: 0.2rem 0.6rem 0.2rem 0.4rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}
.vp-back:hover { color: var(--oxblood); border-color: var(--oxblood); }
.vp-step { margin-left: auto; display: inline-flex; gap: 0.15rem; }
.vp-step button {
  width: 1.8rem;
  height: 1.8rem;
  font-family: var(--sans);
  font-size: 1.1rem;
  line-height: 1;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.vp-step button:hover { background: var(--gold-soft); color: var(--oxblood); }
.vp-step button:disabled { opacity: 0.25; cursor: default; background: none; }

.vp-ref {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.15;
}
.vp-text {
  margin: 0.5rem 0 0.35rem;
  font-family: var(--read-font);
  font-size: 1.18rem;
  font-weight: var(--read-wt);
  line-height: 1.52;
}
.vp-alt {
  font-family: var(--read-font);
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.vp-alt .tag, .vp-text .tag {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-right: 0.35rem;
  font-style: normal;
}
mark.anchor {
  background: none;
  color: inherit;
  border-bottom: 1.5px solid var(--gold);
  cursor: pointer;
}
mark.anchor:hover, mark.anchor.is-hover { background: var(--gold-soft); }

.vp-tools { margin-top: 0.6rem; }

.mark-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.7rem; }
.mark-label { font-size: 0.85rem; color: var(--ink-soft); margin-right: 0.15rem; }
.mark-sw {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: linear-gradient(var(--mark), var(--mark)), var(--paper);
  cursor: pointer;
}
.mark-sw:hover { border-color: var(--ink-soft); }
.mark-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.mark-yellow { --mark: var(--mark-yellow); }
.mark-green { --mark: var(--mark-green); }
.mark-blue { --mark: var(--mark-blue); }
.mark-pink { --mark: var(--mark-pink); }
.mark-purple { --mark: var(--mark-purple); }
.mark-clear {
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: none;
  border: 0;
  padding: 0.2rem 0.3rem;
  text-decoration: underline;
  cursor: pointer;
}
.mark-clear:hover { color: var(--oxblood); }
.mark-note { flex-basis: 100%; font-size: 0.8rem; font-style: italic; color: var(--ink-faint); }
.mark-signin { padding: 0; font: inherit; color: var(--ink-soft); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.mark-signin:hover { color: var(--oxblood); }

.tsk-head { display: flex; align-items: baseline; gap: 0.6rem; }
.tsk-toggle {
  margin-left: auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  cursor: pointer;
}
.tsk-toggle input { accent-color: var(--oxblood); }

.tsk { list-style: none; }
.tsk-group {
  padding: 0.45rem 0 0.5rem;
  border-bottom: 1px solid var(--hairline-soft);
  scroll-margin-top: 1rem;
}
.tsk-group:last-child { border-bottom: 0; }
.tsk-group.is-flash { animation: flash 1.4s ease-out; }
.tsk-phrase {
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink);
  margin-right: 0.35rem;
}
.tsk-refs { display: inline; }
.xr {
  display: inline;
  padding: 0 0.1rem;
  margin: 0 0.1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--oxblood);
  background: none;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}
.xr:hover { background: var(--gold-soft); }
.xr[aria-expanded="true"] { background: var(--gold-soft); color: var(--ink); }
.xr-sep { color: var(--ink-faint); font-size: 0.75rem; }

.xr-texts { list-style: none; margin-top: 0.35rem; }
.xr-text {
  padding: 0.3rem 0 0.3rem 0.7rem;
  border-left: 2px solid var(--gold-soft);
  margin-bottom: 0.3rem;
  font-size: 0.93rem;
  line-height: 1.42;
  color: var(--ink-soft);
}
.xr-text a {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-right: 0.35rem;
}
.xr-text a:hover { color: var(--oxblood); text-decoration: underline; }
.xr-text sup { font-family: var(--sans); font-size: 0.6em; color: var(--gold); margin: 0 0.1em; }

/* hover preview for a cross-reference */
.preview {
  position: fixed;
  z-index: 70;
  max-width: 22rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  box-shadow: 0 10px 28px var(--shadow);
  font-size: 0.95rem;
  line-height: 1.42;
  pointer-events: none;
}
.preview b { display: block; font-family: var(--sans); font-size: 0.8rem; margin-bottom: 0.15rem; }

/* ---------- the Hebrew or Greek beneath the English ---------- */

.orig-glyph { font-family: "SBL Hebrew", "Ezra SIL", "Gentium Plus", "Times New Roman", serif; font-size: 1.05rem; line-height: 1; }
.text.orig .ow {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--k-lang) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
  border-radius: 2px;
}
.text.orig .ow:hover { text-decoration-color: var(--k-lang); background: var(--v-hover-strong); }
.text.orig .ow.is-on { background: var(--select); text-decoration-color: var(--k-lang); }
.word[data-i] { cursor: pointer; }
.word[data-i]:hover { border-color: var(--k-lang); }
.word.is-on { border-color: var(--k-lang); background: var(--select); }

/* the word's card: beside the word, or at the foot on a phone */
.lex {
  position: absolute;
  z-index: 85;
  width: min(30rem, calc(100vw - 16px));
  max-height: min(34rem, 62vh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.9rem 1.1rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: 0 14px 36px var(--shadow);
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink);
}
.lex-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 1;
  width: 1.9rem;
  height: 1.9rem;
  margin: -0.3rem -0.5rem 0 0.4rem;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}
.lex-close:hover { color: var(--oxblood); border-color: var(--oxblood); }
.lex-word + .lex-word { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--hairline-soft); }
.lex-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.lex-lemma { font-size: 2.1rem; line-height: 1.15; font-family: "Gentium Plus", "Times New Roman", serif; font-weight: 500; }
.lex-lemma[lang="hbo"], .conc-lemma[lang="hbo"], .lex-form[lang="hbo"] { font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", serif; font-weight: 400; }
.lex-count {
  padding: 0.25rem 0.8rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}
.lex-count:hover { color: var(--oxblood); border-color: var(--oxblood); }
.lex-pos { margin-top: 0.15rem; color: var(--ink-soft); }
.lex-tr { color: var(--ink); }
.lex-gloss { font-style: italic; }
.lex-num { margin-left: 0.2rem; font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--k-lang); text-decoration: none; }
.lex-num:hover { text-decoration: underline; }
.lex-here { margin-top: 0.35rem; font-size: 0.88rem; color: var(--ink-soft); }
.lex-here-k { font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.lex-form { font-size: 1.15rem; color: var(--ink); font-family: "Gentium Plus", "Times New Roman", serif; }
.lex-n { font-size: 0.78rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.lex-def { margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px solid var(--hairline-soft); }
.lex-def b { font-weight: 600; }
.lex-def .he { font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", serif; font-size: 1.1em; }
.lex-def a[data-r] { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--hairline); cursor: pointer; }
.lex-def a[data-r]:hover { color: var(--oxblood); }
/* BDB's senses (I, 1, a, (1)) as an indented outline */
.lex-def--bdb .s { display: block; margin: 0.15rem 0 0 1.1rem; }
.lex-def--bdb > .s { margin-left: 0; }
.lex-def--bdb .n { font-weight: 600; color: var(--ink-soft); margin-right: 0.15rem; }
.lex-src { margin-top: 0.8rem; font-size: 0.78rem; line-height: 1.4; color: var(--ink-faint); }

/* the concordance in the sidebar */
.conc-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.conc-lemma { font-size: 1.9rem; font-weight: 500; font-family: "Gentium Plus", "Times New Roman", serif; }
.conc-num { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--k-lang); }
.conc-about { margin-top: 0.3rem; color: var(--ink-soft); font-size: 0.95rem; }
.conc-chart {
  display: grid;
  gap: 0.25rem;
  margin: 0.8rem 0 0.4rem;
  padding: 0.6rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  border-radius: 6px;
}
.conc-bar {
  display: grid;
  grid-template-columns: 8.4rem 1fr 3rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.12rem 0.2rem;
  font: inherit;
  font-size: 0.86rem;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 3px;
  text-align: left;
  cursor: pointer;
}
.conc-bar-name { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conc-bar-track { height: 0.95rem; }
.conc-bar-fill { display: block; height: 100%; background: var(--k-lang); opacity: 0.75; border-radius: 2px; }
.conc-bar-n { font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--ink-faint); }
.conc-bar:hover { background: var(--v-hover); }
.conc-bar:hover .conc-bar-fill { opacity: 1; }
.conc-chart:has(.conc-bar[aria-pressed="true"]) .conc-bar[aria-pressed="false"] { opacity: 0.45; }
.conc-bar[aria-pressed="true"] { color: var(--ink); background: var(--select); }
.conc-bar[aria-pressed="true"] .conc-bar-fill { opacity: 1; }
.conc-list { list-style: none; }
.conc-row { padding: 0.55rem 0.3rem; border-bottom: 1px solid var(--hairline-soft); line-height: 1.45; }
.conc-row.is-here { background: var(--hl); }
.conc-ref { display: block; font-family: var(--sans); font-size: 0.9rem; color: var(--ink); text-decoration: none; }
.conc-ref:hover { color: var(--oxblood); text-decoration: underline; }
.conc-text { color: var(--ink-soft); }
.conc-text b { color: var(--ink); font-weight: 650; }
.conc-more {
  display: block;
  margin: 0.8rem auto 0;
  padding: 0.3rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}
.conc-more[hidden] { display: none; }

@media (max-width: 960px) {
  .lex {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: auto;
    max-height: 58vh;
    padding: 0.9rem 1.1rem calc(1rem + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--ink);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -14px 36px var(--shadow);
  }
}
@media (max-width: 640px) {
  .orig-btn { padding: 0 0.55rem; }
  .conc-bar { grid-template-columns: 7.2rem 1fr 2.6rem; }
}

/* ---------- the reading plan ---------- */

.plan-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 2.2rem;
  padding: 0.8rem 1rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
}
.plan-foot[hidden] { display: none; }
.plan-foot + .ch-foot { margin-top: 1.2rem; }
.pf-head { color: var(--ink-soft); }
.pf-head a { color: var(--gold); text-decoration: none; }
.pf-head a:hover { text-decoration: underline; }
.pf-done { color: var(--k-people); font-weight: 600; }
.pf-done::before { content: "✓ "; }
.plan-foot .pf-next { color: var(--oxblood); text-decoration: none; }
.plan-foot .pf-next:hover { text-decoration: underline; }
.plan-foot .set-btn { width: auto; margin-left: auto; font-family: inherit; font-size: 0.88rem; }
.pf-undo, .pl-reset {
  margin-left: auto;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink-faint);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.pl-reset { margin-left: 0.3rem; }
.set-account { margin-top: 0.5rem; }
.set-account[hidden] { display: none; }
.set-account .set-note { margin: 0 0 0.4rem; }
.pl-acct { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; max-width: 44rem; margin-top: 1.2rem; font-size: 0.92rem; color: var(--ink-soft); }
.pl-acct.is-in { display: block; }
.pl-acct .pl-google { width: auto; align-items: center; font-weight: 600; color: var(--ink); background: var(--surface); }
.pl-note { max-width: 44rem; margin-top: 1rem; padding: 0.5rem 0.8rem; color: var(--oxblood); border: 1px solid var(--hairline); border-radius: 8px; }

.pl-up {
  max-width: 44rem;
  margin: 1.4rem 0 0.4rem;
  padding: 1rem 1.2rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  border-radius: 10px;
}
.pl-up-head { font-family: var(--sans); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.pl-up-head span { font-weight: 400; color: var(--ink-soft); font-size: 1rem; }
.pl-up-list { list-style: none; }
.pl-up-list li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--hairline-soft);
}
.pl-track {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.pl-read { display: inline-flex; align-items: baseline; gap: 0.5rem; cursor: pointer; }
.pl-read input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--oxblood); flex: none; align-self: center; cursor: pointer; }
.pl-read a { color: var(--ink); text-decoration: none; }
.pl-read a:hover { color: var(--oxblood); text-decoration: underline; }
.pl-read.is-done a { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--hairline); }
.pl-up-list .pl-read { font-size: 1.05rem; }
.pl-up-act { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.pl-up-act .set-btn { width: auto; }
.pl-up-act .pl-go { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.pl-progress {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 44rem;
  margin: 1rem 0 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.pl-pct { font-size: 2.2rem; font-weight: 600; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.pl-pct small { font-size: 1.1rem; font-weight: 400; color: var(--ink-soft); margin-left: 0.05rem; }
.pl-prog-mid { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.pl-meter { display: block; width: 100%; max-width: 22rem; height: 6px; background: var(--paper-deep); border-radius: 3px; overflow: hidden; }
.pl-start { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; max-width: 44rem; margin-top: 0.9rem; font-size: 0.92rem; color: var(--ink-soft); }
.pl-start label { font-family: var(--sans); font-size: 0.85rem; }
.pl-start input { margin-left: 0.3rem; padding: 0.2rem 0.4rem; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--hairline); border-radius: 6px; }
.pl-start .pl-reset { margin-left: 0; }
.pl-sched { flex-basis: 100%; }
.pl-month tr.is-due th { color: var(--gold); font-weight: 600; }
.pl-month tr.is-due th::after { content: " ●"; font-size: 0.6em; vertical-align: middle; }
.pl-meter span { display: block; height: 100%; background: var(--gold); }
.plan-view .index-filter button.is-done { border-color: var(--gold); color: var(--gold); }
.plan-view .index-filter button.is-done[aria-pressed="true"] { color: var(--paper); border-color: var(--ink); }

.pl-month-act { margin-top: 0.8rem; }
.pl-month-act .set-btn { width: auto; display: inline-flex; }
.pl-month { width: 100%; margin-top: 0.8rem; border-collapse: collapse; font-size: 0.95rem; }
.pl-month th, .pl-month td { padding: 0.4rem 0.6rem 0.4rem 0; text-align: left; border-bottom: 1px solid var(--hairline-soft); }
.pl-month thead th {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.pl-month tbody th { width: 3rem; font-family: var(--sans); font-weight: 400; color: var(--ink-faint); }
.pl-month tr.is-today { background: var(--hl); }
.pl-month tr.is-today th { color: var(--oxblood); font-weight: 600; }
.pl-foot { max-width: 44rem; margin-top: 1.6rem; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55; }
.pl-credit { margin-top: 0.6rem; font-size: 0.8rem; color: var(--ink-faint); }
.pl-credit a { color: inherit; }

@media (max-width: 640px) {
  .pl-up { padding: 0.9rem 0.9rem 1rem; }
  .pl-up-list li { grid-template-columns: 1fr; gap: 0.15rem; }
  .pl-month thead { display: none; }
  .pl-month tr { display: grid; grid-template-columns: 2.4rem 1fr 1fr; padding: 0.35rem 0; border-bottom: 1px solid var(--hairline-soft); }
  .pl-month th, .pl-month td { border: 0; padding: 0.2rem 0.4rem 0.2rem 0; }
  .pl-month tbody th { grid-row: span 2; }
  .plan-foot .set-btn, .pf-undo { margin-left: 0; }
}

/* ---------- index of resources ---------- */

.index-view {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.2rem 1.6rem 5rem;
}
.index-view[hidden] { display: none; }
.index-intro { max-width: 44rem; }
.index-intro h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.1;
  margin: 0.2rem 0 0.6rem;
}
.index-intro p { color: var(--ink-soft); line-height: 1.55; margin-bottom: 0.6rem; }
.index-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1.2rem 0 0.5rem;
}
.index-filter button {
  padding: 0.25rem 0.75rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
}
.index-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.index-app { margin-top: 2rem; }
.index-app > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--ink);
}
.index-app h3 { font-family: var(--sans); font-size: 1.3rem; font-weight: 600; }
.index-app h3 a { color: var(--ink); text-decoration: none; }
.index-app h3 a:hover { color: var(--oxblood); }
.index-app .about { font-style: italic; color: var(--ink-soft); font-size: 0.95rem; }
.index-app .n { margin-left: auto; font-family: var(--sans); font-size: 0.8rem; color: var(--gold); }
.index-rows { list-style: none; }
.index-rows li {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0.2rem 1.2rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--hairline-soft);
  line-height: 1.35;
}
.index-rows .it-title { color: var(--ink); text-decoration: none; }
.index-rows a.it-title:hover { color: var(--oxblood); text-decoration: underline; }
.index-rows .it-group { display: block; font-size: 0.8rem; font-style: italic; color: var(--ink-faint); }
.index-rows .it-refs { font-family: var(--sans); font-size: 0.8rem; }
.index-rows .it-refs a { color: var(--ink-soft); margin-right: 0.55rem; white-space: nowrap; }
.index-rows .it-refs a.cite { color: var(--ink-faint); font-style: italic; }
.index-rows .it-refs a:hover { color: var(--oxblood); }

/* ---------- sources & changelog ---------- */

.sources {
  max-width: 78rem;
  margin: 0 auto;
  padding: 1.4rem 1.6rem 1.2rem;
  border-top: 1px solid var(--ink);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.sources h2 {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.7rem;
}
.sources-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.8rem 2rem; }
.sources h3 { font-family: var(--sans); font-size: 0.9rem; color: var(--ink); margin-bottom: 0.2rem; }
.sources p + p { margin-top: 0.4rem; }

.changelog {
  padding: 0.7rem 1.6rem 1.3rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink-soft);
  text-align: center;
}
.changelog h2 {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
}
.changelog ul { list-style: none; max-width: 62rem; margin: 0 auto; }
.changelog li + li { margin-top: 0.3rem; }
.changelog time {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-right: 0.55rem;
  white-space: nowrap;
}

.noscript { padding: 2rem; text-align: center; font-style: italic; }

.sheet-toggle, .sheet-close { display: none; }

/* ---------- narrow screens: the sidebar becomes a bottom sheet ---------- */

@media (max-width: 960px) {
  :root { --side-w: 0px; }
  .page { display: block; padding: 0 1.1rem; }
  .reader { max-width: 40rem; margin: 0 auto; padding-top: 1.6rem; }
  .rules { right: -0.95rem; width: 0.8rem; }

  .side {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 80;
    height: auto;
    max-height: 72vh;
    padding: 0.4rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--ink);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -14px 36px var(--shadow);
    transform: translateY(105%);
    transition: transform 0.25s ease;
    visibility: hidden;
  }
  .side.is-open { transform: none; visibility: visible; }
  .sheet-close {
    display: block;
    position: sticky;
    top: 0;
    float: right;
    z-index: 2;
    margin: -0.2rem -0.4rem 0 0.5rem;
    width: 2rem;
    height: 2rem;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    cursor: pointer;
  }
  .side::before {
    content: "";
    display: block;
    width: 2.6rem;
    height: 4px;
    margin: 0.2rem auto 0.8rem;
    border-radius: 2px;
    background: var(--hairline);
  }

  .sheet-toggle {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 75;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    font-family: var(--sans);
    font-size: 0.88rem;
    color: var(--paper);
    background: var(--ink);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 8px 22px var(--shadow);
    cursor: pointer;
    white-space: nowrap;
  }
  .sheet-toggle[hidden] { display: none; }
  .player { left: 50%; transform: translateX(-50%); bottom: calc(4.2rem + env(safe-area-inset-bottom)); }
  .sheet-count { font-weight: 600; color: var(--gold-soft); }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .masthead { padding: 0.8rem 1.1rem 0.6rem; }
  .wordmark { font-size: 1.5rem; }
  .tagline { font-size: 0.88rem; flex-basis: 100%; }
  /* the account stays on the wordmark's line, after Share when that shows */
  .mast-acct { order: 2; }
  .standalone .share-mast + .mast-acct { margin-left: 0.5rem; }
  .bar { gap: 0.35rem; padding: 0 0.7rem; }
  .pick { padding: 0.3rem 0.55rem; font-size: 0.95rem; }
  .step-btn { width: 1.7rem; }
  /* the chapter's foot has ‹ › too; the search box needs the room */
  .bar .step { display: none; }
  .go { flex: 1 1 5rem; }
  .go input { padding: 0.38rem 0.6rem; font-size: 16px; }
  .bar-link { display: none; }
  .tr-pick, .settings-btn { padding-left: 0.55rem; font-size: 0.78rem; }
  .tr-pick { padding-right: 1.3rem; }
  .bar .tr-par { display: none; }
  .set-par { display: block; margin-bottom: 0.9rem; }
  .settings-btn .set-word, .settings-btn .chev { display: none; }
  .settings-btn .set-icon { display: inline; }
  .listen { padding: 0 0.5rem; }
  .listen-label { display: none; }
  .seg button { padding: 0.26rem 0.5rem; }
  .picker { grid-template-columns: 1fr; padding: 1rem 1.1rem 1.4rem; }
  .picker-books { columns: 1; }
  /* a book's chapters take the place of the list of books */
  .picker:not(.is-chapters) .picker-chapters { display: none; }
  .picker.is-chapters .picker-books { display: none; }
  .picker-back {
    display: inline-block;
    margin-bottom: 0.7rem;
    padding: 0.3rem 0.8rem 0.3rem 0.6rem;
    font-family: var(--sans);
    font-size: 0.9rem;
    color: var(--ink-soft);
    background: none;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    cursor: pointer;
  }
  .chapter-grid { grid-template-columns: repeat(auto-fill, minmax(2.9rem, 1fr)); gap: 0.4rem; }
  .chapter-grid a { height: 2.7rem; font-size: 1rem; }
  .text { font-size: calc(var(--read-size) * 0.93); }
  .text.lines .v { padding-left: 1.9rem; }
  .sf-list label { padding: 0.38rem 0; }
  .text.lines .vn { width: 1.45rem; }
  .text.parallel .v { grid-template-columns: minmax(0, 1fr); row-gap: 0.3rem; padding-left: 1.9rem; }
  .text.parallel .vn { width: 1.45rem; }
  .text.parallel .pcell-1 { padding-left: 0; margin-left: 0; border-left: 0; font-size: 0.92em; color: var(--ink-soft); }
  .text.parallel .pcell::before {
    content: attr(data-t);
    margin-right: 0.4rem;
    font-family: var(--sans);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--gold);
  }
  .par-head { display: none; }
  .ch-num { font-size: 2.8rem; }
  .index-rows li { grid-template-columns: 1fr; }
}

/* ---------- the home-screen app ---------- */

/* Opened from the home screen (the class is set in index.html's head): the
   site's nav bar gives way, and --appnav-h becomes the status bar's height, so
   the toolbar, picker, and settings sit just under it however iOS draws it. */
html.standalone { --appnav-h: env(safe-area-inset-top, 0px); }
.standalone .appnav, .standalone .appnav-menu { display: none !important; }
.standalone body { padding-top: env(safe-area-inset-top, 0px); }
.standalone body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: env(safe-area-inset-top, 0px);
  background: var(--paper);
}
.standalone .tagline { display: none; }

/* The notch in landscape: keep the masthead, toolbar, and text clear of it. */
.masthead, .bar {
  padding-left: max(1.6rem, env(safe-area-inset-left));
  padding-right: max(1.6rem, env(safe-area-inset-right));
}
@media (max-width: 960px) {
  .page {
    padding-left: max(1.1rem, env(safe-area-inset-left));
    padding-right: max(1.1rem, env(safe-area-inset-right));
  }
}
@media (max-width: 640px) {
  .masthead {
    padding-left: max(1.1rem, env(safe-area-inset-left));
    padding-right: max(1.1rem, env(safe-area-inset-right));
  }
  .bar {
    padding-left: max(0.7rem, env(safe-area-inset-left));
    padding-right: max(0.7rem, env(safe-area-inset-right));
  }
  .standalone .bar .share-btn { display: none; }
  .standalone .share-mast { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  .v.is-flash, .tsk-group.is-flash, .listen .wave { animation: none; }
  .side { transition: none; }
}

/* ---------- readable side panels ----------
   The sidebar, the word card, and the previews read in the same system sans as
   the text (Helvetica stays for headings and labels; the Hebrew and Greek keep
   their own faces), at sizes that hold up on a phone. */
.side, .lex, .preview {
  font-family: var(--read-sans);
  font-size: 1.02rem;
  line-height: 1.5;
}
/* labels and references: never below a size you can read at arm's length */
.side .kicker, .side .count, .side .res-group, .side .tag, .side .sf-label,
.side .side-section > h3, .side .side-section > summary, .side .tsk-head, .side .vp-back,
.side .more, .side .w-strongs, .lex .lex-num, .lex .lex-here-k, .lex .lex-count, .side .conc-num {
  font-size: max(0.8rem, 12.5px);
}
.side .xr, .side .res-ref, .side .ext, .side .conc-ref, .side .conc-bar, .side .xr-votes { font-size: 0.9rem; }
.side .xr-votes { font-size: 0.75rem; }
/* running text: full size, upright (italic only for transliterations) */
.side .w-gloss, .side .sf-name, .side .chip, .side .res-meta, .side .s-when, .side .side-empty,
.side .sf-state, .side .conc-about, .side .conc-text, .side .tsk-toggle,
.lex .lex-here, .lex .lex-pos {
  font-size: 0.98rem;
  font-style: normal;
}
.side .w-gloss--mark { font-size: 0.85rem; }
.side .w-tr, .lex .lex-here i { font-size: 0.92rem; }
.side .tsk-toggle { font-family: var(--read-sans); font-size: 0.85rem; }
.side .conc-text, .lex .lex-def { line-height: 1.55; }
.lex .lex-def { font-size: 1rem; }
.lex .lex-src { font-size: 0.85rem; }
.lex .lex-n, .side .xr-sep { font-size: 0.82rem; }
.lex .lex-gloss { font-style: normal; }

/* how the BSB renders a word: the sentence, and a bar per rendering */
.lex-range { margin-top: 0.6rem; font-size: 1rem; line-height: 1.5; color: var(--ink); }
.freq-wrap { margin-top: 0.45rem; }
.freq { list-style: none; display: grid; gap: 0.1rem; }
.freq-btn {
  display: grid;
  grid-template-columns: minmax(6rem, 11rem) 1fr 3.4rem 2.6rem;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.18rem 0.3rem;
  font-family: var(--read-sans);
  font-size: 0.92rem;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 3px;
  text-align: left;
  cursor: pointer;
}
.freq-btn:hover { background: var(--v-hover); }
.freq-btn[aria-pressed="true"] { background: var(--select); }
.freq-btn--mark .freq-name { font-style: italic; color: var(--ink-faint); }
.freq-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.freq-track { height: 0.8rem; }
.freq-fill { display: block; height: 100%; background: var(--k-lang); opacity: 0.7; border-radius: 2px; }
.freq-btn:hover .freq-fill, .freq-btn[aria-pressed="true"] .freq-fill { opacity: 1; }
.freq-n { text-align: right; font-variant-numeric: tabular-nums; }
.freq-pct { text-align: right; font-size: 0.82rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.freq-toggle, .conc-clear {
  margin-top: 0.3rem;
  padding: 0;
  font-family: var(--read-sans);
  font-size: 0.88rem;
  color: var(--oxblood);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}
.freq-rest { margin-top: 0.2rem; font-size: 0.85rem; color: var(--ink-faint); }
.conc-sub {
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: max(0.8rem, 12.5px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.conc .conc-chart { margin-top: 0.4rem; }
.conc-showing { margin: 0.7rem 0 0.2rem; font-size: 0.95rem; color: var(--ink-soft); }
@media (max-width: 640px) {
  .freq-btn { grid-template-columns: minmax(5rem, 8.5rem) 1fr 3rem 2.4rem; }
}

/* the definition in the concordance panel, folded when it runs long */
.conc-about .lex-pos { display: block; margin: 0 0 0.2rem; font-size: 0.98rem; }
.conc-def .lex-def { margin-top: 0.4rem; padding-top: 0; border-top: 0; font-size: 0.98rem; }
.conc-def .lex-def.is-folded {
  max-height: 280px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent);
  mask-image: linear-gradient(to bottom, #000 75%, transparent);
}
.conc .lex-pos .lex-num { display: none; }
/* the sheet's pill would cover the foot of the open picker */
body:has(.picker:not([hidden])) .sheet-toggle { display: none; }
