:root {
  --ink: #14212c;
  --muted: #66727c;
  --navy: #0b1724;
  --navy-2: #122538;
  --paper: #f6f3ec;
  --paper-deep: #eee8dc;
  --white: #fffefa;
  --gold: #c59a42;
  --gold-soft: #ead8ad;
  --blue-soft: #dce9ee;
  --line: #dcd5c8;
  --shadow: 0 18px 48px rgba(11, 23, 36, .12);
  --verse-size: 1.12rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  min-width: 320px;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(197,154,66,.6); outline-offset: 2px; }

.topbar {
  height: 76px;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3vw;
  border-bottom: 1px solid rgba(255,255,255,.09);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 13px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  font: 700 1.18rem/1 "Libre Baskerville", serif;
  border-radius: 50%;
}
.brand strong { display: block; font: 700 1.03rem/1.2 "Libre Baskerville", serif; letter-spacing: .02em; }
.brand small { color: #aeb8c1; display: block; margin-top: 4px; font-size: .7rem; }
.top-actions { display: flex; align-items: center; gap: 5px; }
.icon-button {
  color: #e3e8ec;
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  font-size: .84rem;
}
.icon-button:hover, .icon-button[aria-expanded="true"] { background: rgba(255,255,255,.08); color: white; }
.icon-button svg, .search-row svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bookmark-count { min-width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: .66rem; font-weight: 700; }
.bookmark-count[hidden] { display: none; }

.search-drawer {
  position: sticky;
  top: 76px;
  z-index: 15;
  background: var(--navy-2);
  color: white;
  padding: 15px max(24px, 16vw);
  box-shadow: 0 10px 22px rgba(11,23,36,.12);
}
.search-drawer label { display: block; font-size: .78rem; color: #b9c4cc; margin-bottom: 7px; }
.search-row { display: flex; align-items: center; gap: 9px; background: white; color: var(--ink); border-radius: 8px; padding: 0 12px; }
.search-row input { border: 0; outline: 0; padding: 11px 0; flex: 1; min-width: 0; background: transparent; }
.search-row button { border: 0; background: transparent; color: #677680; padding: 8px; }
.search-drawer > p { margin: 7px 0 0; color: #aeb8c1; font-size: .76rem; }
.search-drawer > .search-wildcard-hint { color: #d6dee3; }
.search-filters { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)) auto; align-items: end; gap: 8px; margin-top: 10px; }
.search-filters label { margin: 0; min-width: 0; }
.search-filters select { width: 100%; min-height: 38px; margin-top: 4px; border: 1px solid rgba(255,255,255,.24); border-radius: 7px; background: #0b1d2c; color: white; padding: 7px 9px; }
.search-filters .search-focus-only { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; color: #d6dee3; white-space: nowrap; }
.search-focus-only input { width: 18px; height: 18px; }
.bible-search-results { max-height: min(56vh, 560px); overflow-y: auto; margin-top: 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: #102536; overscroll-behavior: contain; }
.bible-search-result { display: grid; gap: 5px; padding: 12px 14px; color: #edf3f6; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.1); }
.bible-search-result:hover, .bible-search-result:focus-visible { background: rgba(255,255,255,.08); outline: 0; }
.bible-search-result strong { color: #e4bc59; font-size: .82rem; }
.bible-search-result span { font: 400 .9rem/1.55 "Libre Baskerville", serif; }
.bible-search-result mark { color: inherit; background: #6b5421; padding: 0 .08em; border-radius: 2px; }
.search-more { display: block; width: 100%; border: 0; background: #173047; color: #f0cc73; padding: 12px; font-weight: 700; }
.search-more:hover, .search-more:focus-visible { background: #203d55; }
.search-empty { margin: 0; padding: 14px; color: #c4cdd3; font-size: .88rem; }
.settings-popover {
  position: fixed;
  right: 3vw;
  top: 68px;
  z-index: 30;
  width: 260px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.settings-popover p { margin: 0 0 12px; font-weight: 700; font-size: .82rem; }
.testament-book-panel { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); scroll-padding-bottom: 32px; }
.size-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.size-controls button { border: 1px solid var(--line); background: var(--paper); min-width: 46px; min-height: 40px; border-radius: 7px; }
.size-controls span { color: var(--muted); font-size: .8rem; }

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 230px minmax(480px, 760px) 320px;
  justify-content: center;
  min-height: calc(100vh - 76px);
}
.book-rail, .study-panel {
  padding: 42px 28px;
  position: sticky;
  top: 76px;
  align-self: start;
  height: calc(100vh - 76px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.book-rail { border-right: 1px solid var(--line); }
.study-panel { border-left: 1px solid var(--line); background: rgba(255,255,255,.34); }
.reader { background: var(--white); padding: 54px clamp(34px, 5vw, 74px) 60px; box-shadow: 0 0 50px rgba(38,43,47,.035); }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; color: #7b6b49; font-size: .69rem; font-weight: 700; margin: 0 0 10px; }
.book-picker {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-bottom: 2px solid var(--gold);
  background: transparent;
  padding: 6px 0 12px;
  font: 700 1.4rem "Libre Baskerville", serif;
  color: var(--ink);
}
.testament-selectors { display: grid; gap: 24px; }
.reader.intro-reader h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.2; }
.intro-instructions { font-size: var(--verse-size); line-height: 1.65; margin-top: 28px; }
.intro-instructions ol { padding-left: 1.4em; }
.intro-instructions li { margin-bottom: 18px; }
.chapter-label { margin: 30px 0 12px; display: flex; justify-content: space-between; align-items: baseline; color: #4f5a63; font-size: .78rem; font-weight: 700; }
.chapter-label small { color: #9a9488; font-weight: 500; }
.chapter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chapter-grid button { aspect-ratio: 1; border: 1px solid transparent; background: transparent; color: #6c7378; border-radius: 6px; }
.chapter-grid button.active { background: var(--navy); color: white; box-shadow: inset 0 -3px var(--gold); }
.chapter-grid button:disabled { cursor: default; opacity: .42; }
.rail-note { font-size: .76rem; line-height: 1.55; color: #7b817f; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }

.reader-heading { display: flex; justify-content: space-between; align-items: start; gap: 24px; }
.reader h1 { font: 700 clamp(2.6rem, 5vw, 4.25rem)/.95 "Libre Baskerville", serif; margin: 0; letter-spacing: -.055em; color: var(--navy); }
.reader h1 span { color: var(--gold); font-weight: 400; }
.reader-heading:has(.numbered-book-title) > div { min-width: 0; flex: 1; container-type: inline-size; }
.reader h1.numbered-book-title { white-space: nowrap; font-size: min(clamp(2.6rem, 5vw, 4.25rem), 10cqi); }
.book-picker[aria-label^="Selected book: 1 "] > span:first-child,
.book-picker[aria-label^="Selected book: 2 "] > span:first-child,
.book-picker[aria-label^="Selected book: 3 "] > span:first-child,
.testament-book-panel .book-picker[href^="1"],
.testament-book-panel .book-picker[href^="2"],
.testament-book-panel .book-picker[href^="3"] { white-space: nowrap; }
.book-picker[aria-label^="Selected book: 1 "],
.book-picker[aria-label^="Selected book: 2 "],
.book-picker[aria-label^="Selected book: 3 "] { container-type: inline-size; }
.book-picker[aria-label$="Chronicles"] > span:first-child,
.book-picker[aria-label$="Corinthians"] > span:first-child,
.book-picker[aria-label$="Thessalonians"] > span:first-child { font-size: min(1.4rem, 10cqi); }
.passage-label { margin: 13px 0 0; color: var(--muted); font-size: .82rem; }
.bookmark-button { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 9px 11px; }
.bookmark-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bookmark-button[aria-pressed="true"] { color: #7a5819; background: #f5ead1; border-color: #e1c684; }
.bookmark-button[aria-pressed="true"] svg { fill: var(--gold); }
.audio-player { margin: 34px 0 18px; padding: 20px; border: 1px solid #d7c89f; border-left: 4px solid var(--gold); border-radius: 10px; background: #fbf8f0; box-shadow: 0 9px 24px rgba(11,23,36,.055); }
.audio-heading { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 16px; }
.audio-heading .eyebrow { margin-bottom: 5px; }
.audio-heading h2 { margin: 0; color: var(--navy); font: 700 1.18rem/1.35 "Libre Baskerville", serif; }
.audio-source { flex: 0 0 auto; border: 1px solid #d9cda9; border-radius: 999px; color: #6f5b2d; background: #f5ecd7; padding: 5px 9px; font-size: .69rem; font-weight: 700; }
.audio-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.audio-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #bcb4a5; border-radius: 8px; color: #3f4b53; background: var(--white); padding: 9px 13px; font-size: .8rem; font-weight: 700; }
.audio-button:hover:not(:disabled) { border-color: #91712f; color: #6d5018; background: #fffaf0; }
.audio-button:disabled { cursor: default; opacity: .46; }
.audio-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.audio-primary { color: white; background: var(--navy); border-color: var(--navy); min-width: 90px; }
.audio-primary svg { fill: currentColor; stroke: currentColor; }
.audio-primary:hover:not(:disabled) { color: white; background: #1b3247; border-color: #1b3247; }
.audio-options { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; margin-top: 15px; }
.audio-options label > span { display: block; margin-bottom: 6px; color: #746d60; font-size: .7rem; font-weight: 700; }
.audio-options select { width: 100%; min-height: 42px; border: 1px solid #c9c1b3; border-radius: 8px; color: var(--ink); background: var(--white); padding: 8px 34px 8px 10px; }
.audio-options select:disabled { opacity: .65; }
.audio-status { margin: 12px 0 0; color: #616d74; font-size: .76rem; line-height: 1.45; }
.reader-hint { margin: 18px 0 31px; padding: 11px 14px; border: 1px solid #d7e1e4; background: #f3f8f9; border-radius: 8px; display: flex; align-items: center; gap: 12px; color: #52636c; }
.reader-hint span { font: 700 .78rem "Libre Baskerville", serif; color: #42616e; border-right: 1px solid #cbd8dc; padding-right: 12px; }
.reader-hint p { margin: 0; font-size: .79rem; line-height: 1.4; }
.verses { font: 400 var(--verse-size)/1.95 "Libre Baskerville", Georgia, serif; letter-spacing: .003em; transition: font-size .2s; }
.verse { margin: 0 0 .38rem; padding: .1rem .35rem; border-radius: 5px; transition: background .2s, opacity .2s; }
.verse sup { color: var(--gold); font: 700 .62em "DM Sans", sans-serif; vertical-align: super; margin-right: .55em; }
.verse-actions { display: inline-flex; align-items: center; gap: 2px; margin-left: .42rem; vertical-align: middle; opacity: .42; transition: opacity .15s; }
.verse:hover .verse-actions, .verse:focus-within .verse-actions { opacity: 1; }
.verse-action { width: 27px; height: 27px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #7b817f; padding: 4px; }
.verse-action:hover, .verse-action:focus-visible { border-color: var(--line); background: var(--paper-deep); color: #6f5220; }
.verse-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.verse-bookmark[aria-pressed="true"] { color: #7a5819; background: #f5ead1; border-color: #e1c684; }
.verse-bookmark[aria-pressed="true"] svg { fill: var(--gold); }
.word-help { display: inline; border: 0; background: transparent; padding: 0; color: inherit; font: inherit; line-height: inherit; cursor: help; transition: color .15s, background .15s; }
.study-token { white-space: nowrap; }
.word-help:focus-visible { color: #684b16; background: #f2e5c5; border-radius: 2px; }
.place-name:focus-visible { color: #315f6d; background: #dcebee; }
.word-help.is-locked { color: #684b16; background: #f2e5c5; border-radius: 2px; box-shadow: 0 0 0 2px rgba(197,154,66,.58); }
.place-name.is-locked { color: #315f6d; background: #dcebee; }
@media (hover: hover) {
  .word-help:hover { color: #684b16; background: #f2e5c5; border-radius: 2px; }
  .place-name:hover { color: #315f6d; background: #dcebee; }
  body.night .word-help:hover { color: #f0d594; background: #3a301e; }
  body.night .place-name:hover { color: #d6f0f6; background: #1d3d47; }
}
.verse.search-miss { opacity: .25; }
.verse.search-hit { background: #f5ead1; }
.verse.reference-target { background: #f5ead1; box-shadow: inset 3px 0 var(--gold); }
.verse.reader-highlight { background: #fff2b7; box-shadow: inset 3px 0 #c59a42; }
.verse.audio-current { background: #f5ead1; box-shadow: inset 3px 0 var(--gold); }
.passage-end { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: .77rem; display: flex; justify-content: space-between; }
.passage-end button { border: 0; background: transparent; color: #765920; font-weight: 700; }
.chapter-navigation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 24px; }
.chapter-nav-link { min-height: 44px; display: inline-flex; align-items: center; width: fit-content; border: 1px solid var(--line); border-radius: 8px; color: #765920; background: var(--white); padding: 10px 14px; font: 700 .78rem/1.3 "DM Sans", sans-serif; text-decoration: none; transition: border-color .15s, background .15s, color .15s; }
.chapter-nav-link.next { justify-self: end; text-align: right; }
.chapter-nav-link:hover, .chapter-nav-link:focus-visible { border-color: #b79a61; color: #5e4518; background: #fffaf0; outline: 0; }
.chapter-nav-spacer { min-height: 1px; }

.study-tabs-wrap { display: flex; align-items: flex-start; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 31px; }
.study-tabs { display: flex; flex: 1; gap: 4px; overflow-x: auto; }
.study-tabs button { white-space: nowrap; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #7c827f; font-size: .73rem; padding: 0 8px 11px; }
.study-tabs button:first-child { padding-left: 0; }
.study-tabs button.active { color: var(--ink); border-bottom-color: var(--gold); font-weight: 700; }
.study-tabs button:disabled { cursor: default; opacity: .48; }
.study-tabs button[hidden] { display: none; }
.study-lock-close {
  flex: 0 0 auto;
  margin-top: -6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
}
.study-lock-close[hidden] { display: none; }
.study-lock-close:hover, .study-lock-close:focus-visible { color: var(--ink); background: var(--paper-deep); }
.study-content h2 { margin: 0; font: 700 1.7rem/1.2 "Libre Baskerville", serif; color: var(--navy); overflow-wrap: anywhere; }
.pronunciation { font-size: .75rem; color: #8a8d8a; margin: 5px 0 22px; letter-spacing: .04em; }
.plain-meaning { border-left: 3px solid var(--gold); padding: 2px 0 2px 16px; margin: 21px 0; }
.plain-meaning span { font-size: .68rem; color: #887143; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.plain-meaning p { margin: 6px 0; font: 700 1rem/1.5 "Libre Baskerville", serif; }
.greek-study { margin: 24px 0; padding-top: 22px; border-top: 1px solid var(--line); }
.greek-meta { display: grid; gap: 0; margin: 0 0 22px; }
.greek-meta div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.greek-meta dt, .greek-section h3 {
  margin: 0 0 5px;
  color: #887143;
  font-size: .68rem;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 700;
}
.greek-meta dd { margin: 0; color: var(--ink); font-size: .88rem; line-height: 1.55; overflow-wrap: anywhere; }
#greekTerm { font: 700 1.08rem/1.5 "Libre Baskerville", serif; }
.greek-section { margin-top: 18px; }
.greek-section p { margin: 0; color: #5f696d; font-size: .84rem; line-height: 1.66; }
.verse-sense { border-left: 3px solid var(--gold); padding-left: 13px; }
.nuance { border-radius: 8px; background: var(--blue-soft); padding: 12px 13px; }
.greek-method { margin: 20px 0 0; color: #7b817f; font-size: .7rem; line-height: 1.55; }
.detail { color: #5f696d; font-size: .85rem; line-height: 1.7; }
.entity-details { margin-top: 22px; }
.entity-meta { display: grid; gap: 9px; margin: 0 0 23px; }
.entity-meta div { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.entity-meta dt, .entity-section h3 { margin: 0; color: #887143; font-size: .68rem; line-height: 1.45; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }
.entity-meta dd { margin: 0; color: var(--ink); font-size: .8rem; line-height: 1.5; }
.entity-section { margin-top: 20px; }
.entity-section p { margin: 6px 0 0; color: #5f696d; font-size: .82rem; line-height: 1.62; }
.entity-section .first-occurrence { color: var(--ink); font-weight: 700; }
.reference-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 9px 0 0; }
.reference-list li { border: 1px solid #d2c49d; border-radius: 999px; background: #f8f2e3; color: #65532c; padding: 5px 8px; font-size: .7rem; line-height: 1.2; }
.distinction { border-left: 3px solid var(--gold); padding: 2px 0 2px 13px; }
.secondary-button { width: 100%; padding: 10px 12px; border: 1px solid #b79a61; color: #6f5220; background: transparent; border-radius: 7px; font-weight: 700; font-size: .78rem; margin-top: 10px; }
.entry-sources { margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; line-height: 1.55; }
.entry-sources summary { color: #765920; cursor: pointer; font-weight: 700; }
.entry-source-content p, .entry-source-content ul { margin: 10px 0 0; }
.entry-source-content a { color: inherit; font-weight: 700; }
.related-scriptures { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; line-height: 1.55; }
.related-scriptures summary { color: #765920; cursor: pointer; font-weight: 700; }
.related-scriptures-content { display: grid; gap: 8px; margin-top: 10px; }
.related-scriptures-content > a:not(.related-word-study-link) { display: grid; gap: 3px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); text-decoration: none; background: var(--paper); }
.related-scriptures-content strong { color: #765920; }
.related-word-study-link { color: #765920; font-weight: 700; text-underline-offset: 3px; }
.report-error-button { margin-top: 17px; border: 0; background: transparent; color: var(--muted); padding: 4px 0; font-size: .72rem; text-decoration: underline; text-underline-offset: 3px; }
.report-error-button:hover, .report-error-button:focus-visible { color: #765920; }
blockquote { margin: 22px 0; border-left: 3px solid var(--gold); padding: 3px 0 3px 17px; }
blockquote p { font: 400 .95rem/1.65 "Libre Baskerville", serif; margin: 0; }
blockquote cite { display: block; color: #7c827f; font-style: normal; font-size: .74rem; margin-bottom: 9px; }
.notes-panel label { display: block; color: var(--muted); font-size: .76rem; margin: 20px 0 7px; }
.notes-panel textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); padding: 11px; line-height: 1.5; min-height: 150px; }
.save-status { font-size: .7rem; color: #8b908d; margin-top: 7px; }
.study-principle { margin-top: 38px; padding: 14px; background: #eaf1f2; display: flex; gap: 10px; border-radius: 8px; color: #52636c; }
.study-principle svg { width: 21px; flex: 0 0 auto; fill: none; stroke: #577783; stroke-width: 1.5; }
.study-principle p { margin: 0; font-size: .72rem; line-height: 1.5; }

footer { background: var(--navy); color: #9ca8b1; text-align: center; padding: 20px; font-size: .7rem; }
footer p { margin: 0; }
.footer-links { margin-top: 7px; }
.footer-links a { color: #d9c58d; text-underline-offset: 3px; }
dialog { width: min(520px, calc(100% - 32px)); border: 1px solid #c7b27f; border-radius: 12px; background: var(--white); color: var(--ink); padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(4,11,18,.72); backdrop-filter: blur(3px); }
dialog form { position: relative; padding: 34px; }
.dialog-content { position: relative; padding: 34px; }
dialog h2 { font: 700 1.8rem "Libre Baskerville", serif; color: var(--navy); margin: 0 0 14px; }
dialog p { line-height: 1.7; color: #576269; }
.dialog-close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; color: #68747b; font-size: 1.6rem; }
.dialog-rule { width: 44px; height: 2px; background: var(--gold); margin: 22px 0; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; background: var(--navy); color: white; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: .8rem; }
.bookmarks-dialog { width: min(620px, calc(100% - 32px)); max-height: min(76vh, 700px); }
.bookmark-privacy { margin: 0 0 18px; font-size: .8rem; }
.bookmark-list { display: grid; gap: 10px; max-height: 48vh; overflow-y: auto; padding-right: 3px; }
.bookmark-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: var(--paper); }
.bookmark-item a { display: grid; gap: 5px; color: var(--ink); text-decoration: none; min-width: 0; }
.bookmark-item a:hover strong, .bookmark-item a:focus-visible strong { text-decoration: underline; text-underline-offset: 3px; }
.bookmark-item strong { color: #765920; font-size: .82rem; }
.bookmark-item span { font: 400 .78rem/1.55 "Libre Baskerville", serif; }
.bookmark-remove { border: 0; background: transparent; color: var(--muted); font-size: .72rem; padding: 8px; }
.bookmark-empty { margin: 12px 0; color: var(--muted); }
.report-dialog label { display: block; margin: 16px 0 6px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.report-dialog select, .report-dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); padding: 10px 11px; line-height: 1.5; }
.report-dialog textarea { resize: vertical; min-height: 115px; }
.report-context { margin: 0; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--paper); font-weight: 700; }
.report-status { min-height: 1.5em; margin: 13px 0 0; color: var(--muted); font-size: .75rem; }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; }
.report-actions .secondary-button { margin: 0; }
.verse-note-dialog label { display: block; margin: 16px 0 6px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.verse-note-dialog textarea { width: 100%; min-height: 150px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); padding: 10px 11px; line-height: 1.5; }
.verse-highlight[aria-pressed="true"] { color: #6f5220; background: #fff2b7; border-color: #d8b457; }
.verse-note.has-note { color: #315f6d; background: #dcebee; border-color: #8eb4bd; }
.primary-button { border: 1px solid var(--navy); border-radius: 7px; background: var(--navy); color: white; padding: 10px 12px; font-weight: 700; font-size: .78rem; }
.primary-button:disabled { cursor: wait; opacity: .55; }

.word-study-shell { max-width: 1050px; }
.word-study-form { margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.word-study-form > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.word-study-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.word-study-search-row input { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); padding: 11px 12px; font: inherit; }
.word-study-form fieldset { display: flex; flex-wrap: wrap; gap: 14px; margin: 15px 0 0; padding: 0; border: 0; }
.word-study-form legend { float: left; margin-right: 14px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.word-study-form fieldset label { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; }
.word-study-status { color: var(--muted); }
#wordStudySummary, #wordStudyTerms, #wordStudyOccurrences { margin-top: 28px; }
#wordStudySummary h2, #wordStudyTerms h2, #wordStudyOccurrences h2 { margin-bottom: 12px; }
#wordStudySummary blockquote { margin: 18px 0 0; }
.word-study-term-list { display: grid; gap: 10px; }
.word-study-term { border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: var(--paper); }
.word-study-term h3 { margin: 0 0 6px; font-size: .98rem; }
.word-study-term p { margin: 6px 0; }
.word-study-transliteration, .word-study-sense { color: var(--muted); font-size: .78rem; }
.word-study-results { display: grid; gap: 2px; }

.methodology-shell { width: min(900px, 100%); min-height: calc(100vh - 76px); margin: 0 auto; background: var(--white); box-shadow: 0 0 50px rgba(38,43,47,.035); }
.methodology-reader { padding: 54px clamp(24px, 7vw, 80px) 70px; }
.methodology-reader h1 { font-size: clamp(2rem, 5vw, 3.45rem); line-height: 1.05; }
.methodology-lead { margin: 20px 0 34px; color: var(--muted); font: 400 1.02rem/1.72 "Libre Baskerville", serif; }
.methodology-section { padding: 24px 0; border-top: 1px solid var(--line); }
.methodology-section h2 { margin: 0 0 12px; color: var(--navy); font: 700 1.35rem/1.3 "Libre Baskerville", serif; }
.methodology-section p, .methodology-section li { color: #526069; line-height: 1.72; }
.methodology-section ul { padding-left: 1.25rem; }
.methodology-section a { color: #765920; text-underline-offset: 3px; }
.methodology-note { border-left: 3px solid var(--gold); padding: 12px 15px; background: var(--paper); }

body.night { --ink: #dce5eb; --muted: #98a8b2; --paper: #07111b; --paper-deep: #0a1723; --white: #0e1d2b; --line: #263746; --blue-soft: #172b38; }
body.night .reader, body.night .study-panel { box-shadow: none; }
body.night .study-panel { background: #0a1825; }
body.night .reader h1, body.night .study-content h2, body.night dialog h2 { color: #edf2f5; }
body.night .eyebrow, body.night .plain-meaning span { color: #dfc477; }
body.night .pronunciation, body.night .study-tabs button, body.night blockquote cite, body.night .save-status, body.night .rail-note { color: #adbbc4; }
body.night .detail, body.night .reader-hint, body.night .study-principle, body.night dialog p { color: #c8d2d8; }
body.night .reader-hint, body.night .study-principle { background: #152934; border-color: #35505e; }
body.night .reader-hint span { color: #b8ced7; border-color: #3b5663; }
body.night .study-principle svg { stroke: #a7c0cb; }
body.night .secondary-button { color: #f0d594; border-color: #9d8141; background: rgba(197,154,66,.08); }
body.night .secondary-button:hover, body.night .secondary-button:focus { background: rgba(197,154,66,.16); }
body.night .passage-end button { color: #e0c273; }
body.night .chapter-nav-link { color: #e0c273; background: #0e1d2b; border-color: #354858; }
body.night .chapter-nav-link:hover, body.night .chapter-nav-link:focus-visible { color: #f0d594; background: #172b38; border-color: #9d8141; }
body.night .word-help { background: transparent; }
body.night .word-help:focus-visible { color: #f0d594; background: #3a301e; }
body.night .place-name:focus-visible { color: #d6f0f6; background: #1d3d47; }
body.night .word-help.is-locked { color: #f0d594; background: #3a301e; }
body.night .place-name.is-locked { color: #d6f0f6; background: #1d3d47; }
body.night .entity-meta dt, body.night .entity-section h3 { color: #dfc477; }
body.night .greek-meta dt, body.night .greek-section h3 { color: #dfc477; }
body.night .greek-meta dd { color: #edf2f5; }
body.night .greek-section p { color: #c8d2d8; }
body.night .nuance { background: #152934; }
body.night .greek-method { color: #adbbc4; }
body.night .entity-meta dd, body.night .entity-section .first-occurrence { color: #edf2f5; }
body.night .entity-section p { color: #c8d2d8; }
body.night .reference-list li { color: #e3d39d; background: #2d2a20; border-color: #766842; }
body.night .verse.search-hit { background: #3a301e; }
body.night .verse.reference-target { background: #3a301e; }
body.night .verse.reader-highlight { background: #413719; box-shadow: inset 3px 0 #e0c273; }
body.night .bookmark-button[aria-pressed="true"] { color: #f0d594; background: #3a301e; border-color: #806629; }
body.night .verse-action { color: #adbbc4; }
body.night .verse-action:hover, body.night .verse-action:focus-visible { color: #f0d594; background: #172b38; border-color: #60798a; }
body.night .verse-bookmark[aria-pressed="true"] { color: #f0d594; background: #3a301e; border-color: #806629; }
body.night .verse-highlight[aria-pressed="true"] { color: #f0d594; background: #3a301e; border-color: #806629; }
body.night .verse-note.has-note { color: #d6f0f6; background: #1d3d47; border-color: #527b87; }
body.night .related-scriptures summary, body.night .related-scriptures-content strong, body.night .related-word-study-link { color: #e0c273; }
body.night .related-scriptures-content > a:not(.related-word-study-link) { color: #edf2f5; background: #0a1723; }
body.night .entry-sources summary, body.night .report-error-button, body.night .bookmark-item strong, body.night .methodology-section a { color: #e0c273; }
body.night .bookmark-item, body.night .report-context { background: #0a1723; }
body.night .bookmark-item a, body.night .methodology-section h2 { color: #edf2f5; }
body.night .report-dialog select, body.night .report-dialog textarea { background: #172b38; border-color: #60798a; color: #f4f7fa; }
body.night .verse-note-dialog textarea { background: #172b38; border-color: #60798a; color: #f4f7fa; }
body.night .primary-button { color: #101b23; background: #e0c273; border-color: #e0c273; }
body.night .word-study-form, body.night .word-study-term { background: #0a1723; }
body.night .word-study-search-row input { background: #172b38; border-color: #60798a; color: #f4f7fa; }
body.night .methodology-shell { background: #0e1d2b; box-shadow: none; }
body.night .methodology-section p, body.night .methodology-section li, body.night .methodology-lead { color: #c8d2d8; }
body.night .methodology-note { background: #152934; }
body.night .audio-player { color: #dce5eb; background: #122433; border-color: #4f5d5f; border-left-color: var(--gold); box-shadow: none; }
body.night .audio-heading h2 { color: #f2f5f7; }
body.night .audio-source { color: #f0d594; background: #342c1e; border-color: #806b3b; }
body.night .audio-button { color: #e8eef2; background: #1a3040; border-color: #60798a; }
body.night .audio-button:hover:not(:disabled) { color: #ffffff; background: #244256; border-color: #b8c9d4; }
body.night .audio-primary { color: #101b23; background: #e0c273; border-color: #e0c273; }
body.night .audio-primary:hover:not(:disabled) { color: #081017; background: #f0d594; border-color: #f0d594; }
body.night .audio-options label > span, body.night .audio-status { color: #c0ccd3; }
body.night .audio-options select { color: #f4f7fa; background: #172b38; border-color: #7890a1; }
body.night .verse.audio-current { background: #3a301e; }
body.night .size-controls button {
  color: #f4f7fa;
  background: #172b38;
  border-color: #7890a1;
  font-weight: 700;
}
body.night .size-controls button:hover,
body.night .size-controls button:focus-visible {
  color: #ffffff;
  background: #213b4b;
  border-color: #c4d2da;
}

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 185px minmax(460px, 1fr) 285px; }
  .book-rail, .study-panel { padding: 35px 20px; }
  .reader { padding-left: 40px; padding-right: 40px; }
}
@media (max-width: 850px) {
  .search-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { display: block; }
  .book-rail { position: static; height: auto; overflow: visible; }
  .book-rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 24px; }
  .book-rail .eyebrow, .book-picker, .rail-note { display: none; }
  .testament-selectors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 22px; }
  .book-rail .testament-dropdown .eyebrow { display: block; }
  .book-rail .testament-dropdown > .book-picker { display: flex; }
  .chapter-label { margin: 0 0 10px; }
  .chapter-grid { display: flex; overflow-x: auto; gap: 7px; padding-bottom: 4px; }
  .chapter-grid button { width: 40px; height: 40px; flex: 0 0 auto; }
  .study-panel {
    position: fixed;
    z-index: 41;
    top: 82px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    width: auto;
    height: auto;
    max-height: calc(100dvh - 94px - env(safe-area-inset-bottom, 0px));
    padding: 22px clamp(20px, 6vw, 34px) 30px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 24px 70px rgba(4, 11, 18, .32);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(.985);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .study-panel.is-mobile-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
  }
  body.mobile-study-open { overflow: hidden; }
  body.mobile-study-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(4, 11, 18, .6);
    backdrop-filter: blur(2px);
  }
  .study-panel .study-tabs-wrap {
    position: sticky;
    top: -22px;
    z-index: 1;
    background: var(--white);
    padding-top: 22px;
  }
  .study-panel .study-lock-close { width: 34px; height: 34px; margin-top: -9px; }
  .study-principle { max-width: 520px; }
  .verse-actions { opacity: .72; gap: 3px; }
  .verse-action { width: 40px; height: 40px; }
}
@media (hover: none), (pointer: coarse) {
  .word-help {
    border-bottom: 1px dotted #8a6a2d;
    text-decoration: none;
  }
  body.night .word-help { border-bottom-color: #d8bc6b; }
  .word-help.is-locked { border-bottom-color: transparent; }
}
html.touch-capable .word-help {
  border-bottom: 1px dotted #8a6a2d;
  text-decoration: none;
}
html.touch-capable body.night .word-help { border-bottom-color: #d8bc6b; }
html.touch-capable .word-help.is-locked { border-bottom-color: transparent; }
@media (max-width: 560px) {
  .topbar { height: 68px; padding: 0 15px; }
  .brand small { display: none; }
  .brand strong { font-size: .94rem; }
  .brand-mark { width: 34px; height: 34px; }
  .icon-button { padding: 9px; }
  .icon-button span { display: none; }
  .search-drawer { top: 68px; padding: 14px 16px; }
  .search-filters { grid-template-columns: 1fr 1fr; }
  .study-panel {
    top: 78px;
    max-height: calc(100dvh - 90px - env(safe-area-inset-bottom, 0px));
  }
  .settings-popover { right: 12px; top: 62px; }
  .book-rail { padding: 16px; }
  .testament-selectors { grid-template-columns: 1fr; gap: 16px; }
  .reader { padding: 38px 22px 46px; }
  .reader-heading { align-items: center; }
  .reader h1 { font-size: 2.65rem; }
  .reader h1.numbered-book-title { font-size: min(2.65rem, 10cqi); }
  .bookmark-button span { display: none; }
  .bookmark-button { padding: 10px; }
  .verses { line-height: 1.9; }
  .reader-hint { margin-top: 28px; }
  .audio-player { padding: 17px; }
  .audio-heading { align-items: center; }
  .audio-controls { display: grid; grid-template-columns: repeat(3, 1fr); }
  .audio-button { padding-left: 8px; padding-right: 8px; }
  .audio-options { grid-template-columns: 1fr; }
  .passage-end { align-items: center; }
  .report-actions { grid-template-columns: 1fr; }
  .bookmark-item { grid-template-columns: 1fr; }
  .bookmark-remove { justify-self: start; padding-left: 0; }
  .word-study-search-row { grid-template-columns: 1fr; }
  .dialog-content, dialog form { padding: 30px 22px 24px; }
  .chapter-navigation { gap: 10px; }
  .chapter-nav-link { min-height: 46px; padding: 10px 11px; font-size: .74rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
