/* ── Bible bar ── */
.bible-bar { margin-bottom: 8px; }
.bible-bar .signal-line { margin-bottom: 16px; }

.bible-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bible-ref-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.02em;
  cursor: pointer;
  box-shadow: 0 1px 4px color-mix(in oklch, var(--fg) 6%, transparent);
}

.bible-ref-btn .icon-sm {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.bible-version-btn {
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
}

/* ── Reading card ── */
.bible-content { padding-bottom: 40px; }

.bible-reading-card {
  padding: 24px 20px 28px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 18px 50px color-mix(in oklch, var(--fg) 5%, transparent);
}

.bible-verses {
  font-family: var(--font-editorial);
  font-size: 19px;
  line-height: 1.78;
}

.bible-verses .verse-num {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  vertical-align: super;
  margin-right: 3px;
  line-height: 0;
}

.bible-verses p { margin: 0; display: inline; }

.bible-chapter-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.chapter-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 120ms ease;
}

.chapter-nav-btn:active { transform: scale(.97); }

.chapter-nav-btn.primary {
  border: 0;
  background: var(--ink);
  color: var(--surface);
}

.chapter-nav-btn .icon { width: 16px; height: 16px; }

/* ── Loading ── */
.bible-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 300px;
  color: var(--muted);
  font-size: 14px;
}

.bible-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════
   Modals
   ══════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  background: color-mix(in oklch, var(--ink) 50%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

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

.modal-panel {
  width: 100%;
  max-height: 88svh;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 320ms cubic-bezier(.2, .7, .2, 1);
}

.modal-overlay.open .modal-panel { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.modal-header-actions { display: flex; gap: 8px; }

.modal-close-btn,
.modal-history-btn {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--fg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* ── Chapter grid ── */
.chapter-grid-section { padding: 20px 20px 12px; }

.chapter-grid-section h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.chapter-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0;
  border-radius: 16px;
  background: var(--bg);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 80ms ease;
}

.chapter-cell:active { transform: scale(.93); }

.chapter-cell.selected {
  background: var(--ink);
  color: var(--surface);
}

/* ── Book list ── */
.book-list { padding: 8px 0; }

.book-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.book-item:active { background: var(--bg); }
.book-item.selected { font-weight: 800; }

/* ── Tab toggle ── */
.modal-tabs {
  display: flex;
  padding: 12px 20px;
  gap: 0;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-tab {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
}

.modal-tab:first-child { border-radius: 12px 0 0 12px; }
.modal-tab:last-child { border-radius: 0 12px 12px 0; }

.modal-tab.active {
  background: var(--bg);
  color: var(--fg);
  border-color: color-mix(in oklch, var(--fg) 18%, var(--border));
}

/* ══════════════════════════════════
   Version selector
   ══════════════════════════════════ */
.version-list { padding: 12px 20px; }

.version-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.version-item:last-child { border-bottom: 0; }

.version-badge {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--fg);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--brand-gradient) border-box;
  border: 2.5px solid transparent;
}

.version-info { flex: 1; min-width: 0; text-align: left; }

.version-publisher {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.version-name {
  display: block;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.version-item.selected {
  margin: 4px -14px;
  padding: 14px;
  border-radius: 18px;
  border-bottom: 0;
  background: color-mix(in oklch, var(--accent) 7%, var(--surface));
}

.version-item.selected + .version-item { border-top: 0; }

.version-count {
  text-align: center;
  padding: 12px 0 20px;
  font-size: 13px;
  color: var(--muted);
}

/* ══════════════════════════════════
   Search
   ══════════════════════════════════ */
.search-panel {
  max-height: 100svh;
  border-radius: 0;
}

.search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--bg);
}

.search-input-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--fg);
  outline: none;
}

.search-input::placeholder { color: var(--muted); }

.search-clear {
  flex-shrink: 0;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--fg);
}

.search-clear .icon { width: 14px; height: 14px; }

.search-cancel {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.search-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.search-hint {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.search-count {
  padding: 12px 20px 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: .03em;
}

.search-results { padding: 0; }

.search-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  cursor: pointer;
}

.search-result:active { background: var(--bg); }

.search-result-ref {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.search-result-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
}

.search-result-text mark {
  background: linear-gradient(90deg, #e88e0033, #ed304a33);
  color: var(--fg);
  border-radius: 3px;
  padding: 1px 2px;
}
