/* Lazarus Bible — reader styles.
   Calm, typographic, mobile-first. Themes: light (default), sepia, dark; "system" = no data-theme. */

@font-face { font-family: "Literata"; src: url(/fonts/literata-opsz-normal-v5.woff2) format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url(/fonts/literata-opsz-italic-v5.woff2) format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-wght-normal-v5.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face {
  font-family: "Noto Serif Hebrew"; src: url(/fonts/noto-serif-hebrew-wght.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0590-05FF, U+200C-200F, U+FB1D-FB4F;
}
@font-face {
  font-family: "Noto Serif Greek"; src: url(/fonts/noto-serif-greek-wght.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0300-036F, U+0370-03FF, U+1F00-1FFF, U+203F;
}

:root {
  --bg: #fdfbf7; --bg2: #f7f3ec; --card: #ffffff; --fg: #1f1c18; --fg2: #47423a; --muted: #766f65; --faint: #a59d91;
  --rule: #e6dfd3; --rule2: #eee9e0; --accent: #8e4a2c; --accent-fg: #fffaf5; --mark: #f5e2a6;
  --shadow: 0 1px 2px rgba(50, 36, 20, .06), 0 10px 30px rgba(50, 36, 20, .10);
  --hl-mix: 26%;
  --scrim: rgba(28, 22, 16, .32);
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --fs: 19px; --lh: 1.75; --fs-k: .95;
  --bar-h: 56px; --gutter: 18px;
  color-scheme: light;
}
html[data-theme="sepia"] {
  --bg: #f4ecdb; --bg2: #eee4cf; --card: #faf4e6; --fg: #352b1f; --fg2: #514436; --muted: #7a6a57; --faint: #a6957b;
  --rule: #e0d2b6; --rule2: #e8dcc4; --accent: #874621; --mark: #ead39a; --scrim: rgba(40, 28, 14, .3);
}
html[data-theme="dark"] {
  --bg: #15171b; --bg2: #1a1d22; --card: #1f2329; --fg: #e7e3db; --fg2: #c9c3b8; --muted: #9a948a; --faint: #6c675f;
  --rule: #2c3138; --rule2: #23272e; --accent: #e5a582; --accent-fg: #1b130e; --mark: #5c4a19;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 34px rgba(0, 0, 0, .45); --hl-mix: 34%; --scrim: rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #15171b; --bg2: #1a1d22; --card: #1f2329; --fg: #e7e3db; --fg2: #c9c3b8; --muted: #9a948a; --faint: #6c675f;
    --rule: #2c3138; --rule2: #23272e; --accent: #e5a582; --accent-fg: #1b130e; --mark: #5c4a19;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 34px rgba(0, 0, 0, .45); --hl-mix: 34%; --scrim: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
@media (min-width: 700px) { :root { --fs-k: 1; --gutter: 46px; } }
@media (min-width: 2200px) { :root { --fs-k: 1.12; --gutter: 52px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  min-height: 100dvh; transition: background-color .25s ease, color .25s ease;
}
a { color: var(--accent); text-decoration-thickness: .06em; text-underline-offset: .18em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.ic { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ic svg { width: 100%; height: 100%; }

/* ───────────────────────── splash ───────────────────────── */
#splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
#splash .brand-mark { transform: scale(1.8); }

/* ───────────────────────── top bar ───────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40; height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--rule2);
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tb-right { justify-content: flex-end; }
.tb-center { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: min(56vw, 560px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); padding: 6px 8px; border-radius: 10px; }
.brand-mark { display: inline-flex; gap: 2.5px; align-items: stretch; height: 18px; }
.brand-mark i { display: block; width: 4px; border-radius: 2px; background: #c47757; }
.brand-mark i:nth-child(2) { background: #5f95a2; height: 70%; align-self: flex-end; }
.brand-mark i:nth-child(3) { background: #9a80bd; height: 85%; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.06rem; letter-spacing: .01em; }
.brand-sub { font-family: var(--sans); font-weight: 600; font-size: .66rem; letter-spacing: .12em; color: var(--muted); margin-left: 2px; vertical-align: .15em; }
.tb-back { display: none; }
.tb-btn, .icon-btn, .tb-back {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent;
  color: var(--fg2); cursor: pointer; text-decoration: none; transition: background-color .15s ease, color .15s ease;
}
.tb-btn:hover, .icon-btn:hover, .tb-back:hover { background: var(--rule2); color: var(--fg); }
.tb-btn.on { background: var(--rule2); color: var(--accent); }
/* translation chip: BSB / WEB / OEB / BLL — opens the settings sheet */
.tb-ver {
  height: 30px; min-width: 44px; padding: 0 9px; margin-right: 2px; border-radius: 9px; border: 1px solid var(--rule);
  background: transparent; color: var(--fg2); cursor: pointer; font: 650 .7rem/1 var(--sans); letter-spacing: .08em;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.tb-ver:hover { background: var(--rule2); color: var(--fg); }
.tb-ver.alt { border-color: var(--accent); color: var(--accent); }
.icon-btn.tiny { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.tiny .ic { width: 18px; height: 18px; }
.tb-title {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; cursor: pointer;
  padding: 2px 8px; border-radius: 10px; max-width: 100%;
}
.tb-title:hover { background: var(--rule2); }
.tb-book { font-family: var(--serif); font-weight: 600; font-size: 1.04rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-caret .ic { width: 16px; height: 16px; color: var(--muted); }
.tb-path .short { display: none; }
@media (max-width: 699px) { .tb-path .short { display: inline; } .tb-path .full { display: none; } }
.tb-path { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; letter-spacing: .01em; min-height: 1.1em; }
@media (max-width: 699px) {
  .topbar.in-book { grid-template-columns: auto minmax(0, 1fr) auto; }
  .topbar.in-book .brand { display: none; }
  .topbar.in-book .tb-back { display: inline-grid; }
  .topbar.in-book .tb-center { max-width: none; align-items: flex-start; }
  .topbar.in-book .tb-title { padding-left: 2px; }
  .topbar.in-book .tb-path { padding-left: 2px; }
  .hide-phone { display: none !important; }
}
.brand { white-space: nowrap; }
@media (max-width: 1099px) { .brand-sub { display: none; } .topbar.in-book .brand-name { display: none; } }
@media (min-width: 1100px) { .tb-center { flex-direction: row; gap: 14px; align-items: baseline; max-width: 60vw; } }

/* ───────────────────────── generic page bits ───────────────────────── */
.app { min-height: calc(100dvh - var(--bar-h)); }
.page { margin: 0 auto; padding: 28px 18px 120px; }
.page.narrow { max-width: 760px; }
.eyebrow { font: 600 .7rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem; }
.page-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 4.5vw, 2.6rem); letter-spacing: -.01em; line-height: 1.15; margin: 0 0 1rem; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg); text-decoration: none; font-weight: 600; font-size: .92rem;
  border: 1px solid transparent; cursor: pointer; transition: filter .15s ease, transform .15s ease;
}
.pill:hover { filter: brightness(1.06); }
.pill:active { transform: translateY(1px); }
.pill .ic { width: 18px; height: 18px; }
.pill.ghost { background: transparent; color: var(--fg2); border-color: var(--rule); }
.pill.ghost:hover { background: var(--rule2); }
.error { color: #b3261e; }
.error-card { margin: 10vh auto; max-width: 30rem; text-align: center; }
.error-card h2 { font-family: var(--serif); font-weight: 500; }
.loading-dots { display: flex; gap: 7px; justify-content: center; padding: 48px 0; }
.loading-dots.big { padding: 18vh 0; }
.loading-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: dot 1.1s infinite ease-in-out; }
.loading-dots i:nth-child(2) { animation-delay: .15s; } .loading-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.notfound { text-align: center; padding-top: 18vh; }

/* ───────────────────────── library ───────────────────────── */
.library { max-width: 1180px; padding-top: 0; }
/* first screen: a quiet spotlight; the books start below the fold */
.spot {
  min-height: calc(100svh - var(--bar-h) - 24px); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 5vh 0 3vh; position: relative;
}
.spot-mark { transform: scale(2.1); margin-bottom: 30px; }
.spot-h { font: 450 clamp(2.5rem, 9vw, 4.6rem)/1.06 var(--serif); letter-spacing: -.025em; margin: 0; max-width: 12em; text-wrap: balance; }
.spot-sub { font: clamp(1.02rem, 2.4vw, 1.14rem)/1.6 var(--serif); color: var(--fg2); max-width: 31em; margin: 1.1rem auto 1.9rem; }
.hero-search, .search-box {
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; min-height: 52px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--rule); max-width: 40rem; color: var(--muted);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hero-search:focus-within, .search-box:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--rule)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.hero-search input, .search-box input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: 1rem var(--sans); height: 48px; outline: none; }
.hero-search.jump { width: 100%; max-width: 38rem; min-height: 62px; border-radius: 999px; padding-left: 22px; box-shadow: var(--shadow); }
.hero-search.jump .pill { flex: none; min-height: 46px; }
.spot-try { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 16px 0 0; font-size: .9rem; color: var(--muted); }
.spot-try a { color: var(--fg2); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.spot-try a:hover { color: var(--accent); border-color: currentColor; }
.spot-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; align-items: center; margin-top: 24px; }
.spot-acts .lib-bm { justify-content: center; padding: 0; }
.spot-down { margin-top: auto; padding-top: 34px; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font: 600 .7rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.spot-down .ic { width: 20px; height: 20px; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 85% { transform: translateY(4px); } }
.continue {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px 6px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--rule); text-decoration: none; color: var(--fg); box-shadow: var(--shadow);
}
.continue-k { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.continue-t { font-family: var(--serif); font-weight: 600; }
.continue .ic { color: var(--accent); width: 18px; }

/* the books: spines on a shelf. Rows wrap (no sideways scrolling); each spine carries its own
   stretch of plank, so every row has a shelf under it. */
.books { scroll-margin-top: calc(var(--bar-h) + 8px); padding-top: 1.2rem; }
.g0, .g5 { --gc: #c47757; } .g1, .g6 { --gc: #5f95a2; } .g2, .g7 { --gc: #9a80bd; } .g3, .g8 { --gc: #7c9a5a; } .g4 { --gc: #b8954a; }
.testament { margin-top: 1.6rem; }
.testament-h { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; letter-spacing: -.01em; margin: 0 0 1rem; }
.rack { --sw: 32px; --hmin: 118px; --hrange: 64px; display: flex; flex-wrap: wrap; align-items: flex-end; row-gap: 26px; padding-bottom: 8px; }
@media (min-width: 700px) { .rack { --sw: 38px; --hmin: 132px; --hrange: 96px; row-gap: 30px; } }
.spine {
  position: relative; flex: none; width: var(--sw); height: calc(var(--hmin) + var(--len, 0) * var(--hrange)); margin-right: 4px; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; color: var(--fg);
  background: var(--card); border: 1px solid var(--rule); border-top: 6px solid var(--gc); border-radius: 5px 5px 2px 2px;
  transition: transform .15s ease, background-color .15s ease, color .15s ease;
}
.spine.first:not(:first-child) { margin-left: 14px; }
.spine::after { content: ""; position: absolute; left: -1px; right: -5px; bottom: -8px; height: 6px; background: var(--rule); border-radius: 1px; pointer-events: none; }
.spine span { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 .8rem/1 var(--serif); white-space: nowrap; letter-spacing: .01em; }
@media (min-width: 700px) { .spine span { font-size: .88rem; } }
.spine:hover { transform: translateY(-5px); }
.spine:hover::after { transform: translateY(5px); }
.spine.open { background: var(--accent); border-color: var(--accent); border-top-color: var(--gc); color: var(--accent-fg); transform: translateY(-8px); }
.spine.open::after { transform: translateY(8px); }
.spine.plain span { font-style: italic; color: var(--muted); }
.rack-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 0; font-size: .78rem; color: var(--muted); }
.rack-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--gc); }
.chapters {
  flex: 0 0 100%; margin: 4px 0 0; padding: 10px 12px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--rule);
  box-shadow: var(--shadow); animation: chapters-in .16s ease-out; text-align: start;
}
@keyframes chapters-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.chapters-head { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.chapters-name { font: 600 1.05rem/1.2 var(--serif); margin-inline-end: auto; }
.chapters-ov { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; text-decoration: none; }
.chapters-ov .ic { width: 16px; height: 16px; }
.chapters-x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.chapters-x:hover { background: var(--rule2); color: var(--fg); }
.chapters-x .ic { width: 18px; height: 18px; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 5px; }
.ch {
  display: grid; place-items: center; height: 40px; border-radius: 9px; background: var(--bg2); color: var(--fg);
  text-decoration: none; font: 500 .9rem/1 var(--sans); font-variant-numeric: tabular-nums;
}
.ch:hover { background: color-mix(in srgb, var(--accent) 16%, var(--bg2)); color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .chapters, .spot-down .ic { animation: none; } .spine, .spine::after { transition: none; } }

/* a thank-you to the open projects this is built on */
.giants-strip { margin-top: 3.4rem; padding: 1.4rem 1.5rem; border-radius: 16px; background: var(--bg2); border: 1px solid var(--rule2); max-width: 46rem; }
.giants-strip h2 { font: 500 1.25rem/1.25 var(--serif); margin: 0 0 .5rem; }
.giants-strip p { margin: 0 0 .8rem; color: var(--fg2); font-family: var(--serif); line-height: 1.55; }
.giants-strip .giants-names { display: flex; flex-wrap: wrap; gap: 4px 0; font: 500 .84rem/1.5 var(--sans); color: var(--muted); }
.giants-names span:not(:last-child)::after { content: "·"; margin: 0 .55em; color: var(--faint); }
.giants-more { font-size: .88rem; font-weight: 600; text-decoration: none; }
.site-foot { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); font-size: .82rem; color: var(--muted); max-width: 46rem; }

/* ───────────────────────── reader layout ───────────────────────── */
.reader { position: relative; }
.page.reading { padding: 22px 18px 140px; container: page / inline-size; width: 100%; margin: 0; min-width: 0; }
.side {
  position: fixed; top: 0; bottom: 0; z-index: 70; width: min(88vw, 360px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg2); box-shadow: var(--shadow); transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility .28s;
  padding-top: env(safe-area-inset-top); visibility: hidden;
}
.side-left { left: 0; transform: translateX(-104%); }
.side-right { right: 0; transform: translateX(104%); }
.side.open { transform: none; visibility: visible; }
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.scrim.show { opacity: 1; pointer-events: auto; }
@media (min-width: 1100px) {
  .reader { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
  .side-left { position: sticky; top: var(--bar-h); height: calc(100dvh - var(--bar-h)); width: auto; transform: none; visibility: visible; box-shadow: none; background: transparent; border-right: 1px solid var(--rule2); z-index: 1; padding-top: 0; }
  .side-left .only-drawer { display: none; }
  .drawer-scrim.for-contents { display: none; }
}
/* The margin (study notes, or cross-references) needs the room of the legend column between 1440
   and 2000px: the legend goes back to its drawer there while either is on (`html.study-margin`,
   `html.xrefs-margin`, set from the settings). */
@media (min-width: 1440px) {
  html:not(.study-margin):not(.xrefs-margin) .reader { grid-template-columns: 300px minmax(0, 1fr) 330px; }
  html:not(.study-margin):not(.xrefs-margin) .side-right { position: sticky; top: var(--bar-h); height: calc(100dvh - var(--bar-h)); width: auto; transform: none; visibility: visible; box-shadow: none; background: transparent; border-left: 1px solid var(--rule2); z-index: 1; padding-top: 0; }
  html:not(.study-margin):not(.xrefs-margin) .side-right .only-drawer { display: none; }
  html:not(.study-margin):not(.xrefs-margin) .drawer-scrim.for-legend { display: none; }
  html:not(.study-margin):not(.xrefs-margin) .legend-btn { display: none !important; }
}
@media (min-width: 2000px) {
  .reader, html:not(.study-margin):not(.xrefs-margin) .reader { grid-template-columns: 370px minmax(0, 1fr) 400px; }
  html:is(.study-margin, .xrefs-margin) .side-right { position: sticky; top: var(--bar-h); height: calc(100dvh - var(--bar-h)); width: auto; transform: none; visibility: visible; box-shadow: none; background: transparent; border-left: 1px solid var(--rule2); z-index: 1; padding-top: 0; }
  html:is(.study-margin, .xrefs-margin) .side-right .only-drawer, html:is(.study-margin, .xrefs-margin) .drawer-scrim.for-legend, html:is(.study-margin, .xrefs-margin) .legend-btn { display: none !important; }
}

/* ───────────────────────── book head / foot ───────────────────────── */
.book-head, .book-foot { max-width: calc(34em * var(--fs-k)); margin: 0 auto; padding-inline-start: var(--gutter); font-size: var(--fs); }
.book-head { padding-top: 3.2vh; margin-bottom: 1.2em; }
.book-head .eyebrow { font-size: .62rem; }
.book-title { font-family: var(--serif); font-weight: 450; font-size: 2.45em; letter-spacing: -.02em; line-height: 1.05; margin: 0 0 .45em; }
.book-intro { font-family: var(--serif); font-style: italic; font-size: 1em; line-height: 1.6; color: var(--fg2); margin: 0 0 .6em; }
.intro-by { font-style: normal; font-family: var(--sans); font-size: .78em; color: var(--muted); white-space: nowrap; }
.intro-by a { color: inherit; }
.book-stats { font-size: .66em; letter-spacing: .04em; color: var(--muted); margin: 0; }
.plain-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 1.1em; padding: .8em .95em; border-radius: 12px; background: var(--bg2); border: 1px solid var(--rule); font-size: .72em; line-height: 1.5; color: var(--fg2); }
.plain-note .ic { color: var(--accent); width: 19px; height: 19px; margin-top: 1px; }
.plain-note.subtle { background: transparent; border-style: dashed; }
.book-foot { margin-top: 3em; text-align: center; font-size: calc(var(--fs) * .85); }
.end-mark { font-family: var(--serif); font-style: italic; color: var(--muted); }
.end-mark::before, .end-mark::after { content: "❧"; font-style: normal; margin: 0 .7em; color: var(--faint); }
.end-mark::before { display: inline-block; transform: scaleX(-1); }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 1.6em 0; text-align: left; font-size: 15px; }
.pn { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--rule); text-decoration: none; color: var(--fg); }
.pn.next { grid-column: 2; text-align: right; }
.pn:hover { background: var(--bg2); }
.pn-k { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pn-t { font-family: var(--serif); font-weight: 600; }
.attrib { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ───────────────────────── the text ───────────────────────── */
.text {
  font-family: var(--serif); font-size: calc(var(--fs) * var(--fs-k)); line-height: var(--lh); color: var(--fg);
  font-optical-sizing: auto; font-variant-numeric: oldstyle-nums proportional-nums; font-kerning: normal;
  max-width: calc(34em + var(--gutter)); margin: 0 auto; padding-inline-start: var(--gutter); container: text / inline-size;
  overflow-wrap: break-word; hyphens: manual;
}
@media (max-width: 699px) { .text { hyphens: auto; -webkit-hyphens: auto; } }
.reader:not(.formatted) .text { --gutter: 0px; }
.reader:not(.formatted) .book-head, .reader:not(.formatted) .book-foot { --gutter: 0px; }

.chap { display: flex; align-items: center; gap: .65em; margin: 2em 0 1.1em; font-family: var(--sans); color: var(--muted); scroll-margin-top: calc(var(--bar-h) + 16px); }
.chap:first-child { margin-top: .4em; }
.chap-n { font-family: var(--serif); font-size: 2.15em; font-weight: 300; line-height: 1; color: var(--fg2); font-variant-numeric: lining-nums; }
.chap::after { content: ""; flex: 1; height: 1px; background: var(--rule); margin-inline-start: .3em; }

.b { position: relative; margin: 0 0 1em; }
.ln { padding-inline-start: calc(var(--i, 0) * 1.6em); }
.ln.i1 { --i: 1; } .ln.i2 { --i: 2; } .ln.i3 { --i: 3; } .ln.i4 { --i: 4; }

.vn {
  font: 600 .54em/0 var(--sans); color: var(--faint); vertical-align: baseline; position: relative; top: -.72em;
  margin: 0; margin-inline: .08em .22em; font-variant-numeric: tabular-nums lining-nums; user-select: none; -webkit-user-select: none;
  scroll-margin-top: calc(var(--bar-h) + 30px); border-radius: 3px; padding: 0 .1em;
}
.ln > .tx > .vn:first-child, .tx > .vn:first-child { margin-inline-start: 0; }
html.no-vn .vn { display: none; }
.vn.flash, .fn.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 30% { background: var(--mark); color: var(--fg); box-shadow: 0 0 0 .35em var(--mark); } 100% { background: transparent; box-shadow: 0 0 0 .35em transparent; } }

.fn {
  position: relative; top: -.66em; display: inline; border: 0; background: transparent; padding: 0 .16em; margin: 0 .04em;
  font: 650 .56em/1 var(--sans); color: var(--accent); cursor: pointer; border-radius: 4px; vertical-align: baseline;
}
.fn::after { content: ""; position: absolute; inset: -10px -6px; }
.fn:hover, .fn.active { background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* outline sections: nested bars drawn in the start-side gutter (left; right in Hebrew), text edge stays aligned */
.ol { position: relative; }
.ol + .ol, .b + .ol, .chap + .ol { margin-top: 1.5em; }
.ol.d1 + .ol.d1 { margin-top: 2.3em; }
.ol::before {
  content: ""; position: absolute; top: .3em; bottom: .55em; inset-inline-start: calc(var(--bx) - var(--gutter)); width: var(--bw);
  border-radius: 99px; background: var(--oc); transition: opacity .2s ease;
}
.ol.d1 { --bx: 4px; --bw: 5px; }
.ol.d2 { --bx: 16px; --bw: 3px; }
.ol.d2::before { background: color-mix(in srgb, var(--oc) 62%, var(--bg)); }
.ol.d3 { --bx: 25px; --bw: 2px; }
.ol.d3::before { background: color-mix(in srgb, var(--oc) 42%, var(--bg)); }
.ol.d4 { --bx: 32px; --bw: 2px; }
.ol.d4::before { background: color-mix(in srgb, var(--oc) 30%, var(--bg)); }
@media (max-width: 699px) {
  .ol.d1 { --bx: 0px; --bw: 4px; } .ol.d2 { --bx: 7px; --bw: 2px; } .ol.d3 { --bx: 11px; --bw: 1.5px; } .ol.d4 { --bx: 14px; --bw: 1.5px; }
}
html.no-bars .ol::before { opacity: 0; }
/* "Simple outline" (reader setting): the deepest level (3+) keeps its text but loses its heading,
   gutter bar, extra spacing and outline rows. Books always carry the full outline. */
html.outline-simple .ol.d3::before, html.outline-simple .ol.d4::before { display: none; }
html.outline-simple .ol.d3 > .olh, html.outline-simple .ol.d4 > .olh { display: none; }
html.outline-simple .ol.d3 + .ol.d3, html.outline-simple .b + .ol.d3, html.outline-simple .ol.d4 + .ol.d4, html.outline-simple .b + .ol.d4 { margin-top: 0; }
html.outline-simple .tree .d3, html.outline-simple .tree .d4,
html.outline-simple .outline-list .d3, html.outline-simple .outline-list .d4 { display: none; }
.olh { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15em .7em; margin: 0 0 .5em; font-family: var(--sans); scroll-margin-top: calc(var(--bar-h) + 20px); }
.olt { font-size: .7em; font-weight: 680; letter-spacing: .11em; text-transform: uppercase; color: color-mix(in oklab, var(--oc) 72%, var(--fg)); }
.olr { font-size: .62em; color: var(--muted); letter-spacing: .03em; font-variant-numeric: tabular-nums lining-nums; }
.ol.d2 > .olh .olt, .ol.d3 > .olh .olt, .ol.d4 > .olh .olt {
  font-family: var(--serif); font-style: italic; text-transform: none; letter-spacing: 0; font-weight: 520; font-size: .9em;
  color: color-mix(in oklab, var(--oc) 55%, var(--fg));
}
.ol.d3 > .olh .olt, .ol.d4 > .olh .olt { font-size: .84em; }
.ols { font-style: italic; color: var(--muted); font-size: .9em; line-height: 1.55; margin: -.25em 0 .9em; }
.ol { scroll-margin-top: calc(var(--bar-h) + 20px); }

/* block labels: above the block, or in the end-side margin when there is room */
.lbl { font: 650 .6em/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .35em; }
@container page (min-width: 980px) {
  .lbl { position: absolute; inset-inline-start: calc(100% + 1.6em); top: .55em; width: 9.5em; margin: 0; letter-spacing: .1em; }
}

/* poetry & parallelism: line per row, hanging indent for wraps */
.k-poetry .ln, .k-parallel .ln { padding-inline-start: calc(var(--i, 0) * 1.6em + 1.6em); text-indent: -1.6em; }
.k-poetry .ln + .ln, .k-parallel .ln + .ln { margin-top: .08em; }
.k-parallel { padding-inline-start: .9em; border-inline-start: 2px solid var(--rule); }
.k-d { font-style: italic; color: var(--fg2); font-size: .94em; }

/* lists: stacked items with markers */
.k-list .ln { display: grid; grid-template-columns: 1.7em minmax(0, 1fr); padding-inline-start: calc(var(--i, 0) * 1.7em); }
.k-list .ln + .ln { margin-top: .22em; }
.mk { font: 650 .7em/1 var(--sans); color: var(--muted); padding-top: .78em; font-variant-numeric: tabular-nums lining-nums; }
.mk-dot { display: flex; padding-top: 0; align-items: flex-start; }
.k-list:has(.ln.i1) .ln.i0 > .mk-dot::before { visibility: hidden; }
.mk-dot::before { content: ""; width: .32em; height: .32em; border-radius: 50%; margin-top: calc(var(--lh) * .5em - .16em); background: color-mix(in srgb, var(--fg) 38%, transparent); }

/* contrast: two columns when wide, stacked when narrow */
/* contrast couplets (Proverbs): two tight lines, the second's "but" hangs in the gutter */
.k-contrast.cpl { margin-top: .35em; margin-bottom: .35em; }
.k-contrast.cpl + .k-contrast.cpl { margin-top: .55em; }
.k-contrast.cpl .ln { margin: 0; }
.k-contrast.cpl .ln { position: relative; padding-inline-start: 2.1em; }
.k-contrast.cpl .ln:first-child .vn { position: absolute; inset-inline-start: 0; top: .45em; }
.k-contrast.cpl .cj { position: absolute; inset-inline-start: 0; top: 0; color: var(--muted); font-style: italic; font-size: .92em; }
/* table (charts) and genealogy: one grid row per line, columns from "cell" */
.tbl { display: grid; column-gap: .8em; row-gap: .12em; align-items: baseline; }
.tbl .tr { display: contents; }
.tbl .td { min-width: 0; }
.k-table .tr:nth-child(odd) > .td { background: var(--bg2); }
.k-table .td { padding: .08em .35em; }
.k-genealogy .td.c1 { text-align: right; }
/* (physical on purpose: text-align is inherited as a keyword, and "end" would flip inside the
   right-to-left Hebrew glosses of an English genealogy; RTL text overrides it at the end) */
.k-genealogy .td.c2 { color: var(--fg2); }
.k-contrast .cols { display: grid; grid-template-columns: minmax(0, 1fr); }
.k-contrast .col { padding: .2em 0; }
.k-contrast .col2 { margin-top: .5em; padding-top: .7em; border-top: 1px dashed var(--rule); }
.k-contrast .ln + .ln { margin-top: .3em; }
@container text (min-width: 520px) {
  .k-contrast .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6em; }
  .k-contrast .col2 { margin: 0; padding: .2em 0; padding-inline-start: 1.6em; border-top: 0; border-inline-start: 1px solid var(--rule); }
  .k-contrast .col1 { text-align: left; }
}

/* dialogue: speaker-tagged lines */
.k-dialogue .ln + .ln { margin-top: .3em; }
/* Speaker labels: one bracket per run of speech in the speaker's color, the label set sideways
   into its line (render_lines). --n (label length) keeps a short speech tall enough for it. */
.spl { display: none; }
html.sp-on .spr { position: relative; padding-inline-start: 1.25em; margin: .35em 0 .45em; min-height: max(3.4em, calc(var(--n, 3) * .48em + 1.6em)); }
html.sp-on .spr::before {
  content: ""; position: absolute; inset-inline-start: .45em; top: .25em; bottom: .25em; width: .5em;
  border: 1.5px solid var(--tc, var(--muted)); border-inline-end: 0; border-start-start-radius: 5px; border-end-start-radius: 5px; opacity: .75;
}
html.sp-on .spl {
  display: block; position: absolute; inset-inline-start: .45em; top: 50%; transform: translate(-50%, -50%) rotate(-90deg);
  background: var(--bg); padding: .35em .6em; white-space: nowrap;
  font: 700 .56em/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--tc, var(--muted));
}
.spa { display: none; }
/* Rail style: a thin rule in the speaker's color, the label sideways at its top */
html.sp-on.sp-rail .spr { padding-inline-start: 1.55em; }
html.sp-on.sp-rail .spr::before { inset-inline-start: 1.02em; top: .3em; bottom: .3em; width: 2px; border: 0; border-radius: 2px; background: var(--tc, var(--muted)); opacity: .85; }
html.sp-on.sp-rail .spl { display: flex; left: 0; top: .5em; bottom: 0; width: 1.85em; padding: 0; background: none; align-items: center; justify-content: flex-end; writing-mode: vertical-rl; transform: rotate(180deg); }
html.sp-on.sp-rail .text[dir=rtl] .spl { left: auto; right: 0; transform: rotate(180deg); }
/* Panel style: the speech on a tint, the label sideways on a tab at its edge */
html.sp-on.sp-panel .spr { margin: .45em 0 .55em; padding: .4em .55em .45em; padding-inline-start: 2.1em; border-radius: 12px; border-start-start-radius: 4px; border-end-start-radius: 4px; background: color-mix(in srgb, var(--tc, var(--muted)) 8%, transparent); }
html.sp-on.sp-panel .spr::before { inset-inline-start: 0; top: 0; bottom: 0; width: 1.35em; border: 0; border-radius: inherit; border-start-end-radius: 0; border-end-end-radius: 0; background: color-mix(in srgb, var(--tc, var(--muted)) 22%, transparent); opacity: 1; }
html.sp-on.sp-panel .spl { display: flex; left: 0; top: .9em; bottom: 0; width: 2.4em; padding: 0; background: none; align-items: center; justify-content: flex-end; writing-mode: vertical-rl; transform: rotate(180deg); }
html.sp-on.sp-panel .text[dir=rtl] .spl { left: auto; right: 0; transform: rotate(180deg); }
/* After style: "— God" at the end of the speech */
html.sp-on.sp-after .spr { margin: 0; padding: 0; min-height: 0; }
html.sp-on.sp-after .spr::before, html.sp-on.sp-after .spl { display: none; }
html.sp-on.sp-after .spa { display: block; text-align: end; margin: .1em .2em .3em; font: italic 500 .78em/1.3 var(--serif); color: var(--tc, var(--muted)); }
html.sp-on.sp-after .spa::before { content: "— "; }

/* question, salutation, quote */
.k-question { padding: .5em .95em .55em; border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
.k-salutation { padding-inline-start: 1.1em; color: var(--fg2); }
.k-salutation .ln + .ln { margin-top: .15em; }
.k-salutation::before { content: ""; position: absolute; inset-inline-start: 0; top: .5em; bottom: .5em; width: 1px; background: var(--rule); }
.k-quote { margin-inline-start: 1.1em; padding-inline-start: 1em; border-inline-start: 2px solid color-mix(in srgb, var(--fg) 16%, transparent); color: var(--fg2); }
.k-quote .ln + .ln { margin-top: .25em; }

/* plain-BSB headings */
.hd { scroll-margin-top: calc(var(--bar-h) + 16px); }
.hd.s1 { font-family: var(--serif); font-weight: 620; font-size: 1em; letter-spacing: .005em; margin: 1.9em 0 .45em; line-height: 1.35; }
.chap + .hd.s1 { margin-top: .4em; }
.hd.s2 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: .95em; margin: 1.3em 0 .35em; color: var(--fg2); }
.hd.r { font: .64em/1.4 var(--sans); color: var(--muted); margin: -.25em 0 .9em; letter-spacing: .02em; }
.hd.ms { text-align: center; font: 650 .72em/1.2 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); margin: 2.6em 0 .25em; }
.hd.mr { text-align: center; font-style: italic; color: var(--muted); font-size: .86em; margin-bottom: 1.4em; }
.hd.qa { text-align: center; font: 650 .64em/1.2 var(--sans); letter-spacing: .28em; color: var(--muted); margin: 1.6em 0 .5em; }

/* ───────────────────────── footnote popover ───────────────────────── */
.fnpop {
  position: fixed; z-index: 80; max-width: 380px; background: var(--card); color: var(--fg); border: 1px solid var(--rule);
  border-radius: 14px; box-shadow: var(--shadow); padding: 10px 14px 13px; animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(4px); } }
.fnpop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.fnpop-label { font: 650 .66rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fnpop-text { margin: 0; font-family: var(--serif); font-size: 1rem; line-height: 1.6; }
@media (max-width: 639px) {
  .fnpop { left: 8px !important; right: 8px; width: auto !important; top: auto !important; max-width: none;
    bottom: calc(72px + env(safe-area-inset-bottom)) !important; border-radius: 16px; padding: 12px 16px 16px; }
}

/* ───────────────────────── side panels ───────────────────────── */
.panel { padding: 18px 16px 40px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.panel-head h2 { font-family: var(--serif); font-weight: 550; font-size: 1.28rem; margin: 0; }
.panel-sec { margin-top: 18px; }
.panel-h { font: 650 .66rem/1.2 var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; }
.panel-h-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-h-row .panel-h { margin-bottom: 10px; }
.mini-segs { display: inline-flex; padding: 2px; border-radius: 99px; border: 1px solid var(--rule); background: var(--bg2); margin-top: 8px; }
.mini-seg {
  border: 0; background: transparent; color: var(--muted); font: 600 .72rem/1 var(--sans); padding: 6px 10px; border-radius: 99px;
  cursor: pointer; min-height: 28px;
}
.mini-seg.on { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.mini-seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.panel-empty { font-size: .88rem; color: var(--muted); line-height: 1.55; }
.panorama-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--rule);
  text-decoration: none; color: var(--fg); font-weight: 600; font-size: .9rem; background: var(--card);
}
.panorama-link > span:not(.ic) { flex: 1; }
.panorama-link .ic:last-child { width: 16px; color: var(--muted); }
.panorama-link .ic:first-child { color: var(--accent); }
.chap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.chap-btn {
  display: grid; place-items: center; height: 42px; border-radius: 10px; background: var(--card); border: 1px solid var(--rule2);
  color: var(--fg2); text-decoration: none; font-size: .88rem; font-weight: 550; font-variant-numeric: tabular-nums;
}
.chap-btn:hover { border-color: var(--rule); color: var(--fg); }
.chap-btn.cur { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 12px; }
.tree a {
  display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 7px 8px; border-radius: 9px;
  text-decoration: none; color: var(--fg2); font-size: .86rem; line-height: 1.35;
}
.tree a:hover { background: var(--rule2); color: var(--fg); }
.tree-bar { align-self: stretch; border-radius: 3px; background: var(--oc); min-height: 1.2em; }
.tree .d2 .tree-bar { background: color-mix(in srgb, var(--oc) 60%, transparent); width: 3px; }
.tree .d3 .tree-bar, .tree .d4 .tree-bar { background: color-mix(in srgb, var(--oc) 40%, transparent); width: 2px; }
.tree-r { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .12em; white-space: nowrap; }
.tree a.on-path { color: var(--fg); font-weight: 600; }
.tree a.active { background: color-mix(in srgb, var(--oc) 15%, transparent); color: var(--fg); }

/* switches */
.switch-row, .legend-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.switch-row input, .legend-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sr-text { display: flex; flex-direction: column; gap: 2px; }
.sr-label { font-weight: 600; font-size: .92rem; }
.sr-hint { font-size: .76rem; color: var(--muted); }
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--rule); transition: background-color .18s ease; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s ease; }
input:checked + .switch { background: var(--accent); }
input:checked + .switch::after { transform: translateX(18px); }
input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch.small { width: 36px; height: 22px; }
.switch.small::after { width: 16px; height: 16px; }
input:checked + .switch.small::after { transform: translateX(14px); }
.master { border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.legend-items { list-style: none; margin: 0; padding: 0; }
.legend-item { grid-template-columns: 2.6em minmax(0, 1fr) auto; padding: 7px 0; }
.lg-sample { font-family: var(--serif); font-size: 1.15rem; text-align: center; line-height: 1.3; padding: 0 .1em; }
.lg-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lg-label { font-size: .88rem; font-weight: 560; }
.lg-note { font-size: .74rem; color: var(--muted); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.legend-item:hover .lg-note, .legend-item:focus-within .lg-note { -webkit-line-clamp: 12; }
.legend-list.dim { opacity: .45; }
.lg-family + .lg-family { border-top: 1px solid var(--rule2); }
.lg-family .panel-h { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.lg-q { letter-spacing: .04em; text-transform: none; font-weight: 500; color: var(--faint); }
/* the God family: the shades side by side, so their differences are easy to learn */
.lg-shades { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin: 2px 0 6px; }
.lg-shade { display: flex; flex-direction: column; align-items: center; gap: 5px; font: 600 .72rem/1.1 var(--sans); color: var(--sw); }
.lg-shade i { display: block; width: 100%; height: 10px; border-radius: 99px; background: var(--sw); }
.lg-family.deity .lg-sample { font-weight: 600; }
.notes { margin-top: 26px; border-top: 1px solid var(--rule); }
.notes-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.notes-list li { display: grid; grid-template-columns: 4.4em minmax(0, 1fr); gap: 8px; font-size: .88rem; }
.note-ref { display: flex; gap: 6px; align-items: baseline; border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; }
.note-letter { font-weight: 700; color: var(--accent); }
.note-v { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.note-text { font-family: var(--serif); line-height: 1.5; color: var(--fg2); }

/* ───────────────────────── settings sheet ───────────────────────── */
.sheet {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow-y: auto;
  background: var(--card); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); padding: 14px 20px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(105%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility .28s;
}
.sheet.open { transform: none; visibility: visible; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--rule); margin: 0 auto 10px; }
.settings-scrim { z-index: 85; }
@media (min-width: 700px) {
  .sheet { left: auto; right: 14px; bottom: auto; top: calc(var(--bar-h) + 10px); width: 370px; border-radius: 18px; border: 1px solid var(--rule); transform: translateY(-8px); opacity: 0; transition: opacity .18s ease, transform .18s ease, visibility .18s; }
  .sheet.open { opacity: 1; transform: none; }
  .sheet::before { display: none; }
  .settings-scrim { background: transparent; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-family: var(--serif); font-weight: 550; font-size: 1.2rem; margin: 0; }
.set-group { padding: 12px 0; border-bottom: 1px solid var(--rule2); }
.set-group:last-of-type { border-bottom: 0; }
.set-label { font: 650 .68rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; }
.set-val { letter-spacing: .02em; text-transform: none; font-weight: 600; color: var(--fg2); }
.segs { display: grid; gap: 6px; }
.segs.four { grid-template-columns: repeat(4, 1fr); }
.segs.three { grid-template-columns: repeat(3, 1fr); }
.segs.two { grid-template-columns: repeat(2, 1fr); }
.set-hint { margin: 8px 2px 0; font-size: .76rem; color: var(--muted); line-height: 1.4; }
.seg {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; padding: 8px 4px; border-radius: 12px;
  border: 1px solid var(--rule); background: transparent; cursor: pointer; font-size: .8rem; font-weight: 560; color: var(--fg2);
}
.seg.on { border-color: var(--accent); color: var(--fg); box-shadow: 0 0 0 1px var(--accent) inset; }
.ver-list { display: grid; gap: 6px; }
.ver {
  display: grid; grid-template-columns: 3.4em 1fr auto; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
  border-radius: 12px; border: 1px solid var(--rule); background: transparent; cursor: pointer; text-align: left; color: var(--fg2);
}
.ver.on { border-color: var(--accent); color: var(--fg); box-shadow: 0 0 0 1px var(--accent) inset; }
.ver-abbr { font: 700 .74rem/1 var(--sans); letter-spacing: .08em; color: var(--accent); }
.ver-name { font-size: .86rem; font-weight: 560; display: flex; flex-direction: column; gap: 2px; }
.ver-note { font-size: .72rem; font-weight: 450; color: var(--muted); }
.ver-note:empty { display: none; }
.ver-lang { font: 650 .64rem/1 var(--sans); letter-spacing: .1em; color: var(--muted); }
.swatch { width: 26px; height: 18px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .12); }
.sw-auto { background: linear-gradient(135deg, #fdfbf7 50%, #15171b 50%); }
.sw-light { background: #fdfbf7; } .sw-sepia { background: #f4ecdb; } .sw-dark { background: #15171b; }
.size-row { display: flex; align-items: center; gap: 12px; }
.size-row input { flex: 1; accent-color: var(--accent); height: 30px; }
.size-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--rule); background: transparent; cursor: pointer; font-family: var(--serif); }
.size-btn.small { font-size: .85rem; } .size-btn.big { font-size: 1.3rem; }
.switches { padding-top: 4px; }
.set-foot { font-size: .74rem; color: var(--faint); margin: 8px 0 0; text-align: center; }

/* ───────────────────────── bottom nav (phones) ───────────────────────── */
.bottomnav { display: none; }
@media (max-width: 699px) {
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 4px 4px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); border-top: 1px solid var(--rule2);
  }
  .bn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border: 0; background: transparent;
    color: var(--muted); text-decoration: none; font-size: .66rem; font-weight: 600; letter-spacing: .02em; cursor: pointer; border-radius: 12px;
  }
  .bn.on { color: var(--accent); }
  .bn .ic { width: 23px; height: 23px; }
}

/* ───────────────────────── overview / panorama ───────────────────────── */
.overview { max-width: 1240px; }
.ov-head { max-width: 46rem; margin-left: 0; padding-left: 0; font-size: 18px; }
.ov-hint { font-size: .85rem; color: var(--muted); margin: 1.4rem 0 .9rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 10px; }
.crumb { border: 0; background: var(--rule2); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--fg2); }
.crumb-sep { color: var(--faint); }
.pano { display: flex; gap: 3px; align-items: stretch; }
.pb { display: flex; flex-direction: column; gap: 3px; flex-basis: 0; min-width: 0; }
.pb-band {
  display: flex; flex-direction: column; gap: 4px; justify-content: space-between; text-align: left; border: 0; cursor: pointer;
  height: 118px; padding: 10px 9px 8px; border-radius: 7px; overflow: hidden; container-type: inline-size;
  background: color-mix(in srgb, var(--oc) 20%, var(--bg)); box-shadow: inset 0 4px 0 var(--oc);
  transition: background-color .15s ease;
}
.pb.d2 > .pb-band { height: 92px; box-shadow: inset 0 3px 0 color-mix(in srgb, var(--oc) 70%, var(--bg)); background: color-mix(in srgb, var(--oc) 11%, var(--bg)); }
.pb-band:hover { background: color-mix(in srgb, var(--oc) 30%, var(--bg)); }
.pb-band.sel { outline: 2px solid var(--oc); outline-offset: 1px; }
.pb-t { font: 620 .8rem/1.25 var(--sans); color: color-mix(in oklab, var(--oc) 50%, var(--fg)); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.pb-r { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@container (max-width: 76px) { .pb-t { font-size: .66rem; -webkit-line-clamp: 5; } .pb-r { display: none; } }
@container (max-width: 34px) { .pb-t { display: none; } }
.pb-kids { display: flex; gap: 3px; }
/* vertical layout: phones, and books with many top-level sections */
.pano.vertical { flex-direction: column; }
.pano.vertical .pb { flex-direction: row; flex-basis: auto; flex-shrink: 0; min-height: max(52px, calc(var(--v) * 4px)); }
.pano.vertical .pb-kids .pb { min-height: max(52px, calc(var(--v) * 4px)); }
.pano.vertical .pb-band { height: auto; flex: 0 0 42%; box-shadow: inset 4px 0 0 var(--oc); padding: 7px 10px 7px 14px; justify-content: center; gap: 2px; }
.pano.vertical .pb.d2 > .pb-band { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--oc) 70%, var(--bg)); }
.pano.vertical .pb:not(:has(> .pb-kids)) > .pb-band { flex: 1; }
.pano.vertical .pb-kids { flex-direction: column; flex: 1; }
.pano.vertical .pb-t { -webkit-line-clamp: 3; font-size: .78rem; display: -webkit-box !important; }
.pano.vertical .pb-r { display: block !important; }
@media (max-width: 699px) {
  .pano { flex-direction: column; }
  .pb { flex-direction: row; flex-basis: auto; flex-shrink: 0; min-height: max(52px, calc(var(--v) * 4px)); }
  .pb-band, .pb.d2 > .pb-band { height: auto; flex: 0 0 44%; padding: 7px 10px 7px 14px; justify-content: center; gap: 2px; }
  .pb > .pb-band { box-shadow: inset 4px 0 0 var(--oc); }
  .pb.d2 > .pb-band { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--oc) 70%, var(--bg)); }
  .pb:not(:has(> .pb-kids)) > .pb-band { flex: 1; }
  .pb-kids { flex-direction: column; flex: 1; }
  .pb-t { -webkit-line-clamp: 3; font-size: .78rem; display: -webkit-box !important; }
  .pb-r { display: block !important; }
  .ruler { display: none; }
}
.ruler { position: relative; height: 30px; margin-top: 8px; border-top: 1px solid var(--rule); }
.pano.vertical + .ruler { display: none; }
.tick { position: absolute; top: 0; width: 1px; height: 6px; background: var(--faint); }
.tick.labeled { height: 10px; }
.tick span { position: absolute; top: 12px; left: 0; transform: translateX(-50%); font-size: .66rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pano-card { display: flex; margin-top: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow); overflow: hidden; animation: pop .18s ease-out; }
.pc-bar { width: 6px; background: var(--oc); flex: none; }
.pc-body { padding: 16px 20px 18px; min-width: 0; }
.pc-path { font-size: .72rem; color: var(--muted); margin: 0 0 4px; }
.pc-title { font-family: var(--serif); font-weight: 550; font-size: 1.4rem; margin: 0 0 4px; }
.pc-meta { font-size: .8rem; color: var(--muted); margin: 0 0 10px; }
.pc-summary { font-family: var(--serif); font-style: italic; color: var(--fg2); margin: 0 0 12px; line-height: 1.55; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ov-list { margin-top: 2.4rem; max-width: 46rem; }
.outline-list, .outline-list ol { list-style: none; margin: 0; padding: 0; }
.outline-list ol { padding-left: 22px; }
.outline-list a { display: flex; align-items: baseline; gap: 10px; padding: 7px 4px; text-decoration: none; color: var(--fg); border-bottom: 1px solid var(--rule2); }
.outline-list a:hover { background: var(--bg2); }
.ol-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--oc); flex: none; transform: translateY(1px); }
.outline-list .d2 .ol-dot { background: color-mix(in srgb, var(--oc) 60%, var(--bg)); }
.ol-title { flex: 1; font-family: var(--serif); font-size: 1rem; }
.outline-list .d1 > a .ol-title { font-weight: 600; }
.ol-range { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ol-sum { margin: 4px 0 8px 19px; font-family: var(--serif); font-style: italic; color: var(--fg2); font-size: .92rem; }

/* ───────────────────────── search ───────────────────────── */
.search-box { max-width: none; margin-bottom: 14px; }
.search-box .pill { min-height: 38px; }
.ref-jump { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 9%, transparent); text-decoration: none; color: var(--fg); margin-bottom: 14px; }
.ref-jump > span:not(.ic) { flex: 1; }
.ref-jump .ic { color: var(--accent); }
.hint { color: var(--muted); font-size: .92rem; }
.result-count { font-size: .82rem; color: var(--muted); margin: 18px 0 6px; }
.results { list-style: none; margin: 0; padding: 0; }
.result { display: block; padding: 14px 6px; border-bottom: 1px solid var(--rule2); text-decoration: none; color: var(--fg); border-radius: 6px; }
.result:hover { background: var(--bg2); }
.result-ref { display: block; font-size: .76rem; font-weight: 700; color: var(--accent); letter-spacing: .02em; margin-bottom: 3px; }
.result-text { font-family: var(--serif); font-size: 1.04rem; line-height: 1.6; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 .08em; }

/* ───────────────────────── about ───────────────────────── */
.prose-page h2 { font-family: var(--serif); font-weight: 550; font-size: 1.3rem; margin: 2rem 0 .5rem; }
.prose-page p, .prose-page li { font-family: var(--serif); font-size: 1.06rem; line-height: 1.7; color: var(--fg2); }
.prose-page li + li { margin-top: .4rem; }
#giants { scroll-margin-top: calc(var(--bar-h) + 12px); }
.giants { display: grid; gap: 12px; margin-top: 1.2rem; }
.giant { padding: 4px 18px 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--rule2); border-left: 4px solid var(--gc, var(--rule)); }
.giant:nth-child(5n+1) { --gc: #c47757; } .giant:nth-child(5n+2) { --gc: #5f95a2; } .giant:nth-child(5n+3) { --gc: #9a80bd; }
.giant:nth-child(5n+4) { --gc: #7c9a5a; } .giant:nth-child(5n) { --gc: #b8954a; }
.giant h3 { font: 600 1.08rem/1.3 var(--serif); margin: .9rem 0 .2rem; }
.giant p, .giant li { font-size: 1rem; }

/* ───────────────────────── toast ───────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 95; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .88rem; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.update-bar { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 96; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); background: var(--fg); color: var(--bg); padding: 8px 8px 8px 16px; border-radius: 12px; font-size: .88rem; box-shadow: 0 4px 18px rgb(0 0 0 / .25); transition: opacity .2s ease, transform .2s ease; }
.update-bar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.update-bar button { font: inherit; font-weight: 600; color: var(--fg); background: var(--bg); border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; }

/* ───────────────────────── large screens ───────────────────────── */
@media (min-width: 2000px) {
  .library { max-width: 1480px; }
  .overview { max-width: 1600px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .topbar, .bottomnav, .side, .scrim, .sheet, .book-foot .prev-next { display: none !important; }
  .reader { display: block !important; }
}

/* ───────────────────────── original words (interlinear) ───────────────────────── */
.w .wg { display: none; }
@media (hover: hover) and (pointer: fine) {
  .reader .w:hover .we { text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: .22em; }
}
.w { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.w.on .we { background: var(--hl, color-mix(in srgb, var(--fg) 10%, transparent)); border-radius: 3px; box-shadow: 0 0 0 2px var(--hl, color-mix(in srgb, var(--fg) 10%, transparent)); }
html.il-on .text .w { display: inline-flex; flex-direction: column; align-items: flex-start; vertical-align: top; text-indent: 0; }
html.il-on .text .w .wg { display: flex; flex-direction: column; line-height: 1.2; margin: .1em 0 .35em; color: var(--muted); font-weight: 400; font-style: normal; white-space: nowrap; }
html.il-on .text .wgo { font-family: var(--serif); font-size: .74em; color: var(--fg2); }
html.il-on .text .wgt { font-family: var(--sans); font-size: .56em; letter-spacing: .01em; }
html.il-on .text .ln { line-height: 1.3; }

.wpop { max-width: 400px; max-height: min(70vh, 560px); overflow-y: auto; }
/* the label and tabs stay put while a long entry scrolls */
.wpop .wp-top { position: sticky; top: -10px; margin: -10px -14px 0; padding: 10px 14px 0; background: var(--card); z-index: 1; }
@media (max-width: 639px) { .wpop .wp-top { top: -12px; margin: -12px -16px 0; padding: 12px 16px 0; } }
.wp-en { font-family: var(--serif); font-size: 1.08rem; font-weight: 560; margin: 2px 0 8px; }
.wp-sup { display: block; font: .72rem/1.4 var(--sans); color: var(--muted); font-weight: 400; margin-top: 2px; }
.wp-word { padding: 8px 0; border-top: 1px solid var(--rule); }
.wp-orig { font-family: var(--serif); font-size: 1.6rem; line-height: 1.25; }
.wp-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.wp-tr { font-family: var(--serif); font-style: italic; font-size: 1rem; }
.wp-str { font: 600 .74rem/1.2 var(--sans); color: var(--accent, var(--fg2)); text-decoration: none; border: 1px solid var(--rule); border-radius: 999px; padding: 2px 8px; }
.wp-str:hover { text-decoration: underline; }
.wp-parse { font: .8rem/1.4 var(--sans); color: var(--fg2); margin-top: 4px; }
.wp-note { font: italic .8rem/1.4 var(--sans); color: var(--muted); margin-top: 4px; }
.wp-renders { margin-top: 6px; font: .8rem/1.5 var(--sans); }
.wp-k { display: block; font: 650 .62rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.wp-rlist { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); }
.wp-rlist b { color: var(--fg); font-weight: 560; }
.wp-verse { border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 2px; font-family: var(--serif); font-size: 1.02rem; line-height: 1.7; }
.wp-vw { font: inherit; color: var(--fg2); background: none; border: 0; padding: 0 1px; border-radius: 3px; cursor: pointer; }
.wp-vw:hover { color: var(--fg); text-decoration: underline; }
.wp-vw.dim { color: var(--muted); }
.wp-vw.on { color: var(--fg); background: color-mix(in srgb, var(--fg) 10%, transparent); }
.wp-src { font: .66rem/1.4 var(--sans); color: var(--muted); margin-top: 8px; }

:is(.wp-orig, .wp-verse, html.il-on .text .wgo):lang(grc) { font-family: "Noto Serif Greek", var(--serif); }
/* elements that declare Hebrew; their children inherit it (a :lang() match would also catch the
   sans-serif verse numbers and markers inside Hebrew text) */
[lang=hbo] { font-family: "Noto Serif Hebrew", var(--serif); }
html.il-on .text .wgo:is(:lang(hbo), [lang=hbo]) { font-family: "Noto Serif Hebrew", var(--serif); font-size: .9em; line-height: 1.55; }
.wp-orig:lang(hbo) { font-family: "Noto Serif Hebrew", var(--serif); font-size: 1.8rem; line-height: 1.5; }
.wp-verse:lang(hbo) { font-family: "Noto Serif Hebrew", var(--serif); font-size: 1.18rem; line-height: 1.85; direction: rtl; text-align: start; }
/* tables and genealogies can't shrink once every name carries a gloss: scroll inside the table, not the page */
html.il-on .text .tbl { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; }

/* ───────────────────────── compare translations (pages/compare.rs) ───────────────────────── */
.vn { cursor: pointer; }
.vn:hover, .vn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.vcmp { width: 460px; max-width: min(460px, calc(100vw - 24px)); max-height: min(78vh, 640px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 12px; }
.vcmp:focus, .vcmp:focus-visible { outline: none; }
.vcmp .vc-top { position: sticky; top: -10px; margin: -10px -14px 0; padding: 10px 14px 0; background: var(--card); z-index: 2; }
.vcmp .fnpop-head { position: relative; margin: 0 0 2px; padding: 0 0 6px; }
.vcmp h2.fnpop-label { margin: 0; }
.vcmp .loading-dots { padding: 22px 0; }
.vc-ver { padding: 10px 0 11px; border-top: 1px solid var(--rule2); }
.vc-body > .vc-ver:first-child { border-top: 0; padding-top: 4px; }
.vc-vh { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-bottom: 2px; }
.vc-abbr { font: 700 .7rem/1 var(--sans); letter-spacing: .08em; color: var(--accent); white-space: nowrap; }
.vc-name { flex: 1; min-width: 0; font: .74rem/1.25 var(--sans); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-lang, .vc-here { font: 650 .6rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.vc-here { color: var(--fg2); border: 1px solid var(--rule); border-radius: 99px; padding: 3px 7px; }
.vc-go { display: inline-flex; align-items: center; gap: 3px; min-height: 32px; padding: 0 6px 0 10px; margin-right: -6px; border-radius: 99px; font: 600 .74rem/1 var(--sans); text-decoration: none; white-space: nowrap; }
.vc-go .ic svg { width: 15px; height: 15px; }
.vc-go:hover { background: var(--rule2); }
.vc-tx { margin: 0; font-family: var(--serif); font-size: 1.04rem; line-height: 1.6; color: var(--fg); text-align: start; }
.vc-tx:lang(grc) { font-family: "Noto Serif Greek", var(--serif); }
.vc-tx:lang(hbo) { font-size: 1.24rem; line-height: 1.8; }
.vc-cur .vc-tx { font-size: 1.08rem; }
.vc-miss { margin: 0; font: italic .86rem/1.5 var(--sans); color: var(--muted); }
.vc-words { display: flex; flex-wrap: wrap; gap: 4px 2px; margin: 4px -6px 0; }
.vc-w {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 40px; min-height: 44px; padding: 4px 6px 5px;
  border: 1px solid transparent; border-radius: 9px; background: none; color: var(--fg); cursor: pointer; font: inherit;
}
.vc-w:hover { background: var(--bg2); }
.vc-w[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.vc-g { font-family: var(--serif); font-size: 1.18rem; line-height: 1.35; }
.vc-g:lang(grc) { font-family: "Noto Serif Greek", var(--serif); }
.vc-g:lang(hbo) { font-size: 1.32rem; line-height: 1.45; }
.vc-tr { font: italic .76rem/1.2 var(--serif); color: var(--fg2); }
.vc-gl { font: .68rem/1.25 var(--sans); color: var(--muted); max-width: 8.5em; text-align: center; overflow-wrap: anywhere; }
.vc-w.dim .vc-g { color: var(--fg2); }

/* ───────────────────────── study notes (verse dialog tab) ───────────────────────── */
.study { padding-top: 2px; }
.sn-src { display: inline-flex; gap: 2px; padding: 2px; margin: 2px 0 10px; border: 1px solid var(--rule); border-radius: 99px; }
.sn-s { border: 0; background: transparent; padding: 5px 12px; min-height: 30px; border-radius: 99px; font: 600 .74rem/1 var(--sans); color: var(--muted); cursor: pointer; }
.sn-s:hover { color: var(--fg); }
.sn-s.on { background: var(--bg2); color: var(--fg); box-shadow: 0 0 0 1px var(--rule) inset; }
.sn { margin: 0 0 12px; }
.sn-rf { font: 700 .68rem/1 var(--sans); letter-spacing: .04em; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.sn > .sn-rf { display: block; margin-bottom: 4px; }
.sn-p { margin: 0 0 .55em; font-family: var(--serif); font-size: .98rem; line-height: 1.6; color: var(--fg); overflow-wrap: break-word; }
.sn-x { font-weight: 640; }
.sn-sc { font-variant: small-caps; }
.sn-h { font-family: "Noto Serif Hebrew", var(--serif); font-size: 1.1em; }
.sn-g { font-family: "Noto Serif Greek", var(--serif); }
.sn-ref {
  display: inline; border: 0; background: none; padding: 0 .05em; margin: 0; font: inherit; color: var(--accent); cursor: pointer; border-radius: 3px;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: .18em; text-decoration-thickness: .06em;
}
.sn-ref:hover, .sn-ref.on { background: color-mix(in srgb, var(--accent) 12%, transparent); text-decoration-color: var(--accent); }
.sn-peek { margin: 2px 0 10px; padding: 8px 6px 6px 12px; border-inline-start: 2px solid color-mix(in srgb, var(--accent) 45%, var(--rule)); background: var(--bg2); border-radius: 0 10px 10px 0; animation: pop .16s ease-out; }
.sn-peek .loading-dots { padding: 8px 0; }
.sn-peek-tx { margin: 0 0 .3em; font-family: var(--serif); font-size: .95rem; line-height: 1.55; }
.sn-peek-tx.ctx { opacity: .55; }
.sn-peek-n { font: 600 .6em/0 var(--sans); color: var(--faint); margin-inline-end: .25em; }
.sn-peek .vc-go { float: right; margin: -4px 0 0 8px; min-height: 28px; }
.sn-peek::after { content: ""; display: block; clear: both; }
.sn-ctx { border-top: 1px solid var(--rule2); margin-top: 4px; padding-top: 8px; }
.sn-ctx-h { font: 650 .6rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.sn-fold-h {
  display: flex; align-items: baseline; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 4px; margin: 0 -4px; text-align: start;
  cursor: pointer; border-radius: 8px; color: var(--fg2); min-height: 36px;
}
.sn-fold-h:hover { background: var(--bg2); }
.sn-fold-h .sn-rf { color: var(--muted); min-width: 4.6em; }
.sn-fold-pv { flex: 1; min-width: 0; font: .9rem/1.4 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-chev { color: var(--faint); align-self: center; transition: transform .15s ease; }
.sn-chev .ic { width: 16px; height: 16px; }
.sn-fold.open .sn-chev { transform: rotate(90deg); }
.sn-fold.open .sn-fold-pv { visibility: hidden; }
.sn-fold-b { padding: 2px 0 4px; }
.sn-fold-b .sn > .sn-rf { display: none; }
.sn-foot { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--rule2); display: grid; gap: 8px; }
.sn-mtog { display: flex; align-items: center; gap: 8px; font: .78rem/1.3 var(--sans); color: var(--fg2); cursor: pointer; }
.sn-mtog input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.sn-att { font: .68rem/1.45 var(--sans); color: var(--faint); text-decoration: none; }
.sn-att:hover { color: var(--muted); text-decoration: underline; }

/* ───────────────────────── study margin (wide screens, reader setting) ───────────────────────── */
.page.reading { position: relative; }
.smg { position: absolute; top: 0; left: 0; width: 0; pointer-events: none; }
.smg[hidden] { display: none; }
/* make room: the text column moves toward the start */
.reader.study-on .text { margin-inline: max(0px, calc((100% - 34em - var(--gutter) - var(--smw, 17em)) / 2)) auto; }
.reader.study-on .book-head, .reader.study-on .book-foot { margin-inline: max(0px, calc((100% - 34em * var(--fs-k) - var(--gutter) - var(--smw, 17em)) / 2)) auto; }
.reader.study-on.sm-tight .lbl { position: static; width: auto; margin: 0 0 .35em; letter-spacing: .12em; }
.sm-n {
  position: absolute; left: 0; right: 0; display: block; pointer-events: auto; text-align: start; cursor: pointer;
  border: 0; border-inline-start: 1px solid var(--rule); background: none; padding: 1px 0 1px 10px; margin: 0;
  font: 400 .8rem/1.48 var(--serif); color: var(--muted); transition: color .15s ease, border-color .15s ease;
}
.sm-n:hover, .sm-n:focus-visible { color: var(--fg2); border-inline-start-color: var(--accent); }
.sm-rf { display: block; font: 700 .62rem/1.5 var(--sans); letter-spacing: .05em; color: var(--faint); font-variant-numeric: tabular-nums lining-nums; }
.sm-n:hover .sm-rf { color: var(--accent); }
.sm-tx { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vn.sm-hl { background: var(--mark); color: var(--fg); }
@media print { .smg { display: none !important; } }
.vc-detail { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg2); }
.vc-detail .wp-orig { font-size: 1.4rem; }
.vc-en { font-family: var(--serif); font-weight: 560; margin-top: 4px; }
.vc-orig .wp-src { margin-top: 10px; }
.wp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.wp-foot .wp-src { margin-top: 0; }
.wp-cmp {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 8px 0 12px; border-radius: 99px;
  border: 1px solid var(--rule); background: transparent; color: var(--accent); cursor: pointer; font: 600 .76rem/1 var(--sans);
}
.wp-cmp .ic svg { width: 15px; height: 15px; }
.wp-cmp:hover { background: var(--rule2); }
.vcmp-scrim { z-index: 78; display: none; }
@media (max-width: 639px) {
  .vcmp-scrim { display: block; }
  .vcmp { left: 0 !important; right: 0; bottom: 0 !important; top: auto !important; width: auto !important; max-width: none; max-height: 82dvh !important;
    border-radius: 18px 18px 0 0; border-bottom: 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); z-index: 82; }
  .vcmp .vc-top { top: 0; margin: 0 -16px; padding: 12px 16px 0; }
  .vcmp .fnpop-head { padding: 0 0 8px; }
  .vcmp .vc-top::before { content: ""; position: absolute; left: 50%; top: 5px; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--rule); }
}
/* settings: which versions to compare */
.cmp-hint { margin: -2px 0 8px; }
.cmp-list { display: grid; gap: 2px; }
.cmp-row { display: grid; grid-template-columns: 22px 3.4em minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.cmp-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.cmp-name { font-size: .86rem; font-weight: 520; display: flex; flex-direction: column; gap: 2px; color: var(--fg2); }
/* ───────────────────────── original-language text (the `orig` version) ─────────────────────────
   The reading column carries lang="grc" / lang="hbo" (+ dir="rtl" for Hebrew); the layout above
   uses logical properties, so indents, gutter bars and markers follow the text direction. English
   labels inside it (outline headings, block labels, speakers, glosses) carry lang="en", and
   dir="ltr" in Hebrew. */
.text[lang=grc] { font-family: "Noto Serif Greek", var(--serif); }
/* pointed Hebrew with cantillation: a larger size, and room above and below each line so the
   accents and vowel points of neighbouring lines don't meet */
.text[lang=hbo] :is(.ln, .td) { font-size: 1.22em; line-height: calc(var(--lh) + .3); }
.text[lang=hbo] .vn { font-size: .44em; }
.text[lang=hbo] .mk { font-size: .58em; }
.text[lang=hbo] .tbl { row-gap: .3em; }
@media (hover: hover) and (pointer: fine) {
  .text[lang=hbo] .w:hover .we { text-underline-offset: .5em; }
}
/* English inside right-to-left text: aligned to the start (right) edge, beside the gutter bars */
.text[dir=rtl] :is(.ols, .lbl, .hd:not(.ms, .mr, .qa), .k-contrast .col1) { text-align: right; }
.text[dir=rtl] .k-genealogy .td.c1 { text-align: left; }
/* the label carries dir=ltr (an English label in Hebrew text), so its logical insets would resolve
   left to right: place it physically */
html.sp-on .text[dir=rtl] .spl { left: auto; right: .45em; transform: translate(50%, -50%) rotate(90deg); }
.text[dir=rtl] .k-question { box-shadow: inset -3px 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
/* English glosses under the original words */
html.il-on .text .wge { font-family: var(--sans); font-size: .58em; color: var(--fg2); }
html.il-on .text[lang=hbo] .ln { line-height: 1.6; }
html.il-on .text[lang=hbo] .w .wg { margin-top: .2em; }
html.il-on .text[lang=grc] .ln { line-height: 1.4; }
.wp-gloss { font-family: var(--serif); font-size: 1.08rem; font-weight: 560; margin-top: 4px; }

/* ───────────────────────── dialog tabs (word popover, verse dialog) ───────────────────────── */
.tabs { display: flex; gap: 2px; margin: 0 -4px 6px; border-bottom: 1px solid var(--rule2); overflow-x: auto; scrollbar-width: none; }
.vcmp .tabs { margin-bottom: 0; }
.vcmp .vc-body { padding-top: 6px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 0; background: none; cursor: pointer;
  font: 600 .78rem/1 var(--sans); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--fg); }
.tab.on { color: var(--fg); border-bottom-color: var(--accent); }
.tab-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; font: 700 .64rem/1 var(--sans); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
button.wp-str { background: none; cursor: pointer; }

/* ───────────────────────── Strong's dictionary (pages/lexicon.rs) ───────────────────────── */
.lx-wrap { padding-top: 2px; }
.lx-back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer; color: var(--accent); font: 600 .76rem/1 var(--sans); padding: 4px 6px 4px 0; margin-bottom: 2px; }
.lx-back .ic svg { width: 16px; height: 16px; }
.lx-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lx-lemma { font-size: 1.7rem; }
.lx-id { font: 650 .66rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lx-pron { font: .8rem/1.2 var(--sans); color: var(--muted); }
.lx-def { font-family: var(--serif); font-size: 1.02rem; line-height: 1.55; margin: 8px 0 4px; }
.lx-def em { font-weight: 600; }
.lx-sec { margin-top: 10px; }
.lx-p { margin: 0; font: .86rem/1.55 var(--sans); color: var(--fg2); }
.lx-senses { margin: 0; padding: 0; list-style: none; font: .86rem/1.5 var(--sans); color: var(--fg2); }
.lx-senses li.sub { padding-inline-start: 1.1em; color: var(--muted); }
.lx-ref { display: inline; border: 0; background: none; padding: 0 1px; cursor: pointer; font: inherit; color: var(--accent); }
.lx-ref:hover { text-decoration: underline; }
.lx-ref [lang=grc] { font-family: "Noto Serif Greek", var(--serif); }
.lx-ref [lang=hbo] { font-family: "Noto Serif Hebrew", var(--serif); font-size: 1.08em; }
.lx-num { font: 600 .74em/1 var(--sans); }
.lx-src a { color: inherit; }

/* ───────────────────────── notes (pages/notes.rs) ───────────────────────── */
.nt-panel { padding-top: 2px; }
.nt-list { list-style: none; margin: 0; padding: 0; }
.nt-row { padding: 10px 0; border-bottom: 1px solid var(--rule2); }
.nt-row:first-child { padding-top: 4px; }
.nt-ref { display: inline-block; font: 650 .74rem/1.2 var(--sans); text-decoration: none; margin-bottom: 3px; }
.nt-word { font: 600 .72rem/1.35 var(--sans); color: var(--muted); margin-bottom: 3px; }
.nt-word.head { margin: 2px 0 6px; }
.nt-text { margin: 0; font-family: var(--serif); font-size: 1rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.nt-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.nt-date { font: .7rem/1.2 var(--sans); color: var(--faint); }
.nt-grow { flex: 1; }
.nt-act { border: 0; background: none; cursor: pointer; font: 600 .74rem/1 var(--sans); color: var(--muted); padding: 6px 6px; border-radius: 6px; min-height: 30px; }
.nt-act:hover { color: var(--fg); background: var(--rule2); }
.nt-editor { margin-top: 8px; }
.nt-area {
  display: block; width: 100%; min-height: 96px; resize: vertical; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rule);
  background: var(--bg); color: var(--fg); font: 1rem/1.5 var(--serif);
}
.nt-area:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--rule)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.nt-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill.small { min-height: 34px; padding: 0 14px; font-size: .82rem; }
.pill[disabled] { opacity: .5; cursor: default; filter: none; }
.pill.danger { background: #b3261e; color: #fff; }
.nt-mic { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px 0 8px; border-radius: 99px; border: 1px solid var(--rule); background: transparent; cursor: pointer; font: 600 .8rem/1 var(--sans); color: var(--fg2); }
.nt-mic .ic svg { width: 18px; height: 18px; }
.nt-mic.on { border-color: #c0392b; color: #c0392b; background: color-mix(in srgb, #c0392b 10%, transparent); }
.nt-mic.on .ic { animation: mic 1.2s ease-in-out infinite; }
@keyframes mic { 50% { opacity: .35; } }
.nt-interim { flex-basis: 100%; font: italic .84rem/1.4 var(--serif); color: var(--muted); }
.nt-err { flex-basis: 100%; font: .78rem/1.4 var(--sans); color: #b3261e; }
.nt-add { margin-top: 10px; }
.nt-undo { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 4px 4px 4px 12px; border-radius: 10px; background: var(--bg2); font: .82rem/1.3 var(--sans); }
.nt-sync { margin: 10px 0 0; font: .72rem/1.4 var(--sans); color: var(--muted); }
.nt-sync a { font-weight: 600; }
.nt-sync.warn { color: #b3261e; }
.nt-empty { color: var(--muted); font-style: italic; }
.notes-page h1, .account-page h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 4.5vw, 2.4rem); margin: 0 0 .5rem; }
.notes-page .lede, .account-page .lede { color: var(--fg2); max-width: 36rem; }
.notes-filter { margin: 18px 0 8px; }
.nt-book h2 { font-family: var(--serif); font-weight: 550; font-size: 1.25rem; margin: 26px 0 4px; }
.notes-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.notes-foot .nt-sync { margin: 0; }
.set-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; text-decoration: none; color: var(--fg); font-weight: 600; font-size: .92rem; }
.set-link .ic svg { width: 20px; height: 20px; color: var(--accent); }

/* ───────────────────────── account (pages/account.rs) ───────────────────────── */
.acc-form { display: grid; gap: 14px; max-width: 24rem; margin-top: 18px; }
.acc-field { display: grid; gap: 6px; font: 600 .82rem/1.2 var(--sans); color: var(--fg2); }
.acc-field input {
  height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--rule); background: var(--card); color: var(--fg); font: 1rem var(--sans);
}
.acc-field input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--rule)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.acc-err { margin: 0; color: #b3261e; font: .86rem/1.4 var(--sans); }
.acc-note { font: .86rem/1.45 var(--sans); color: var(--fg2); background: var(--bg2); border-radius: 10px; padding: 10px 12px; max-width: 30rem; }
.acc-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.acc-actions.col { flex-direction: column; align-items: flex-start; margin-top: 22px; }
.acc-switch { border: 0; background: none; cursor: pointer; padding: 8px 0; font: 600 .84rem/1.3 var(--sans); color: var(--accent); text-align: start; }
.acc-back { margin-top: 28px; font-size: .9rem; }
.acc-card { margin-top: 18px; border: 1px solid var(--rule); border-radius: 14px; background: var(--card); max-width: 30rem; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: .92rem; }
.acc-row + .acc-row { border-top: 1px solid var(--rule2); }
.acc-status { color: var(--muted); font-size: .84rem; }
.acc-status.warn { color: #b3261e; }
.acc-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font: .86rem/1.4 var(--sans); color: var(--fg2); max-width: 30rem; }
.acc-danger { margin-top: 34px; max-width: 30rem; }
.acc-danger summary { cursor: pointer; font: 600 .84rem/1.3 var(--sans); color: var(--muted); }
html[data-theme="dark"] .pill.danger, html[data-theme="dark"] .acc-err, html[data-theme="dark"] .nt-err, html[data-theme="dark"] .nt-sync.warn, html[data-theme="dark"] .acc-status.warn { --danger: #f2b8b5; }
html[data-theme="dark"] :is(.acc-err, .nt-err, .nt-sync.warn, .acc-status.warn) { color: #f2b8b5; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) :is(.acc-err, .nt-err, .nt-sync.warn, .acc-status.warn) { color: #f2b8b5; } }

/* ---- shared by the study features (pages/hits.rs): by-book chart, verse hit rows */
.bchart { display: block; width: 100%; overflow: visible; }
.bchart .bc-hit { fill: transparent; cursor: pointer; }
.bchart .bc-b:hover rect:not(.bc-hit) { opacity: .75; }
.hit { display: block; width: 100%; padding: 7px 4px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: start; text-decoration: none; cursor: pointer; }
.hit:hover, .hit.on { background: var(--bg2); }
.hit-rf { display: block; font: 600 .74rem/1.3 var(--sans); color: var(--muted); }
.hit-tx { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--serif); font-size: .95rem; line-height: 1.5; }
.hit.on .hit-tx { -webkit-line-clamp: unset; }
.hit-tx mark { background: none; color: inherit; font-weight: 650; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }
