/* ---------- Theme tokens ---------- */
:root {
  --font-serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #14141b;
  --bg-elevated: #1c1c26;
  --bg-elevated-2: #25252f;
  --bg-hover: #2c2c38;
  --border: #303040;
  --text: #e8e7ee;
  --text-dim: #9d9caa;
  --text-faint: #86858f;
  --wj-color: #ef8686;

  --accent: #8d7cf5;
  --accent-2: #6f5de0;
  --accent-soft: rgba(141, 124, 245, 0.16);
  --accent-glow: rgba(141, 124, 245, 0.35);
  --highlight-bg: rgba(141, 124, 245, 0.22);

  --hl-yellow: rgba(234, 179, 8, 0.22);
  --hl-green: rgba(34, 197, 94, 0.20);
  --hl-blue: rgba(59, 130, 246, 0.20);
  --hl-pink: rgba(236, 72, 153, 0.20);
  --hl-purple: rgba(168, 85, 247, 0.22);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.28);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.35), 0 14px 34px rgba(0,0,0,0.32);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.04);
  --shadow: var(--shadow-md);
}

html[data-theme="light"] {
  --bg: #f4f2fa;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #edeaf7;
  --bg-hover: #e5e1f3;
  --border: #dfdaef;
  --text: #29273a;
  --text-dim: #67637c;
  --text-faint: #6e6b78;
  --wj-color: #a3271f;

  --accent: #5d4fc7;
  --accent-2: #4a3fae;
  --accent-soft: rgba(93, 79, 199, 0.1);
  --accent-glow: rgba(93, 79, 199, 0.22);
  --highlight-bg: rgba(93, 79, 199, 0.14);

  --hl-yellow: rgba(234, 179, 8, 0.28);
  --hl-green: rgba(34, 197, 94, 0.22);
  --hl-blue: rgba(59, 130, 246, 0.18);
  --hl-pink: rgba(236, 72, 153, 0.18);
  --hl-purple: rgba(168, 85, 247, 0.20);

  --shadow-sm: 0 1px 2px rgba(41,30,80,0.05), 0 2px 6px rgba(41,30,80,0.05);
  --shadow-md: 0 6px 18px rgba(41,30,80,0.08), 0 2px 8px rgba(41,30,80,0.05);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.6);
  --shadow: var(--shadow-md);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden { display: none !important; }

button:focus-visible, a:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- App shell ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  min-height: 64px;
  padding: 0 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 20;
}
.menu-toggle { display: none; flex-shrink: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.15;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 10px;
  flex-shrink: 0;
  min-width: 0;
}
.brand:hover { background: var(--bg-hover); }
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
}
.brand-sub {
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}
#searchInput {
  width: 100%;
  height: 38px;
  padding: 0 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease;
}
#searchInput:focus { border-color: var(--accent); }
.search-wrap .search-clear {
  position: absolute;
  right: 4px;
  display: none;
  width: 30px;
  height: 30px;
}
.search-clear svg { width: 14px; height: 14px; }
.search-wrap.has-text .search-clear { display: flex; }

.topbar-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.icon-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Sun/moon pill slider theme switch */
.theme-switch {
  position: relative;
  width: 56px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background .2s ease;
}
.theme-switch-icons {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  color: var(--text-faint);
  pointer-events: none;
}
.theme-switch-icons svg { width: 14px; height: 14px; }
.theme-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 6px rgba(0,0,0,0.3), 0 0 10px var(--accent-glow);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}
html[data-theme="dark"] .theme-switch-knob { transform: translateX(26px); }
html[data-theme="dark"] .theme-switch { background: #26242f; }

/* ---------- Body layout ---------- */
.body-wrap {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
  overflow-y: auto;
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
}
.jump-form { padding: 4px 2px 10px; }
#jumpInput {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
#jumpInput:focus { border-color: var(--accent); }
#jumpInput.shake { animation: shake .35s ease; border-color: #d9534f; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.sidebar-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-faint);
  padding: 14px 10px 6px;
}
.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.book-item { margin: 1px 0; }
.book-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.book-btn:hover { background: var(--bg-hover); color: var(--text); }
.book-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: var(--shadow-inset); }
.book-btn .chev {
  width: 14px; height: 14px;
  transition: transform .15s ease;
  color: var(--text-faint);
  flex-shrink: 0;
}
.book-item.open .book-btn .chev { transform: rotate(90deg); }

.chapter-grid {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 12px 14px;
}
.book-item.open .chapter-grid { display: flex; }
.chapter-chip {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chapter-chip:hover { background: var(--bg-hover); color: var(--text); }
.chapter-chip.active {
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.sidebar-footer {
  margin-top: 12px;
  padding: 14px 10px 6px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.sidebar-footer-link {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.sidebar-footer-link:hover { background: var(--bg-hover); color: var(--text-dim); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 15;
}

/* ---------- Reading pane ---------- */
.reading-pane {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 28px 20px 80px;
  display: flex;
  justify-content: center;
}

.reader-view {
  width: 100%;
  max-width: var(--reader-width, 760px);
}
.search-view, .bookmarks-view, .info-view {
  width: 100%;
  max-width: 760px;
}

/* ---------- Landing page ---------- */
.landing-view {
  width: 100%;
  max-width: 640px;
  padding-top: 10px;
}
.landing-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 0 8px;
}
.landing-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}
.landing-logo {
  position: relative;
  height: 72px;
  width: auto;
  margin-bottom: 14px;
  z-index: 1;
}
.landing-wordmark {
  position: relative;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text);
  z-index: 1;
}
.landing-subtitle {
  position: relative;
  font-size: 12.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.6px;
  margin-top: 6px;
  z-index: 1;
}

.daily-verse {
  margin: 28px 0 20px;
  padding: 20px 22px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-elevated-2));
  border: 1px solid var(--border);
  cursor: pointer;
  box-shadow: var(--shadow-md), var(--shadow-inset);
  transition: box-shadow .18s ease, transform .18s ease;
}
.daily-verse:hover {
  box-shadow: var(--shadow-md), var(--shadow-inset), 0 0 0 1px var(--accent-soft);
  transform: translateY(-1px);
}
.daily-verse-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.daily-verse-text {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
}
.daily-verse-text .wj { color: var(--wj-color); }
.daily-verse-ref {
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
}

.continue-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.continue-btn:hover {
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: var(--shadow-sm), 0 0 16px var(--accent-glow);
}

.testament-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.testament-card {
  padding: 22px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-elevated-2));
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.testament-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-soft);
}
.testament-card-icon {
  width: 30px; height: 30px;
  margin: 0 auto 10px;
  padding: 8px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 0 14px var(--accent-glow);
}
.testament-card-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.testament-card-sub {
  font-size: 12px;
  color: var(--text-faint);
}

.landing-search-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 20px;
}

/* ---------- Info pages (About / Privacy / Contact) ---------- */
.info-view {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-dim);
}
.info-view h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--text);
  margin: 0 0 16px;
}
.info-view p { margin: 0 0 14px; }
.info-view ul { margin: 0 0 14px; padding-left: 20px; }
.info-view li { margin-bottom: 6px; }
.info-logo {
  height: 56px;
  width: auto;
  margin-bottom: 18px;
  opacity: 0.9;
}
.contact-email {
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}
.contact-email:hover { text-decoration: underline; }
.info-note {
  font-size: 13px;
  color: var(--text-faint);
  font-style: italic;
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}
.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.nav-btn:hover { color: var(--text); border-color: var(--accent); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.nav-btn:disabled:hover { border-color: var(--border); }

.reader-title-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chapter-select {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  border-radius: 8px;
  padding: 4px 6px;
}
.chapter-select:hover { background: var(--bg-hover); }
.chapter-select-num { width: 62px; }

/* ---------- Reader settings popover ---------- */
.reader-settings-wrap {
  position: relative;
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.reader-settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  max-width: calc(100vw - 32px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 14px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper-btn:hover { color: var(--text); border-color: var(--accent); }
.stepper-value {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.segmented {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.segmented button {
  flex: 1;
  border: none;
  background: var(--bg-elevated-2);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 12.5px;
  padding: 8px 4px;
  cursor: pointer;
  border-right: 1px solid var(--border);
}
.segmented button:last-child { border-right: none; }
.segmented button.active {
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
}
.segmented button:hover:not(.active) { color: var(--text); }

@media (max-width: 480px) {
  .reader-settings-panel {
    position: fixed;
    top: auto;
    bottom: 16px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
}

.verses {
  font-family: var(--font-serif);
  font-size: var(--reader-font-size, 18px);
  line-height: var(--reader-line-height, 1.85);
  color: var(--text);
}

.verse {
  position: relative;
  padding: 3px 66px 3px 44px;
  margin: 0 -8px;
  border-radius: 8px;
  cursor: default;
}
.verse:hover { background: var(--bg-elevated); }
.verse-num {
  position: absolute;
  left: 0;
  top: 6px;
  width: 34px;
  text-align: right;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  user-select: none;
}
.verse-text .wj { color: var(--wj-color); }

/* Verse action icons (bookmark/options + share) — always visible, not hover-gated,
   so bookmarking and sharing are discoverable without hunting for them. */
.verse-actions-btn, .verse-share-btn {
  display: flex;
  position: absolute;
  top: 4px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  opacity: 0.75;
  cursor: pointer;
  transition: opacity .15s ease, color .15s ease, background .15s ease;
}
.verse-actions-btn { right: 4px; }
.verse-share-btn { right: 34px; }
.verse-actions-btn svg, .verse-share-btn svg { width: 15px; height: 15px; }
.verse:hover .verse-actions-btn,
.verse:hover .verse-share-btn,
.verse.has-marks .verse-actions-btn {
  opacity: 1;
}
.verse.bookmarked .verse-actions-btn { color: var(--accent); }
.verse.bookmarked .verse-actions-btn svg { fill: currentColor; }
.verse-actions-btn:hover, .verse-share-btn:hover { background: var(--bg-hover); color: var(--text); opacity: 1; }

.verse-note-dot {
  position: absolute;
  right: 62px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Highlight colors — placed after :hover so the tint always wins */
.verse[data-hl-color="yellow"] { background: var(--hl-yellow); }
.verse[data-hl-color="green"]  { background: var(--hl-green); }
.verse[data-hl-color="blue"]   { background: var(--hl-blue); }
.verse[data-hl-color="pink"]   { background: var(--hl-pink); }
.verse[data-hl-color="purple"] { background: var(--hl-purple); }

.reader-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.footer-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-ui);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.footer-nav-btn:hover { color: var(--text); border-color: var(--accent); }
.footer-nav-btn:disabled { opacity: 0.3; cursor: default; }

/* ---------- Search / Bookmarks views ---------- */
.search-view-header { margin-bottom: 16px; }
.search-view-header h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin: 0;
}
.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.result-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--accent-soft);
  transform: translateY(-1px);
}
.result-ref {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.result-snippet {
  font-family: var(--font-serif);
  font-size: 15.5px;
  color: var(--text-dim);
  line-height: 1.5;
}
.result-snippet mark {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 3px;
}
.empty-state {
  color: var(--text-faint);
  font-size: 14px;
  padding: 30px 6px;
  text-align: center;
}
.result-empty-icon { display:none; }

.result-note {
  margin-top: 6px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-dim);
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.saved-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  margin: 18px 2px 6px;
}
.saved-section-label:first-child { margin-top: 2px; }

/* ---------- Search filters ---------- */
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.filter-select {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}
.search-exact-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.search-exact-toggle input { cursor: pointer; }
.index-progress {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

/* ---------- Verse action sheet ---------- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 20, 0.55);
  z-index: 40;
}
.verse-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: 480px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-md);
  padding: 10px 20px 22px;
  z-index: 41;
}
.verse-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 6px auto 14px;
}
.verse-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.verse-sheet-ref {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  color: var(--accent);
}
.verse-sheet-snippet {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-dim);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.verse-sheet-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.sheet-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-dim);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.sheet-action-btn svg { width: 17px; height: 17px; }
.sheet-action-btn:hover { color: var(--text); border-color: var(--accent); }
.sheet-action-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.verse-sheet-section { margin-bottom: 16px; }
.verse-sheet-section:last-child { margin-bottom: 4px; }
.verse-sheet-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}
.color-swatch-row {
  display: flex;
  gap: 10px;
}
.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.color-swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--accent); }
.swatch-none {
  background: linear-gradient(135deg, transparent 46%, var(--border) 48%, var(--border) 52%, transparent 54%);
  border-color: var(--border);
}
.swatch-yellow { background: #eab308; }
.swatch-green { background: #22c55e; }
.swatch-blue { background: #3b82f6; }
.swatch-pink { background: #ec4899; }
.swatch-purple { background: #a855f7; }

.verse-sheet-note {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  resize: vertical;
  margin-bottom: 10px;
}
.sheet-save-btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.sheet-save-btn:hover { filter: brightness(1.08); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--bg-elevated-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  z-index: 60;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-sub { display: none; }
  .brand-logo { height: 26px; }
  .brand { gap: 6px; padding: 4px; }
  .menu-toggle { display: flex; }
  .search-wrap { max-width: none; }
  .search-wrap input { min-width: 0; }
  .topbar-actions { gap: 4px; }
  .sidebar {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    width: 84vw;
    max-width: 320px;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-overlay,
  .sidebar-overlay.show { display: block; }

  .reading-pane { padding: 16px 12px 90px; }
  .testament-cards { gap: 10px; }
  .landing-wordmark { font-size: 22px; }
  .landing-logo { height: 60px; }

  /* Larger touch targets */
  .icon-btn { width: 42px; height: 42px; }
  .nav-btn { width: 42px; height: 42px; }
  .book-btn { padding: 11px 10px; font-size: 15px; }
  .chapter-chip { min-width: 38px; height: 38px; font-size: 14px; }
  .chapter-select { font-size: 19px; }

  .verse { padding: 5px 68px 5px 38px; }
  .verse-num { width: 28px; top: 8px; }

  .reader-header {
    gap: 8px 6px;
    flex-wrap: wrap;
  }
  .reader-title-wrap {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }
  #prevChapter { order: 0; }
  #nextChapter { order: 2; }
  #bookSelect {
    min-width: 0;
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .chapter-select-num { width: 54px; }
  .reader-settings-wrap { order: 3; flex-shrink: 0; }

  .footer-nav-btn { padding: 12px 14px; font-size: 15px; }
  .footer-nav-btn span { display: none; }

  .daily-verse { padding: 16px 42px 16px 16px; }
}

@media (max-width: 420px) {
  .brand-title { font-size: 16px; }
}

@media (max-width: 360px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .brand-text { display: none; }
  .brand-logo { height: 24px; }
  .theme-switch { width: 46px; height: 26px; }
  .theme-switch-knob { width: 20px; height: 20px; }
  html[data-theme="dark"] .theme-switch-knob { transform: translateX(20px); }
  .icon-btn { width: 34px; height: 34px; }
}
