:root {
  color-scheme: dark;
  --bg: #1f2223;
  --bg-2: #252829;
  --bg-3: #2c2f30;
  --panel: #2b2e2f;
  --panel-2: #17191a;
  --text: #d9dddf;
  --muted: #979da0;
  --muted-2: #6f7679;
  --line: rgba(255,255,255,.13);
  --blue: #69a9bd;
  --blue-soft: rgba(105,169,189,.13);
  --gold: #baa87b;
  --highlight: rgba(186,168,123,.32);
  --danger: #d98a87;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --reader-size: 25px;
  --reader-leading: 1.65;
  --reader-font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui-font: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-family: var(--ui-font);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 35%, rgba(105,169,189,.08), transparent 28%),
    linear-gradient(180deg, #1c1f20, #232627);
  transition: opacity .45s ease, visibility .45s ease;
}
.splash.is-done { opacity: 0; visibility: hidden; }
.splash-mark,
.brand-glyph,
.listen-art span {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--gold);
  letter-spacing: -.12em;
}
.splash-mark {
  width: 82px;
  height: 82px;
  border: 1px solid rgba(186,168,123,.5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 48px;
  padding-right: 5px;
}
.splash-title { font-size: 1.45rem; font-weight: 700; letter-spacing: .02em; }
.splash-rule { width: 64px; height: 1px; background: var(--gold); opacity: .65; }
.splash-status { color: var(--muted); font-size: .82rem; min-height: 1.2em; }

.app-shell {
  height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.app-shell.is-loading { visibility: hidden; }

.reader-header {
  height: calc(76px + var(--safe-top));
  padding: var(--safe-top) 18px 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(31,34,35,.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  z-index: 30;
}
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; text-decoration: none; border: 0; padding: 0; background: transparent; }
.brand-glyph { font-size: 34px; padding-right: 3px; }
.location-button {
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: clamp(1.08rem, 4.5vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -.015em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  min-width: 0;
}
.location-button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.location-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; transition: transform .2s ease; }
.location-button[aria-expanded="true"] svg { transform: rotate(180deg); }
.icon-button {
  border: 0;
  background: transparent;
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--text);
}
.more-button { justify-self: end; color: var(--muted-2); }
.more-button svg { width: 30px; height: 30px; fill: currentColor; }

.main-stage {
  height: calc(100dvh - 76px - var(--safe-top) - 76px - var(--safe-bottom));
  position: relative;
  overflow: hidden;
}
.view { display: none; height: 100%; }
.view.is-active { display: block; }

.view-reader { position: relative; overflow: hidden; }
.reader-progress { position: absolute; left: 0; top: 0; right: 0; height: 2px; z-index: 5; background: rgba(255,255,255,.03); }
.reader-progress span { display: block; width: 0; height: 100%; background: var(--blue); transition: width .12s linear; }
.scripture {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 28px clamp(22px, 7vw, 74px) 120px;
  outline: none;
  font-family: var(--reader-font);
  font-size: var(--reader-size);
  line-height: var(--reader-leading);
  color: #d5d9db;
  max-width: 900px;
  margin: 0 auto;
}
.scripture h1, .scripture h2, .scripture h3, .scripture h4 {
  font-family: var(--ui-font);
  color: var(--blue);
  font-size: .78em;
  line-height: 1.35;
  letter-spacing: .01em;
  margin: 0 0 1.3em;
}
.scripture p { margin: 0 0 .5em; }
.scripture p.psalm-superscription { margin: 0 0 .8em; color: var(--muted); font-size: .78em; line-height: 1.5; }
.scripture p.psalm-superscription em { font-style: italic; }
.scripture sup, .scripture .verse-num, .scripture [class*="verse"] sup {
  font-family: var(--ui-font);
  color: #aeb5b8;
  font-size: .54em;
  line-height: 1;
  vertical-align: .55em;
  margin-right: .22em;
}
.scripture a { color: inherit; text-decoration: none; }
.scripture a[role="doc-noteref"], .scripture a.footnote, .scripture sup a { color: var(--blue); font-size: .75em; }
.scripture blockquote { margin: 1em 0 1em 1.2em; padding-left: .8em; border-left: 1px solid rgba(105,169,189,.45); }
.scripture mark.way-highlight { background: var(--highlight); color: inherit; padding: .02em .08em; border-radius: .1em; }
.scripture::selection, .scripture *::selection { background: rgba(105,169,189,.34); color: #fff; }
.reader-empty { color: var(--muted); font-family: var(--ui-font); text-align: center; padding-top: 28vh; font-size: 1rem; }

.selection-toolbar {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 42px rgba(0,0,0,.35);
  background: #3a3d3e;
  border: 1px solid rgba(255,255,255,.09);
}
.selection-toolbar[hidden] { display: none; }
.selection-toolbar button { border: 0; background: transparent; color: #fff; padding: 12px 16px; font-weight: 700; font-size: .82rem; }
.selection-toolbar button + button { border-left: 1px solid var(--line); }

.page-view { background: var(--bg); }
.page-scroll { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 34px clamp(24px, 7vw, 78px) 120px; max-width: 980px; margin: 0 auto; }
.page-kicker { color: var(--blue); font-size: .72rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; margin-bottom: 12px; }
.page-view h1 { font-size: clamp(2rem, 7vw, 3.6rem); line-height: 1.05; letter-spacing: -.045em; margin: 0 0 14px; color: #f0f2f2; }
.page-lead { max-width: 650px; color: var(--muted); font-size: 1.02rem; line-height: 1.65; margin: 0 0 30px; }

.home-search-page { padding-top: clamp(36px, 7vh, 76px); }
.home-search-page h1 { max-width: 560px; margin-bottom: 24px; }
.home-search-field {
  width: min(100%, 700px);
  min-height: 56px;
  grid-template-columns: 24px minmax(0,1fr);
  gap: 12px;
  padding: 0 18px;
  border: 1px solid rgba(105,169,189,.2);
  border-radius: 15px;
  background: #121516;
  box-shadow: 0 10px 30px rgba(0,0,0,.14);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.home-search-field:focus-within {
  border-color: rgba(105,169,189,.58);
  background: #101314;
  box-shadow: 0 0 0 3px rgba(105,169,189,.08), 0 12px 34px rgba(0,0,0,.16);
}
.home-search-field svg { width: 20px; height: 20px; }
.home-search-field input { font-size: 1rem; padding: 0; }
.search-key { display: none; }
.home-search-suggestions,
.home-search-help { width: min(100%, 700px); }
.home-search-suggestions { margin-top: 10px; border-top: 0; }
.direct-location, .search-everything { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 16px 2px; text-align: left; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.direct-location span { color: var(--blue); font-size: .68rem; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; grid-row: span 2; }
.direct-location strong { color: #eef0f1; }
.direct-location small { color: var(--muted); }
.search-everything { display: block; color: var(--blue); font-weight: 700; }
.home-book-suggestion { border-bottom: 1px solid rgba(255,255,255,.06); }
.home-book-toggle { width: 100%; min-height: 62px; border: 0; background: transparent; display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 0 2px; }
.home-book-toggle strong { color: #d9dddf; font-size: 1.05rem; }
.home-book-toggle span { color: var(--muted-2); font-size: .72rem; }
.home-chapter-grid { display: none; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; padding: 0 0 16px; }
.home-book-suggestion.is-expanded .home-chapter-grid { display: grid; }
.home-chapter-grid button { aspect-ratio: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #202324; color: #c8ccce; font-weight: 700; }
.home-chapter-grid button.is-current { background: var(--blue); color: #152126; border-color: var(--blue); }
.home-search-help { color: var(--muted-2); font-size: .8rem; line-height: 1.6; }
.home-search-help button { border: 0; background: transparent; color: var(--blue); padding: 0; }
.search-autocomplete { margin: -12px 0 20px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; overflow: hidden; background: #17191a; }
.search-autocomplete:empty { display: none; }
.search-autocomplete > button { width: 100%; min-height: 54px; border: 0; border-top: 1px solid rgba(255,255,255,.05); background: transparent; display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 0 14px; }
.search-autocomplete > button strong { color: #d9dddf; }
.search-autocomplete > button span { color: var(--muted-2); font-size: .72rem; }
.auto-chapters { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 7px; padding: 10px 12px 14px; }
.auto-chapters[hidden] { display: none; }
.auto-chapters button { min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #202324; color: #ccd0d2; font-weight: 700; }
.sheet[aria-hidden="true"] { pointer-events: none; }
.sheet.is-open { pointer-events: auto; }
.sheet-close, .search-head .icon-button { touch-action: manipulation; position: relative; z-index: 3; }

.continue-card {
  width: 100%;
  min-height: 188px;
  border: 1px solid rgba(105,169,189,.24);
  border-radius: 24px;
  padding: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, transparent 20%, rgba(0,0,0,.28)),
    radial-gradient(circle at 88% 10%, rgba(105,169,189,.24), transparent 34%),
    #2b2e2f;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
.continue-label { color: var(--blue); text-transform: uppercase; letter-spacing: .13em; font-weight: 800; font-size: .64rem; margin-bottom: 8px; }
.continue-card strong { color: #fff; font-size: 1.65rem; margin-bottom: 6px; }
.continue-card > span:last-child { color: #c3c8ca; font-family: var(--reader-font); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.home-action { border: 1px solid var(--line); background: var(--bg-2); min-height: 130px; border-radius: 20px; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.home-icon { color: var(--blue); font-size: 1.6rem; margin-bottom: auto; }
.home-action strong { font-size: 1rem; color: #e9ebec; margin-top: 14px; }
.home-action small { color: var(--muted); margin-top: 4px; }
.local-note { display: flex; gap: 14px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px; }
.local-note-icon { color: var(--gold); }
.local-note strong { color: #e8ebec; }
.local-note p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }

.segmented { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); padding: 3px; border-radius: 10px; background: #111314; margin: 20px 0 30px; }
.segmented button { border: 0; min-height: 48px; background: transparent; color: var(--muted); border-radius: 8px; font-weight: 700; font-size: .86rem; padding: 8px 6px; }
.segmented button.is-active { background: var(--bg-3); color: #e8eaeb; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.explore-section { margin-bottom: 30px; }
.explore-section h2 { font-family: var(--reader-font); font-style: italic; font-size: 1.6rem; font-weight: 500; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 0 0 6px; }
.explore-book { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 58px; border: 0; border-bottom: 1px solid rgba(255,255,255,.06); background: transparent; text-align: left; padding: 0 2px; }
.explore-book strong { font-size: 1rem; color: #cfd3d4; }
.explore-book span { color: var(--muted-2); font-size: .76rem; }

.library-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 24px 0 18px; }
.library-stats button { border: 1px solid var(--line); background: var(--bg-2); border-radius: 18px; padding: 18px 8px; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.library-stats span { color: var(--blue); font-size: 1.5rem; }
.library-stats strong { color: #fff; font-size: 1.35rem; margin: 6px 0 2px; }
.library-stats small { color: var(--muted); }
.library-tools { display: flex; gap: 10px; margin-bottom: 18px; }
.library-tools button, .import-label { flex: 1; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 12px; min-height: 44px; display: grid; place-items: center; font-size: .78rem; }
.import-label input { display: none; }
.library-list { display: grid; gap: 10px; }
.library-item { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--bg-2); }
.library-item button { border: 0; background: transparent; text-align: left; padding: 0; width: 100%; }
.library-item .item-ref { color: var(--blue); font-size: .76rem; font-weight: 800; letter-spacing: .04em; margin-bottom: 6px; }
.library-item p { margin: 0; color: #d0d4d5; line-height: 1.5; font-family: var(--reader-font); }
.library-item small { display: block; color: var(--muted-2); margin-top: 8px; }
.library-empty { text-align: center; padding: 70px 10px; color: var(--muted); }

.listen-scroll { display: grid; align-content: center; justify-items: center; text-align: center; min-height: 100%; }
.listen-art { width: 140px; height: 140px; border-radius: 30px; display: grid; place-items: center; background: radial-gradient(circle at 35% 25%, rgba(105,169,189,.25), transparent 35%), #2c2f30; border: 1px solid rgba(186,168,123,.22); box-shadow: 0 24px 60px rgba(0,0,0,.25); margin-bottom: 30px; }
.listen-art span { font-size: 76px; padding-right: 8px; }
.listen-view .page-lead { text-align: center; }
.listen-now { margin-top: 12px; display: grid; justify-items: center; gap: 8px; }
.listen-now small { color: var(--muted); }
.listen-now strong { font-size: 1.3rem; }
.play-button { width: 68px; height: 68px; border-radius: 50%; border: 1px solid rgba(105,169,189,.4); background: var(--blue-soft); display: grid; place-items: center; margin-top: 10px; }
.play-button svg { width: 30px; fill: var(--blue); }

.search-scroll { padding-top: 0; }
.search-head { min-height: 88px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); margin: 0 calc(clamp(24px, 7vw, 78px) * -1) 26px; padding: 0 clamp(24px, 7vw, 78px); }
.search-head h1 { grid-column: 2; grid-row: 1; justify-self: center; align-self: center; font-size: 1.28rem; letter-spacing: 0; margin: 0; }
.search-head #search-close { grid-column: 1; grid-row: 1; justify-self: start; align-self: center; color: #d9dddf; }
.search-head #search-close svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.search-field { display: grid; grid-template-columns: 30px minmax(0,1fr) 34px; align-items: center; gap: 8px; background: #111314; border-radius: 10px; min-height: 58px; padding: 0 14px; }
.search-field svg { width: 21px; height: 21px; fill: none; stroke: #abb1b3; stroke-width: 1.7; }
.search-field input { border: 0; outline: none; background: transparent; color: #e1e4e5; font-size: 1.03rem; min-width: 0; }
.search-field input::placeholder { color: #61676a; }
.search-field button { border: 0; width: 28px; height: 28px; border-radius: 50%; background: #000; color: #cfd3d4; display: grid; place-items: center; font-size: 1.25rem; }
.search-filter { margin: 14px 0 26px; }
.recent-searches h2, .search-results h2 { font-family: var(--reader-font); font-size: 1.3rem; font-style: italic; font-weight: 500; color: #aeb4b6; margin: 0 0 12px; }
.recent-searches button { display: block; width: 100%; border: 0; background: transparent; text-align: left; color: #d7dadd; font-size: 1.05rem; font-weight: 700; padding: 11px 0; }
.search-result { padding: 18px 0; border-top: 1px solid var(--line); }
.search-result:first-of-type { border-top: 0; }
.search-result button { border: 0; background: transparent; text-align: left; width: 100%; padding: 0; }
.search-result strong { display: block; color: #b6bbbd; font-size: .9rem; margin-bottom: 8px; }
.search-result p { font-family: var(--reader-font); margin: 0; font-size: 1.06rem; line-height: 1.6; color: #d6dadb; }
.search-result mark { background: transparent; color: var(--blue); font-weight: 800; }
.search-message { color: var(--muted); padding: 20px 0; }

.bottom-nav {
  height: calc(76px + var(--safe-bottom));
  padding: 0 8px var(--safe-bottom);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  background: rgba(28,31,32,.98);
  position: relative;
  z-index: 35;
}
.bottom-nav button { border: 0; background: transparent; color: #9ca2a5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; font-size: .66rem; font-weight: 700; }
.bottom-nav button.is-active { color: var(--blue); }
.nav-icon { height: 31px; display: grid; place-items: center; }
.nav-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; stroke-linecap: round; }
.bottom-nav button:nth-child(3) .nav-icon svg path { fill: none; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 60; backdrop-filter: blur(2px); }
.sheet {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 0;
  width: min(100%, 880px);
  max-height: calc(100dvh - var(--safe-top) - 30px);
  transform: translate(-50%, 105%);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
  border-radius: 26px 26px 0 0;
  background: #272a2b;
  box-shadow: 0 -16px 60px rgba(0,0,0,.35);
  overflow: hidden;
  padding-bottom: var(--safe-bottom);
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet-handle { width: 42px; height: 5px; border-radius: 99px; background: #5d6365; margin: 10px auto 8px; }
.sheet-location, .settings-heading { min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); }
.sheet-location span { color: var(--blue); font-size: 1.15rem; font-weight: 700; }
.sheet-close { border: 0; background: transparent; font-size: 1.8rem; color: var(--muted); min-width: 44px; min-height: 44px; }
.testament-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.testament-tabs button { min-height: 66px; border: 0; background: transparent; color: var(--muted); font-size: 1rem; font-weight: 700; border-bottom: 2px solid transparent; }
.testament-tabs button.is-active { color: #e7e9ea; border-bottom-color: var(--blue); }
.book-picker { max-height: calc(100dvh - 190px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 24px 80px; }
.book-row { border-bottom: 1px solid rgba(255,255,255,.05); }
.book-row > button { width: 100%; min-height: 62px; border: 0; background: transparent; text-align: left; color: #9da3a5; font-size: 1.2rem; padding: 0; display: flex; justify-content: space-between; align-items: center; }
.book-row > button.is-current { color: var(--blue); font-weight: 700; }
.book-row > button span:last-child { font-size: .72rem; color: var(--muted-2); }
.chapter-grid { display: none; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; padding: 0 0 16px; }
.book-row.is-expanded .chapter-grid { display: grid; }
.chapter-grid button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; background: #202324; color: #c8ccce; font-weight: 700; }
.chapter-grid button.is-current { background: var(--blue); border-color: var(--blue); color: #152126; }

.compact-sheet { width: min(calc(100% - 32px), 540px); bottom: calc(86px + var(--safe-bottom)); border-radius: 22px; padding-bottom: 0; }
.options-sheet > button { width: 100%; min-height: 70px; border: 0; background: transparent; padding: 0 22px; display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; }
.options-sheet > button + button { border-top: 1px solid var(--line); }
.options-sheet svg { width: 25px; height: 25px; fill: none; stroke: #edf0f1; stroke-width: 1.8; }
.settings-heading h2 { margin: 0; font-size: 1.15rem; }
.setting-row { min-height: 76px; border-bottom: 1px solid var(--line); padding: 14px 22px; display: grid; grid-template-columns: 98px minmax(0,1fr) 40px; gap: 12px; align-items: center; color: #d7dbdc; }
.setting-row > span { font-size: .88rem; }
.setting-row input[type="range"] { width: 100%; accent-color: var(--blue); }
.setting-row output { color: var(--blue); text-align: right; font-size: .8rem; }
.setting-buttons { grid-template-columns: 98px 1fr; }
.setting-buttons > div { display: grid; grid-template-columns: 1fr 1fr; border-radius: 9px; background: #181a1b; padding: 3px; }
.setting-buttons button { min-height: 38px; border: 0; background: transparent; color: var(--muted); border-radius: 7px; }
.setting-buttons button.is-active { background: #363a3b; color: #fff; }
.note-sheet { padding-bottom: 16px; }
.note-context { margin: 16px 18px 0; color: var(--muted); font-family: var(--reader-font); font-style: italic; line-height: 1.5; max-height: 80px; overflow: hidden; }
.note-sheet textarea { width: calc(100% - 36px); margin: 14px 18px; resize: vertical; min-height: 130px; background: #181a1b; color: #e3e6e7; border: 1px solid var(--line); border-radius: 12px; padding: 14px; outline: none; }
.primary-button { width: calc(100% - 36px); margin: 0 18px; min-height: 48px; border: 0; border-radius: 10px; background: var(--gold); color: #232526; font-weight: 800; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 100; opacity: 0; pointer-events: none; background: #3b3f40; color: #f0f2f2; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; font-size: .8rem; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.3); transition: .2s ease; white-space: nowrap; max-width: calc(100vw - 40px); overflow: hidden; text-overflow: ellipsis; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }

@media (min-width: 720px) {
  .reader-header { grid-template-columns: 70px minmax(0,1fr) 70px; padding-left: 28px; padding-right: 28px; }
  .scripture { padding-top: 44px; }
  .bottom-nav { width: min(620px, calc(100% - 48px)); left: 50%; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; }
  .main-stage { height: calc(100dvh - 76px - var(--safe-top)); padding-bottom: calc(76px + var(--safe-bottom)); }
  .home-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .home-chapter-grid, .auto-chapters { grid-template-columns: repeat(10, minmax(0,1fr)); }
  .page-scroll { padding-top: 56px; }
  .chapter-grid { grid-template-columns: repeat(10, minmax(0,1fr)); }
  .library-stats { max-width: 640px; }
}

@media (min-width: 1020px) {
  body { background: #17191a; }
  .app-shell { border-left: 1px solid rgba(255,255,255,.05); border-right: 1px solid rgba(255,255,255,.05); box-shadow: 0 0 80px rgba(0,0,0,.25); }
  .scripture { font-size: var(--reader-size); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}


/* Mobile sheet and notes UX, 2026-08-26 */
.sheet {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 28px));
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .18s ease, visibility 0s linear .28s;
}
.sheet.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
}
.compact-sheet-heading {
  min-height: 52px;
  padding: 0 14px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.compact-sheet-heading strong { font-size: .83rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.options-sheet > .compact-sheet-heading + button { border-top: 0; }
.selection-toolbar { max-width: calc(100vw - 28px); }
.selection-dismiss { width: 42px; padding-left: 0 !important; padding-right: 0 !important; color: var(--muted) !important; font-size: 1.2rem !important; }

.note-sheet {
  width: min(100%, 680px);
  max-height: min(88dvh, 780px);
  bottom: 0;
  border-radius: 26px 26px 0 0;
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr) auto;
}
.note-sheet-heading {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 22px;
  border-bottom: 1px solid var(--line);
}
.note-sheet-heading small { display: block; color: var(--blue); font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 2px; }
.note-sheet-heading h2 { margin: 0; font-size: 1.15rem; }
.note-editor-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px; }
.note-field { display: grid; gap: 7px; margin-bottom: 16px; }
.note-field > span, .note-verse-picker label > span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.note-field input, .note-field textarea, .note-verse-picker select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #181a1b;
  color: #e5e7e8;
  outline: 0;
}
.note-field input { min-height: 48px; padding: 0 13px; }
.note-field textarea { min-height: 150px; padding: 13px; resize: vertical; }
.note-field input:focus, .note-field textarea:focus, .note-verse-picker select:focus { border-color: rgba(105,169,189,.65); box-shadow: 0 0 0 3px rgba(105,169,189,.08); }
.note-reference-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(105,169,189,.18);
  border-radius: 14px;
  background: rgba(105,169,189,.06);
  margin-bottom: 10px;
}
.note-reference-card small { display: block; color: var(--muted); font-size: .66rem; margin-bottom: 3px; }
.note-reference-card strong { color: var(--blue); font-size: .95rem; }
.note-reference-card button { border: 0; background: transparent; color: var(--blue); font-size: .76rem; font-weight: 800; padding: 8px; }
.note-verse-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.note-verse-picker[hidden] { display: none; }
.note-verse-picker label { display: grid; gap: 6px; }
.note-verse-picker select { min-height: 44px; padding: 0 10px; }
.note-context { margin: 0 0 16px; padding: 12px 14px; max-height: 132px; overflow-y: auto; border-left: 2px solid rgba(105,169,189,.5); background: rgba(255,255,255,.025); border-radius: 0 10px 10px 0; color: #afb5b7; font-style: normal; font-size: .88rem; line-height: 1.5; }
.note-context.is-empty { color: var(--muted-2); border-left-color: rgba(255,255,255,.12); }
.note-body-field { margin-bottom: 8px; }
.note-storage-hint { color: var(--muted-2); font-size: .72rem; line-height: 1.45; margin: 8px 2px 0; }
.note-actions { display: flex; gap: 10px; padding: 12px 18px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: #272a2b; }
.note-actions .primary-button { flex: 1; width: auto; margin: 0; }
.danger-button { min-height: 48px; border: 1px solid rgba(217,138,135,.3); border-radius: 10px; padding: 0 15px; background: transparent; color: var(--danger); font-weight: 700; }

.note-library-item { padding: 0; overflow: hidden; }
.note-card-main { padding: 16px !important; }
.note-card-title { color: #eef0f1; font-size: 1.03rem; font-weight: 800; margin-bottom: 4px; }
.note-card-actions { display: grid; grid-template-columns: 1fr auto auto; border-top: 1px solid var(--line); }
.note-card-actions button { border: 0; background: transparent; min-height: 42px; padding: 0 12px; color: var(--blue); font-size: .72rem; font-weight: 700; }
.note-card-actions button:first-child { text-align: left; }
.note-card-actions .danger-link { color: var(--danger); }

/* Keep the Home search compact on web while filling the phone naturally. */
.home-search-page { max-width: 820px; margin-left: auto; margin-right: auto; }
.home-search-field { width: min(100%, 660px); min-height: 54px; border-radius: 14px; }
.home-search-suggestions, .home-search-help { width: min(100%, 660px); }
@media (max-width: 719px) {
  .home-search-page { padding-top: 28px; }
  .home-search-page h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .home-search-field, .home-search-suggestions, .home-search-help { width: 100%; }
  .note-sheet { max-height: calc(94dvh - var(--safe-top)); }
}

.note-field textarea { margin: 0; }


/* Share system and app information links */
.reader-header { grid-template-columns: 52px minmax(0, 1fr) 132px; }
.header-actions { justify-self: end; display: flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 128px; }
.header-actions .icon-button { min-width: 42px; min-height: 42px; }
.header-search-button, .header-share-button { color: var(--muted); }
.header-search-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.header-share-button svg, .share-primary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.info-button { display: none; text-decoration: none; color: var(--blue); font-family: Georgia, serif; font-size: 1.05rem; font-weight: 700; border: 1px solid rgba(105,169,189,.32); border-radius: 50%; width: 34px; height: 34px; min-width: 34px !important; min-height: 34px !important; }
.home-learn-more { width: min(100%, 700px); display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; margin: 24px 0 16px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); text-decoration: none; }
.home-learn-more:hover { border-color: rgba(105,169,189,.42); background: rgba(105,169,189,.05); }
.home-learn-icon { width: 32px; height: 32px; border: 1px solid rgba(105,169,189,.38); border-radius: 50%; display: grid; place-items: center; color: var(--blue); font-family: Georgia, serif; font-weight: 700; }
.home-learn-more strong { display: block; color: #e8ebec; font-size: .9rem; }
.home-learn-more small { display: block; color: var(--muted-2); margin-top: 2px; font-size: .72rem; }
.home-learn-more > span:last-child { color: var(--blue); }

.selection-toolbar { max-width: calc(100vw - 24px); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.selection-toolbar button { flex: 0 0 auto; }
.selection-toolbar .selection-dismiss { position: sticky; right: 0; background: #3a3d3e; }

.share-sheet { padding-bottom: 12px; }
.share-sheet-heading { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 8px 22px; border-bottom: 1px solid var(--line); }
.share-sheet-heading small { display: block; color: var(--blue); font-size: .65rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 2px; }
.share-sheet-heading h2 { margin: 0; color: #eef0f1; font-size: 1.16rem; }
.share-sheet-body { padding: 16px 18px 8px; }
.share-sheet blockquote { margin: 0 0 16px; max-height: 130px; overflow: auto; color: #d6dadb; font-family: var(--reader-font); font-size: 1.02rem; line-height: 1.55; border-left: 2px solid rgba(105,169,189,.55); padding-left: 14px; }
.share-mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin: 0 0 15px; background: #17191a; border-radius: 11px; }
.share-mode-options[hidden] { display: none; }
.share-mode-options button { min-height: 42px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .8rem; font-weight: 800; }
.share-mode-options button.is-active { background: #343839; color: #f1f2f2; }
.share-link-label > span { display: block; margin: 0 0 7px; color: var(--muted-2); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.share-link-row { display: grid; grid-template-columns: minmax(0,1fr) 48px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #17191a; }
.share-link-row input { min-width: 0; height: 48px; border: 0; outline: none; background: transparent; color: #bac0c2; padding: 0 12px; font-size: .76rem; }
.share-link-row button { border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--blue); display: grid; place-items: center; }
.share-link-row svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.share-primary { margin: 12px 0 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; }
.share-primary svg { width: 19px; height: 19px; }
.share-privacy { margin: 11px 2px 0; color: var(--muted-2); font-size: .69rem; line-height: 1.45; }
.scripture mark.way-shared-highlight { background: rgba(105,169,189,.28); color: inherit; border-bottom: 2px solid rgba(105,169,189,.9); border-radius: .08em; }

@media (min-width: 720px) {
  .reader-header { grid-template-columns: 70px minmax(0,1fr) 108px; }
}


/* Remembered reading themes */
:root[data-reader-theme="paper"] {
  color-scheme: light;
  --bg: #f3eee6; --bg-2: #ebe4da; --bg-3: #e1d8cc; --panel: #fffaf3; --panel-2: #e8e0d5;
  --text: #332f2a; --muted: #70685e; --muted-2: #91877a; --line: rgba(58,49,39,.16);
  --blue: #7b6048; --blue-soft: rgba(123,96,72,.12); --gold: #8a704b; --highlight: rgba(184,149,91,.29);
  --surface-glass: rgba(243,238,230,.97); --field: #fffaf3; --active: #ded4c7; --inverse-text: #fff;
}
:root[data-reader-theme="mist"] {
  color-scheme: light;
  --bg: #edf0ef; --bg-2: #e3e8e7; --bg-3: #d6dddc; --panel: #f9fbfa; --panel-2: #dfe5e4;
  --text: #283234; --muted: #687477; --muted-2: #899396; --line: rgba(37,54,58,.15);
  --blue: #477584; --blue-soft: rgba(71,117,132,.12); --gold: #827151; --highlight: rgba(111,151,163,.25);
  --surface-glass: rgba(237,240,239,.97); --field: #f9fbfa; --active: #d3dcda; --inverse-text: #fff;
}
:root[data-reader-theme="cream"] {
  color-scheme: light;
  --bg: #fff5e5; --bg-2: #f5ead8; --bg-3: #eaddc9; --panel: #fffaf0; --panel-2: #eee1ce;
  --text: #3b3328; --muted: #786e60; --muted-2: #988c7b; --line: rgba(63,49,31,.15);
  --blue: #816247; --blue-soft: rgba(129,98,71,.12); --gold: #947549; --highlight: rgba(207,170,102,.3);
  --surface-glass: rgba(255,245,229,.97); --field: #fffaf0; --active: #eadcc8; --inverse-text: #fff;
}
:root[data-reader-theme="charcoal"] {
  --surface-glass: rgba(31,34,35,.97); --field: #17191a; --active: #363a3b; --inverse-text: #fff;
}
:root[data-reader-theme="navy"] {
  color-scheme: dark;
  --bg: #172638; --bg-2: #1c2d42; --bg-3: #24384f; --panel: #203248; --panel-2: #101c2a;
  --text: #e8eef4; --muted: #a2b0bd; --muted-2: #74869a; --line: rgba(219,233,246,.15);
  --blue: #8bc3df; --blue-soft: rgba(139,195,223,.14); --gold: #c9b483; --highlight: rgba(139,195,223,.27);
  --surface-glass: rgba(23,38,56,.97); --field: #101c2a; --active: #30475e; --inverse-text: #fff;
}
:root[data-reader-theme="black"] {
  color-scheme: dark;
  --bg: #090a0b; --bg-2: #101213; --bg-3: #181a1b; --panel: #111314; --panel-2: #050606;
  --text: #f0f1f1; --muted: #a7abad; --muted-2: #73787a; --line: rgba(255,255,255,.15);
  --blue: #9bc5d0; --blue-soft: rgba(155,197,208,.13); --gold: #c2b184; --highlight: rgba(194,177,132,.3);
  --surface-glass: rgba(9,10,11,.97); --field: #050606; --active: #282b2c; --inverse-text: #fff;
}

html, body, .app-shell, .page-view { background: var(--bg); }
.reader-header, .bottom-nav { background: var(--surface-glass, rgba(31,34,35,.97)); }
.sheet, .note-actions { background: var(--panel); }
.scripture { color: var(--text); }
.scripture sup, .scripture .verse-num, .scripture [class*="verse"] sup { color: var(--muted); }
.page-view h1, .home-learn-more strong, .note-card-title, .share-sheet-heading h2 { color: var(--text); }
.home-search-field, .search-field, .setting-buttons > div, .chapter-grid button,
.note-field input, .note-field textarea, .note-verse-picker select, .share-mode-options, .share-link-row { background: var(--field, var(--panel-2)); color: var(--text); }
.setting-buttons button.is-active, .share-mode-options button.is-active { background: var(--active, var(--bg-3)); color: var(--text); }
.bottom-nav button { color: var(--muted); }
.testament-tabs button.is-active, .selection-toolbar button { color: var(--text); }
.book-row > button, .chapter-grid button, .setting-row, .share-sheet blockquote, .share-link-row input { color: var(--text); }
.selection-toolbar, .selection-toolbar .selection-dismiss { background: var(--active, var(--bg-3)); }
.home-learn-more, .note-context { background: var(--blue-soft); }

.theme-setting { border: 0; margin: 0; padding: 18px 22px 22px; }
.theme-setting legend { padding: 0; color: var(--muted); font-size: .88rem; font-weight: 700; }
.theme-options { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.theme-option {
  position: relative; min-width: 0; aspect-ratio: .72; border: 2px solid transparent; border-radius: 12px;
  padding: 13px 8px 8px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  box-shadow: inset 0 0 0 1px rgba(127,127,127,.18); cursor: pointer;
}
.theme-option:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
.theme-option.is-active { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.theme-option small { font-size: .58rem; font-weight: 800; white-space: nowrap; }
.theme-lines { width: 78%; height: 27px; opacity: .8; background: linear-gradient(currentColor 0 0) 0 0/100% 3px no-repeat, linear-gradient(currentColor 0 0) 0 10px/82% 3px no-repeat, linear-gradient(currentColor 0 0) 0 20px/60% 3px no-repeat; border-radius: 2px; }
.theme-check { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; opacity: .2; font-size: .9rem; font-weight: 900; }
.theme-option.is-active .theme-check { opacity: 1; }
.theme-paper { background: #f3eee6; color: #332f2a; }
.theme-mist { background: #edf0ef; color: #283234; }
.theme-cream { background: #fff5e5; color: #3b3328; }
.theme-charcoal { background: #293031; color: #e8ecec; }
.theme-navy { background: #172b41; color: #e8eef4; }
.theme-black { background: #090a0b; color: #f0f1f1; }

@media (max-width: 480px) {
  .settings-sheet { width: min(calc(100% - 20px), 540px); }
  .theme-setting { padding-left: 16px; padding-right: 16px; }
  .theme-options { gap: 6px; }
  .theme-option { border-radius: 10px; padding: 11px 5px 7px; }
  .theme-option small { font-size: .52rem; }
}


/* Continuous reader and reversible multi-verse highlights */
.reader-chapter { display: block; }
.reader-chapter + .reader-chapter {
  margin-top: 3.6em;
  padding-top: 3em;
  border-top: 1px solid var(--line);
}
.reader-chapter .chapter-title {
  margin: 0 0 1.5em;
  color: var(--blue);
  font-family: var(--ui-font);
  font-size: .72em;
  font-weight: 800;
  letter-spacing: .04em;
}
.reader-end {
  margin: 4em 0 1em !important;
  padding-top: 2em;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}
.scripture mark.way-highlight {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.scripture mark.way-highlight:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.selection-toolbar .unhighlight-action[hidden] { display: none; }
.selection-toolbar.is-highlight-menu [data-selection-action]:not([data-selection-action="unhighlight"]):not([data-selection-action="dismiss"]) { display: none; }
.selection-toolbar.is-highlight-menu .unhighlight-action {
  display: block;
  color: var(--inverse-text, #fff);
}


/* Temporary search-result locator: navigation UI only; never alters Scripture text. */
.scripture .search-verse-target {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.scripture .search-verse-target:focus,
.scripture .search-verse-target:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
}
