:root {
  --bg: #f4f2f9;
  --surface: #ffffff;
  --surface-2: #ece8f6;
  --ink: #15121f;
  --ink-soft: #484260;
  --muted: #7a7590;
  --line: #e1dcec;
  --accent: #4b2bb3;
  --accent-2: #6d3fe0;
  --accent-ink: #ffffff;
  --gold: #d9960f;
  --gold-soft: #fff1d0;
  --mark: #ffe08a;
  --chrome: #15121f;
  --chrome-ink: #f4f1ff;
  --hero: radial-gradient(1200px 400px at 85% -10%, rgb(217 150 15 / .35), transparent 60%),
          radial-gradient(900px 500px at 0% 120%, rgb(109 63 224 / .55), transparent 60%),
          linear-gradient(135deg, #1a1236 0%, #2d1a6b 55%, #3f1f7f 100%);
  --shadow: 0 1px 2px rgb(30 20 60 / .06), 0 10px 30px rgb(30 20 60 / .08);
  --shadow-lg: 0 2px 4px rgb(30 20 60 / .08), 0 22px 50px rgb(30 20 60 / .16);
  --radius: 20px;
  /* Atkinson Hyperlegible Next (Braille Institute) for all reading and interface text;
     Fraunces only for large titles and the logo. */
  --legible: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --brand: "Fraunces", Georgia, serif;
  --display: var(--legible);
  --serif: var(--legible);
  --sans: var(--legible);
  --read-size: 19px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0b14; --surface: #171424; --surface-2: #221d35; --ink: #f1eefa; --ink-soft: #c3bdd9;
    --muted: #8e88a8; --line: #2c2643; --accent: #a48bff; --accent-2: #c2b1ff; --accent-ink: #120d22;
    --gold: #f5b83d; --gold-soft: #3a2c12; --mark: #6a4f12; --chrome: #0a0810; --chrome-ink: #f1eefa;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px rgb(0 0 0 / .3); --shadow-lg: 0 22px 50px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0b14; --surface: #171424; --surface-2: #221d35; --ink: #f1eefa; --ink-soft: #c3bdd9;
  --muted: #8e88a8; --line: #2c2643; --accent: #a48bff; --accent-2: #c2b1ff; --accent-ink: #120d22;
  --gold: #f5b83d; --gold-soft: #3a2c12; --mark: #6a4f12; --chrome: #0a0810; --chrome-ink: #f1eefa;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px rgb(0 0 0 / .3); --shadow-lg: 0 22px 50px rgb(0 0 0 / .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 var(--sans);
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-family: var(--brand); font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 900; letter-spacing: -.02em; }
h2 { font-size: 1.8rem; }

/* ---------- chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: var(--chrome); color: var(--chrome-ink);
  border-bottom: 1px solid rgb(255 255 255 / .06);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--chrome-ink); font: 800 1.3rem var(--brand); white-space: nowrap; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; }
.brand em { font-style: italic; font-weight: 600; color: var(--gold); }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a { color: rgb(244 241 255 / .75); padding: 8px 14px; border-radius: 999px; font-size: .92rem; font-weight: 600; }
.topnav a:hover { background: rgb(255 255 255 / .08); color: #fff; text-decoration: none; }
.topnav a.active { background: var(--gold); color: #1a1205; }
.icon-btn { background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); border-radius: 999px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; color: var(--chrome-ink); flex: none; }
.icon-btn:hover { background: rgb(255 255 255 / .14); }
.tabbar { display: none; }
#app { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 32px 16px 56px; outline: none; }
.site-footer { text-align: center; color: rgb(244 241 255 / .6); font-size: .82rem; padding: 26px 16px 30px; background: var(--chrome); }
.site-footer p { margin: 0; }

@media (max-width: 760px) {
  .topnav { display: none; }
  .brand { font-size: 1.12rem; margin-right: auto; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--chrome); border-top: 1px solid rgb(255 255 255 / .08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; font-weight: 600; color: rgb(244 241 255 / .55); padding: 4px 0; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg { width: 23px; height: 23px; fill: currentColor; }
  .tabbar a.active { color: var(--gold); }
  body { padding-bottom: 68px; }
  #app { padding-top: 22px; }
}

/* ---------- shared ---------- */
.eyebrow { font: 800 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 3px; background: var(--gold); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); padding: 10px 18px; border-radius: 999px; font: 700 .92rem var(--sans); cursor: pointer; transition: transform .12s, background .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.small { padding: 7px 14px; font-size: .84rem; }
.muted { color: var(--muted); }
.crumbs { font-size: .86rem; font-weight: 600; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--ink-soft); }
.crumbs span[aria-hidden] { opacity: .5; }
.page-head { margin-bottom: 26px; }
.page-head p { margin: 0; color: var(--ink-soft); font-size: 1.05rem; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- home ---------- */
.hero {
  text-align: center; color: #fff; background: var(--hero);
  margin: -32px calc(50% - 50vw) 36px; padding: 64px 16px 72px; position: relative;
}
.hero .date { display: inline-block; font: 700 .78rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #ffe2a3; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); padding: 6px 14px; border-radius: 999px; }
.hero h1 { margin: 18px auto 12px; font-size: clamp(2.5rem, 7.5vw, 4.6rem); max-width: 900px; color: #fff; }
.hero h1 .gold { color: var(--gold); font-style: italic; font-weight: 700; }
.hero p { color: rgb(255 255 255 / .78); max-width: 560px; margin: 0 auto; font-size: 1.08rem; }
.hero-search { max-width: 620px; margin: 30px auto 0; }
.hero .hero-search input { background: #fff; color: #15121f; border: none; box-shadow: 0 14px 40px rgb(0 0 0 / .3); padding: 16px 22px; }
.hero .hero-search .btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1205; box-shadow: 0 14px 40px rgb(0 0 0 / .3); padding: 0 26px; }
@media (max-width: 760px) { .hero { margin-top: -22px; padding: 44px 16px 52px; } }

.home-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; }
.home-grid .wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .home-grid { grid-template-columns: 1fr; } }

.quote-card { position: relative; overflow: hidden; border: none; color: #fff; padding: 38px 36px 30px; box-shadow: var(--shadow-lg);
  background: radial-gradient(700px 300px at 100% 0%, rgb(217 150 15 / .28), transparent 60%), linear-gradient(135deg, #241552, #3b1f7a); }
.quote-card .eyebrow { color: #ffe2a3; }
.quote-card blockquote { margin: 0; font: 600 clamp(1.4rem, 3.2vw, 2rem)/1.4 var(--legible); color: #fff; }
.quote-card blockquote::before { content: "“"; display: block; font: 900 6rem/.55 var(--brand); color: var(--gold); margin: 22px 0 8px; }
.quote-card .cite { margin-top: 18px; font-size: .95rem; font-weight: 600; color: rgb(255 255 255 / .75); }
.quote-card .cite a { color: #ffe2a3; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; align-items: center; }
.quote-card .btn { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .2); color: #fff; }
.quote-card .btn:hover { background: rgb(255 255 255 / .2); }
.quote-actions .spacer { flex: 1; }

.plan-card { border-top: 6px solid var(--accent); }
.plan-card h3 { font-size: 1.55rem; margin-bottom: 2px; }
.reading-list { list-style: none; padding: 0; margin: 16px 0 18px; display: grid; gap: 8px; }
.reading-list a { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; border-radius: 12px; background: var(--surface-2); color: var(--ink); font-weight: 600; border: 1.5px solid transparent; }
.reading-list a:hover { border-color: var(--accent); text-decoration: none; }
.reading-list .pages { color: var(--accent); font-size: .88rem; white-space: nowrap; font-weight: 700; }
.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: inherit; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.qa-card { border-top: 6px solid var(--gold); }
.qa-card .q { font: 700 1.4rem/1.3 var(--display); margin: 4px 0 16px; }
.qa-card .qtitle { font: 800 .74rem var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.answer { font: 400 1.02rem/1.65 var(--serif); color: var(--ink-soft); }
.answer p { margin: 0 0 .8em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
details.reveal summary { cursor: pointer; list-style: none; display: inline-flex; }
details.reveal summary::-webkit-details-marker { display: none; }
details.reveal[open] summary { margin-bottom: 14px; }
details.reveal[open] .when-closed, details.reveal:not([open]) .when-open { display: none; }

.continue { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-left: 6px solid var(--accent); }

/* ---------- library ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.cat-tile {
  --c1: #4b2bb3; --c2: #7a46e6;
  display: flex; flex-direction: column; gap: 6px; padding: 24px; min-height: 170px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(140deg, var(--c1), var(--c2)); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.cat-tile::after { content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: rgb(255 255 255 / .1); }
.cat-tile:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-tile:nth-child(7n+2) { --c1: #a3123a; --c2: #e0465f; }
.cat-tile:nth-child(7n+3) { --c1: #0b6e6e; --c2: #18a39a; }
.cat-tile:nth-child(7n+4) { --c1: #b45309; --c2: #e8a01a; }
.cat-tile:nth-child(7n+5) { --c1: #1d4ed8; --c2: #4f8cf7; }
.cat-tile:nth-child(7n+6) { --c1: #166534; --c2: #2fa35a; }
.cat-tile:nth-child(7n+7) { --c1: #334155; --c2: #64748b; }
.cat-tile .spine { width: 36px; height: 5px; border-radius: 5px; background: rgb(255 255 255 / .85); margin-bottom: 10px; }
.cat-tile h3 { font-size: 1.65rem; margin: 0; color: #fff; }
.cat-tile span { color: rgb(255 255 255 / .85); font-size: .88rem; font-weight: 600; margin-top: auto; }
.book-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.book-list li + li { border-top: 1px solid var(--line); }
.book-list a { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 20px; color: var(--ink); border-left: 4px solid transparent; transition: background .12s, border-color .12s; }
.book-list a:hover { background: var(--surface-2); border-left-color: var(--accent); text-decoration: none; }
.book-list .t { font: 700 1.15rem var(--display); }
.book-list .sub { display: block; font: 400 .98rem/1.4 var(--serif); color: var(--ink-soft); margin-top: 2px; }
.page-head .subtitle { font: 600 1.35rem/1.35 var(--display); color: var(--accent); margin-bottom: 6px; }
.book-list .n { color: var(--accent); font-size: .85rem; font-weight: 700; white-space: nowrap; }
.book-list .tag { font-size: .7rem; background: var(--gold-soft); color: var(--ink); padding: 2px 9px; border-radius: 99px; margin-left: 8px; font-family: var(--sans); font-weight: 700; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.page-grid a { display: grid; place-items: center; height: 50px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); font-weight: 700; font-size: .95rem; transition: background .1s, color .1s, border-color .1s; }
.page-grid a:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); text-decoration: none; }
.page-grid a.last { background: var(--gold); color: #1a1205; border-color: var(--gold); }
.jump { display: flex; gap: 8px; align-items: center; margin: 0 0 20px; flex-wrap: wrap; }
.jump input { width: 90px; }
input[type="number"], input[type="search"], input[type="text"] {
  font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 10px 14px;
}
input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }

/* ---------- reader ---------- */
.reader-bar { position: sticky; top: 59px; z-index: 10; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; margin-bottom: 14px; background: var(--bg); }
.reader-bar .title { font: 800 1.15rem var(--display); margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-bar .title a { color: var(--ink); }
.reader-bar select { font: inherit; font-size: .9rem; font-weight: 600; padding: 7px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.reader-bar .group { display: flex; gap: 4px; align-items: center; }
.reader {
  max-width: 760px; margin: 0 auto; padding: 44px 56px 34px; font: 400 var(--user-read-size, var(--read-size))/var(--read-lh, 1.75) var(--read-font, var(--serif)); letter-spacing: .005em;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.reader p { margin: 0 0 1em; text-wrap: pretty; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.reader h3 { font: 800 1.08em/1.3 var(--display); letter-spacing: .01em; text-align: center; margin: 1.5em 0 .8em; color: var(--accent); }
.reader .label { font: 800 .76em var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin: 1.4em 0 .35em; }
.reader .pageno { text-align: center; font: 800 .74rem var(--sans); color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 22px; }
.reader .empty { text-align: center; color: var(--muted); font-style: italic; padding: 50px 0; }
.pager { display: flex; justify-content: space-between; gap: 10px; max-width: 760px; margin: 22px auto 0; }
.pager .btn { min-width: 130px; justify-content: center; }
@media (max-width: 760px) {
  .reader-bar { top: 53px; }
  .reader { --read-size: 18px; padding: 26px 18px 18px; margin: 0 -6px; }
  .reader-bar .title { flex-basis: 100%; }
}

/* ---------- search ---------- */
.search-box { display: flex; gap: 8px; margin-bottom: 12px; }
.search-box input { flex: 1; font-size: 1.05rem; padding: 14px 20px; border-radius: 999px; min-width: 0; }
.ref-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 14px; padding: 13px 18px; border-radius: 14px; background: var(--gold-soft); border: 1.5px solid var(--gold); color: var(--ink); }
.ref-hint:hover { text-decoration: none; filter: brightness(1.03); }
.ref-hint span { color: var(--ink-soft); }
.ref-hint .enter { margin-left: auto; font-size: .8rem; font-weight: 700; color: var(--muted); }
.ref-hint[hidden] { display: none; }
.ref-help { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; box-shadow: var(--shadow); }
.ref-help summary { cursor: pointer; font-weight: 800; }
.ref-help table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.ref-help td { padding: 7px 10px 7px 0; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
.ref-help td:first-child { white-space: nowrap; }
.ref-help code, .tips code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; color: var(--accent); font-weight: 700; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: .84rem; font-weight: 600; cursor: pointer; color: var(--ink-soft); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.search-status { font-size: .9rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; min-height: 1.4em; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.results a { display: block; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s; }
.results a:hover { transform: translateX(3px); text-decoration: none; }
.results .where { font: 800 .85rem var(--sans); color: var(--accent); margin-bottom: 4px; }
.results .snip { font: 400 .98rem/1.55 var(--serif); color: var(--ink-soft); }
.tips { font-size: .9rem; color: var(--muted); }

/* ---------- plan ---------- */
.plan-summary { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.plan-summary .stat b { display: block; font: 900 2.2rem/1 var(--display); color: var(--accent); }
.plan-summary .stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.months { display: grid; gap: 26px; }
.month h3 { font-size: 1.5rem; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 3px solid var(--accent); display: inline-block; }
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.day { display: grid; grid-template-columns: auto 74px 1fr; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.day.today { border: 2px solid var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.day.done .what { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.day .d { font: 800 .82rem var(--sans); color: var(--ink-soft); }
.day .what { font-size: .92rem; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.day input { width: 19px; height: 19px; accent-color: var(--accent); margin: 0; }

/* ---------- Q&A list ---------- */
.qa-list { display: grid; gap: 10px; }
.qa-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.qa-item[open] { border-color: var(--accent); }
.qa-item summary { cursor: pointer; padding: 16px 20px; list-style: none; }
.qa-item summary::-webkit-details-marker { display: none; }
.qa-item summary .t { font: 800 .72rem var(--sans); color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.qa-item summary .q { font: 700 1.15rem/1.4 var(--display); display: block; margin-top: 3px; }
.qa-item .body { padding: 0 20px 18px; }
.qa-item .src { font-size: .86rem; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 999px; font-size: .9rem; font-weight: 600; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ---------- Bible verse & Ellen G. White links ---------- */
a.bref { color: inherit; text-decoration: underline dotted var(--gold); text-underline-offset: 3px; text-decoration-thickness: 2px; cursor: help; }
a.bref:hover, a.bref:focus-visible { color: var(--accent); text-decoration-style: solid; }
a.egwref { color: inherit; text-decoration: underline dotted var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; cursor: help; }
a.egwref:hover, a.egwref:focus-visible { color: var(--accent); text-decoration-style: solid; }
.vp-note { font-size: .82rem !important; }
.verse-pop {
  position: absolute; z-index: 60; width: min(440px, calc(100vw - 24px)); max-height: 360px; overflow: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 14px 18px 8px; text-align: left;
}
.verse-pop[hidden] { display: none; }
.vp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.vp-head strong { font: 800 1.15rem var(--display); }
.vp-head span { font: 800 .68rem var(--sans); letter-spacing: .12em; color: var(--accent-ink); background: var(--accent); padding: 3px 8px; border-radius: 6px; }
.vp-body p { font: 400 .98rem/1.55 var(--serif); margin: 0 0 .55em; }
.vp-body sup { font: 800 .68rem var(--sans); color: var(--gold); margin-right: 2px; }
.verse-pop.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 55vh; border-radius: 20px 20px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 70; }

/* ---------- highlights & notes ---------- */
:root { --hl-yellow: #ffe58a; --hl-green: #bdf0c4; --hl-blue: #c2dcff; --hl-pink: #ffc7dc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hl-yellow: #6b5714; --hl-green: #1f5a33; --hl-blue: #1f3f72; --hl-pink: #6e2346; } }
:root[data-theme="dark"] { --hl-yellow: #6b5714; --hl-green: #1f5a33; --hl-blue: #1f3f72; --hl-pink: #6e2346; }
mark.hl { color: inherit; border-radius: 3px; padding: 1px 0; cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hl-yellow { background: var(--hl-yellow); } .hl-green { background: var(--hl-green); }
.hl-blue { background: var(--hl-blue); } .hl-pink { background: var(--hl-pink); }
mark.hl.has-note::after { content: "✎"; font: 800 .7em var(--sans); color: var(--accent); vertical-align: super; margin-left: 2px; }
.hl-bar {
  position: absolute; z-index: 65; display: flex; align-items: center; gap: 6px; padding: 7px 8px;
  background: var(--chrome); color: var(--chrome-ink); border-radius: 999px; box-shadow: var(--shadow-lg);
}
.hl-bar[hidden] { display: none; }
.hl-bar.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); top: auto; }
.hl-bar .sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .85); cursor: pointer; padding: 0; }
.hl-bar .sw-yellow { background: #ffd84d; } .hl-bar .sw-green { background: #5fd27a; } .hl-bar .sw-blue { background: #5ea2ff; } .hl-bar .sw-pink { background: #ff7fae; }
.hl-bar .sw:hover { transform: scale(1.12); }
.hl-bar button.hb-note, .hl-bar button.hb-del { background: rgb(255 255 255 / .1); border: none; color: inherit; font: 700 .85rem var(--sans); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.hl-bar button.hb-del { color: #ff9db5; }
.hl-bar button:hover { background: rgb(255 255 255 / .2); }

.note-dlg { border: none; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.note-dlg::backdrop { background: rgb(10 8 20 / .55); }
.note-dlg form { padding: 22px; display: grid; gap: 12px; }
.note-dlg h3 { margin: 0; font-size: 1.2rem; }
.nd-quote { margin: 0; padding: 10px 14px; border-left: 4px solid var(--gold); background: var(--surface-2); border-radius: 8px; color: var(--ink-soft); font-size: .95rem; }
.note-dlg textarea { font: 400 1rem/1.5 var(--sans); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; resize: vertical; width: 100%; }
.note-dlg textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
.nd-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nd-del { color: #c0264f; }
.linklike { background: none; border: none; padding: 0; color: var(--accent); font: 700 .86rem var(--sans); cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: #c0264f; }

.page-notes { max-width: 760px; margin: 18px auto 0; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 16px; box-shadow: var(--shadow); }
.pn-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pn-item { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pn-item p { margin: 6px 0; white-space: pre-wrap; }
.pn-tip { margin: 10px 0 0; font-size: .9rem; }
.hlq { margin: 0; padding: 6px 10px; border-radius: 6px; font-size: .95rem; color: var(--ink); }

/* ---------- My Study page ---------- */
.study-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px; }
.study-tabs a { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .92rem; color: var(--ink-soft); white-space: nowrap; }
.study-tabs a:hover { text-decoration: none; color: var(--ink); }
.study-tabs a[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.study-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.study-tools input[type="search"] { flex: 1 1 260px; border-radius: 999px; padding: 11px 18px; }
.study-tools .chips { margin: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.study-book { margin-bottom: 26px; }
.study-book h3 { font-size: 1.25rem; padding-bottom: 6px; border-bottom: 3px solid var(--accent); display: inline-block; }
.study-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 10px; box-shadow: var(--shadow); }
.study-note { margin: 10px 0 0; white-space: pre-wrap; }
.pn-label { font: 800 .72rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.study-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: .88rem; font-weight: 700; }
.hist-day { margin-bottom: 22px; }
.hist-day h3 { font-size: 1.1rem; }
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hist-list a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.hist-list a:hover { border-color: var(--accent); text-decoration: none; }
.hist-list a > span:first-child { display: flex; gap: 10px; flex-wrap: wrap; }
.empty-state { padding: 30px 0; text-align: center; }
.backup-card h3 { font-size: 1.3rem; }
.backup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 760px) { .tabbar a { font-size: .64rem; } }

/* ---------- folders, favorites, account ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.title-row h1 { margin-bottom: 0; }
.page-head .title-row + p, .page-head .title-row + .subtitle { margin-top: 10px; }
.fav-btn { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: 8px 14px; font: 700 .9rem var(--sans); cursor: pointer; line-height: 1; }
.fav-btn:hover { border-color: var(--gold); color: var(--ink); }
.fav-btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--ink); }
.fav-btn.on, .fav-btn.on span { }
.fav-btn.compact { padding: 4px 9px; font-size: 1.05rem; margin-left: 8px; vertical-align: middle; }
.fav-btn.on::first-letter { color: var(--gold); }
.fav-ind { color: var(--gold); margin-right: 6px; }
.fav-row { display: flex; align-items: center; }
.fav-row a { flex: 1; min-width: 0; }
.fav-row .fav-btn { margin-right: 16px; }
.fav-card .fav-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fav-chip { padding: 9px 16px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 700; border: 1.5px solid transparent; }
.fav-chip:hover { border-color: var(--gold); text-decoration: none; }
.reader-bar .title { display: flex; align-items: center; }

.folder-bar { margin-bottom: 14px; }
.folder-chips { margin-bottom: 8px; }
.folder-chips .chip b { margin-left: 4px; opacity: .7; font-weight: 800; }
.folder-chip::before { content: ""; display: inline-block; width: 13px; height: 10px; margin-right: 7px; border-radius: 2px 2px 3px 3px; background: var(--gold); vertical-align: -1px;
  box-shadow: 3px -3px 0 -1px var(--gold); }
.chip-new { border-style: dashed; color: var(--accent); }
.folder-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 4px 2px 6px; }
.move select { font: 600 .84rem var(--sans); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; max-width: 170px; }
.folder-options { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.folder-opt { text-align: left; font: 700 .95rem var(--sans); color: var(--ink); background: var(--surface-2); border: 1.5px solid transparent; border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.folder-opt:hover { border-color: var(--accent); }
.folder-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.folder-new { display: flex; gap: 8px; }
.folder-new input { flex: 1; min-width: 0; }
.hl-bar button.hb-folder { background: rgb(255 255 255 / .1); border: none; color: inherit; font: 700 .85rem var(--sans); padding: 6px 12px; border-radius: 999px; cursor: pointer; }

#account { margin: -8px 0 20px; }
.account-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 16px; box-shadow: var(--shadow); }
.account-card.on { border-left-color: #2fa35a; }
.acct-text { display: grid; gap: 4px; flex: 1 1 280px; }
.acct-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2fa35a; margin-right: 8px; vertical-align: 1px; }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-form { display: flex; gap: 8px; flex: 1 1 360px; flex-wrap: wrap; }
.acct-form input { flex: 1 1 200px; border-radius: 999px; padding: 10px 16px; }
.acct-local { margin: 0; }
@media (max-width: 760px) { .tabbar a { font-size: .62rem; } }

/* ---------- sharing ---------- */
.share-btn { gap: 6px; }
.share-btn svg { flex: none; }
.title-row .share-btn span { display: inline; }
.qa-share { margin-top: 14px; }
.qa-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.share-dlg { width: min(560px, calc(100vw - 24px)); }
.share-dlg h3 { font-size: 1.2rem; }
.share-preview { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.share-preview blockquote { margin: 0; font-size: .98rem; line-height: 1.5; }
.share-cite { font-weight: 700; font-size: .88rem; color: var(--ink-soft); }
.share-url { font-size: .8rem; color: var(--accent); word-break: break-all; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.share-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); font: 700 .88rem var(--sans); cursor: pointer; text-align: left; }
.share-opt:hover { border-color: var(--accent); text-decoration: none; }
.si { flex: none; width: 32px; height: 32px; border-radius: 50%; position: relative; }
.si::after { content: ""; position: absolute; inset: 8px; background: #fff; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.si-link { background: #4b2bb3; --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10.6 13.4a4 4 0 0 0 5.7 0l3-3a4 4 0 1 0-5.7-5.7l-1 1 1.4 1.4 1-1a2 2 0 1 1 2.9 2.9l-3 3a2 2 0 0 1-2.9 0zm2.8-2.8a4 4 0 0 0-5.7 0l-3 3a4 4 0 1 0 5.7 5.7l1-1-1.4-1.4-1 1a2 2 0 1 1-2.9-2.9l3-3a2 2 0 0 1 2.9 0z'/></svg>"); }
.si-copy { background: #334155; --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8 3h11a2 2 0 0 1 2 2v11h-2V5H8zM5 7h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2z'/></svg>"); }
.si-wa { background: #25d366; --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2a10 10 0 0 0-8.7 15l-1.3 5 5.1-1.3A10 10 0 1 0 12 2zm-3 5.5c.3 0 .6 0 .8.5l.8 1.9c.1.3 0 .6-.2.8l-.6.7c.8 1.5 2 2.6 3.4 3.3l.7-.8c.2-.2.5-.3.8-.2l1.9.9c.4.2.5.5.4.8-.2 1.2-1.2 2-2.4 2C9.6 18.1 6 14.4 6 10.2c0-1.4.9-2.6 2.2-2.7z'/></svg>"); }
.si-fb { background: #1877f2; --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M14 8V6.5c0-.8.2-1.5 1.5-1.5H17V2h-2.5C11.6 2 11 4 11 6v2H9v3h2v11h3V11h2.6l.4-3z'/></svg>"); }
.si-x { background: #111111; --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 3h4.6l4.2 5.8L16.9 3H20l-6.6 7.7L21 21h-4.6l-4.6-6.3L6.3 21H3.2l7.1-8.2z'/></svg>"); }
.si-tg { background: #2aabee; --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M21.5 3.5 2.8 10.7c-1 .4-1 1.6 0 1.9l4.7 1.5 1.8 5.6c.2.7 1.1.9 1.6.4l2.6-2.4 4.9 3.6c.6.4 1.4.1 1.6-.6L23 4.7c.2-.9-.7-1.6-1.5-1.2zM9.5 14.2l8.6-7.7-6.9 9.2-.4 3z'/></svg>"); }
.si-mail { background: #d9960f; --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 5h18a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm9 7.5L20 7H4z'/></svg>"); }
.si-sms { background: #16a34a; --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 3h16a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2z'/></svg>"); }
.si-more { background: #64748b; --m: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm7 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm7 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4z'/></svg>"); }

.para-share { position: absolute; z-index: 30; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--accent); border: 1.5px solid var(--line); box-shadow: var(--shadow); }
.para-share:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.para-share[hidden] { display: none; }
@keyframes paraflash { 0%, 40% { background: color-mix(in srgb, var(--gold) 35%, transparent); } 100% { background: transparent; } }
.reader .flash { animation: paraflash 2.6s ease-out; border-radius: 6px; box-shadow: -10px 0 0 color-mix(in srgb, var(--gold) 35%, transparent), 10px 0 0 color-mix(in srgb, var(--gold) 35%, transparent); }
.hl-bar button.hb-share { background: rgb(255 255 255 / .1); border: none; color: inherit; font: 700 .85rem var(--sans); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.hl-bar.dock { flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 16px); border-radius: 22px; }
@media (max-width: 760px) {
  .hl-bar button.hb-note, .hl-bar button.hb-folder, .hl-bar button.hb-share, .hl-bar button.hb-del { padding: 6px 10px; font-size: .8rem; }
  .hl-bar .sw { width: 26px; height: 26px; }
  .reader-bar .share-btn span { display: none; }
}
.reader [data-i] { scroll-margin-top: 150px; }
@media (max-width: 760px) { .reader [data-i] { scroll-margin-top: 170px; } }

/* ---------- verse & testimony of the day, Bible reader ---------- */
.votd-card { border: none; color: #1a1205; box-shadow: var(--shadow-lg); padding: 34px 36px 28px;
  background: radial-gradient(600px 260px at 100% 0%, rgb(255 255 255 / .35), transparent 60%), linear-gradient(135deg, #f5c04f, #e19b14); }
.votd-card .eyebrow { color: #3b2400; }
.votd-card .eyebrow::before { background: #3b2400; }
.votd-text { display: block; color: #1a1205; font: 700 clamp(1.35rem, 3vw, 1.9rem)/1.4 var(--legible); }
.votd-text:hover { text-decoration: none; opacity: .85; }
.votd-text sup { font-size: .55em; margin: 0 3px 0 6px; opacity: .7; }
.votd-text .muted { color: #5a3d00; }
.votd-ref { margin-top: 14px; font: 800 1.05rem var(--sans); }
.votd-ref a { color: #3b2400; }
.votd-card .btn { background: rgb(255 255 255 / .45); border-color: rgb(59 36 0 / .25); color: #1a1205; box-shadow: none; }
.votd-card .btn.primary { background: #1a1205; border-color: #1a1205; color: #ffe2a3; }
.testi-card { border-left: 6px solid #2fa35a; }
.testi-card blockquote { margin: 0; font: 500 1.12rem/1.65 var(--legible); color: var(--ink); }
.testi-card blockquote::before { content: "“"; color: #2fa35a; font: 900 2.2rem/0 var(--brand); vertical-align: -.35em; margin-right: 4px; }
.testi-card .cite { margin-top: 14px; font-weight: 700; color: var(--ink-soft); }
.egw-badge { font: 800 .64rem var(--sans); letter-spacing: .1em; color: #fff; background: #2fa35a; padding: 2px 7px; border-radius: 5px; vertical-align: 2px; margin-left: 4px; }
.testi-where { margin-top: 4px; font-size: .9rem; color: var(--muted); }
.vp-more { margin-top: 8px !important; padding-top: 8px; border-top: 1px solid var(--line); font: 700 .88rem var(--sans) !important; }

.bible-tile { --c1: #1a1205 !important; --c2: #6b4a10 !important; }
.bible-testament { margin-bottom: 26px; }
.bible-testament h2 { font-size: 1.3rem; padding-bottom: 6px; border-bottom: 3px solid var(--accent); display: inline-block; }
.bible-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bible-books a { padding: 11px 14px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); font-weight: 700; }
.bible-books a:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); text-decoration: none; }
.bible-text .vs { margin: 0 0 .55em; text-align: left; hyphens: manual; padding: 2px 8px; border-radius: 8px; scroll-margin-top: 150px; }
.bible-text .vs sup { font: 800 .62em var(--sans); color: var(--gold); margin-right: 6px; }
.bible-text .vhl { background: color-mix(in srgb, var(--gold) 22%, transparent); box-shadow: inset 4px 0 0 var(--gold); }

/* ---------- believers' testimonies ---------- */
.believer-card { border-left: 6px solid #0b6e6e; }
.believer-card h3 { font-size: 1.4rem; margin: 2px 0 10px; }
.believer-text { margin: 0; font-size: 1.05rem; line-height: 1.65; color: var(--ink); }
.believers-tile { --c1: #0b5560 !important; --c2: #1f8a8a !important; }
.believer-item summary .believer-peek { display: block; margin-top: 4px; font-size: .92rem; color: var(--muted); }
.believer-item[open] summary .believer-peek { display: none; }
.believer-item { scroll-margin-top: 90px; }

/* ---------- donate ---------- */
.donate-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; flex: none;
  background: transparent; color: var(--gold); border: 1.5px solid var(--gold); font: 800 .88rem var(--sans); }
.donate-btn:hover { background: var(--gold); color: #1a1205; text-decoration: none; }
.donate-btn[hidden] { display: none; }
@media (max-width: 760px) { .donate-btn { padding: 8px 10px; } .donate-btn span { display: none; } }
.donate-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; border-left: 6px solid var(--gold); }
.donate-card p { margin: 0; color: var(--ink-soft); max-width: 620px; }
.donate-cta { background: var(--gold) !important; border-color: var(--gold) !important; color: #1a1205 !important; padding: 12px 26px; font-size: 1rem; }
.footer-donate a { color: var(--gold); font-weight: 800; }
.site-footer p + p { margin-top: 6px; }
.topnav a { white-space: nowrap; }
@media (max-width: 1120px) and (min-width: 761px) {
  .topbar { gap: 10px; }
  .topnav { gap: 0; }
  .topnav a { padding: 7px 9px; font-size: .86rem; }
  .brand { font-size: 1.15rem; }
  .donate-btn { padding: 8px 10px; }
  .donate-btn span { display: none; }
}
/* Small phones: the brand and theme button fill the bar; Donate stays on the home card and footer. */
@media (max-width: 440px) { .donate-btn { display: none !important; } }

/* ---------- home: library section ---------- */
.home-library { margin: 8px 0 4px; }
.home-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.home-section-head h2 { font-family: var(--brand); font-weight: 900; font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 0; }
.home-cats { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.home-cats .cat-tile { min-height: 190px; }
.cat-blurb { margin: 2px 0 10px; font-size: .92rem; line-height: 1.45; color: rgb(255 255 255 / .88); position: relative; z-index: 1; }
.cat-tile span { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: relative; z-index: 1; }
.cat-go { font-weight: 800; background: rgb(255 255 255 / .18); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.cat-tile:hover .cat-go { background: rgb(255 255 255 / .3); }
@media (max-width: 560px) { .home-cats { grid-template-columns: 1fr 1fr; gap: 10px; } .home-cats .cat-tile { min-height: 150px; padding: 16px; }
  .home-cats .cat-tile h3 { font-size: 1.2rem; } .home-cats .cat-blurb { display: none; } .home-cats .cat-go { display: none; } }

/* ---------- continuous reader ---------- */
.reader-flow { display: grid; gap: 22px; }
.reader-flow .rpage { width: 100%; }
.rpage .pageno { position: relative; }
.load-prev { justify-self: center; }
.flow-end { display: grid; justify-items: center; gap: 12px; padding: 18px 0 8px; min-height: 40px; }
.flow-done { font: 800 .8rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rpage .page-notes { max-width: none; margin: 22px 0 0; padding: 12px 0 0; background: none; border: none; border-top: 1px dashed var(--line);
  border-radius: 0; box-shadow: none; font: 400 1rem/1.5 var(--sans); }
.rpage .page-notes .pn-head { font-size: .88rem; }
.rpage .page-notes.has-notes { border-top: 2px solid var(--gold); }
.reader-bar button[disabled] { opacity: .4; pointer-events: none; }

/* ---------- phones: hide bars while reading ---------- */
.topbar, .tabbar, .reader-bar { transition: transform .28s ease; }
@media (max-width: 760px) {
  body.chrome-hidden .topbar { transform: translateY(-100%); }
  body.chrome-hidden .tabbar { transform: translateY(110%); }
  body.chrome-hidden .reader-bar { transform: translateY(calc(-100% - 60px)); }
  body.chrome-hidden .hl-bar.dock { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .reader-flow { gap: 14px; }
}

/* ---------- read aloud ---------- */
.listen-btn { background: var(--gold); border-color: var(--gold); color: #1a1205; }
.listen-btn:hover { background: var(--gold); filter: brightness(1.06); }
.rpage .speaking { background: color-mix(in srgb, var(--gold) 16%, transparent); box-shadow: -10px 0 0 color-mix(in srgb, var(--gold) 16%, transparent), 10px 0 0 color-mix(in srgb, var(--gold) 16%, transparent), -14px 0 0 var(--gold); border-radius: 6px; }
.tts-bar { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: 22px; width: min(560px, calc(100vw - 20px));
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 999px; background: var(--chrome); color: var(--chrome-ink); box-shadow: var(--shadow-lg); transition: bottom .28s ease; }
.tts-bar[hidden] { display: none; }
.tts-bar button { border: none; cursor: pointer; font: 800 .9rem var(--sans); color: inherit; background: rgb(255 255 255 / .1); border-radius: 999px; height: 40px; min-width: 40px; padding: 0 12px; }
.tts-bar .tts-play { background: var(--gold); color: #1a1205; width: 44px; height: 44px; padding: 0; }
.tts-bar button:hover { background: rgb(255 255 255 / .2); }
.tts-bar .tts-play:hover { background: var(--gold); filter: brightness(1.08); }
.tts-info { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.tts-info strong { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.tts-info span { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.listening .reader-flow { padding-bottom: 80px; }
@media (max-width: 760px) {
  .tts-bar { bottom: calc(78px + env(safe-area-inset-bottom)); }
  body.chrome-hidden .tts-bar { bottom: calc(14px + env(safe-area-inset-bottom)); }
  .reader-bar .listen-btn span { display: none; }
}

/* ---------- headings inside the writings ---------- */
.reader h3.t-title {
  font: 800 1.42em/1.22 var(--brand); letter-spacing: -.005em; text-align: center; color: var(--ink);
  margin: 1.6em auto .9em; max-width: 30em; text-wrap: balance;
}
.reader h3.t-title::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 4px; background: var(--gold); margin: .45em auto 0; }
.reader .t-title + .t-title { margin-top: -.5em; font-size: 1.15em; color: var(--accent); }
.reader .t-title + .t-title::after { display: none; }
.reader h4.t-sub {
  font: 800 1.08em/1.35 var(--legible); color: var(--accent); margin: 1.5em 0 .55em; padding-left: 12px;
  border-left: 4px solid var(--gold); text-wrap: balance;
}
.reader .t-section {
  font: 800 .78em var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
  text-align: center; margin: 1.8em 0 .2em;
}
.reader .t-section + .t-title { margin-top: .3em; }
.reader .t-byline {
  font: 700 .72em/1.6 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  text-align: center; margin: -.2em auto 1.4em; max-width: 34em;
}
.rpage > .pageno + .t-title, .rpage > .pageno + .t-section { margin-top: .4em; }
.reader .label { font-size: .78em; }

/* ---------- table of contents entries ---------- */
.reader .toc-entry { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; margin: 0 -10px; border-radius: 8px;
  color: var(--ink); font-size: .95em; line-height: 1.45; text-align: left; }
.reader a.toc-entry:hover, .reader a.toc-entry:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); text-decoration: none; }
.reader a.toc-entry .toc-t { color: var(--ink); }
.reader a.toc-entry:hover .toc-t { color: var(--accent); }
.toc-dots { flex: 1; min-width: 20px; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.toc-n { font: 800 .9em var(--sans); color: var(--accent); white-space: nowrap; }
.reader div.toc-entry .toc-n { color: var(--muted); }
.reader a.toc-entry .toc-n::after { content: " ›"; }

/* ---------- no forced capitals: labels in normal case for legibility ---------- */
.eyebrow { text-transform: none; font-size: .88rem; letter-spacing: .01em; }
.hero .date { text-transform: none; font-size: .9rem; letter-spacing: .01em; }
.qa-card .qtitle, .qa-item summary .t { text-transform: none; font-size: .86rem; letter-spacing: 0; }
.reader .label { text-transform: none; font-size: .92em; letter-spacing: 0; }
.reader .pageno { text-transform: none; font-size: .84rem; letter-spacing: .01em; }
.pn-label, .flow-done { text-transform: none; font-size: .88rem; letter-spacing: .01em; }
.tts-info strong { text-transform: none; font-size: .86rem; letter-spacing: .01em; }
.reader .t-section { text-transform: none; font: 800 .95em var(--legible); letter-spacing: .02em; }
.reader .t-byline { text-transform: none; font: italic 500 .86em/1.55 var(--legible); letter-spacing: 0; }

/* Hide the "Powered by Netlify" badge the host injects */
#nl-badge-frame { display: none !important; }

/* ---------- reader settings panel ---------- */
:root[data-readfont="serif"] { --read-font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; }
.aa-btn { font-weight: 800; letter-spacing: -.02em; }
.aa-panel { position: fixed; z-index: 75; width: 330px; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lg); padding: 16px; display: grid; gap: 12px; }
.aa-panel[hidden] { display: none; }
.aa-panel.sheet { left: 0; right: 0; bottom: 0; top: auto !important; width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.aa-row { display: grid; gap: 6px; }
.aa-row > span { font: 800 .72rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.aa-row .chips { margin: 0; }
.aa-size { display: flex; align-items: center; gap: 10px; }
.aa-size b { min-width: 2.2em; text-align: center; font-size: 1.05rem; }
.aa-foot { display: flex; justify-content: space-between; align-items: center; }

/* ---------- streaks & reminders ---------- */
.streak-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.streak { font-weight: 700; font-size: .95rem; }
.streak b { font-size: 1.15rem; color: var(--gold); }
.streak.none { color: var(--muted); font-weight: 600; }
.plan-streak { margin: -10px 0 22px; border-top: none; padding-top: 0; }
.rem-time { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.rem-time input { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); }
.rem-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rem-hint { font-size: .85rem; margin: 0; }

/* ---------- Bible → writings index ---------- */
.vindex-note { max-width: 760px; margin: 0 auto 12px; padding: 10px 16px; border-radius: 14px; font-size: .92rem;
  background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.vcite { display: inline-flex; align-items: center; justify-content: center; min-width: 1.7em; height: 1.45em; padding: 0 .4em; margin-left: 2px;
  vertical-align: .12em; border-radius: 999px; border: none; cursor: pointer; font: 800 .62em var(--sans);
  background: linear-gradient(135deg, #f7d774, #e0a520); color: #2a1c02; box-shadow: 0 2px 6px rgb(224 165 32 / .35); }
.vcite[aria-expanded="true"] { outline: 2px solid var(--accent); }
.vrefs { margin: -4px 0 16px; padding: 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); display: grid; gap: 8px; text-align: left; }
.vrefs-head { font: 800 .74rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.vref { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border-left: 3px solid var(--gold); color: var(--ink); }
.vref:hover { text-decoration: none; border-left-color: var(--accent); }
.vref .where { font: 800 .82rem var(--sans); color: var(--accent); }
.vref .snip { font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }

/* ---------- glossary terms ---------- */
.gloss { text-decoration: underline dotted color-mix(in srgb, var(--gold) 80%, transparent); text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: help; }
.gloss:hover, .gloss:focus-visible { background: color-mix(in srgb, var(--gold) 16%, transparent); border-radius: 4px; }
.vp-more a + a { margin-left: 14px; }

/* ---------- topic guides ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.topic-card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.topic-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.topic-card h3 { margin: 0; font: 800 1.25rem/1.25 var(--brand); }
.topic-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; flex: 1; }
.topic-ref { font: 800 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.topic-n { font: 700 .85rem var(--sans); color: var(--accent); margin-top: 6px; }
.topic-scripture { margin-top: 8px !important; font-weight: 700; }
.topic-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.topic-item p { font: 400 1.04rem/1.7 var(--serif); margin: 8px 0 14px; text-align: justify; hyphens: auto; }
.topic-item .where { font: 800 .85rem var(--sans); color: var(--accent); display: flex; align-items: center; gap: 10px; }
.topic-item .num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #1a1205; font-size: .8rem; }
.topic-more { margin: 18px 0; }
.topics-home .home-section-head { margin-bottom: 14px; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 700; font-size: .9rem; }
.topic-chip:hover { text-decoration: none; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }

/* ---------- search extras ---------- */
.chip-n { font-weight: 800; opacity: .7; margin-left: 2px; }
.chip:disabled { opacity: .45; cursor: default; }
.did-you-mean { margin: -6px 0 14px; font-size: 1.02rem; }
.did-you-mean a { font-weight: 800; font-style: italic; }

/* ---------- shared folders ---------- */
.shared-actions { margin-top: 14px; }

/* ---------- charts gallery ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.chart-card { margin: 0; padding: 12px; display: grid; gap: 10px; }
.chart-open { padding: 0; border: none; background: var(--bg); border-radius: 12px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; }
.chart-open img { width: 100%; height: 100%; object-fit: contain; display: block; }
.chart-card figcaption { display: grid; gap: 4px; font-size: .92rem; }
.chart-card figcaption span { color: var(--ink-soft); }
.empty-charts { text-align: center; padding: 50px 24px; }
.empty-charts h3 { font: 800 1.5rem var(--brand); margin: 8px 0; }
.empty-icon { font-size: 2.4rem; color: var(--gold); }
.chart-dlg { border: none; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #050807; color: #fff; }
.chart-dlg::backdrop { background: #000; }
.chart-bar { position: sticky; top: 0; display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: rgb(5 8 7 / .9); z-index: 1; }
.chart-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-view { overflow: auto; height: calc(100dvh - 56px); display: grid; place-items: center; }
.chart-view img { max-width: 100%; height: auto; display: block; }

/* ---------- language menu ---------- */
.lang-menu { position: fixed; z-index: 80; width: 300px; max-height: 70vh; overflow: auto; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 14px; }
.lang-menu[hidden] { display: none; }
.lang-head { font: 800 .74rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.lang-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lang-menu a { padding: 7px 10px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: .92rem; }
.lang-menu a:hover { background: var(--surface-2); text-decoration: none; }
.lang-menu .lang-en { display: block; margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 10px; color: var(--accent); }
.lang-note { font-size: .78rem; color: var(--muted); margin: 8px 2px 0; }
@media (max-width: 440px) { .lang-menu { left: 8px !important; right: 8px; width: auto; } }

/* ---------- install & offline card ---------- */
.app-card { margin-top: 22px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.app-card h3 { margin: 0 0 4px; font: 800 1.35rem var(--brand); }
.app-card p { margin: 0; }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.offline-status { margin-top: 8px !important; font-weight: 700; color: var(--accent); font-size: .9rem; }
.footer-links a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- site statistics ---------- */
.stats-summary { margin-bottom: 16px; }
.stats-chart, .stats-top { margin-bottom: 16px; }
.stats-chart h3, .stats-top h3 { margin: 0 0 14px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.bar i { display: block; width: 100%; height: var(--h); min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--gold), var(--accent)); }
.bar span { font-size: .62rem; color: var(--muted); }
.stats-top ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.stats-top li { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr auto; gap: 12px; align-items: center; font-size: .92rem; }
.stats-top .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-top .track { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.stats-top .track i { display: block; height: 100%; background: var(--accent); border-radius: 8px; }
.aa-panel, .lang-menu { background: var(--bg) linear-gradient(var(--surface), var(--surface)); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
@media (max-width: 400px) {
  .topbar { gap: 6px; }
  .brand { font-size: 1rem; gap: 7px; min-width: 0; }
  .brand img { width: 26px; height: 26px; }
  .topbar .icon-btn { width: 34px; height: 34px; }
}

/* ---------- report a mistake / feedback inbox ---------- */
.pn-tools { display: flex; gap: 14px; align-items: center; }
.report-link { color: var(--muted) !important; }
.report-link:hover { color: var(--accent) !important; }
.fb-dlg form { gap: 10px; }
.fb-intro { margin: -4px 0 2px; font-size: .92rem; }
.fb-kinds { margin: 0; }
.fb-where { font-size: .92rem; padding: 8px 12px; border-radius: 10px; background: var(--bg); }
.fb-label { font-weight: 700; font-size: .92rem; }
.fb-dlg input[type="email"] { font: inherit; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); }
.fb-shot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fb-shot img { max-height: 120px; max-width: 200px; border-radius: 10px; border: 1px solid var(--line); }
.fb-pick { cursor: pointer; }
.fb-shot .muted { font-size: .85rem; }
.fb-err { color: #e5484d; font-size: .88rem; font-weight: 600; }
.fb-count { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 .35em; border-radius: 999px; background: #e5484d; color: #fff; font-size: .78em; margin-left: 4px; }
.fb-list { display: grid; gap: 14px; }
.fb-item.done { opacity: .7; }
.fb-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .88rem; }
.fb-kind { font: 800 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.fb-kind.fb-text { background: color-mix(in srgb, var(--gold) 25%, transparent); }
.fb-kind.fb-site { background: color-mix(in srgb, #e5484d 22%, transparent); }
.fb-kind.fb-idea { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.fb-msg { white-space: pre-wrap; font-size: 1.02rem; margin: 12px 0; }
.fb-img img { max-width: 100%; max-height: 360px; border-radius: 12px; border: 1px solid var(--line); display: block; margin-bottom: 12px; }
.fb-meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; font-size: .9rem; }
.fb-meta details { font-size: .82rem; }
.fb-actions { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
