/* ============================================================
   R.E. NETWORK / Life Coordination — Bible Reader
   Design tokens + layout. Prefix: bb-
   ============================================================ */

:root {
  /* Surfaces */
  --bb-parchment: #f6f1e7;
  --bb-surface: #fbf8f2;
  --bb-chrome: #e8e0d4; /* light warm chrome — no black fills */
  --bb-chrome-soft: #d2c9ba;
  --bb-panel: #ffffff;
  --bb-panel-muted: #f3eee6;

  /* Text */
  --bb-ink: #1a1614;
  --bb-ink-soft: #3f3833;
  --bb-muted: #6e655c;
  --bb-faint: #9a9085;

  /* Accent — deep burgundy, used sparingly */
  --bb-accent: #7a2e3a;
  --bb-accent-soft: #9a4552;
  --bb-accent-wash: rgba(122, 46, 58, 0.08);
  --bb-accent-ring: rgba(122, 46, 58, 0.22);

  /* Borders & shadow */
  --bb-border: #e4ddd2;
  --bb-border-strong: #d2c9ba;
  --bb-shadow-sm: 0 1px 2px rgba(26, 22, 20, 0.05);
  --bb-shadow-md: 0 8px 24px rgba(26, 22, 20, 0.08);
  --bb-shadow-lg: 0 16px 40px rgba(26, 22, 20, 0.12);

  /* Type */
  --bb-font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --bb-font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --bb-text-xs: 0.75rem;
  --bb-text-sm: 0.875rem;
  --bb-text-base: 1rem;
  --bb-text-md: 1.125rem;
  --bb-text-lg: 1.25rem;
  --bb-text-xl: 1.5rem;
  --bb-text-2xl: 1.875rem;
  --bb-text-3xl: 2.25rem;

  --bb-leading-tight: 1.25;
  --bb-leading-snug: 1.4;
  --bb-leading-body: 1.75;
  --bb-measure: 68ch;
  /* Kept for optional use; full mode passage uses max-width: none */
  --bb-measure-full: none;

  /* Space */
  --bb-space-1: 0.25rem;
  --bb-space-2: 0.5rem;
  --bb-space-3: 0.75rem;
  --bb-space-4: 1rem;
  --bb-space-5: 1.25rem;
  --bb-space-6: 1.5rem;
  --bb-space-8: 2rem;
  --bb-space-10: 2.5rem;
  --bb-space-12: 3rem;
  --bb-space-16: 4rem;

  /* Radii */
  --bb-radius-sm: 6px;
  --bb-radius-md: 10px;
  --bb-radius-lg: 14px;
  --bb-radius-pill: 999px;

  /* Layout */
  --bb-header-h: 64px;
  --bb-sidebar-w: 340px;
  --bb-reader-half: min(720px, 92vw);
  /* True full = nearly viewport; stage padding provides the only gutters */
  --bb-reader-full: 100%;
  --bb-stage-pad-x-full: var(--bb-space-5);
  --bb-stage-pad-x-half: var(--bb-space-8);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body.bb-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--bb-font-sans);
  color: var(--bb-ink);
  background: var(--bb-parchment);
  line-height: var(--bb-leading-snug);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

a {
  color: var(--bb-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.bb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== App shell ========== */

.bb-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== Header ========== */

.bb-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--bb-header-h);
  display: flex;
  align-items: center;
  gap: var(--bb-space-4);
  padding: 0 var(--bb-space-6);
  background: rgba(251, 248, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bb-border);
}

.bb-brand {
  display: flex;
  align-items: center;
  gap: var(--bb-space-3);
  flex-shrink: 0;
  min-width: 0;
}

.bb-brand__mark {
  width: 34px;
  height: 34px;
  border-radius: var(--bb-radius-sm);
  background: linear-gradient(145deg, var(--bb-accent) 0%, #5c222c 100%);
  color: #fbf8f2;
  display: grid;
  place-items: center;
  font-family: var(--bb-font-serif);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.bb-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.bb-brand__title {
  font-size: var(--bb-text-sm);
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--bb-ink);
}

.bb-brand__sub {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bb-muted);
  font-weight: 500;
}

.bb-header__nav {
  display: flex;
  align-items: center;
  gap: var(--bb-space-2);
  flex: 1;
  min-width: 0;
}

.bb-search {
  position: relative;
  flex: 1;
  max-width: 420px;
  min-width: 140px;
  z-index: 45;
}

.bb-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--bb-faint);
  pointer-events: none;
}

.bb-search__input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-pill);
  background: var(--bb-panel);
  color: var(--bb-ink);
  box-shadow: var(--bb-shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bb-search__input::placeholder {
  color: var(--bb-faint);
}

.bb-search__input:focus {
  outline: none;
  border-color: var(--bb-accent-soft);
  box-shadow: 0 0 0 3px var(--bb-accent-ring);
}

.bb-nav-btns {
  display: flex;
  align-items: center;
  gap: var(--bb-space-1);
  flex-shrink: 0;
}

.bb-nav-btn {
  height: 36px;
  padding: 0 var(--bb-space-3);
  border-radius: var(--bb-radius-pill);
  border: 1px solid transparent;
  color: var(--bb-ink-soft);
  font-size: var(--bb-text-sm);
  font-weight: 550;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bb-nav-btn:hover,
.bb-nav-btn[aria-expanded="true"] {
  background: var(--bb-accent-wash);
  color: var(--bb-accent);
  border-color: transparent;
}

.bb-header__actions {
  display: flex;
  align-items: center;
  gap: var(--bb-space-2);
  flex-shrink: 0;
  margin-left: auto;
}

.bb-chip {
  height: 36px;
  padding: 0 var(--bb-space-3);
  border-radius: var(--bb-radius-pill);
  border: 1px solid var(--bb-border);
  background: var(--bb-panel);
  color: var(--bb-ink-soft);
  font-size: var(--bb-text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: var(--bb-space-2);
  box-shadow: var(--bb-shadow-sm);
}

.bb-chip--toggle {
  cursor: pointer;
  font: inherit;
  font-size: var(--bb-text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bb-chip--toggle:hover {
  background: var(--bb-accent-wash);
  border-color: var(--bb-accent-soft);
  color: var(--bb-accent);
}

.bb-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bb-accent);
}

.bb-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--bb-radius-md);
  border: 1px solid var(--bb-border);
  background: var(--bb-panel);
  color: var(--bb-ink-soft);
  display: grid;
  place-items: center;
  box-shadow: var(--bb-shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bb-icon-btn:hover,
.bb-icon-btn[aria-pressed="true"] {
  background: var(--bb-accent-wash);
  border-color: var(--bb-accent-soft);
  color: var(--bb-accent);
}

.bb-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ========== Main layout ========== */

.bb-main {
  flex: 1;
  display: flex;
  position: relative;
  min-height: calc(100vh - var(--bb-header-h));
}

.bb-reader-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  width: 100%;
  padding: var(--bb-space-6) var(--bb-stage-pad-x-full) var(--bb-space-12);
  transition: padding 0.28s ease;
}

.bb-app.is-half-width .bb-reader-stage {
  padding-left: var(--bb-stage-pad-x-half);
  padding-right: var(--bb-stage-pad-x-half);
  padding-top: var(--bb-space-10);
  padding-bottom: var(--bb-space-16);
}

.bb-app.is-sidebar-open .bb-reader-stage {
  padding-right: calc(var(--bb-sidebar-w) + var(--bb-space-6));
}

.bb-reader-shell {
  /* Full width by default — spans stage (nearly full viewport) */
  width: var(--bb-reader-full);
  max-width: 100%;
  flex: 1 1 auto;
  position: relative;
  transition: width 0.28s ease, max-width 0.28s ease;
}

.bb-app.is-half-width .bb-reader-shell {
  width: var(--bb-reader-half);
  max-width: var(--bb-reader-half);
  flex: 0 1 auto;
}

.bb-reader {
  background: var(--bb-surface);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-lg);
  box-shadow: var(--bb-shadow-md);
  padding: var(--bb-space-10) clamp(var(--bb-space-6), 4vw, var(--bb-space-16)) var(--bb-space-12);
  width: 100%;
}

.bb-reader__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--bb-space-4);
  margin-bottom: var(--bb-space-2);
}

.bb-reader__ref {
  font-family: var(--bb-font-sans);
  font-size: var(--bb-text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bb-accent);
}

.bb-reader__version {
  font-size: var(--bb-text-xs);
  color: var(--bb-muted);
  font-weight: 500;
}

.bb-reader__title {
  margin: 0 0 var(--bb-space-6);
  font-family: var(--bb-font-serif);
  font-size: var(--bb-text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--bb-leading-tight);
  color: var(--bb-ink);
}

.bb-section-heading {
  margin: var(--bb-space-10) 0 var(--bb-space-5);
  font-family: var(--bb-font-serif);
  font-size: var(--bb-text-xl);
  font-weight: 650;
  color: var(--bb-ink);
  letter-spacing: -0.01em;
}

.bb-section-heading:first-of-type {
  margin-top: 0;
}

.bb-passage {
  /* Full mode: text spans the reader card (padding only) */
  max-width: none;
  width: 100%;
  font-family: var(--bb-font-serif);
  font-size: var(--bb-text-lg);
  line-height: var(--bb-leading-body);
  color: var(--bb-ink);
}

.bb-app.is-half-width .bb-passage,
.bb-app.is-half-width .bb-reader__footnote {
  max-width: var(--bb-measure);
  width: auto;
}

/* Prose paragraphs — conventional Bible first-line indent */
.bb-para {
  margin: 0 0 0.9em;
  padding: 0;
  max-width: none;
  width: 100%;
  text-indent: 1.75em;
}

.bb-para:last-child {
  margin-bottom: 0;
}

/* Poetry / strophe (for later chapters; hanging indent) */
.bb-poetry {
  margin: 0.85em 0 0.85em 0.5em;
  padding: 0;
  max-width: none;
  width: calc(100% - 0.5em);
}

.bb-poetry__line,
.bb-poetry .bb-verse {
  display: block;
  text-indent: -1.35em;
  padding-left: 1.35em;
  margin: 0.15em 0;
}

.bb-poetry__stanza + .bb-poetry__stanza {
  margin-top: 0.75em;
}

.bb-verse {
  display: inline;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s ease;
  padding: 0.05em 0;
}

.bb-verse:hover {
  background: var(--bb-accent-wash);
}

.bb-verse.is-active {
  background: var(--bb-accent-wash);
  box-shadow: inset 0 -2px 0 var(--bb-accent-soft);
}

.bb-verse__num {
  font-family: var(--bb-font-sans);
  font-size: 0.7em;
  font-weight: 650;
  color: var(--bb-accent-soft);
  vertical-align: super;
  margin-right: 0.28em;
  line-height: 0;
  letter-spacing: 0.02em;
  user-select: none;
}

.bb-reader__footnote {
  margin-top: var(--bb-space-12);
  padding-top: var(--bb-space-6);
  border-top: 1px solid var(--bb-border);
  font-size: var(--bb-text-xs);
  color: var(--bb-muted);
  line-height: 1.55;
  max-width: none;
  width: 100%;
}

.bb-reader__footnote strong {
  color: var(--bb-ink-soft);
  font-weight: 600;
}

/* Chapter arrows */

.bb-arrow {
  position: absolute;
  top: 42%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--bb-border);
  background: var(--bb-panel);
  color: var(--bb-ink-soft);
  display: grid;
  place-items: center;
  box-shadow: var(--bb-shadow-sm);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.bb-arrow:hover {
  background: var(--bb-accent-wash);
  color: var(--bb-accent);
  border-color: var(--bb-accent-soft);
  transform: scale(1.04);
}

.bb-arrow--prev {
  left: var(--bb-space-3);
}

.bb-arrow--next {
  right: var(--bb-space-3);
}

.bb-app.is-half-width .bb-arrow--prev {
  left: -22px;
}

.bb-app.is-half-width .bb-arrow--next {
  right: -22px;
}

.bb-arrow svg {
  width: 18px;
  height: 18px;
}

/* ========== Right sidebar (testimony / LC) ========== */

.bb-sidebar {
  position: fixed;
  top: var(--bb-header-h);
  right: 0;
  bottom: 0;
  width: var(--bb-sidebar-w);
  background: var(--bb-panel);
  border-left: 1px solid var(--bb-border);
  box-shadow: var(--bb-shadow-lg);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.bb-app.is-sidebar-open .bb-sidebar {
  transform: translateX(0);
}

.bb-sidebar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--bb-space-3);
  padding: var(--bb-space-5) var(--bb-space-5) var(--bb-space-4);
  border-bottom: 1px solid var(--bb-border);
}

.bb-sidebar__kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bb-accent);
  font-weight: 650;
  margin: 0 0 var(--bb-space-1);
}

.bb-sidebar__title {
  margin: 0;
  font-family: var(--bb-font-serif);
  font-size: var(--bb-text-lg);
  font-weight: 650;
  color: var(--bb-ink);
  letter-spacing: -0.01em;
}

.bb-sidebar__sub {
  margin: var(--bb-space-1) 0 0;
  font-size: var(--bb-text-xs);
  color: var(--bb-muted);
}

.bb-sidebar__close {
  width: 32px;
  height: 32px;
  border-radius: var(--bb-radius-sm);
  color: var(--bb-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.bb-sidebar__close:hover {
  background: var(--bb-panel-muted);
  color: var(--bb-ink);
}

.bb-sidebar__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--bb-space-4) var(--bb-space-5) var(--bb-space-8);
  display: flex;
  flex-direction: column;
  gap: var(--bb-space-3);
}

.bb-sidebar__note {
  font-size: var(--bb-text-xs);
  color: var(--bb-muted);
  background: var(--bb-panel-muted);
  border: 1px dashed var(--bb-border-strong);
  border-radius: var(--bb-radius-md);
  padding: var(--bb-space-3) var(--bb-space-4);
  margin-bottom: var(--bb-space-2);
  line-height: 1.5;
}

.bb-card {
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-md);
  background: var(--bb-surface);
  padding: var(--bb-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--bb-space-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bb-card:hover {
  border-color: var(--bb-border-strong);
  box-shadow: var(--bb-shadow-sm);
}

.bb-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bb-space-2);
}

.bb-card__letter {
  width: 28px;
  height: 28px;
  border-radius: var(--bb-radius-sm);
  background: var(--bb-accent-wash);
  color: var(--bb-accent);
  font-weight: 700;
  font-size: var(--bb-text-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.bb-card__badge {
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bb-muted);
  background: var(--bb-panel-muted);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-pill);
  padding: 2px 8px;
}

.bb-card__title {
  margin: 0;
  font-size: var(--bb-text-sm);
  font-weight: 650;
  color: var(--bb-ink);
  line-height: 1.35;
}

.bb-card__blurb {
  margin: 0;
  font-size: var(--bb-text-xs);
  color: var(--bb-muted);
  line-height: 1.55;
}

/* ========== Panels / modals ========== */

.bb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(246, 241, 231, 0.72);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.bb-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bb-panel {
  position: fixed;
  top: calc(var(--bb-header-h) + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(640px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - var(--bb-header-h) - 24px));
  background: var(--bb-panel);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-lg);
  box-shadow: var(--bb-shadow-lg);
  z-index: 60;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.bb-panel.is-open {
  display: flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bb-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--bb-space-4) var(--bb-space-5);
  border-bottom: 1px solid var(--bb-border);
}

.bb-panel__title {
  margin: 0;
  font-size: var(--bb-text-md);
  font-weight: 650;
  font-family: var(--bb-font-serif);
}

.bb-panel__close {
  width: 32px;
  height: 32px;
  border-radius: var(--bb-radius-sm);
  color: var(--bb-muted);
  display: grid;
  place-items: center;
}

.bb-panel__close:hover {
  background: var(--bb-panel-muted);
  color: var(--bb-ink);
}

.bb-panel__body {
  padding: var(--bb-space-4) var(--bb-space-5) var(--bb-space-5);
  overflow-y: auto;
}

.bb-panel__hint {
  margin: 0 0 var(--bb-space-4);
  font-size: var(--bb-text-xs);
  color: var(--bb-muted);
}

.bb-book-grid,
.bb-chapter-grid,
.bb-verse-grid {
  display: grid;
  gap: var(--bb-space-2);
}

.bb-book-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.bb-chapter-grid,
.bb-verse-grid {
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
}

.bb-pick {
  height: 40px;
  border-radius: var(--bb-radius-md);
  border: 1px solid var(--bb-border);
  background: var(--bb-surface);
  color: var(--bb-ink-soft);
  font-size: var(--bb-text-sm);
  font-weight: 550;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.bb-pick:hover {
  border-color: var(--bb-accent-soft);
  color: var(--bb-accent);
  background: var(--bb-accent-wash);
}

.bb-pick.is-current {
  background: var(--bb-accent);
  border-color: var(--bb-accent);
  color: #fbf8f2;
}

.bb-pick--book {
  height: auto;
  min-height: 40px;
  padding: var(--bb-space-2) var(--bb-space-3);
  text-align: left;
  justify-content: flex-start;
}

.bb-testament {
  margin: var(--bb-space-4) 0 var(--bb-space-2);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bb-muted);
  font-weight: 650;
}

.bb-testament:first-child {
  margin-top: 0;
}

/* ========== Toast ========== */

.bb-toast {
  position: fixed;
  bottom: var(--bb-space-6);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bb-surface);
  color: var(--bb-ink);
  border: 1px solid var(--bb-border-strong);
  padding: var(--bb-space-3) var(--bb-space-5);
  border-radius: var(--bb-radius-pill);
  font-size: var(--bb-text-sm);
  font-weight: 500;
  box-shadow: var(--bb-shadow-md);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(420px, calc(100vw - 32px));
  text-align: center;
}

.bb-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== Responsive ========== */

@media (max-width: 900px) {
  .bb-header {
    padding: 0 var(--bb-space-4);
    gap: var(--bb-space-2);
    flex-wrap: wrap;
    height: auto;
    min-height: var(--bb-header-h);
    padding-top: var(--bb-space-2);
    padding-bottom: var(--bb-space-2);
  }

  .bb-brand__text {
    display: none;
  }

  .bb-reader {
    padding: var(--bb-space-8) var(--bb-space-5) var(--bb-space-12);
  }

  .bb-arrow--prev {
    left: -8px;
  }

  .bb-arrow--next {
    right: -8px;
  }

  .bb-app.is-sidebar-open .bb-reader-stage {
    padding-right: var(--bb-space-4);
  }

  .bb-sidebar {
    width: min(100vw, 340px);
  }

  .bb-reader__title {
    font-size: var(--bb-text-2xl);
  }

  .bb-passage {
    font-size: var(--bb-text-md);
  }
}

@media (max-width: 640px) {
  .bb-chip {
    display: none;
  }

  .bb-nav-btn {
    padding: 0 var(--bb-space-2);
  }

  .bb-reader-stage {
    padding: var(--bb-space-6) var(--bb-space-4) var(--bb-space-12);
  }
}

/* LC-linked verses: underline only (no jump bar / no pills) */
.bb-verse--lc {
  text-decoration: underline;
  text-decoration-color: var(--bb-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
}

.bb-verse--lc:hover,
.bb-verse--lc.is-active {
  text-decoration-color: #2f5ea8;
  background: var(--bb-accent-wash);
}

.bb-pick--lc {
  border-color: var(--bb-accent-ring);
  box-shadow: inset 0 0 0 1px var(--bb-accent-wash);
}


/* ---- Video Rooms + Encounter + A–Z (light parchment sidebar) ---- */
.bb-sidebar__section-label {
  margin: var(--bb-space-3) 0 var(--bb-space-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bb-muted);
}

.bb-lane {
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-md);
  background: var(--bb-parchment);
  color: var(--bb-ink);
  padding: var(--bb-space-4);
  margin-bottom: var(--bb-space-3);
  box-shadow: var(--bb-shadow-sm);
}

.bb-lane__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--bb-space-3);
  margin-bottom: var(--bb-space-3);
}

.bb-lane__kicker {
  margin: 0 0 0.2rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-accent);
}

.bb-lane__title {
  margin: 0;
  font-family: var(--bb-font-serif);
  font-size: var(--bb-text-md);
  font-weight: 650;
  color: var(--bb-ink);
  letter-spacing: -0.01em;
}

.bb-lane__sub {
  margin: 0.3rem 0 0;
  font-size: var(--bb-text-xs);
  line-height: 1.45;
  color: var(--bb-muted);
}

.bb-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  border-radius: var(--bb-radius-pill);
  background: rgba(34, 140, 78, 0.1);
  border: 1px solid rgba(46, 160, 90, 0.4);
  color: #1a7a45;
  font-size: 0.72rem;
  font-weight: 700;
}

.bb-live__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  animation: bb-live-pulse 1.6s ease-out infinite;
}

@keyframes bb-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.bb-live__example {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2a8f55;
  border-left: 1px solid rgba(46, 160, 90, 0.35);
  padding-left: 0.4rem;
}

.bb-videorooms__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bb-space-2);
}

.bb-videorooms__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bb-space-2);
  padding: var(--bb-space-3);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-md);
  background: var(--bb-panel);
}

.bb-videorooms__name {
  margin: 0;
  font-size: var(--bb-text-sm);
  font-weight: 650;
  color: var(--bb-ink);
}

.bb-videorooms__meta {
  margin: 0.15rem 0 0;
  font-size: var(--bb-text-xs);
  color: var(--bb-muted);
}

.bb-videorooms__join {
  height: 32px;
  padding: 0 var(--bb-space-3);
  border-radius: var(--bb-radius-pill);
  border: 1px solid var(--bb-border);
  background: var(--bb-panel);
  color: var(--bb-accent);
  font-size: var(--bb-text-xs);
  font-weight: 650;
  flex-shrink: 0;
}

.bb-videorooms__join:hover {
  background: var(--bb-accent-wash);
  border-color: var(--bb-accent-soft);
}

.bb-encounter__stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bb-space-2);
  margin-bottom: var(--bb-space-3);
}

.bb-encounter__pane {
  aspect-ratio: 4 / 3;
  border-radius: var(--bb-radius-md);
  border: 1px solid var(--bb-border);
  background: var(--bb-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: var(--bb-space-3);
}

.bb-encounter__pane-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bb-ink-soft);
}

.bb-encounter__pane-hint {
  font-size: 0.7rem;
  color: var(--bb-muted);
}

.bb-encounter__prompt {
  margin: 0 0 var(--bb-space-2);
  font-family: var(--bb-font-serif);
  font-size: var(--bb-text-sm);
  line-height: 1.45;
  color: var(--bb-ink);
}

.bb-encounter__mood {
  margin: 0 0 var(--bb-space-3);
  font-size: var(--bb-text-xs);
  color: var(--bb-muted);
}

.bb-encounter__mood-label {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bb-accent);
  margin-right: 0.35rem;
}

.bb-encounter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bb-space-2);
  margin-bottom: var(--bb-space-2);
}

.bb-encounter__btn {
  height: 36px;
  padding: 0 var(--bb-space-3);
  border-radius: var(--bb-radius-pill);
  border: 1px solid var(--bb-border);
  background: var(--bb-panel);
  color: var(--bb-ink-soft);
  font-size: var(--bb-text-xs);
  font-weight: 650;
}

.bb-encounter__btn:hover {
  background: var(--bb-accent-wash);
  border-color: var(--bb-accent-soft);
  color: var(--bb-accent);
}

.bb-encounter__btn--primary {
  background: var(--bb-accent);
  border-color: var(--bb-accent);
  color: #fbf8f2;
}

.bb-encounter__btn--primary:hover {
  background: var(--bb-accent-soft);
  border-color: var(--bb-accent-soft);
  color: #fbf8f2;
}

.bb-lane__foot {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--bb-muted);
}


/* ---- LC verse vertical options menu ---- */
.bb-lc-menu__heading {
  margin: 0 0 var(--bb-space-3);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-accent);
}

.bb-lc-menu__intro {
  display: none;
}

.bb-lc-menu__list {
  display: flex;
  flex-direction: column;
  gap: var(--bb-space-1);
  margin-bottom: var(--bb-space-4);
  padding-bottom: var(--bb-space-4);
  border-bottom: 1px solid var(--bb-border);
}

.bb-lc-option {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: var(--bb-space-3) var(--bb-space-2);
  border: none;
  border-radius: var(--bb-radius-sm);
  background: transparent;
  color: var(--bb-ink);
  font-family: var(--bb-font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.bb-lc-option__label {
  text-decoration: inherit;
  text-underline-offset: 0.18em;
  flex: 0 1 auto;
  white-space: nowrap;
}

.bb-lc-option:hover .bb-lc-option__label,
.bb-lc-option.is-active .bb-lc-option__label {
  text-decoration: underline;
  text-decoration-color: var(--bb-accent);
  text-decoration-thickness: 2px;
}

.bb-lc-option:hover,
.bb-lc-option.is-active {
  color: var(--bb-accent);
  background: var(--bb-accent-wash);
}

.bb-lc-option__live {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--bb-radius-pill);
  background: rgba(34, 140, 78, 0.1);
  border: 1px solid rgba(46, 160, 90, 0.4);
  color: #1a7a45;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bb-lc-option__label {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.bb-lc-option .bb-live__example {
  /* Keep Example marker without forcing a second line */
  flex-shrink: 0;
}

.bb-lc-option__live-prefix {
  opacity: 0.9;
}

.bb-lc-option__live-num {
  font-variant-numeric: tabular-nums;
}

.bb-lc-menu__panel {
  min-height: 1px;
}

/* ---- Numbered canon book list (1–66) ---- */
.bb-book-list {
  list-style: none;
  margin: 0 0 var(--bb-space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(420px, 55vh);
  overflow-y: auto;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-md);
  background: var(--bb-surface);
  padding: var(--bb-space-2);
}

.bb-book-list__item {
  margin: 0;
  padding: 0;
}

.bb-book-list .bb-pick--book {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: auto;
  min-height: 36px;
  padding: 0.4rem 0.65rem;
  text-align: left;
  justify-content: flex-start;
  border-radius: var(--bb-radius-sm);
}

.bb-book-list__num {
  flex: 0 0 2.1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--bb-muted);
  font-size: var(--bb-text-xs);
}

.bb-book-list__name {
  flex: 1 1 auto;
  font-weight: 600;
}

.bb-book-list__tag {
  flex: 0 0 auto;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bb-accent);
  border: 1px solid var(--bb-accent-ring);
  background: var(--bb-accent-wash);
  border-radius: var(--bb-radius-pill);
  padding: 0.1rem 0.45rem;
}

.bb-book-list .bb-pick--book.is-current .bb-book-list__num {
  color: #fbf8f2;
}


/* ---- 1st Testament / New Testament tabs ---- */
.bb-canon-tabs {
  display: flex;
  gap: var(--bb-space-2);
  margin: 0 0 var(--bb-space-3);
  padding: 3px;
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-pill);
  background: var(--bb-panel-muted);
}

.bb-canon-tab {
  flex: 1 1 0;
  height: 36px;
  border: none;
  border-radius: var(--bb-radius-pill);
  background: transparent;
  color: var(--bb-ink-soft);
  font-size: var(--bb-text-sm);
  font-weight: 650;
  cursor: pointer;
}

.bb-canon-tab:hover {
  color: var(--bb-accent);
}

.bb-canon-tab.is-active {
  background: var(--bb-surface);
  color: var(--bb-accent);
  box-shadow: var(--bb-shadow-sm);
  border: 1px solid var(--bb-border);
}


/* ---- Search suggestions dropdown ---- */
.bb-search__suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(360px, 50vh);
  overflow-y: auto;
  background: var(--bb-panel);
  border: 1px solid var(--bb-border);
  border-radius: var(--bb-radius-lg);
  box-shadow: var(--bb-shadow-lg);
  padding: var(--bb-space-2);
  z-index: 70;
}

.bb-search__suggest[hidden] {
  display: none !important;
}

.bb-suggest__group {
  margin: var(--bb-space-2) 0 var(--bb-space-1);
  padding: 0 var(--bb-space-2);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bb-muted);
}

.bb-suggest__group:first-child {
  margin-top: var(--bb-space-1);
}

.bb-suggest__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: var(--bb-space-3);
  border: none;
  border-radius: var(--bb-radius-md);
  background: transparent;
  color: var(--bb-ink);
  cursor: pointer;
}

.bb-suggest__item:hover,
.bb-suggest__item.is-active {
  background: var(--bb-accent-wash);
}

.bb-suggest__ref {
  font-size: var(--bb-text-sm);
  font-weight: 700;
  color: var(--bb-accent);
}

.bb-suggest__text {
  font-family: var(--bb-font-serif);
  font-size: var(--bb-text-xs);
  line-height: 1.45;
  color: var(--bb-ink-soft);
}

.bb-suggest__meta {
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bb-muted);
}

.bb-suggest__empty {
  padding: var(--bb-space-4);
  font-size: var(--bb-text-sm);
  color: var(--bb-muted);
}


/* ---- Bible left rail (stays visible under -SYNCED overlay) ---- */
.bb-shell {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: calc(100vh - var(--bb-header-h));
  position: relative;
  z-index: 1;
}

.bb-left-rail {
  flex: 0 0 200px;
  width: 200px;
  background: var(--bb-surface);
  border-right: 1px solid var(--bb-border);
  padding: var(--bb-space-4) var(--bb-space-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1; /* under -SYNCED drawer (10010) / backdrop (10000) */
  overflow: visible;
}

.bb-left-rail__label {
  margin: 0 0 var(--bb-space-2);
  padding: 0 var(--bb-space-2);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-accent);
}

.bb-left-rail__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--bb-radius-md);
  background: transparent;
  color: var(--bb-ink-soft);
  font-size: var(--bb-text-sm);
  font-weight: 600;
  cursor: pointer;
}

.bb-left-rail__item:hover {
  background: var(--bb-accent-wash);
  color: var(--bb-accent);
}

.bb-left-rail__item.is-active {
  background: var(--bb-accent-wash);
  border-color: var(--bb-accent-ring);
  color: var(--bb-accent);
}

.bb-shell > .bb-main {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 900px) {
  .bb-left-rail {
    flex-basis: 148px;
    width: 148px;
    padding: var(--bb-space-3) var(--bb-space-2);
  }
}
