/* ============================================================
   Bible reader — "Read" tab
   ============================================================ */

:root {
  --hl-amber: #e2a63c;
  --hl-rose: #e0678a;
  --hl-teal: #4fb3a9;
  --hl-violet: #9b7fe0;
  --hl-green: #5fae5a;
  --hl-blue: #4a90d9;
  --hl-orange: #e0793c;
  --hl-gray: #8b93a1;
}

.bible-shell { padding-bottom: 60px; }

/* ---------- bookmarked-verses list (Bookmarks page) ---------- */
.bible-bookmark-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.bible-bookmark-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bible-bookmark-card .teaser { font-family: var(--font-serif); font-style: italic; color: var(--text); font-size: 0.98rem; line-height: 1.5; }
.bible-bookmark-note {
  font-size: 0.82rem; color: var(--text-faint); border-top: 1px solid var(--border);
  padding-top: 8px; margin-top: 2px;
}

.bible-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.bible-nav-select { display: flex; gap: 10px; flex-wrap: wrap; }
.bible-nav-select select,
.bible-audio-toolbar .audio-rate {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 9px 16px; font-size: 0.88rem; font-family: var(--font-ui);
  max-width: 60vw;
}
.bible-version-pills {
  display: inline-flex; padding: 4px; border-radius: var(--radius-pill);
  background: var(--bg-card); border: 1px solid var(--border); gap: 2px;
}
.bible-version-btn {
  padding: 8px 16px; border-radius: var(--radius-pill); border: none; background: none;
  color: var(--text-dim); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.03em;
  transition: all 0.2s var(--ease-out);
}
.bible-version-btn.is-active { background: var(--accent); color: var(--accent-ink); }
.bible-controls-right { display: flex; align-items: center; gap: 10px; }

.bible-audio-toolbar { margin-bottom: 36px; }

/* ---------- search panel (inside the shared Modal) ---------- */
.bible-search-panel { display: flex; flex-direction: column; gap: 14px; }
.bible-search-tabs {
  display: inline-flex; align-self: flex-start; padding: 4px; border-radius: var(--radius-pill);
  background: var(--bg); border: 1px solid var(--border); gap: 2px;
}
.bible-search-tabs button {
  padding: 7px 16px; border-radius: var(--radius-pill); border: none; background: none;
  color: var(--text-dim); font-weight: 600; font-size: 0.82rem;
}
.bible-search-tabs button.is-active { background: var(--accent); color: var(--accent-ink); }
.bible-search-input-row { display: flex; gap: 10px; }
#bible-search-input {
  flex: 1; background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 10px 16px; font-size: 0.95rem; font-family: var(--font-ui);
}
.bible-search-hint { font-size: 0.8rem; color: var(--text-faint); margin: -6px 0 0; }
.bible-search-results { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.bible-search-result {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 14px; width: 100%;
}
.bible-search-result:hover { border-color: var(--accent); }
.bsr-ref { font-family: var(--font-ui); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; color: var(--accent); }
.bsr-reason { font-size: 0.8rem; color: var(--text-dim); font-style: italic; }
.bsr-snippet { font-family: var(--font-serif); font-size: 0.92rem; color: var(--text); line-height: 1.45; }

.bible-verses {
  font-family: var(--font-serif); font-size: var(--reading-size, 1.2rem); line-height: 1.85; color: var(--text);
  min-height: 200px;
  /* The controls above (book/chapter pickers, translation pills, audio
     scrubber) earn the full wrap width — more room for the scrubber track.
     Running text doesn't: past ~75 characters a line gets tiring to track
     back to the left edge of, so the reading column itself gets its own,
     narrower measure and centers under those wider controls. */
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.bible-verses[data-font="sans"] { font-family: var(--font-ui); font-size: calc(var(--reading-size, 1.2rem) * 0.86); line-height: 1.75; }
.bible-shell .reader-nav-pair { max-width: 720px; margin-left: auto; margin-right: auto; }
.bible-loading, .bible-empty { color: var(--text-faint); font-family: var(--font-ui); font-size: 0.95rem; padding: 40px 0; }

.bible-verse {
  cursor: pointer; border-radius: 5px; padding: 0.05em 0.15em; margin: -0.05em -0.15em;
  transition: background-color 0.2s;
  scroll-margin: 140px;
}
.bible-verse:hover { background: var(--bg-card); }
.bible-verse:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bible-verse.is-speaking { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.bible-verse.is-selected { box-shadow: 0 0 0 2px var(--accent) inset; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.bible-verse.is-highlighted[data-color="amber"] { background: color-mix(in srgb, var(--hl-amber) 35%, transparent); }
.bible-verse.is-highlighted[data-color="rose"] { background: color-mix(in srgb, var(--hl-rose) 35%, transparent); }
.bible-verse.is-highlighted[data-color="teal"] { background: color-mix(in srgb, var(--hl-teal) 35%, transparent); }
.bible-verse.is-highlighted[data-color="violet"] { background: color-mix(in srgb, var(--hl-violet) 35%, transparent); }
.bible-verse.is-highlighted[data-color="green"] { background: color-mix(in srgb, var(--hl-green) 35%, transparent); }
.bible-verse.is-highlighted[data-color="blue"] { background: color-mix(in srgb, var(--hl-blue) 35%, transparent); }
.bible-verse.is-highlighted[data-color="orange"] { background: color-mix(in srgb, var(--hl-orange) 35%, transparent); }
.bible-verse.is-highlighted[data-color="gray"] { background: color-mix(in srgb, var(--hl-gray) 35%, transparent); }
.bible-verse.is-bookmarked { box-shadow: 2px 0 0 var(--accent) inset; padding-left: 0.35em; }
@keyframes bible-verse-flash {
  0% { background: color-mix(in srgb, var(--accent) 45%, transparent); }
  70% { background: color-mix(in srgb, var(--accent) 45%, transparent); }
  100% { background: transparent; }
}
.bible-verse.is-flash { animation: bible-verse-flash 3s ease-out; }
.bible-verse.has-note::after {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); vertical-align: super; margin-left: 2px;
}
.bv-num {
  font-family: var(--font-ui); font-size: 0.62em; font-weight: 700; color: var(--text-faint);
  margin-right: 0.15em; user-select: none;
}

/* ---------- verse action sheet ---------- */
.bible-verse-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 700;
  background: var(--bg-elevated); border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  padding: 22px clamp(20px, 5vw, 40px) calc(22px + env(safe-area-inset-bottom, 0px));
  max-width: 640px; margin: 0 auto;
}
@media (min-width: 760px) {
  .bible-verse-sheet { left: auto; right: 24px; bottom: 24px; border-radius: var(--radius-lg); width: 380px; }
}
.bvs-close {
  position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-faint);
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.bvs-close:hover { background: var(--bg-card); color: var(--text); }
.bvs-close svg { width: 16px; height: 16px; }
.bvs-ref { font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); padding-right: 32px; }
.bvs-hint { font-size: 0.76rem; color: var(--text-faint); margin-top: 4px; }
.bvs-text { font-family: var(--font-serif); font-style: italic; font-size: 1.05rem; color: var(--text-dim); margin: 10px 0 20px; line-height: 1.55; max-height: 30vh; overflow-y: auto; }
.bvs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bvs-label { font-family: var(--font-ui); font-size: 0.78rem; color: var(--text-faint); margin-right: 4px; }
.bvs-color {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  background: var(--bg-card);
}
.bvs-color[data-color="amber"] { background: var(--hl-amber); }
.bvs-color[data-color="rose"] { background: var(--hl-rose); }
.bvs-color[data-color="teal"] { background: var(--hl-teal); }
.bvs-color[data-color="violet"] { background: var(--hl-violet); }
.bvs-color[data-color="green"] { background: var(--hl-green); }
.bvs-color[data-color="blue"] { background: var(--hl-blue); }
.bvs-color[data-color="orange"] { background: var(--hl-orange); }
.bvs-color[data-color="gray"] { background: var(--hl-gray); }
.bvs-color.is-active { border-color: var(--text); transform: scale(1.12); }
.bvs-clear-color { display: flex; align-items: center; justify-content: center; color: var(--text-faint); border: 1px solid var(--border); }
.bvs-clear-color svg { width: 13px; height: 13px; }
.bvs-actions { justify-content: space-between; }
.bvs-action {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 8px; color: var(--text-dim); font-size: 0.74rem; font-family: var(--font-ui);
}
.bvs-action svg { width: 18px; height: 18px; }
.bvs-action.is-active { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-card)); }
.bvs-note-wrap { margin-top: 6px; }
#bvs-note-input {
  width: 100%; min-height: 90px; resize: vertical; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--bg); color: var(--text); border: 1px solid var(--border); font-family: var(--font-ui);
  font-size: 0.9rem; line-height: 1.5;
}
.bvs-note-actions { display: flex; gap: 10px; margin-top: 10px; }

@media (max-width: 620px) {
  .bible-controls { flex-direction: column; align-items: stretch; }
  .bible-nav-select select { max-width: none; flex: 1; }
  .bible-version-pills { align-self: flex-start; }
}
