/* Phronesis Bible v1.07 — e-Sword LT style layout, 3 themes + daily strip/quiz/memorize/focus/flow */

:root {
  --blue: #1670d8;
  --blue-deep: #0d5cb8;
  --accent-ink: #fff;
  --blue-soft: #dcebfd;
  --blue-soft-2: #eef4fd;
  --red: #d8402f;
  --red-letter: #e03a28;
  --yellow: #ffe81a;
  --now-bg: #ffe81a;
  --now-ink: #241c00;
  --ink: #131313;
  --ink-2: #3c3c40;
  --muted: #8a8a90;
  --bg: #ffffff;
  --bg-2: #f4f5f7;
  --hair: #e2e2e6;
  --tab-ink: #9a9aa0;
  --reader-font: -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --reader-size: 19px;
}
body.dark {
  --blue: #4da3ff;
  --blue-deep: #7cbcff;
  --accent-ink: #101216;
  --blue-soft: #173450;
  --blue-soft-2: #13293f;
  --red: #ff7a63;
  --red-letter: #ff6a52;
  --yellow: #c7b400;
  --now-bg: #8f6f00;
  --now-ink: #fff3bf;
  --ink: #e9e9ec;
  --ink-2: #c3c3c9;
  --muted: #8b8b93;
  --bg: #101216;
  --bg-2: #181b21;
  --hair: #26292f;
  --tab-ink: #6f7076;
}
body.sepia {
  --blue: #8a5a2b;
  --blue-deep: #6f4519;
  --blue-soft: #ecd9b8;
  --blue-soft-2: #f3e6cb;
  --red: #b0431f;
  --red-letter: #a93a1c;
  --yellow: #e8cf5a;
  --now-bg: #e8cf5a;
  --now-ink: #3a2c00;
  --ink: #3c2f1c;
  --ink-2: #57472f;
  --muted: #97865f;
  --bg: #f6ecd8;
  --bg-2: #efe2c6;
  --hair: #ddcda6;
  --tab-ink: #a08c60;
}
/* v1.08 — Auto theme: follows the device light/dark setting */
@media (prefers-color-scheme: dark) {
  body.auto {
    --blue: #4da3ff;
    --blue-deep: #7cbcff;
    --accent-ink: #101216;
    --blue-soft: #173450;
    --blue-soft-2: #13293f;
    --red: #ff7a63;
    --red-letter: #ff6a52;
    --yellow: #c7b400;
    --now-bg: #8f6f00;
    --now-ink: #fff3bf;
    --ink: #e9e9ec;
    --ink-2: #c3c3c9;
    --muted: #8b8b93;
    --bg: #101216;
    --bg-2: #181b21;
    --hair: #26292f;
    --tab-ink: #6f7076;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { height: 100dvh; }
body {
  margin: 0;
  font-family: var(--reader-font);
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
button { font-family: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font-family: inherit; }
[hidden] { display: none !important; }

/* ============ stale banner ============ */
.stalebar {
  background: #c62828; color: #fff; font-size: 13px; padding: 9px 12px;
  display: flex; gap: 10px; align-items: center; justify-content: center;
}
.stalebar button { background: #fff; color: #b71c1c; font-weight: 700; border-radius: 6px; padding: 3px 10px; }

/* ============ top toolbars ============ */
#topbar { flex: none; z-index: 40; background: var(--bg); padding: var(--safe-top) var(--safe-right) 0 var(--safe-left); }
.tb-row { display: flex; align-items: center; gap: 6px; padding: 6px 12px; }
.tb1 { padding-top: 10px; padding-bottom: 2px; justify-content: space-between; }
.tb2 { padding-top: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--hair); justify-content: space-between; }
.tb-icon {
  color: var(--blue); width: 44px; height: 44px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.tb-icon svg { width: 26px; height: 26px; }
.tb-icon:active { background: var(--blue-soft); }
.tb-icon.font { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.tb-icon.font span { font-size: 14px; }

.refpill {
  flex: 1; max-width: 330px; margin: 0 auto; background: var(--bg-2);
  border: 1px solid var(--hair); border-radius: 10px;
  display: flex; align-items: center; overflow: hidden;
}
.rp-arrow { color: var(--blue); width: 44px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
.rp-arrow svg { width: 17px; height: 17px; }
.rp-label {
  flex: 1; min-width: 0; min-height: 44px; text-align: center; color: var(--blue); font-size: 17px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px;
}

.s-num {
  color: var(--muted); font-size: 22px; font-weight: 800; font-style: italic;
  width: 46px; height: 40px; letter-spacing: -1px;
}
.s-num.on { color: var(--red); }
.s-num.on::after { content: ""; display: block; height: 2px; background: var(--red); margin: -3px 8px 0; border-radius: 2px; }
.ver-pill {
  background: var(--blue-soft); color: var(--blue-deep); font-size: 16px; font-weight: 600;
  border: 1px solid var(--hair); border-radius: 8px; padding: 7px 18px; margin: 0 auto;
}
.help svg { width: 24px; height: 24px; }

/* ============ content ============ */
#content { flex: 1; min-block-size: 0; min-inline-size: 0; overflow: auto; padding: 0 var(--safe-right) 8px var(--safe-left); }
.view { display: none; min-height: 100%; }
.view.active { display: block; }

.reader {
  padding: 14px 16px 90px;
  font-size: var(--reader-size);
  line-height: 1.75;
  color: var(--ink);
}
body.serif .reader { font-family: Georgia, "Times New Roman", "Iowan Old Style", serif; }

.verse { margin: 0 0 4px; scroll-margin-block: 8px; }
.vn { color: var(--blue); font-weight: 600; font-size: 0.98em; margin-right: 6px; user-select: none; }
.w.sw { color: var(--blue); cursor: pointer; }
#reader.str .w.sw {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.6px;
  text-underline-offset: 4px;
}
#reader:not(.str) .w.sw { color: inherit; }
/* Jesus's red-letter words stay red in EVERY mode — Strong's blue must not win */
#reader .w.red { color: var(--red-letter) !important; }
.w.it { opacity: 0.72; font-style: italic; }
.verse.speaking { background: var(--blue-soft-2); box-shadow: inset 3px 0 0 var(--blue); border-radius: 4px; padding-left: 6px; margin-left: -6px; }
.verse .vb-target { outline: none; }

/* read-aloud word tracking: words already read dim, the current word glows */
.w.rdone { opacity: .45; transition: opacity .18s; }
#reader .w.rnow {
  background: var(--now-bg);
  color: var(--now-ink) !important;
  border-radius: 4px;
  padding: 0 3px;
  margin: 0 -3px;
  box-shadow: 0 2px 8px rgba(0,0,0,.16);
  transition: background .12s;
}

/* verse action bar */
.versebar {
  width: min(100%, 720px);
  background: var(--bg); border: 1px solid var(--hair); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18); display: flex; flex-wrap: wrap;
  padding: 4px; gap: 2px;
}
.versebar button { flex: 1 1 auto; min-height: 44px; padding: 6px 8px; font-size: 14.5px; font-weight: 600; border-radius: 8px; white-space: nowrap; }
.versebar button:active { background: var(--blue-soft); }
.colorrow {
  max-inline-size: 100%;
  background: var(--bg); border: 1px solid var(--hair); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px;
}
.colorrow button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--hair); }
.c-yellow { background: #ffe81a; } .c-green { background: #79d858; }
.c-blue { background: #6fb7ff; } .c-pink { background: #ff9ad5; }
.c-orange { background: #ffb35c; }
.c-none { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--bg-2); width: auto; border-radius: 17px; padding: 0 12px; }

/* highlight colors on text */
.hl-yellow { background: rgba(255, 226, 20, .55); border-radius: 3px; }
.hl-green { background: rgba(110, 210, 80, .4); border-radius: 3px; }
.hl-blue { background: rgba(90, 170, 255, .35); border-radius: 3px; }
.hl-pink { background: rgba(255, 130, 200, .4); border-radius: 3px; }
.hl-orange { background: rgba(255, 170, 80, .45); border-radius: 3px; }
.note-flag { color: var(--blue); font-size: 0.72em; vertical-align: super; margin-left: 2px; cursor: pointer; }
.bm-flag { color: #f2a51a; font-size: 0.72em; vertical-align: super; margin-left: 2px; }

/* ============ bottom tab bar ============ */
#tabbar {
  flex: none; z-index: 50;
  display: flex; background: var(--bg); border-top: 1px solid var(--hair);
  padding: 4px max(4px, var(--safe-right)) calc(4px + var(--safe-bottom)) max(4px, var(--safe-left));
}
.tab {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--tab-ink); font-size: 11px; font-weight: 600;
}
.tab svg { width: 25px; height: 25px; }
.tab.on { color: var(--blue); }
.offline-reader #rcCallDock { display: none; }
#rcCallDock {
  flex: none;
  padding: 4px max(8px, var(--safe-right)) 4px max(8px, var(--safe-left));
  background: var(--bg);
  border-top: 1px solid var(--hair);
}
.rc-dock-controls, .rc-dock-media {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rc-dock-controls output { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rc-dock-controls button { min-height: 44px; padding-inline: 8px; }
.rc-dock-media video { width: min(25vw, 120px); aspect-ratio: 16 / 9; object-fit: cover; }
#rcCallDock:not([data-video]) .rc-dock-media { display: none; }
#rcTrustPrompt {
  width: min(420px, calc(100% - 32px));
  padding: 16px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--bg);
  color: var(--tab-ink);
}
#rcTrustPrompt::backdrop { background: #0009; }
#rcTrustPrompt .rc-dock-controls { justify-content: flex-end; }
.offline-reader #content { padding-bottom: var(--safe-bottom); }
.offline-reader .drawer-block a { color: var(--blue); }

/* ============ Strong's detail page (100% reference layout) ============ */
.page {
  position: fixed; inset: 0; z-index: 70; background: var(--bg);
  display: flex; flex-direction: column;
}
.page-head {
  display: flex; align-items: center; padding: 10px 12px 8px;
  border-bottom: 1px solid var(--hair); background: var(--bg);
}
.back-btn { color: var(--blue); font-size: 18px; font-weight: 500; padding: 4px 8px 4px 0; }
.page-ref { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: center; color: var(--red); font-size: 18px; font-weight: 700; }
.page-nav { display: flex; gap: 2px; }
.page-nav button { color: var(--red); width: 38px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.page-nav svg { width: 16px; height: 16px; }
#strBible { color: #1266c4; }
#strBible svg { width: 20px; height: 20px; }

/* module bar — 3 clean text tabs: Word definition / Occurrences / Cross ref.
   (rev 3: the old ad-style red frame, icons and Install/331 badges are gone) */
.module-bar {
  display: flex; align-items: stretch; gap: 2px;
  border-bottom: 1px solid var(--hair);
  margin: 8px 10px 0; padding: 0 4px; background: var(--bg);
}
.mtab {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 12px 4px 11px; color: var(--muted);
  border-bottom: 2.5px solid transparent; border-radius: 0;
  font-weight: 500; transition: color .15s, border-color .15s;
}
.mtab.on {
  color: var(--ink); font-weight: 700;
  border-bottom-color: var(--blue);
}
.mt-lb { font-size: 14.5px; letter-spacing: .01em; }

/* pronounce card — "Say it — hear the pronunciation", exactly like b4 */
.pron-card {
  background: var(--bg-2); border: 1px solid var(--hair); border-radius: 14px;
  padding: 14px; margin: 14px 0 4px;
}
.say-btn {
  width: 100%; background: var(--blue); color: #fff; font-size: 17.5px; font-weight: 700;
  border-radius: 11px; padding: 13px 14px; text-align: center;
  box-shadow: 0 2px 8px rgba(22, 112, 216, .28);
}
.say-btn:active { transform: scale(.98); }
.pron-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.voice-chip {
  background: var(--bg); border: 1.5px solid var(--blue); color: var(--blue);
  font-weight: 700; font-size: 14px; border-radius: 999px; padding: 6px 13px;
}
.phon { margin-top: 10px; font-size: 16.5px; color: var(--ink-2); }
.phon b { color: var(--red); font-size: 1.12em; letter-spacing: .02em; }
.pron-note { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* legend — quiet inline link (the old blue pill button read like an ad) */
.legend-link {
  display: block; width: 100%; text-align: left; margin-top: 14px;
  color: var(--blue); font-size: 14px; text-decoration: underline;
  text-decoration-color: var(--hair); text-underline-offset: 3px;
}

/* cross references (new) */
.xref-hint { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 6px 0 10px; }
.sharedrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.shared-chip {
  background: var(--blue-soft-2, #eaf2fc); color: #1440c8;
  border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600;
}
.shared-chip i { font-style: normal; opacity: .65; font-size: 11px; }
.numchip.root { border-color: #d9a400; color: #9a7500; background: rgba(217, 164, 0, .08); }
.numchip.vchip { min-width: 42px; text-align: center; }

.page-body { flex: 1; min-block-size: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.stab { display: none; padding: 18px 16px 96px; }
.stab.on { display: block; }

/* hero: red text on yellow highlight, like the reference word header */
.str-hero {
  color: var(--ink); font-size: 24px; font-weight: 800;
  text-align: center; padding: 16px 0 4px; line-height: 1.5;
}
.hl-y {
  background: var(--yellow); color: #e01616;
  padding: 3px 10px 5px; border-radius: 3px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  font-size: 1.35em;
}
.str-chiprow { text-align: left; margin: 10px 0 2px; }
.str-chip {
  display: inline-block; background: var(--yellow); color: #e01616;
  font-weight: 800; font-size: 22px; padding: 3px 10px; border-radius: 3px;
}

/* Strong's page — verse shown in context (verse before & after) */
.ctx-block {
  background: var(--bg-2); border: 1px solid var(--hair);
  border-radius: 12px; padding: 12px 14px; margin: 0 0 16px;
}
.ctx-block .flabel { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ctx-verse { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); margin: 0 0 8px; }
.ctx-verse:last-child { margin-bottom: 0; }
.ctx-verse .vn { color: var(--blue); font-weight: 700; font-size: 12.5px; margin-right: 5px; }
.ctx-verse.mid {
  color: var(--ink); font-weight: 500;
  background: var(--blue-soft-2); border-radius: 8px;
  padding: 7px 9px; margin: 0 -4px 8px;
}
.ctx-word {
  color: var(--blue); font-weight: 700;
  text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px;
}
/* reference field typography: blue labels, big black values */
.flabel { color: #1440c8; font-size: 21px; font-weight: 500; margin-top: 22px; }
.fval { font-size: 21px; line-height: 1.45; color: var(--ink); margin-top: 2px; overflow-wrap: break-word; }
.fval .hebrew { font-size: 1.2em; }
.fval .numlink { color: #1266c4; text-decoration: underline; text-decoration-color: #b02a2a; text-underline-offset: 3px; cursor: pointer; }
.fval ol { margin: 8px 0 0 20px; padding: 0; }
.fval ol li { margin-bottom: 6px; }
.fval .dim { color: var(--muted); }
/* KJV usage — plain flowing text exactly like the reference, still tappable */
.kjvplain { cursor: pointer; }
.kjvplain:not(.fixed):hover { text-decoration: underline; text-decoration-color: #b02a2a; text-underline-offset: 3px; }
.occ-item { padding: 11px 4px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.occ-item .oref { color: var(--blue); font-weight: 700; font-size: 15.5px; }
.occ-item .otxt { color: var(--ink-2); font-size: 15.5px; margin-top: 2px; }

/* Thayer outline — reference indentation (1. → a. → 1.), hanging markers */
.fval.outline .th.oln { display: flex; align-items: baseline; }
.fval.outline .tm { flex: 0 0 auto; min-width: 24px; }
.fval.outline .tt { flex: 1; min-width: 0; }
.th.th1 { font-weight: 700; margin-top: 12px; color: var(--ink); }
.th.th2 { font-weight: 600; margin: 10px 0 7px 14px; }
.th.th3 { margin: 6px 0 6px 30px; color: var(--ink-2); }

/* per-book distribution chart (Occurrences tab) */
.dist-chart { margin-top: 6px; }
.dist-row {
  display: grid; grid-template-columns: 108px 1fr 40px; align-items: center;
  gap: 8px; padding: 3px 0; cursor: pointer;
}
.dist-name { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-bar {
  height: 13px; background: var(--bg-2); border-radius: 3px; overflow: hidden;
  border: 1px solid var(--hair);
}
.dist-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f7fd0, #59a3e8); border-radius: 2px; }
.dist-n { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* favorites + history chips */
.chiprow { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.numchip {
  background: var(--bg-2); border: 1px solid var(--hair); border-radius: 999px;
  padding: 5px 12px; font-size: 14px; font-weight: 600; color: var(--blue); cursor: pointer;
}
.fav-btn {
  margin-left: 8px; font-size: 26px; color: #d9a400; vertical-align: -2px;
  background: none; padding: 2px 6px;
}
/* legend modal rows */
.legend-body { overflow-y: auto; padding: 2px 2px 10px; font-size: 15.5px; line-height: 1.5; }
.legend-body p { margin: 8px 4px; }
.legend-body .lg-row {
  display: grid; grid-template-columns: 110px 1fr; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--hair); align-items: baseline;
}
.legend-body code {
  background: var(--bg-2); border: 1px solid var(--hair); border-radius: 6px;
  padding: 3px 7px; font-weight: 700; color: var(--red); font-size: 14px; text-align: center;
}
.copy-ta { width: 100%; min-height: 200px; font-size: 13px; padding: 10px; border: 1px solid var(--hair); border-radius: 8px; background: var(--bg-2); color: var(--ink); }

/* ============ drawer / sheets / popups ============ */
.drawer, .sheet {
  position: fixed; inset: 0; z-index: 80; background: rgba(10, 12, 16, .45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: max(6px, var(--safe-top)) var(--safe-right) var(--safe-bottom) var(--safe-left);
}
.drawer { align-items: stretch; justify-content: flex-start; }
.drawer-card {
  width: min(420px, 92vw); background: var(--bg); padding: 14px;
  display: flex; flex-direction: column; overflow: hidden;
}
.sheet-card {
  width: min(560px, 100%); max-height: 100%; min-width: 0; background: var(--bg);
  border-radius: 18px 18px 0 0; padding: 16px; display: flex; flex-direction: column;
  overflow: hidden;
}
@media (min-width: 700px) {
  .drawer, .sheet { align-items: center; }
  .drawer-card { border-radius: 14px; height: 84dvh; }
  .sheet-card { border-radius: 18px; max-height: 88%; }
}
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sheet-head h3 { margin: 0; font-size: 19px; flex: 1; }
.sheet-head h3 small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.sheet-head input { flex: 1; min-inline-size: 0; }
.x-btn { color: var(--muted); font-size: 19px; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; }
.x-btn:active { background: var(--bg-2); }

.seg { display: flex; background: var(--bg-2); border-radius: 10px; padding: 3px; flex: 1; }
.seg-btn { flex: 1; padding: 8px 6px; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 8px; }
.seg-btn.on { background: var(--bg); color: var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.book-list { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 2px; }
.book-item { text-align: left; padding: 11px 10px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.book-item em { float: right; font-style: normal; color: var(--muted); font-size: 12px; font-weight: 500; }
.book-item .bord {
  display: inline-block; min-width: 21px; text-align: center;
  color: var(--red); background: var(--yellow);
  font-weight: 800; font-size: 11.5px; border-radius: 4px;
  padding: 1px 5px; margin-right: 8px; vertical-align: 1px;
}
.book-item:active { background: var(--blue-soft); }
.book-item.cur { color: var(--blue); background: var(--blue-soft-2); }
.chap-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 7px; padding: 10px 2px; }
.chap-item { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--bg-2); border-radius: 9px; font-weight: 700; font-size: 16px; color: var(--ink-2); }
.chap-item:active { background: var(--blue-soft); color: var(--blue); }

.sheet-card input[type="search"] {
  width: 100%; padding: 12px 14px; font-size: 16.5px; border-radius: 10px;
  border: 1.5px solid var(--hair); background: var(--bg-2); color: var(--ink); outline: none;
}
.sheet-card input[type="search"]:focus { border-color: var(--blue); }
.search-hints { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.search-hints button { background: var(--bg-2); border: 1px solid var(--hair); color: var(--ink-2); padding: 7px 12px; border-radius: 16px; font-size: 13.5px; }
.search-results { flex: 1; overflow-y: auto; margin: 4px -6px 0; padding: 0 6px; }
.sr-item { padding: 12px 6px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.sr-item .oref { color: var(--blue); font-weight: 700; font-size: 15.5px; }
.sr-item .otxt { color: var(--ink-2); font-size: 15px; margin-top: 2px; line-height: 1.45; }
.sr-item mark { background: var(--yellow); color: inherit; border-radius: 2px; padding: 0 1px; }
.sr-type { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin: 12px 2px 2px; }
.sr-head { padding: 12px 6px; border-bottom: 1px solid var(--hair); }
.sr-head .hero { color: var(--red); font-weight: 800; font-size: 17px; background: var(--yellow); display: inline-block; padding: 2px 8px; border-radius: 3px; }

/* ============ voice studio ============ */
.voice-filter { display: flex; gap: 7px; margin-bottom: 10px; }
.vf { flex: 1; background: var(--bg-2); border: 1px solid var(--hair); padding: 8px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.vf.on { background: var(--blue-soft); color: var(--blue-deep); border-color: var(--blue); }
.voice-scroll { min-block-size: 0; overflow: auto; overscroll-behavior: contain; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 8px; padding-bottom: 8px; }
.voice-actions { flex: none; display: flex; gap: 6px; padding-top: 8px; border-top: 1px solid var(--hair); }
.voice-actions button { flex: 1 1 0; min-width: 0; min-height: 44px; padding-inline: 6px; }
.voice-actions #voiceChapter { flex-grow: 1.6; }
.voice-settings { padding-bottom: 8px; }
.voice-settings summary { color: var(--blue); cursor: pointer; padding-block: 12px; min-height: 44px; }
#voicePanel .sheet-head { flex: none; }
#voicePanel .vstat { white-space: normal; max-width: 100%; margin-left: 0; }
#voicePanel .vcard :is(.vplay, .vuse) { min-height: 44px; }
/* v1.08 — the 2-voice studio: big side-by-side cards */
.voice-grid.duo { align-content: start; }
.vcard.duo { gap: 6px; padding: 12px; }
.vcard .vname { font-weight: 700; font-size: 15px; }
.vcard .vgen {
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em; color: #fff;
  background: #c9778a; border-radius: 4px; padding: 2px 6px; vertical-align: 2px;
}
.vcard .vgen:nth-child(1) { } 
.vcard.on .vgen { background: var(--blue); }
.vcard .vbtns { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.vcard .vplay {
  border: 1.5px solid var(--blue); color: var(--blue); border-radius: 9px;
  padding: 8px 6px; font-size: 13px; font-weight: 700; text-align: center;
}
.vcard .vuse { padding: 8px 6px; font-size: 13px; }
.vcard .vnote { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
/* ---- v1.09: voice provenance (source strip, status chip, A/B) ---- */
.voice-src {
  border: 1px solid var(--hair); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
  background: linear-gradient(180deg, var(--blue-soft-2), transparent); text-align: left;
}
.voice-src .vs-t { font-weight: 800; font-size: 13px; margin-bottom: 3px; }
.voice-src .vs-d { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.voice-src .vs-d a { color: var(--blue); font-weight: 700; text-decoration: none; }
.voice-src .vs-d a:hover { text-decoration: underline; }
.vstat {
  display: inline-block; vertical-align: 1px; margin-left: 6px; padding: 1.5px 8px;
  border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .02em;
  border: 1px solid transparent; white-space: nowrap;
}
.vstat.st-exact    { background: #e7f6ec; color: #157347; border-color: #bfe4cc; }
.vstat.st-shaped   { background: #fff6dd; color: #8a6d00; border-color: #efe0a3; }
.vstat.st-fallback { background: #f0f1f3; color: #63676f; border-color: var(--hair); }
.vcard .vprov {
  font-size: 10.5px; color: var(--muted); line-height: 1.4; margin-top: 2px;
  border-left: 2.5px solid var(--blue); padding-left: 7px;
}
.vcard .vst { color: var(--ink); font-weight: 600; }
.vcard .vlive {
  padding: 8px 6px; font-size: 13px; border-radius: 9px; border: 1px solid var(--hair);
  background: var(--bg); cursor: pointer; font-weight: 600;
}
.vcard .vlive:active { transform: translateY(1px); }
.vcard {
  border: 1.5px solid var(--hair); border-radius: 12px; padding: 10px; text-align: left;
  display: flex; flex-direction: column; gap: 2px; background: var(--bg);
}
.vcard.on { border-color: var(--blue); background: var(--blue-soft-2); }
.vcard .vname { font-weight: 700; font-size: 15px; }
.vcard .vmeta { font-size: 12px; color: var(--muted); }
.vcard .vmeta b { color: var(--blue-deep); font-weight: 600; }
.vcard .vplay { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--blue); }
.voice-ctrl { display: grid; gap: 8px; font-size: 14px; }
.voice-ctrl label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(64px, 1fr) 4.5em; align-items: center; gap: 6px; min-height: 36px; }
.voice-ctrl input[type="range"] { min-inline-size: 0; inline-size: 100%; margin-inline: 0; }
.voice-ctrl output { text-align: end; }
.mini-btn { border: 1.5px solid var(--blue); color: var(--blue); border-radius: 9px; padding: 9px 14px; font-weight: 700; font-size: 14px; }
.mini-btn.primary { background: var(--blue); color: var(--accent-ink); }
.sep-note { width: 100%; font-size: 12px; color: var(--muted); }

/* ============ playbar (v1.08 — time + seek + skip) ============ */
.playbar {
  width: min(560px, 100%); background: var(--bg); border: 1px solid var(--hair);
  border-radius: 14px; box-shadow: 0 10px 34px rgba(0,0,0,.22);
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 8px;
}
.pb-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.playbar button { font-size: 21px; width: 44px; height: 44px; border-radius: 12px; }
.playbar button:active { background: var(--bg-2); }
.playbar .pb-skip { font-size: 17px; width: 38px; color: var(--blue-deep); }
.pb-info { flex: 1 1 8em; min-width: 0; }
.pb-info div:first-child { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-info div:last-child { font-size: 12.5px; color: var(--muted); }
.pb-auto { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.pb-seekrow { display: flex; align-items: center; gap: 8px; }
/* v1.08 — playbar options row: speed presets + sleep timer */
.pb-opts { justify-content: space-between; padding-top: 2px; border-top: 1px dashed var(--hair); margin-top: 2px; }
.pb-speed, .pb-sleep { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pb-speed button, .pb-sleep button {
  width: auto; min-width: 34px; height: 28px; padding: 0 6px; border-radius: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  background: var(--bg-2); border: 1px solid var(--hair);
}
.pb-speed button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.pb-sleep button.on { background: #b02a2a; border-color: #b02a2a; color: #fff; }
.pb-sleep button.off-btn { color: var(--muted); }
.pb-sleep-lb { font-size: 13px; }
.pb-time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 34px; text-align: center; font-weight: 600; }
#pbSeek {
  flex: 1; min-inline-size: 0; -webkit-appearance: none; appearance: none; height: 26px; background: transparent; cursor: pointer;
}
#pbSeek::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) var(--fill, 0%), var(--bg-2) var(--fill, 0%));
}
#pbSeek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3);
  margin-top: -5px;
}
#pbSeek::-moz-range-track { height: 6px; border-radius: 3px; background: var(--bg-2); }
#pbSeek::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--blue); }
#pbSeek::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--blue); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }

/* ============ Thayer lexicon + KJV usage (v1.08) ============ */
.thayer { line-height: 1.52; }
.th { margin: 0 0 7px; }
.th.th0 { font-weight: 700; color: var(--blue-deep); margin-bottom: 10px; }
.th.th1 { font-weight: 700; margin-top: 12px; color: var(--ink); }
.th.th2 { font-weight: 600; margin: 10px 0 7px 14px; }
.th.th3 { margin: 6px 0 6px 30px; color: var(--ink-2); }
.thayer-loading { color: var(--muted); font-style: italic; }
.helps { background: var(--bg-2); border-left: 3px solid var(--blue); padding: 10px 12px; border-radius: 0 10px 10px 0; line-height: 1.5; }
.kjvchip {
  display: inline-flex; align-items: center; gap: 5px; background: var(--bg-2);
  border: 1px solid var(--hair); border-radius: 999px; padding: 5px 11px; margin: 0 6px 6px 0;
  font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.kjvchip b { color: var(--blue-deep); font-weight: 650; }
.kjvchip:active { background: var(--blue-soft); }
.usage-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fluid-hint { width: 100%; font-size: 11.5px; color: var(--muted); margin-top: -6px; }

/* ============ font popup ============ */
.pop { position: fixed; z-index: 85; top: calc(112px + var(--safe-top)); right: max(8px, var(--safe-right)); bottom: max(8px, var(--safe-bottom)); width: min(340px, calc(100% - 16px - var(--safe-left) - var(--safe-right))); pointer-events: none; }
.pop-card {
  background: var(--bg); border: 1px solid var(--hair); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.2); padding: 14px; width: 100%; max-height: 100%; overflow: auto; pointer-events: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.theme-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 78px), 1fr)); gap: 6px; }
.theme-seg button { min-height: 44px; background: var(--bg-2); border: 1px solid var(--hair); border-radius: 9px; padding: 9px 4px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.theme-seg button.on { background: var(--blue-soft); color: var(--blue-deep); border-color: var(--blue); }
.font-row { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--ink-2); font-size: 14px; }
.step-btn { flex: 1; background: var(--bg-2); border: 1px solid var(--hair); border-radius: 9px; padding: 9px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.step-btn.on { background: var(--blue-soft); color: var(--blue-deep); border-color: var(--blue); }
.pop-links { display: flex; flex-direction: column; border-top: 1px solid var(--hair); padding-top: 8px; }
.pop-links button { text-align: left; padding: 10px 6px; font-size: 15px; color: var(--blue); font-weight: 600; }

/* ============ panels (commentaries / dictionaries / concordance / download) ============ */
.panel-head { position: sticky; top: 0; background: var(--bg); padding: 10px 14px; z-index: 5; }
.panel-head input {
  width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 10px;
  border: 1.5px solid var(--hair); background: var(--bg-2); color: var(--ink); outline: none;
}
.panel-head input:focus { border-color: var(--blue); }
.panel-body { padding: 12px 16px 90px; }
.ins-card { background: var(--bg-2); border: 1px solid var(--hair); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.ins-card h4 { margin: 0 0 10px; color: var(--blue-deep); font-size: 15px; text-transform: uppercase; letter-spacing: .5px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-chip { background: var(--bg); border: 1px solid var(--hair); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink-2); }
.stat-chip b { display: block; font-size: 19px; color: var(--ink); }
.lex-item, .conc-item { padding: 12px 4px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.lex-item .lnum { color: var(--red); background: var(--yellow); font-weight: 800; padding: 1px 7px; border-radius: 3px; font-size: 13.5px; margin-right: 8px; }
.lex-item .lword { font-size: 17px; font-weight: 600; }
.lex-item .ltrans { color: var(--muted); font-size: 13.5px; }
.lex-item .lkjv { color: var(--ink-2); font-size: 14px; margin-top: 3px; }
.conc-item .cref { color: var(--blue); font-weight: 700; font-size: 14.5px; }
.conc-item .ctxt { color: var(--ink-2); font-size: 14.5px; }
.form-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.form-chip { background: var(--blue-soft-2); border: 1px solid var(--hair); color: var(--blue-deep); padding: 5px 10px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.keyverse { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.keyverse .kvref { color: var(--blue); font-weight: 700; }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.name-chip { background: var(--bg); border: 1px solid var(--hair); border-radius: 9px; padding: 8px 10px; font-size: 13.5px; text-align: left; }
.name-chip b { color: var(--ink); display: block; }
.name-chip span { color: var(--muted); font-size: 12px; }
.dl-block { background: var(--bg-2); border: 1px solid var(--hair); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.dl-block h4 { margin: 0 0 8px; font-size: 16.5px; }
.dl-block p { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.dl-btn { display: inline-block; background: var(--blue); color: #fff; border-radius: 10px; padding: 11px 16px; font-weight: 700; font-size: 14.5px; margin-right: 8px; margin-bottom: 8px; }
.dl-btn.ghost { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.empty-hint { color: var(--muted); text-align: center; padding: 40px 20px; font-size: 14.5px; line-height: 1.6; }

/* ============ modal / toast ============ */
#modalCard { max-height: 86vh; overflow-y: auto; }
.modal-title { margin: 0 0 12px; font-size: 19px; }
.plan-item { display: flex; align-items: center; gap: 12px; padding: 13px 10px; border: 1px solid var(--hair); border-radius: 12px; margin-bottom: 9px; cursor: pointer; }
.plan-item .pi-main { flex: 1; }
.plan-item .pi-main b { display: block; font-size: 15.5px; }
.plan-item .pi-main span { font-size: 13px; color: var(--muted); }
.plan-item .pi-day { color: var(--blue); font-weight: 800; font-size: 15px; }
.prog { height: 7px; background: var(--bg-2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.prog i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.stat-big { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stat-big > div { flex: 1; min-width: 90px; background: var(--bg-2); border: 1px solid var(--hair); border-radius: 12px; padding: 13px; text-align: center; }
.stat-big b { display: block; font-size: 25px; }
.stat-big span { font-size: 12.5px; color: var(--muted); }
.note-area { width: 100%; min-height: 130px; border: 1.5px solid var(--hair); border-radius: 10px; padding: 12px; font-size: 15.5px; background: var(--bg-2); color: var(--ink); resize: vertical; margin-bottom: 12px; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; }
.about-body { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.about-body h4 { color: var(--ink); margin: 14px 0 4px; }
.card-preview { background: linear-gradient(160deg, #10233f, #1d4076); border-radius: 14px; padding: 26px 20px; color: #fff; margin-bottom: 12px; }
.card-preview .cv-text { font-size: 19px; line-height: 1.55; font-family: Georgia, serif; }
.card-preview .cv-ref { margin-top: 14px; color: #ffd75e; font-weight: 700; font-size: 15px; }
.card-preview .cv-brand { margin-top: 10px; color: #9db9dd; font-size: 11.5px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 120px; z-index: 95;
  background: rgba(20, 22, 28, .92); color: #fff; font-size: 14px; font-weight: 600;
  border-radius: 12px; padding: 11px 18px; max-width: 88vw; text-align: center;
}
.toast button { color: #8ec4ff; font-weight: 700; margin-left: 8px; }

/* desktop wide layout: keep phone frame centered like the reference app */
@media (min-width: 700px) {
  #topbar .refpill { max-width: 420px; }
  .reader { max-width: 760px; margin: 0 auto; padding-top: 26px; }
  .panel-body, .panel-head { max-width: 760px; margin: 0 auto; }
}

/* ============ v1.07: daily strip ============ */
#dailyStrip { padding: 12px 16px 0; }
.daily-card {
  background: var(--blue-soft-2); border: 1px solid var(--blue-soft);
  border-radius: 14px; padding: 14px 14px 12px; margin-bottom: 10px;
}
.dc-top { display: flex; align-items: center; margin-bottom: 6px; }
.dc-kicker { flex: 1; color: var(--blue-deep); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; }
.dc-x { color: var(--muted); font-size: 15px; width: 30px; height: 30px; border-radius: 8px; }
.dc-text { font-family: Georgia, "Times New Roman", serif; font-size: 16.5px; line-height: 1.6; color: var(--ink); }
.dc-ref { color: var(--blue); font-weight: 700; font-size: 14px; margin: 6px 0 10px; }
.daily-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 6px; }
.chip {
  background: var(--bg-2); border: 1px solid var(--hair); color: var(--ink-2);
  padding: 8px 12px; border-radius: 16px; font-size: 13px; font-weight: 600;
}
.chip:active { background: var(--blue-soft); color: var(--blue-deep); }
/* v1.08 — reading streak + Word of the Day chips */
.chip.streak { background: #fff3d6; color: #8a5a00; border-color: #ecd28a; }
.chip.streak::before { content: none; }
.wod-gloss { color: var(--muted); font-weight: 500; }
@media (min-width: 700px) {
  #dailyStrip { max-width: 760px; margin: 0 auto; padding-top: 20px; }
}

/* ============ v1.07: search filters + recent searches ============ */
.search-filters { display: flex; gap: 6px; margin-top: 10px; }
.sf { flex: 1; background: var(--bg-2); border: 1px solid var(--hair); padding: 7px 4px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sf.on { background: var(--blue-soft); color: var(--blue-deep); border-color: var(--blue); }
.recents { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.rec-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.recent-q { background: var(--bg-2); border: 1px solid var(--hair); color: var(--ink-2); padding: 5px 10px; border-radius: 14px; font-size: 12.5px; }
.recent-clear { color: var(--red); font-size: 12.5px; font-weight: 700; padding: 5px 6px; }

/* ============ v1.07: multi-verse selection ============ */
.selbar {
  flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--blue); border-radius: 14px;
  box-shadow: 0 10px 34px rgba(0,0,0,.22); display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; width: min(560px, 100%);
}
.selbar #selInfo { flex: 1; font-weight: 700; font-size: 14.5px; color: var(--blue-deep); }
body.selecting #reader .verse { cursor: pointer; }
body.selecting #reader .verse.sel {
  background: var(--blue-soft-2); box-shadow: inset 3px 0 0 var(--blue);
  border-radius: 4px; padding-left: 6px; margin-left: -6px;
}
.mini-btn.ghost { border-color: var(--hair); color: var(--ink-2); }

/* ============ v1.07: focus mode ============ */
body.focus #topbar, body.focus #tabbar, body.focus #dailyStrip, body.focus #selBar { display: none !important; }
body.focus .reader { padding-top: 40px; padding-bottom: 120px; }
.focus-exit {
  position: fixed; top: 10px; right: 10px; z-index: 90;
  background: var(--bg); border: 1px solid var(--hair); color: var(--blue);
  border-radius: 12px; padding: 9px 14px; font-weight: 700; font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

/* ============ v1.07: paragraph flow mode ============ */
body.flow .reader .verse { display: inline; margin: 0; }
body.flow .reader .verse .vn { font-size: 0.62em; vertical-align: super; margin-right: 1px; font-weight: 700; }
body.flow .reader .verse.speaking { box-shadow: none; padding-left: 0; margin-left: 0; }

/* ============ v1.07: chapter grid with ch prefix ============ */
.chap-head {
  grid-column: 1 / -1; color: var(--blue-deep); font-weight: 700;
  font-size: 13.5px; padding: 4px 2px 2px;
}
.chap-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
.chap-item {
  aspect-ratio: auto; min-height: 40px; padding: 8px 2px;
  font-size: 13px; border-radius: 8px;
}

/* ============ v1.07: memorize ============ */
.mem-tools { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.mem-verse { font-size: 17px; line-height: 1.9; color: var(--ink); }
.mem-word { margin-right: 2px; }
.mem-blank {
  display: inline-block; min-width: 52px; text-align: center; margin: 0 3px;
  background: var(--bg-2); border: 1px dashed var(--muted); color: var(--muted);
  border-radius: 6px; padding: 0 8px; cursor: pointer; user-select: none; font-size: 13px;
}

/* ============ v1.07: quiz ============ */
.quiz-prog { color: var(--muted); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.quiz-q { font-size: 16.5px; line-height: 1.55; color: var(--ink); margin-bottom: 14px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  text-align: left; border: 1.5px solid var(--hair); border-radius: 11px;
  padding: 12px 14px; font-size: 15px; font-weight: 600; color: var(--ink-2); background: var(--bg);
}
.quiz-opt:active { background: var(--blue-soft); }
.quiz-opt.right { border-color: #2e9e4f; background: rgba(70, 190, 100, .16); color: #17642e; }
.quiz-opt.wrong { border-color: #d8402f; background: rgba(220, 70, 50, .12); color: #a02515; }
.quiz-opt:disabled { cursor: default; }
.quiz-score { font-size: 40px; font-weight: 800; color: var(--blue); text-align: center; margin: 8px 0 4px; }

/* ============ v1.07: My Verses ============ */
.mv-segs { display: flex; gap: 6px; margin-bottom: 10px; }
.mv-seg { flex: 1; background: var(--bg-2); border: 1px solid var(--hair); padding: 8px 4px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.mv-seg.on { background: var(--blue-soft); color: var(--blue-deep); border-color: var(--blue); }
.mv-row { display: flex; align-items: center; gap: 8px; padding: 11px 4px; border-bottom: 1px solid var(--hair); }
.mv-main { flex: 1; cursor: pointer; }
.mv-main .oref { color: var(--blue); font-weight: 700; font-size: 15px; }
.mv-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.mv-del { color: var(--muted); font-size: 14px; width: 34px; height: 34px; border-radius: 9px; }
.mv-del:active { background: var(--bg-2); color: var(--red); }
.mv-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }

/* ---- v1.09 dark-theme overrides for voice provenance ---- */
body.dark .voice-src { border-color: #2a3a52; }
body.dark .voice-src .vs-d a { color: var(--blue); }
body.dark .vstat.st-exact    { background: #14351f; color: #6fd694; border-color: #1f5330; }
body.dark .vstat.st-shaped   { background: #332b0d; color: #e8c766; border-color: #55461a; }
body.dark .vstat.st-fallback { background: #232733; color: #9aa1b0; border-color: #333a4d; }
body.dark .vcard .vlive { background: var(--bg-2); border-color: #2a3a52; }
body.dark .vcard .vst { color: var(--ink); }

/* ============ v1.10: occurrences accordion + unified Strong's layout ==== */

/* language chip beside the number chip (every entry, Greek & Hebrew) */
.str-chip.lang {
  background: var(--blue-soft); color: var(--blue-deep);
  font-size: 12.5px; font-weight: 800; letter-spacing: .06em;
  padding: 4px 10px; border-radius: 999px; margin-left: 6px;
  text-transform: uppercase;
}

/* occurrence summary panel — identical on Details & Occurrences tabs */
.occ-panel { margin-top: 20px; }
.occ-stats {
  display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px;
}
.occ-stat {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: var(--bg-2); border: 1px solid var(--hair);
  border-radius: 999px; padding: 6px 13px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.occ-stat b { font-size: 16.5px; color: var(--blue-deep); font-variant-numeric: tabular-nums; }
body.dark .occ-stat b { color: var(--blue); }

/* book-organized occurrence list — same visual language as the books drawer */
.occ-books { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.occ-book {
  background: var(--bg-2); border: 1px solid var(--hair);
  border-radius: 12px; overflow: hidden;
}
.occ-book-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 12px 12px; text-align: left; cursor: pointer;
  background: none; border: 0;
}
.occ-book-head:active { background: var(--blue-soft); }
.ob-caret {
  color: var(--blue); font-size: 13px; font-weight: 800;
  transition: transform .18s ease; transform-origin: 50% 50%;
  flex: 0 0 14px;
}
.occ-book.open .ob-caret { transform: rotate(90deg); }
.ob-name { font-size: 15.5px; font-weight: 700; color: var(--ink); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-meta { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ob-n {
  min-width: 30px; text-align: center;
  background: var(--yellow); color: #7a1010;
  font-weight: 800; font-size: 12px; border-radius: 6px; padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}
.occ-book.open { border-color: var(--blue); background: var(--bg); }
.occ-book-verses { border-top: 1px solid var(--hair); padding: 4px 10px 8px; }
.occ-book-verses .occ-item { border-bottom: 1px solid var(--hair); border-radius: 8px; }
.occ-book-verses .occ-item:last-child { border-bottom: 0; }
.dist-row:active .dist-name { color: var(--blue); }

/* ============ v1.10: UI polish ============ */
/* sheets + cards: softer shadow, consistent radius */
.sheet-card { box-shadow: 0 -6px 40px rgba(16, 24, 40, .16); }
@media (min-width: 720px) {
  .sheet-card { box-shadow: 0 24px 80px rgba(16, 24, 40, .22); }
}
/* occ items: comfortable tap targets */
.occ-item { padding: 9px 6px; transition: background .12s ease; border-radius: 8px; }
.occ-item:active { background: var(--blue-soft-2); }
.oref { color: var(--blue-deep); font-weight: 700; }
body.dark .oref { color: var(--blue); }
/* distribution rows: roomier */
.dist-row { padding: 4px 0; border-radius: 6px; }
.dist-row:hover .dist-name { color: var(--blue); }
/* voice cards: clearer active state */
.vcard.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
/* verse hero chips keep punctuation clean */
.occ-stat, .ob-n { font-feature-settings: "tnum"; }

/* v2.1: devotional and private testimony draft controls */
.ministry-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  max-width: 760px;
  margin-inline: auto;
  padding: 10px 16px 3px;
}
.ministry-toolbar button {
  min-height: 44px;
  padding: 9px 8px;
  border: 1px solid var(--blue);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}
.ministry-toolbar button:active { background: var(--blue-soft); }
.ministry-toolbar button:focus-visible, .mini-btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.ministry-card{background:rgba(118,149,185,.11);border:1px solid rgba(118,149,185,.27);padding:14px;border-radius:14px;margin:12px 0;}
.ministry-card h4{font-size:1.15rem;margin:0 0 8px}.ministry-card blockquote,.ministry-quote{border-left:3px solid #c99b47;margin:12px 0;padding:8px 12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;}
.ministry-label{display:block;font-weight:650;margin:14px 0 7px}.sheet-card textarea{box-sizing:border-box;width:100%;min-height:110px;border:1px solid var(--blue);border-radius:10px;background:var(--bg-2);color:var(--ink);padding:12px;font:inherit;resize:vertical;}
.ministry-note,.ministry-excerpt{padding:10px 12px;border-radius:10px;background:rgba(118,149,185,.1);line-height:1.5;overflow-wrap:anywhere;}
.sheet-card textarea::placeholder { color: var(--ink-2); opacity: 1; }

/* Rhema One v0.1: three owner-requested themes (Black & Gold, Clear Glass, Slate).
 * No claims about exact color parity with RhemaFlow screenshots; tokens are mapped conceptually. */
body.rhema-gold {--accent-ink:#16120a;--blue:#d7ad52;--blue-deep:#f4d890;--blue-soft:#342815;--blue-soft-2:#221c13;--red:#e18880;--red-letter:#ef998b;--ink:#fff1d0;--ink-2:#e4d3b4;--muted:#b5a080;--bg:#0e1014;--bg-2:#191a1f;--hair:#393122;--tab-ink:#b4a88e;color-scheme:dark}
body.rhema-glass {--blue:#336aa9;--blue-deep:#1d5b9f;--blue-soft:#e2ebfb;--blue-soft-2:#f0f6ff;--ink:#142a43;--ink-2:#35536d;--muted:#677f99;--bg:#eaf1f9;--bg-2:rgba(255,255,255,.8);--hair:#d0dae6;--tab-ink:#667f99;color-scheme:light}
body.rhema-slate {--accent-ink:#192430;--blue:#a0c6ee;--blue-deep:#c6e1ff;--blue-soft:#31455d;--blue-soft-2:#26364a;--ink:#eef5ff;--ink-2:#ced9e9;--muted:#9fb0c5;--bg:#192430;--bg-2:#253446;--hair:#394a5e;--tab-ink:#bdccda;color-scheme:dark}
.hub-top-banner{position:relative;flex:0 0 auto;background:var(--bg-2);border-bottom:1px solid var(--hair);padding:6px 16px;text-align:center;font:600 11px/1.4 system-ui;letter-spacing:.035em;color:var(--blue-deep)}
body.hub-view #topbar{display:none}
#content{scroll-behavior:smooth}
.hub-body{max-width:1000px;margin:auto;padding:20px 20px 96px;font-family:system-ui,-apple-system,sans-serif}
.hub-hero{border:1px solid var(--hair);border-radius:22px;padding:24px;background:linear-gradient(120deg,var(--bg-2),var(--blue-soft-2));margin-bottom:16px}
.hub-eyebrow{font-size:11px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--blue-deep)}
.hub-hero h1{font-size:clamp(27px,5vw,40px);line-height:1.13;margin:9px 0 10px;letter-spacing:-.035em}
.hub-hero p{color:var(--ink-2);line-height:1.55;margin:0 0 17px}
.hub-panel{background:var(--bg-2);border:1px solid var(--hair);border-radius:20px;padding:21px;margin:14px 0}
.hub-panel h2{font-size:19px;margin:0 0 8px}.hub-panel h3{margin:16px 0 7px;font-size:15px}
.hub-panel p{color:var(--ink-2);line-height:1.55}
.hub-primary,.hub-search button{background:var(--blue);color:var(--bg);font-weight:800;min-height:44px;padding:11px 16px;border-radius:12px;border:1px solid var(--blue)}
body.rhema-glass .hub-primary,body.rhema-glass .hub-search button{color:#fff}
.hub-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.hub-grid>button,.hub-demo-church{display:flex;align-items:flex-start;flex-direction:column;text-align:left;border:1px solid var(--hair);background:var(--bg);border-radius:14px;padding:16px;gap:7px;color:var(--ink);font-size:22px}
.hub-grid strong{font-size:15px}.hub-grid span,.hub-demo-church p{font-size:12px;color:var(--muted);line-height:1.35;margin:0}
.hub-switch,.hub-filter{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.hub-switch button,.hub-filter button,.hub-bible-tools button{border:1px solid var(--hair);border-radius:11px;padding:10px 13px;min-height:40px;color:var(--ink);background:var(--bg);font:650 12px/1.2 system-ui}
.hub-switch button.selected,.hub-filter button.selected{border-color:var(--blue);box-shadow:inset 0 0 0 1px var(--blue);background:var(--blue-soft)}
.hub-disclaimer{font-size:12px;color:var(--muted)!important;line-height:1.5}
.hub-storylist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.hub-story{border-radius:17px;padding:20px;border:1px solid var(--hair);background:var(--bg-2)}
.hub-storytag{font-size:11px;font-weight:800;color:var(--blue-deep);text-transform:uppercase;letter-spacing:.07em}
.hub-story h3{font-size:18px;margin:9px 0}.hub-story p{font-size:14px;line-height:1.6;color:var(--ink-2)}
.hub-story small{font-size:11px;color:var(--muted)}
.hub-search{display:flex;gap:7px;margin:10px 0}
.hub-search input{flex:1;min-width:100px;min-height:44px;padding:12px 14px;border-radius:12px;border:1px solid var(--hair);background:var(--bg);color:var(--ink)}
.hub-bible-tools{display:flex;flex-wrap:wrap;gap:7px;padding:8px 12px;border-bottom:1px solid var(--hair)}
.hub-auth-options{display:grid;gap:9px;margin:16px 0}.hub-auth-options button{background:var(--bg-2);border:1px solid var(--hair);padding:14px;min-height:44px;border-radius:12px;color:var(--muted);cursor:not-allowed}
#hubDraftText{display:block;width:100%;box-sizing:border-box;border:1px solid var(--hair);border-radius:12px;padding:12px;color:var(--ink);background:var(--bg-2);font:14px/1.5 system-ui}
#hubChars{font-size:12px;color:var(--muted);margin:5px 0 12px}
#hubMediaPreview audio,#hubMediaPreview video{max-width:100%;width:100%;border-radius:10px;margin:10px 0}
#tabbar .tab{min-width:0}#tabbar .tab .rhema-navicon{font:700 24px system-ui;line-height:27px}
body.rhema-glass .hub-panel,body.rhema-glass .hub-hero,body.rhema-glass .hub-story{backdrop-filter:blur(14px)}
body.rhema-gold .hub-primary{color:#16120a}
@media(max-width:630px){.hub-body{padding:12px 12px 90px}.hub-grid,.hub-storylist{grid-template-columns:1fr}.hub-hero{padding:18px}.hub-panel{padding:17px}.hub-switch button{flex:1 1 auto}}

/* v0.801.2 connected chat/church UI; same RhemaFlow theme variables */
.rc-mono {overflow-wrap:anywhere; font-family:ui-monospace, SFMono-Regular, Menlo,monospace; font-size:12px; opacity:.85}
.rc-messages {max-height:270px; min-height:100px; overflow:auto; border:1px solid currentColor; border-radius:10px; padding:12px; margin:10px 0; opacity:.95}
.rc-message {white-space:pre-wrap; word-break:break-word; padding:8px 11px; margin:7px 0; border-radius:10px; background:rgba(128,128,128,.15)}
.rc-message.mine {margin-left:12%; border-left:3px solid #c9a347}
.rc-message.theirs {margin-right:12%; border-left:3px solid #7d9ac8}
.rc-message small {opacity:.65; font-size:10px}
.rc-video-grid {display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:12px 0}
.rc-video-grid video {width:100%; aspect-ratio:4/3; object-fit:cover; background:#10161c; border-radius:10px}
#rhemaChats input, #rhemaChats textarea, #rhemaChurches input, #modalCard input {max-width:100%; box-sizing:border-box}
#rcChurchResults .hub-story {margin:9px 0}
@media(max-width:430px){.rc-video-grid {grid-template-columns:1fr} .rc-video-grid video {max-height:180px}}

/* v0.801.3: WhatsApp-inspired voice notes and local draft review (all three themes) */
.rc-draft-panel {margin:14px 0 16px;padding:16px;border-radius:14px;border:1px solid var(--hair);background:var(--blue-soft-2)}
.rc-draft-heading {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.rc-privacy {font:600 11px system-ui;color:var(--blue-deep)}
#rcCompose,#rcReviewText {display:block;width:100%;box-sizing:border-box;border:1px solid var(--hair);border-radius:12px;padding:13px;margin:8px 0;font:inherit;line-height:1.55;resize:vertical;background:var(--bg);color:var(--ink)}
#rcReviewText:focus-visible,#rcCompose:focus-visible {outline:3px solid var(--blue);outline-offset:2px}
.rc-recording-state {display:flex;gap:9px;align-items:center;min-height:38px;color:var(--ink);font-size:13px}
.rc-recording-state #rcRecordTimer {margin-left:auto;font-variant-numeric:tabular-nums;font-weight:750}
.rc-recording-dot {display:inline-block;width:12px;height:12px;border-radius:100%;background:var(--muted);flex:none}
.rc-recording-dot.on {background:#e34848;box-shadow:0 0 0 5px rgba(227,72,72,.12);animation:rcRecordPulse 1.2s infinite}
@keyframes rcRecordPulse {50% {opacity:.5}}
.rc-voice-bars {display:flex;align-items:center;height:45px;gap:4px;padding:8px 4px;opacity:.35}
.rc-voice-bars i {display:block;flex:1;max-width:9px;border-radius:4px;background:var(--blue);height:15px}
.rc-voice-bars i:nth-child(3n) {height:27px}.rc-voice-bars i:nth-child(4n) {height:34px}
.rc-voice-bars.on {opacity:.95}
.rc-voice-bars.on i {animation:rcWave .68s ease-in-out alternate infinite}
.rc-voice-bars.on i:nth-child(2n) {animation-delay:.14s}.rc-voice-bars.on i:nth-child(3n) {animation-delay:.28s}
@keyframes rcWave {to {transform:scaleY(.35)}}
#rcVoiceReview {margin-top:10px;padding:12px;border-radius:12px;background:var(--blue-soft-2);border:1px solid var(--hair)}
#rcVoicePreview,.rc-message audio {display:block;width:100%;max-width:410px;margin:8px 0 5px}
#rhemaChats button:disabled {opacity:.48;cursor:not-allowed}
#rcHoldButton {touch-action:none;user-select:none;-webkit-user-select:none}
@media(prefers-reduced-motion:reduce){.rc-recording-dot.on,.rc-voice-bars.on i{animation:none!important}}
@media(max-width:430px){.rc-draft-panel{padding:12px}.rc-recording-state{font-size:12px}}
/* Ensure primary actions are legible inside the shared button toolbar. */
.hub-switch button.hub-primary {background:var(--blue);border-color:var(--blue);color:var(--bg)}
body.rhema-gold .hub-switch button.hub-primary{color:#16120a}
body.rhema-glass .hub-switch button.hub-primary{color:#fff}

/* 0.801.4 resilient WebAssembly startup diagnostics; remains accessible during failure */
.rhema-boot-notice{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:9px 14px;position:relative;background:var(--surface,#171a1e);color:var(--text,#eee);border-bottom:2px solid #a17939;z-index:3000;font-size:14px;min-height:42px}
.rhema-boot-notice[hidden],.rhema-boot-notice [hidden]{display:none!important}
.rhema-boot-notice[data-state="failed"]{border-bottom-color:#d75b53}
.rhema-boot-notice button{color:inherit;background:transparent;border:1px solid currentColor;border-radius:7px;padding:4px 10px;cursor:pointer}
.rhema-boot-notice small{flex-basis:100%;line-height:1.5;font-size:13px}

/* RhemaChat v0.801.5: accessible engine-failure fallback for every tab */
.rhema-nav-fallback{max-width:780px;margin:22px auto;padding:24px;border:1px solid var(--hair,#a88e55);border-radius:18px;background:var(--surface,#12161a);color:var(--text,#eee);line-height:1.55}
.rhema-nav-fallback h2{font-size:clamp(22px,3vw,30px);margin:12px 0}
.rhema-nav-fallback p{margin:10px 0;opacity:.94}
.rhema-nav-fallback-tag{display:inline-flex;letter-spacing:.07em;text-transform:uppercase;font-size:11px;font-weight:700;color:#d8aa54}
.rhema-nav-detail{font-size:13px;overflow-wrap:anywhere}
.rhema-nav-fallback button{margin-top:12px;max-width:100%}
#tabbar .tab{cursor:pointer;touch-action:manipulation;min-height:48px}
#tabbar .tab:focus-visible{outline:2px solid #d6ab60;outline-offset:-2px}
/* Bundled voice status remains outside the Rust-rendered card grid. */
.neural-status{margin:12px 0;padding:12px 14px;border:1px solid var(--line,#c9cdd5);border-radius:12px;font-size:14px;line-height:1.5;background:var(--panel,transparent);overflow-wrap:anywhere}
.neural-status[data-state="loading"]{border-color:#9c7b2c}
.neural-status[data-state="error"]{border-color:#c74646}
.voice-offline{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:10px 0 18px;font-size:12px;line-height:1.5}
.voice-ctrl input:disabled{opacity:.45;cursor:not-allowed}

/* 0.801.8: compact voice choice with visible progress and measured start time. */
#voicePanel .sheet-card{max-width:760px;width:calc(100% - 28px);max-height:92vh;padding:20px;gap:0}
#voicePanel .voice-grid{min-height:160px;max-height:43vh;flex:1 1 auto;margin:12px 0}
#voicePanel .voice-src{margin-bottom:4px}
#voicePanel .neural-status{flex:none;margin:8px 0 4px;padding:10px 12px;font-weight:650;min-height:22px}
#voicePanel .neural-timing{font-size:12px;line-height:1.4;color:var(--muted);font-variant-numeric:tabular-nums;margin:0 2px 6px}
#voicePanel .voice-offline{margin:2px 0 6px;font-size:11px}
#voicePanel .vcard.duo{padding:12px;gap:7px}
#voicePanel .vcard .vbtns{display:flex;flex-direction:row;gap:7px;margin:0}
#voicePanel .vcard .vbtns button{flex:1;min-height:40px}
#voicePanel .vstat{font-size:9px;margin-left:0;margin-top:4px}
#voicePanel .vdetails{font-size:11px;line-height:1.4;color:var(--muted)}
#voicePanel .vdetails summary{cursor:pointer;padding:2px 0}
#voicePanel .vdetails[open] .vmeta{margin-top:6px}
#voicePanel .voice-ctrl{flex-shrink:0;gap:10px;padding-top:12px}
#voicePanel .fluid-hint{font-size:11px;line-height:1.4}

/* Strong's entry in Black & Gold */
body.rhema-gold .say-btn { color: var(--accent-ink, #191305); box-shadow: none; }
body.rhema-gold .flabel { color: var(--muted); }
body.rhema-gold .str-hero .hl-y,
body.rhema-gold .str-chip:not(.lang) { background: #372b16; color: #ffdf94; }

/* Keep reading and its controls in separate regions, including with the home indicator. */
#readingDock {
  display: flex; flex: none; flex-direction: column; align-items: center;
  max-block-size: min(42dvh, 260px); overflow: auto; overscroll-behavior: contain;
  padding-inline: max(6px, var(--safe-left)) max(6px, var(--safe-right));
}
#readingDock > :not([hidden]) { flex: none; margin-block: 4px; }
.page { padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); }
.page-head, .module-tabs { flex: none; }
.page-head button { min-block-size: 44px; }
.sheet-card :is(.book-list, .chap-grid, .search-results) { min-block-size: 0; }
#searchOverlay .sheet-card { overflow: auto; }
#searchOverlay .sheet-head { position: sticky; top: 0; background: var(--bg); z-index: 1; }
#searchOverlay .search-results { flex: none; overflow: visible; }
.rp-arrow { width: 36px; height: 44px; }
.tab span:last-child { max-width: 100%; overflow-wrap: anywhere; line-height: 1.15; }
.pop-links button { min-height: 44px; }
.str-hero, .page-body, .sr-item { overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .tb-row { padding-inline: 8px; gap: 3px; }
  .ver-pill { padding-inline: 8px; }
  .rp-label, .page-ref { font-size: 15px; }
  .hub-bible-tools button { flex: 1 1 40%; min-height: 44px; }
  .search-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-card { padding: 12px; }
  .page-nav button { width: 32px; }
  .pb-opts { justify-content: flex-start; }
  .pb-speed button, .pb-sleep button { min-height: 36px; }
  .playbar { padding: 6px 8px; gap: 2px; }
}
@media (max-width: 420px) {
  .playbar .pb-row:first-child { display: grid; grid-template-columns: repeat(4, 44px) minmax(0, 1fr); }
  .playbar .pb-row:first-child .pb-info { grid-column: 1 / 4; grid-row: 1; }
  .playbar .pb-row:first-child .pb-auto { grid-column: 4 / -1; grid-row: 1; justify-self: end; min-height: 36px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  #topbar .tb-row { padding-block: 0; }
  #tabbar { padding-top: 0; }
  .hub-top-banner { display: none; }
  #readingDock { max-block-size: 44dvh; }
  .pop { top: max(8px, var(--safe-top)); }
}

#voiceSrc .vbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
#voiceSrc .vbtns button { flex: 1 1 auto; min-height: 44px; }
