:root { color-scheme: light; --ink: #17243a; --muted: #62718a; --paper: #fffdf8; --line: #dce3ed; --blue: #12325f; --blue-soft: #eaf1fb; --gold: #cc9a35; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Georgia, 'Times New Roman', serif; }
button, input { font: inherit; }
.bible-shell { display: grid; width: 100%; max-width: 100%; grid-template-columns: minmax(268px, 340px) minmax(0, 1fr); min-height: 100vh; overflow-x: clip; }
.bible-sidebar { position: sticky; top: 0; height: 100vh; overflow: auto; padding: 1.25rem; border-right: 1px solid var(--line); background: #fff; }
.bible-nav-backdrop, .mobile-nav-heading { display: none; }
.library-tools { display: block; }
.download-panel { margin: 1.2rem 0; padding: .9rem; border: 1px solid #cbd9ed; border-radius: .7rem; background: var(--blue-soft); font-family: system-ui, sans-serif; }
.download-panel strong { color: var(--blue); font-size: .9rem; }
.download-panel p { margin: .35rem 0 .75rem; color: var(--muted); font-size: .78rem; line-height: 1.35; }
#downloadButton { border: 0; border-radius: .45rem; background: var(--blue); color: white; cursor: pointer; font-family: system-ui, sans-serif; font-size: .8rem; font-weight: 700; padding: .6rem .75rem; }
#downloadButton:disabled { opacity: .65; cursor: wait; }
.download-progress { margin-top: .8rem; }
.download-progress-label { display: flex; justify-content: space-between; gap: .6rem; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.download-progress-label strong { color: var(--blue); font-size: .75rem; white-space: nowrap; }
.download-progress-track { height: .42rem; margin-top: .35rem; overflow: hidden; border-radius: 999px; background: #cbd9ed; }
.download-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #1e814c; transition: width .12s linear; }
.download-complete { color: #176a3d !important; font-weight: 700; }
.search-box { display: block; margin-bottom: 1rem; font-family: system-ui, sans-serif; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.search-box input { width: 100%; margin-top: .4rem; padding: .65rem .7rem; border: 1px solid var(--line); border-radius: .4rem; background: white; color: var(--ink); font-size: .88rem; text-transform: none; }
.bible-navigation { font-family: system-ui, sans-serif; font-size: .85rem; }
.search-nav-status { margin: 0 0 .5rem; padding: .45rem .35rem; color: var(--muted); font-family: system-ui, sans-serif; font-size: .72rem; font-weight: 700; }
.search-nav-item { border: 1px solid #d9e4f1; background: #f8fbff; }
.search-nav-item + .search-nav-item { margin-top: .35rem; }
.nav-group { margin: .08rem 0; }
.nav-item { display: flex; width: 100%; gap: .45rem; align-items: center; padding: .37rem .35rem; border: 0; border-radius: .3rem; background: transparent; color: #31415a; cursor: pointer; text-align: left; }
.nav-item:hover, .nav-item.active { background: #e5edf8; color: var(--blue); }
.nav-children { margin-left: .55rem; padding-left: .55rem; border-left: 1px solid #d8e1ee; }
.nav-toggle { width: 1.1rem; color: #8291a9; font-size: .75rem; }
.reader { min-width: 0; max-width: 100%; overflow-x: clip; }
.reader-content { width: min(850px, 100%); max-width: 100%; margin: 0 auto; padding: clamp(1.7rem, 5vw, 4rem); overflow-wrap: anywhere; font-size: 1.04rem; line-height: 1.82; }
.reader-content h1, .reader-content h2, .reader-content h3 { color: var(--blue); line-height: 1.2; }
.reader-content h1 { font-size: clamp(2rem, 5vw, 3.2rem); text-align: center; }
.reader-content h2 { margin-top: 2rem; font-size: 1.6rem; }
.reader-content p { margin: 0 0 1.15rem; }
.reader-content img { max-width: 100%; height: auto; }
.reader-content a { color: #1c5eae; }
.reader-content span, .reader-content a, .reader-content td, .reader-content th { max-width: 100%; overflow-wrap: anywhere; word-break: normal; white-space: normal; }
.reader-content table { width: 100% !important; max-width: 100% !important; table-layout: fixed; }
.reader-content pre { max-width: 100%; overflow-wrap: anywhere; white-space: pre-wrap; }
.reader-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: 4rem; padding-top: 1.35rem; border-top: 1px solid var(--line); font-family: system-ui, sans-serif; }
.reader-pager-button { display: grid; gap: .24rem; min-height: 4.8rem; padding: .9rem 1rem; border: 1px solid #cbd9ed; border-radius: .6rem; background: #fff; color: var(--blue); cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.reader-pager-button.next { text-align: right; }
.reader-pager-button span { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.reader-pager-button strong { font-family: Georgia, 'Times New Roman', serif; font-size: 1rem; }
.reader-pager-button:hover:not(:disabled) { border-color: #86a9d4; background: #f5f9ff; transform: translateY(-1px); }
.reader-pager-button:disabled { opacity: .42; cursor: default; }
.loading { padding: 4rem 0; color: var(--muted); font-family: system-ui, sans-serif; text-align: center; }
.download-panel { margin-top: 0; }
.download-panel.is-done { border-color: #bfe1cb; background: #eef8f1; }
.download-panel.is-done strong { color: #176a3d; }
.download-panel.is-done p { margin-bottom: 0; }
.nav-item.search-nav-item { display: block; }
/* Top bar: current chapter + Download button (sticky on wide screens, fixed on phones). */
.reader-top { position: sticky; z-index: 3; top: 0; display: flex; align-items: center; gap: .7rem; min-height: 3.4rem; padding: .5rem clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line); background: rgba(255,253,248,.96); backdrop-filter: blur(8px); font-family: system-ui, sans-serif; }
.menu-burger { display: none; flex: 0 0 auto; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0; border: 1px solid var(--line); border-radius: .55rem; background: #fff; color: var(--blue); font-size: 1.35rem; line-height: 1; cursor: pointer; }
.reader-top-title { flex: 1; min-width: 0; overflow: hidden; color: var(--blue); font-family: Georgia, serif; font-size: 1.05rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.top-download { flex: 0 0 auto; max-width: 11rem; overflow: hidden; padding: .5rem .8rem; border: 0; border-radius: .45rem; background: var(--blue); color: #fff; font-size: .78rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
/* Quick reference in the top bar: book, chapter and verse pickers. */
.quick-ref { display: flex; flex: 1; min-width: 0; align-items: center; gap: .4rem; }
.quick-ref select { min-width: 0; height: 2.4rem; padding: 0 1.6rem 0 .6rem; border: 1px solid var(--line); border-radius: .45rem; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%2312325f'/></svg>") no-repeat right .55rem center; color: var(--blue); font: 700 .92rem Georgia, serif; appearance: none; -webkit-appearance: none; cursor: pointer; }
.quick-ref #refBook { flex: 0 1 12rem; }
.quick-ref #refChapter, .quick-ref #refVerse { flex: 0 0 auto; }
.top-download:disabled { cursor: default; opacity: .85; }
.top-download.is-done { background: #eef8f1; color: #176a3d; }
/* Every book's title and chapter numbers look the same (the source styles them differently per book). */
.reader-content .bible-book-title { margin: 2.5rem 0 0; color: var(--blue); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.2; text-align: center; }
.reader-content .bible-chapter-number { margin: .6rem 0 1.4rem; color: var(--blue); font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 700; line-height: 1.2; text-align: center; }
.reader-content .bible-book-title:first-child { margin-top: 0; }
.reader-content .bible-book-title *, .reader-content .bible-chapter-number * { font: inherit; color: inherit; }
.ref-flash { background: #fde68a; border-radius: .2rem; transition: background 1s ease; }
@media (max-width: 760px) {
  .bible-shell { display: block; }
  .bible-nav-backdrop { display: block; position: fixed; z-index: 4; inset: 0; border: 0; background: rgba(9, 24, 47, .28); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .bible-nav-backdrop.visible { opacity: 1; pointer-events: auto; }
  .bible-sidebar { position: fixed; z-index: 5; top: 0; left: 0; width: min(340px, 88vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 15px 0 30px rgba(18,50,95,.16); }
  .bible-sidebar.open { transform: translateX(0); }
  .mobile-nav-heading { display: flex; align-items: center; justify-content: space-between; margin: -.1rem 0 1rem; padding: 0 .1rem .8rem; border-bottom: 1px solid var(--line); color: var(--blue); font-family: system-ui, sans-serif; font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .mobile-nav-heading button { display: grid; width: 2rem; height: 2rem; place-items: center; border: 0; border-radius: .4rem; background: #eef3fa; color: var(--blue); cursor: pointer; font-size: 1.55rem; line-height: 1; }
  .reader-top { position: fixed; top: 0; right: 0; left: 0; padding: calc(.5rem + env(safe-area-inset-top)) .9rem .5rem .6rem; }
  .menu-burger { display: grid; }
  .top-download { max-width: 6.5rem; padding: .5rem .55rem; font-size: .72rem; }
  .reader-top { gap: .4rem; }
  .quick-ref { gap: .3rem; }
  .quick-ref select { height: 2.3rem; padding: 0 1.3rem 0 .45rem; background-position: right .4rem center; font-size: .82rem; }
  .quick-ref #refBook { flex: 1 1 auto; max-width: 8.5rem; }
  .reader-content { padding: 4.6rem 1.2rem 2.5rem; font-size: 1rem; }
  .reader-pager { grid-template-columns: 1fr; gap: .55rem; }
}

/* New Bible version published: banner under the top bar. */
.update-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin: 0 auto; padding: .7rem clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid #f3d38a; background: #fff8e6; color: #5c4400; font-family: system-ui, sans-serif; font-size: .88rem; }
.update-banner button { flex: 0 0 auto; padding: .45rem .8rem; border: 0; border-radius: .45rem; background: var(--blue); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
@media (max-width: 760px) { .update-banner { position: fixed; z-index: 2; top: calc(3.4rem + env(safe-area-inset-top)); right: 0; left: 0; } }


/* Verse search results */
.verse-hit { display: block; text-align: left; }
.verse-hit strong { display: block; margin-bottom: .2rem; color: var(--ink); font-size: .82rem; }
.verse-hit span { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; font-weight: 400; }
.verse-hit mark { background: #fff1a8; color: inherit; border-radius: .15rem; padding: 0 .1rem; }
