/* ── Anakalypsis — A Structured Map of Biblical Revelation ── */

:root {
  --bg:          #0e1118;
  --bg-panel:    #141825;
  --bg-card:     #1a1f2e;
  --bg-hover:    #212636;
  --border:      #282d3e;
  --text:        #e8e9ed;
  --text-muted:  #888c9c;
  --accent:      #d4ab2a;      /* gold — revelation, glory */
  --accent-dim:  #8a7019;
  --blue:        #6094e0;
  --green:       #50b882;
  --red:         #d45d5d;
  --purple:      #a07ed4;
  --orange:      #d4994c;
  --font-body:   'Crimson Pro', 'Georgia', serif;
  --font-page:   'EB Garamond', 'Crimson Pro', 'Georgia', serif;
  --font-serif:  'EB Garamond', 'Crimson Pro', 'Georgia', serif;
  --font-ui:     'Inter', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
  --radius:      8px;
  --transition:  150ms ease;
  /* Aliases for older code paths that reference --surface-N / --text-secondary.
     They map to the real theme tokens above, so theme switching keeps working
     and tooltips don't end up white-on-white in dark mode. */
  --surface-0:    var(--bg-card);
  --surface-1:    var(--bg-panel);
  --surface-2:    var(--bg-hover);
  --text-secondary: var(--text-muted);
}

[data-theme="light"] {
  --bg:          #faf9f6;
  --bg-panel:    #f2f0eb;
  --bg-card:     #ffffff;
  --bg-hover:    #f5f3ef;
  --border:      #e0ddd5;
  --text:        #1a1a1a;
  --text-muted:  #5c5c5c;
  --accent:      #7c5e10;
  --accent-dim:  #b8993d;
  --blue:        #2c5ea0;
  --green:       #1d7a4e;
  --red:         #a83a3a;
  --purple:      #6b42a0;
  --orange:      #a86420;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video, canvas, svg { max-width: 100%; height: auto; }
.app { overflow-x: hidden; }
html { overflow-x: hidden; max-width: 100vw; }
body { overflow-x: hidden; max-width: 100vw; }

::selection {
  background: rgba(201, 162, 39, 0.3);
  color: var(--text);
}
[data-theme="light"] ::selection {
  background: rgba(124, 94, 16, 0.2);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(212, 171, 42, 0.02) 0%, transparent 60%);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}
[data-theme="light"] body {
  background-image: radial-gradient(ellipse at 50% 0%, rgba(124, 94, 16, 0.03) 0%, transparent 50%);
}

/* ── Layout ─────────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.app > header {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: 100vw;
}

@media (max-width: 600px) {
  .app > header { padding: 0.75rem 1rem; }
  /* On iPhone (375–414px), the default `main { padding: 2rem }` was eating
     ~64px of the ~375px viewport — verse text wrapped at ~310px making the
     reader feel cramped. Cut the side padding sharply; verses + cards now
     get the full reading width minus a thin breathing margin. */
  main { padding: 1rem 0.6rem; }
  /* Card padding default is 1.5rem all around — also too generous when the
     card is already inside a narrow viewport. */
  .card { padding: 0.85rem; }
  /* Reader card specifically — verse text gets the most extra room. */
  .reader-main .card { padding: 0.75rem 0.6rem; }

  /* ─── Iphone overflow guards ──────────────────────────────────
     Many article pages were getting their right edge clipped on iPhone
     because of three problems that compound:
     (1) main is `display: flex` and its direct children default to
         min-width: auto, which lets them grow wider than the parent.
     (2) Long unbroken strings (URLs, Greek transliteration, Hebrew refs,
         compound citation labels like "1 Cor 3:16–17a") didn't wrap.
     (3) Tables, images, iframes inside article body had no max-width
         bound, so content with any natural width punched through.
     Each guard is scoped to mobile so desktop layouts (grids, sidebars)
     keep working as-is. */
  main > *,
  .card,
  .card > *,
  article,
  article > * { min-width: 0; max-width: 100%; }
  .card,
  .card p, .card li, .card td, .card th,
  article p, article li, article td, article th,
  .story-prose, .commentary-prose, .body-text-block,
  .scripture-text, .verse-text,
  .definition-text, .ch-summary, .ch-statement-text {
    overflow-wrap: anywhere;
    word-wrap: break-word;
  }
  /* Tables wider than viewport — scroll instead of clip */
  main table { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  /* Media — never extend past the column */
  main img, main iframe, main video, main svg { max-width: 100%; height: auto; }
  /* <pre>/<code> blocks — wrap or scroll, never silently clip */
  main pre, main code { overflow-x: auto; max-width: 100%; }
  main pre { white-space: pre-wrap; word-break: break-word; }
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  color: var(--accent);
  flex-shrink: 0;
}

.app > header h1 {
  font-family: var(--font-page);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.app > header h1 span {
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(201, 162, 39, 0.08);
  border-radius: 4px 4px 0 0;
}

[data-theme="light"] nav a.active {
  background: rgba(124, 94, 16, 0.06);
}

/* Persistent header search */
.nav-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  margin-right: 0.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}
.nav-search-icon {
  width: 0.95rem;
  height: 0.95rem;
  stroke: var(--text-muted);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  flex-shrink: 0;
  transition: stroke var(--transition);
}
.nav-search:focus-within .nav-search-icon { stroke: var(--accent); }
.nav-search input {
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  width: 9rem;
  padding: 0;
  transition: width var(--transition);
}
.nav-search input:focus { width: 12rem; }
.nav-search input::placeholder { color: var(--text-muted); }
/* Hide the native search clear/decoration for a cleaner look */
.nav-search input::-webkit-search-decoration,
.nav-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Light mode refinements — cleaner, more luminous */
[data-theme="light"] .card {
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .card:hover {
  border-color: rgba(124, 94, 16, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .app > header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] footer {
  border-top-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .explore-flagship-card {
  box-shadow: 0 2px 12px rgba(124, 94, 16, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  transition: color var(--transition), border-color var(--transition);
  margin-left: 0.5rem;
  line-height: 1;
  vertical-align: middle;
}

/* Workspace link in the main nav — auth-aware swap between "Sign in" and "My writings ↗". */
.nav-workspace {
  display: inline-block;
  margin-left: 0.7rem;
  padding: 0.28rem 0.85rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-workspace:hover {
  background: var(--accent);
  color: var(--bg);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

main {
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), background var(--transition);
}

.card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-hover);
}

.card h2 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.card h3 {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.card p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ── Grid layouts ───────────────────────────────────────────── */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.grid-auto-fill { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.5rem; }

@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ── Breadcrumb ────────────────────────────────────────────── */

.breadcrumb {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb-pillar {
  font-weight: 600;
  color: var(--accent);
  opacity: 0.75;
}

/* ── Hero ───────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  max-width: 100vw;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .hero-greek { font-size: 1.1rem; }
  .explore-section-desc { font-size: 0.95rem; word-break: break-word; }
}

.hero h1 {
  font-family: var(--font-page);
  font-size: 2.6rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: 0.01em;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.hero-greek {
  font-family: var(--font-body);
  font-size: 1.35rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.hero-epigraph {
  max-width: 560px;
  margin: 1.25rem auto 1.5rem;
  padding: 0;
  border: none;
}

.hero-epigraph p {
  font-family: var(--font-page);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text);
  opacity: 0.75;
  margin-bottom: 0.4rem;
}

.hero-epigraph cite {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-style: normal;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.hero-epigraph cite a {
  color: var(--accent-dim);
  text-decoration: none;
}

.hero-epigraph cite a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

/* ── Home page stats & cards ─────────────────────────────── */

.home-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 0 2rem 1rem;
}

.home-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.home-stat-num {
  font-family: var(--font-ui);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
}

.home-stat-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.home-card {
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  color: var(--text);
}
a.home-card h3,
.home-card .card-link h3 {
  color: var(--accent);
}
a.home-card p {
  color: var(--text-muted);
}

.home-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-dim);
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.15);
}

.home-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.home-reading-progress {
  margin-top: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
  min-width: 2px;
}

/* ── Parallel text table ──────────────────────────────────── */

.parallel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0;
}

.parallel-chip {
  background: var(--bg-card, #1e1e1e);
  border: 1px solid var(--border, #333);
  color: var(--text-muted, #999);
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}

.parallel-chip:hover {
  border-color: var(--accent, #c9a84c);
  color: var(--text, #eee);
}

.parallel-chip--active {
  background: var(--accent, #c9a84c);
  color: var(--bg, #111);
  border-color: var(--accent, #c9a84c);
  font-weight: 600;
}

.parallel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.parallel-th {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.parallel-row {
  border-bottom: 1px solid var(--border);
}

.parallel-row:hover {
  background: rgba(201, 162, 39, 0.08);
}

.parallel-verse-num {
  padding: 0.5rem 0.25rem;
  vertical-align: top;
  white-space: nowrap;
}

.parallel-td {
  padding: 0.5rem 0.75rem;
  vertical-align: top;
  line-height: 1.6;
  border-left: 1px solid var(--border);
}

@media (max-width: 768px) {
  .parallel-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .parallel-td { min-width: 200px; font-size: 0.85rem; }
}

/* ── Entity grid ─────────────────────────────────────────── */

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.entity-card {
  padding: 1rem;
}

.entity-card h3 {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

/* ── Reader layout ─────────────────────────────────────────── */

.reader-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
  position: relative;
}

.reader-annotations-toggle { order: 0; grid-column: 1 / -1; display: none; }
.reader-main { order: 1; }
.sidebar { order: 2; }

@media (max-width: 1000px) {
  .reader-layout { grid-template-columns: 1fr; }
  .reader-annotations-toggle { order: 0; }
  .sidebar--above { order: 1; }
  .reader-main { order: 2; }
  .sidebar-conn-list { display: none; }
  .insight-divider { display: none; }
}

.sidebar-toggle-mobile {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  align-items: center;
  justify-content: center;
}

@media (max-width: 1000px) {
  .sidebar-toggle-mobile { display: flex; }
  .sidebar { display: none; }
  .sidebar--mobile-open {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    z-index: 200;
    background: var(--bg-panel);
    overflow-y: auto;
    padding: 1rem;
    box-shadow: -4px 0 16px rgba(0,0,0,0.3);
    animation: slide-in-right 0.2s ease-out;
  }
  .sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 199;
    background: rgba(0,0,0,0.5);
  }
}

@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.reader-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0; /* allow the grid item to shrink below content min-content (no overflow) */
}

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 10;
}

.reader-nav-arrows {
  display: flex;
  gap: 0.25rem;
}

.sidebar {
  position: sticky;
  top: 1rem;
  max-height: none;
  overflow-y: visible;
}

.sidebar-conn-list {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem 0 1.5rem;
}

/* Timeline vertical line */
.sidebar-conn-list::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

/* ── Text tradition tabs ──────────────────────────────────── */

.tradition-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: -0.5rem;
}

.tradition-tab {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.tradition-tab:hover {
  color: var(--text);
}

.tradition-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* "More" dropdown for secondary traditions */
/* Tradition select dropdown */
.tradition-select {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.tradition-select:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}
.tradition-select--active {
  color: var(--accent);
  border-color: var(--accent-dim);
  font-weight: 600;
}

/* ── Reader "Tools" overflow menu ──────────────────────────── */
.reader-nav-spacer { flex: 1 1 auto; }

.reader-tools-wrap { position: relative; }

.reader-tools-btn { white-space: nowrap; }

.reader-tools-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: 0.35rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.reader-tools-menu[hidden] { display: none; }

.reader-tools-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 0.5rem 0.7rem;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.reader-tools-item:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.reader-tools-item.tradition-tab--active { color: var(--accent); }

.reader-tools-row { display: flex; align-items: center; }
.reader-tools-row .reader-tools-item { flex: 1; }
.reader-tools-row .audio-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-right: 0.6rem;
  white-space: nowrap;
}

.reader-tools-find {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem 0.25rem;
  margin-top: 0.2rem;
  border-top: 1px solid var(--border);
}
.reader-tools-find .reader-search { flex: 1; min-width: 0; }

/* ── Book page ─────────────────────────────────────────────── */

.page {
  background: #faf6ef;
  border-radius: 4px;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.2),
    0 20px 60px rgba(0,0,0,0.35),
    inset 0 0 80px rgba(0,0,0,0.03);
  position: relative;
  border: 1px solid rgba(180,170,150,0.25);
  animation: pageReveal 0.6s ease-out both;
}

@keyframes pageReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 4px;
  pointer-events: none;
  /* Parchment texture — layered subtle gradients for paper feel */
  background:
    linear-gradient(135deg, rgba(200,190,170,0.06) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(0,0,0,0.015) 0%, transparent 8%, transparent 92%, rgba(0,0,0,0.02) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(139,119,90,0.008) 2px,
      rgba(139,119,90,0.008) 3px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(139,119,90,0.005) 3px,
      rgba(139,119,90,0.005) 4px
    );
  opacity: 0.98;
}

[data-theme="light"] .page {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.08);
}

.page-inner {
  /* Let the text fill more of the parchment on desktop. Prior values (920px
     max-width + 2rem padding) left a visible empty parchment band around the
     text plus chunky inner padding, which read as "too much margin". Widening
     the column + trimming inner padding pushes the text out toward the
     parchment edge so the page reads as a page, not a card. */
  padding: 1.5rem 1.5rem 1.5rem;
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .page-inner { padding: 1.5rem 1.1rem 1.25rem; }
}
/* Phones: let the reading page span the full width. The desktop "card" inset
   plus main's side padding wasted ~56px on a 390px screen, squeezing the text
   into the middle. Cancel main's padding for the reader and drop the card's
   side border/radius so the page reads edge-to-edge (Apple Books / Kindle style). */
@media (max-width: 600px) {
  .reader-layout { margin-left: -1rem; margin-right: -1rem; }
  .page { border-radius: 0; border-left: none; border-right: none; }
  .page-inner { padding: 1.4rem 1rem 1.2rem; }
}
@media (max-width: 400px) {
  .page-inner { padding: 1.3rem 0.85rem 1.1rem; }
  .scripture-text { font-size: 1.05rem; }
  .chapter-number { font-size: 2.5rem; }
  .scripture-para--first .drop-cap { font-size: 3.2rem; }
}

/* Page header — running head */
.page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(140,130,110,0.2);
  animation: headerReveal 0.8s ease-out 0.1s both;
}

@keyframes headerReveal {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

.page-header-book {
  font-family: var(--font-page);
  font-size: 0.8rem;
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: 0.18em;
  color: #8a7d6b;
}

.page-header-sep {
  width: 20px;
  height: 1px;
  background: rgba(140,130,110,0.25);
}

.page-header-chapter {
  font-family: var(--font-page);
  font-size: 0.8rem;
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: 0.18em;
  color: #8a7d6b;
}

/* Chapter ornament — decorative separator before chapter number */
.chapter-ornament {
  text-align: center;
  font-size: 1rem;
  color: #c4a55a;
  opacity: 0;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5em;
  animation: ornamentReveal 1s ease-out 0.15s both;
}

@keyframes ornamentReveal {
  from { opacity: 0; filter: blur(1px); transform: scale(0.98); }
  to   { opacity: 0.5; filter: blur(0); transform: scale(1); }
}

/* Chapter number — decorative block above text */
.chapter-number {
  font-family: var(--font-page);
  font-size: 3.5rem;
  font-weight: 400;
  line-height: 1;
  color: #c4a55a;
  text-align: center;
  margin-bottom: 1.5rem;
  opacity: 0;
  letter-spacing: 0.05em;
  animation: chapterReveal 1s ease-out 0.25s both;
}

@keyframes chapterReveal {
  from { opacity: 0; letter-spacing: 0.12em; }
  to   { opacity: 0.5; letter-spacing: 0.05em; }
}

/* Gold accent rule below chapter number */
.chapter-number::after {
  content: '';
  display: block;
  width: 3rem;
  height: 1px;
  background: linear-gradient(to right, transparent, #c4a55a, transparent);
  margin: 0.75rem auto 0;
  opacity: 0;
  animation: ruleReveal 0.8s ease-out 0.4s both;
}

@keyframes ruleReveal {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 0.6; transform: scaleX(1); }
}

/* Scripture text — the main reading area */
.scripture-text {
  color: #2b2a28;
  font-family: var(--font-page);
  font-size: 1.2rem;
  line-height: 1.72;
}

.scripture-para {
  margin-bottom: 0.8em;
  text-indent: 1.5em;
  hanging-punctuation: first allow-end;
  animation: textReveal 0.7s ease-out both;
}

/* First paragraph gets subtle lift; rest are opacity-only */
.scripture-para:nth-child(1) { animation-name: textRevealFirst; animation-delay: 0.3s; }
.scripture-para:nth-child(2) { animation-delay: 0.38s; }
.scripture-para:nth-child(3) { animation-delay: 0.44s; }
.scripture-para:nth-child(4) { animation-delay: 0.48s; }
.scripture-para:nth-child(5) { animation-delay: 0.51s; }
.scripture-para:nth-child(n+6) { animation-delay: 0.53s; }

@keyframes textReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes textRevealFirst {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scripture-para--first {
  text-indent: 0;
}

/* Drop cap — first letter of the chapter */
.scripture-para--first .drop-cap {
  float: left;
  font-family: var(--font-page);
  font-size: 4.5rem;
  line-height: 0.78;
  padding-right: 0.1em;
  padding-top: 0.06em;
  margin-right: 0.02em;
  color: #8a6d1b;
  font-weight: 500;
  animation: dropCapReveal 1s ease-out 0.5s both;
}

@keyframes dropCapReveal {
  from { opacity: 0; transform: scale(0.92) translateY(1px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Poetry lines (Psalms, Proverbs, etc.) */
.scripture-line {
  margin-bottom: 0.35em;
  padding-left: 1.5em;
  text-indent: -1.5em;
}

/* Verse units */
.verse-unit {
  border-radius: 3px;
  padding: 1px 2px;
  transition: background 300ms ease;
}

.verse-unit:hover {
  background: rgba(210,180,120,0.06);
}

.verse-unit--active {
  background: rgba(210,180,120,0.15);
}

.verse-unit--highlighted {
  background: rgba(100,160,255,0.15);
  border-radius: 2px;
  box-shadow: 0 0 0 3px rgba(100,160,255,0.12);
  transition: background 0.3s, box-shadow 0.3s;
}

.verse-unit--playing {
  background: rgba(210,180,120,0.14);
  border-radius: 3px;
  outline: 1px solid rgba(210,180,120,0.2);
  transition: background 300ms ease;
}

.audio-play-btn { white-space: nowrap; }
.audio-duration {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}
.audio-play-btn--active {
  color: var(--accent);
  background: rgba(201,162,39,0.15);
}

.verse-num {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--accent);
  vertical-align: baseline;
  position: relative;
  top: -0.5em;
  margin-left: 0.1em;
  margin-right: 0.3em;
  cursor: pointer;
  line-height: 0;
  transition: color 150ms ease;
  user-select: none;
  opacity: 0.7;
}

.verse-num:hover {
  color: #8a6d1b;
  opacity: 1;
}

.verse-source-badge {
  display: none;
}

/* Variant badges on verse numbers */
.verse-variant-badge {
  display: inline-block;
  font-family: var(--font-ui), system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  vertical-align: super;
  cursor: pointer;
  margin-left: 0.05em;
  margin-right: 0.15em;
  line-height: 1;
  user-select: none;
  opacity: 0.8;
  transition: opacity 150ms ease;
}
.verse-variant-badge:hover {
  opacity: 1;
}
.verse-variant-badge--trivial {
  color: var(--text-muted, #888);
}
.verse-variant-badge--minor {
  color: var(--text-muted, #888);
}
.verse-variant-badge--notable {
  color: #c9a227;
}
.verse-variant-badge--major {
  color: var(--accent, #c9a227);
  font-size: 0.65rem;
}

/* AI Commentary badge on verse numbers */
.verse-ai-badge {
  display: inline-block;
  font-family: var(--font-ui), system-ui, sans-serif;
  font-size: 0.55rem;
  color: #7bafd4;
  cursor: pointer;
  margin-left: 1px;
  vertical-align: super;
  opacity: 0.7;
  transition: opacity 150ms ease;
}
.verse-ai-badge:hover {
  opacity: 1;
}

/* AI Commentary inline expansion (under verse text) */
.ai-commentary-inline {
  display: block;
  margin: 0.4rem 0 0.6rem 0;
  padding: 0.5rem 0.75rem;
  background: var(--card-bg, #1a1a1a);
  border-left: 3px solid #7bafd4;
  border-radius: 0 4px 4px 0;
  font-family: var(--font-ui), system-ui, sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  animation: aiCommentaryFadeIn 200ms ease;
}
@keyframes aiCommentaryFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-commentary-text {
  color: var(--text, #e0e0e0);
  margin-bottom: 0.35rem;
}
.ai-commentary-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.25rem;
}
.ai-commentary-source {
  font-size: 0.7rem;
  color: var(--text-muted, #888);
  background: rgba(123, 175, 212, 0.1);
  border: 1px solid rgba(123, 175, 212, 0.2);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
}
.ai-commentary-meta {
  font-size: 0.65rem;
  color: var(--text-muted, #666);
  font-style: italic;
}

/* Chapter synthesis text */
.synthesis-text {
  font-size: 0.88rem;
  line-height: 1.7;
  padding: 0.3rem 0;
  color: var(--text);
}

.synthesis-ref {
  color: var(--accent, #c9a84c);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent, #c9a84c);
}

.synthesis-ref:hover {
  color: var(--text);
  border-bottom-style: solid;
}

.mobile-synthesis { display: none; }

@media (max-width: 1000px) {
  .mobile-synthesis { display: block; margin-top: 1.5rem; }
}

/* Variant detail page */
.variant-detail-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}
.variant-unit-card {
  border: 1px solid var(--border, #333);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--card-bg, #1a1a1a);
}
.variant-unit-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--accent, #c9a227);
}
.variant-unit-description {
  font-size: 0.85rem;
  color: var(--text-secondary, #aaa);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.variant-significance {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.variant-significance--major {
  background: rgba(201, 162, 39, 0.2);
  color: var(--accent, #c9a227);
}
.variant-significance--notable {
  background: rgba(201, 162, 39, 0.12);
  color: #c9a227;
}
.variant-significance--minor {
  background: rgba(136, 136, 136, 0.15);
  color: var(--text-muted, #888);
}
.variant-significance--trivial {
  background: rgba(136, 136, 136, 0.1);
  color: var(--text-muted, #888);
}
.variant-reading {
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--border, #333);
  border-radius: 0 4px 4px 0;
  background: rgba(255,255,255,0.02);
}
.variant-reading--lemma {
  border-left-color: var(--accent, #c9a227);
}
.variant-reading-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.variant-reading-text {
  font-family: 'EB Garamond', 'Gentium Plus', 'Georgia', serif;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.variant-reading-english {
  font-size: 0.85rem;
  color: var(--text-secondary, #aaa);
  font-style: italic;
  margin-bottom: 0.25rem;
}
.variant-reading-witnesses {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}

/* Greek and Latin text styling */
.scripture-text--greek {
  font-family: 'EB Garamond', 'Gentium Plus', 'Gentium', 'Georgia', serif;
  font-size: 1.15rem;
  direction: ltr;
}

.scripture-text--latin {
  font-family: 'EB Garamond', 'Crimson Pro', 'Georgia', serif;
  font-style: italic;
  font-size: 1.15rem;
}

.scripture-text--hebrew {
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Frank Ruehl', 'David', serif;
  font-size: 1.3rem;
  direction: rtl;
  text-align: right;
  line-height: 2;
}

.scripture-text--syriac {
  font-family: 'Estrangelo Edessa', 'Serto Jerusalem', 'East Syriac Adiabene', 'Noto Sans Syriac', serif;
  font-size: 1.25rem;
  direction: rtl;
  text-align: right;
  line-height: 2;
}

/* ── Interlinear mode ──────────────────────────────────────── */

.interlinear-verse {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border, #e0d9cf);
}

.interlinear-verse:last-child {
  border-bottom: none;
}

.interlinear-verse-num {
  display: inline;
  margin-right: 0.3em;
}

.interlinear-english {
  font-family: var(--font-page, Georgia, serif);
  font-size: 1.1rem;
  line-height: 1.65;
  color: #2b2a28;
  margin-bottom: 0.6rem;
}

.interlinear-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin-top: 0.4rem;
}

.interlinear-words--rtl {
  direction: rtl;
  justify-content: flex-start;
}

.interlinear-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition, 0.2s);
  min-width: 3.5rem;
}

.interlinear-word:hover,
.interlinear-word:focus {
  background: rgba(138, 109, 27, 0.08);
}

.interlinear-word-original {
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.4;
  color: #2b2a28;
}

.interlinear-lang--hebrew {
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Frank Ruehl', 'David', serif;
  font-size: 1.3rem;
  direction: rtl;
}

.interlinear-lang--greek {
  font-family: 'EB Garamond', 'Gentium Plus', 'Gentium', 'Georgia', serif;
  font-size: 1.15rem;
}

.interlinear-word-translit {
  font-size: 0.75rem;
  color: #7a7060;
  font-style: italic;
  margin-top: 0.15rem;
  line-height: 1.3;
}

.interlinear-word-strongs {
  font-size: 0.68rem;
  color: #8a6d1b;
  font-family: var(--font-ui, system-ui, sans-serif);
  font-weight: 600;
  margin-top: 0.1rem;
  letter-spacing: 0.02em;
}

.interlinear-word-gloss {
  font-size: 0.72rem;
  color: #555;
  margin-top: 0.1rem;
  line-height: 1.2;
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Interlinear tooltip */
.interlinear-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #faf6ef;
  border: 1px solid #d4c9a8;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 0.75rem 1rem;
  min-width: 200px;
  max-width: 280px;
  margin-top: 4px;
  text-align: left;
  direction: ltr;
  cursor: default;
}

.interlinear-tooltip-word {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2b2a28;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e0d9cf;
}

.interlinear-tooltip-row {
  font-size: 0.82rem;
  color: #444;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.interlinear-tooltip-label {
  font-weight: 600;
  color: #7a7060;
  margin-right: 0.35em;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.interlinear-tooltip-link {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid #e0d9cf;
}

.interlinear-tooltip-link a {
  font-size: 0.78rem;
  color: #8a6d1b;
  text-decoration: none;
  font-weight: 500;
}

.interlinear-tooltip-link a:hover {
  text-decoration: underline;
}

.interlinear-empty {
  text-align: center;
  color: var(--text-muted, #888);
  padding: 2rem 1rem;
  font-style: italic;
  font-size: 0.95rem;
}

.interlinear-loading {
  text-align: center;
  color: var(--text-muted, #888);
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

/* Dark theme adjustments */
[data-theme="dark"] .interlinear-english {
  color: var(--text, #d4c9a8);
}

[data-theme="dark"] .interlinear-word-original {
  color: var(--text, #d4c9a8);
}

[data-theme="dark"] .interlinear-word:hover,
[data-theme="dark"] .interlinear-word:focus {
  background: rgba(212, 201, 168, 0.1);
}

[data-theme="dark"] .interlinear-word-translit {
  color: var(--text-muted, #888);
}

[data-theme="dark"] .interlinear-word-strongs {
  color: var(--accent, #c9a84c);
}

[data-theme="dark"] .interlinear-word-gloss {
  color: var(--text-muted, #999);
}

[data-theme="dark"] .interlinear-tooltip {
  background: var(--bg-card, #1e1c18);
  border-color: var(--border, #3a3630);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

[data-theme="dark"] .interlinear-tooltip-word {
  color: var(--text, #d4c9a8);
  border-bottom-color: var(--border, #3a3630);
}

[data-theme="dark"] .interlinear-tooltip-row {
  color: var(--text-muted, #aaa);
}

[data-theme="dark"] .interlinear-tooltip-label {
  color: var(--text-muted, #888);
}

[data-theme="dark"] .interlinear-tooltip-link {
  border-top-color: var(--border, #3a3630);
}

[data-theme="dark"] .interlinear-tooltip-link a {
  color: var(--accent, #c9a84c);
}

[data-theme="dark"] .interlinear-verse {
  border-bottom-color: var(--border, #3a3630);
}

/* Mobile interlinear — simplified view */
@media (max-width: 768px) {
  .interlinear-word {
    min-width: 2.5rem;
    padding: 0.25rem 0.3rem;
  }

  .interlinear-word-translit {
    display: none;
  }

  .interlinear-word-gloss {
    display: none;
  }

  .interlinear-word-original {
    font-size: 1rem;
  }

  .interlinear-word-strongs {
    font-size: 0.62rem;
  }

  .interlinear-tooltip {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.2rem 1.5rem;
    margin-top: 0;
  }
}

/* Page footer — chapter navigation */
.page-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(140,130,110,0.2);
}

.page-footer-link {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: #8a7d6b;
  text-decoration: none;
  transition: color 150ms ease;
}

.page-footer-link:hover {
  color: #c4a55a;
}

/* ── Tags / Pills ───────────────────────────────────────────── */

.tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin: 0.15rem;
  cursor: pointer;
  transition: all var(--transition);
}

.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.tag--prophecy { border-color: var(--blue); color: var(--blue); }
.tag--theophany { border-color: var(--purple); color: var(--purple); }
.tag--theme { border-color: var(--green); color: var(--green); }
.tag--history { border-color: var(--orange); color: var(--orange); }
.tag--tradition { border-color: var(--red); color: var(--red); }

/* ── Prophecy cards ─────────────────────────────────────────── */

.prophecy-card {
  cursor: pointer;
}

.prophecy-card .type-badge {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.prophecy-card .consensus {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.prophecy-card .ref {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* Enhanced prophecy/claim card */
.prophecy-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.prophecy-card-title {
  font-size: 1rem;
  margin: 0;
  line-height: 1.3;
}
.prophecy-card-thesis {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 0.5rem;
}
.prophecy-card-traditions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}
.prophecy-card-trad {
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 500;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  background: rgba(201,162,39,0.08);
  color: var(--text-muted);
}
.prophecy-card-more {
  font-family: var(--font-ui);
  font-size: 0.55rem;
  color: var(--text-muted);
  padding: 0.1rem 0.2rem;
}

/* ── Theophany cards ────────────────────────────────────────── */

.theophany-card .classification {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

/* Christological status colors */
.classification--consensus { color: var(--green); }
.classification--majority { color: var(--blue); }
.classification--minority { color: var(--orange); }
.classification--disputed { color: var(--red); }

/* ── Search ─────────────────────────────────────────────────── */

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.search-bar input {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.search-bar input:focus { border-color: var(--accent); }

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

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-dim); }

/* ── Filter bar ─────────────────────────────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.filters label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.filter-select {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
}

.filter-select:focus { border-color: var(--accent); }

/* ── Connections panel ──────────────────────────────────────── */

.connection {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  transition: background var(--transition);
  cursor: pointer;
}

.connection:hover { background: var(--bg-hover); }

.connection-type {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  min-width: 80px;
  padding-top: 0.15rem;
}

.connection-ref {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--accent);
}

.connection-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Confidence bar ─────────────────────────────────────────── */

.confidence-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.confidence-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 300ms ease;
}

/* ── Loading ────────────────────────────────────────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  margin-right: 0.75rem;
}

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

/* ── Source text cards ──────────────────────────────────────── */

.source-card {
  cursor: default;
}

.source-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.source-author {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}

.source-work {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.source-period {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.source-claim {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.source-text-toggle {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--blue);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0.25rem;
}

.source-text-toggle:hover {
  color: var(--accent);
}

.source-text-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease, padding 300ms ease;
  padding: 0;
}

.source-text-body.expanded {
  max-height: 2000px;
  padding: 0.75rem 0;
}

.source-heading {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.source-passage {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  border-left: 3px solid var(--accent-dim);
  padding-left: 1rem;
  white-space: pre-wrap;
}

/* Source work entry in corpus browser */
.source-work-entry {
  padding: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.source-work-entry:last-child {
  border-bottom: none;
}

.source-work-entry:hover {
  background: var(--bg-hover);
}

/* ── Stories ────────────────────────────────────────────────── */

.story-layout {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 1.5rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.story-nav-rail {
  position: sticky;
  top: 4rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  padding-top: 0.5rem;
}

.story-nav-rail::-webkit-scrollbar { width: 0; }

@media (max-width: 900px) {
  .story-layout { grid-template-columns: 1fr; }
  .story-nav-rail { display: none; }
}

.story-article {
  max-width: 900px;
}

.story-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.story-icon-large {
  font-size: 2rem;
  text-align: center;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: 1rem;
  width: 100%;
}

.story-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.story-title {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  width: 100%;
}

.story-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  width: 100%;
}

.story-meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.5rem;
  width: 100%;
}

.story-section {
  margin-bottom: 3rem;
  scroll-margin-top: 6rem;
}

.story-section-heading {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Editorial navigation (prev/next) */
.editorial-nav {
  margin-top: 3rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: var(--radius);
}
.editorial-nav-pos {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.75rem;
}
.editorial-nav-links {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}
.editorial-nav-link {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
  max-width: 45%;
}
.editorial-nav-link:hover { opacity: 0.8; }
.editorial-nav-prev { margin-right: auto; }
.editorial-nav-next { margin-left: auto; text-align: right; }

/* Start Here — link cards */
.start-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.start-link-card {
  padding: 1.25rem;
  border-left: 3px solid var(--accent);
}
.start-link-card h3 {
  font-family: var(--font-page);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.start-link-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
@media (max-width: 900px) {
  .start-links { grid-template-columns: 1fr; }
}

/* Editorial list page */
.editorial-featured {
  display: block;
  margin-bottom: 2rem;
  padding: 2rem 2.25rem;
  border-left: 4px solid var(--accent);
}
.editorial-featured h2 {
  font-family: var(--font-page);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.editorial-featured-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.editorial-hook {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  opacity: 0.8;
  font-style: italic;
  margin-bottom: 0.5rem;
}
.editorial-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.editorial-card .editorial-desc {
  -webkit-line-clamp: 2;
}
.editorial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}
.editorial-cta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition);
  white-space: nowrap;
}
.card:hover .editorial-cta {
  color: var(--accent);
}
/* Editorial phases */
.editorial-phase {
  margin-bottom: 2rem;
}
.editorial-phase-header {
  margin-bottom: 1rem;
}
.editorial-phase-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 0.25rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.editorial-phase-desc {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}
.editorial-card-num {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 0.25rem;
}
.editorial-grid {
  margin-bottom: 0;
}

.story-prose {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.story-verse {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(201, 162, 39, 0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.story-verse p {
  font-family: var(--font-page);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
  font-style: italic;
}

.story-verse cite {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-style: normal;
}

.story-verse cite a {
  color: var(--accent);
  text-decoration: none;
}

.story-verse cite a:hover {
  text-decoration: underline;
}

.story-source, .story-father {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.story-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.story-source-author {
  font-weight: 600;
  color: var(--accent);
}

.story-source-work {
  color: var(--text-muted);
}

.story-source-ref, .story-source-date {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.story-source blockquote, .story-father blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  font-style: italic;
}

.story-source-note {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

.story-corpus-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--blue);
  text-decoration: none;
}

.story-corpus-link:hover {
  color: var(--accent);
}

.story-keypoint {
  border-left: 3px solid var(--green);
  background: rgba(76, 175, 125, 0.06);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
}

.story-list {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.story-list li {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.story-list li:last-child {
  border-bottom: none;
}

.story-list li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.story-note {
  border-left: 3px solid var(--blue);
  background: rgba(91, 141, 217, 0.06);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.story-note-label {
  display: block;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 0.35rem;
}

.story-objection {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}

.story-objection-name {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.story-objection-row {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.story-objection-label {
  font-weight: 600;
  color: var(--text);
}

.story-toc {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--border);
  padding-left: 0;
}

.story-toc-link {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.4;
}

.story-toc-link:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}

/* ── Genealogy tree diagram ─────────────────────────────────── */
.story-genealogy {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}
.genealogy-title {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.genealogy-node {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.35rem 0;
  position: relative;
}
.genealogy-node a {
  color: var(--accent);
  text-decoration: none;
}
.genealogy-node a:hover {
  text-decoration: underline;
}
.genealogy-root {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.genealogy-merge-node {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.75rem;
}
.genealogy-cursed {
  color: #c0392b;
}
.genealogy-cursed a {
  color: #c0392b;
}
.genealogy-cursed::before {
  content: '\2716 ';
  font-size: 0.7em;
  color: #c0392b;
}
.genealogy-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
}
.genealogy-branch-label {
  display: flex;
  justify-content: space-around;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0.75rem 0 0.25rem;
  padding: 0 1rem;
}
.genealogy-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 0 auto;
  max-width: 420px;
}
.genealogy-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 2px solid var(--border);
  padding-top: 0.5rem;
}
.genealogy-col-left {
  border-right: 1px solid var(--border);
}
.genealogy-ellipsis {
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0.15rem 0;
  line-height: 1;
}

@media (max-width: 600px) {
  .story-genealogy { padding: 1.25rem 0.75rem; }
  .genealogy-columns { gap: 0.5rem; }
  .genealogy-node { font-size: 0.78rem; }

  /* Editorial pages — keep blocks inside the viewport on iPhone.
     Without these, the translation picker forces .story-meta wider than
     the viewport, and long unbreakable strings in prose or source-meta
     punch through the right edge. */
  .story-article { max-width: 100%; min-width: 0; }
  .story-meta { flex-wrap: wrap; gap: 0.5rem 0.75rem; }
  .ak-trad-picker { flex-wrap: wrap; max-width: 100%; }
  .ak-trad-select { max-width: 100%; min-width: 0; }
  .story-prose, .story-keypoint, .story-note,
  .story-source blockquote, .story-father blockquote,
  .story-objection-row { overflow-wrap: anywhere; }
  .story-verse { padding: 0.75rem 0.9rem; }
  .story-keypoint, .story-note { padding: 0.75rem 0.9rem; }
  .story-source, .story-father, .story-objection { padding: 0.9rem; }
  .story-source-meta { row-gap: 0.35rem; }
  .editorial-nav { padding: 1rem; }
  .editorial-nav-link { max-width: 100%; }
  /* Trusted HTML blocks (tables) — let the table scroll inside its box
     instead of pushing the whole article off-screen. */
  .story-html { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .manuscript-table th { white-space: normal; }
}

/* ── Table of Contents panel ────────────────────────────────── */

.toc-btn {
  font-size: 1.1rem;
  padding: 0.4rem 0.7rem;
  line-height: 1;
}

.toc-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 340px;
  height: 100vh;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 250ms ease;
  overflow-y: auto;
}

.toc-panel--open {
  transform: translateX(0);
}

.toc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.toc-panel--open ~ .toc-overlay {
  opacity: 1;
  pointer-events: auto;
}

.toc-panel-inner {
  padding: 1.25rem;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.toc-header h2 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.toc-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color var(--transition);
}

.toc-close:hover {
  color: var(--text);
}

.toc-section {
  margin-bottom: 1.25rem;
}

.toc-section-title {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.toc-book {
  margin-bottom: 0.15rem;
}

.toc-book--active > .toc-book-name {
  color: var(--accent);
  font-weight: 600;
}

.toc-book-name {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text);
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.toc-book-name:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.toc-chapters {
  display: none;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0.25rem 0.5rem 0.5rem;
}

.toc-chapters--open {
  display: flex;
}

.toc-ch {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  width: 28px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
  background: var(--bg);
}

.toc-ch:hover {
  background: var(--accent-dim);
  color: var(--text);
}

.toc-ch--active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

@media (max-width: 500px) {
  .toc-panel { width: 100vw; }
}

/* ── Chapter picker ────────────────────────────────────────── */

.chapter-picker-wrap {
  position: relative;
}

.chapter-picker-btn {
  font-weight: 600;
  min-width: 60px;
}

.chapter-picker {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  z-index: 50;
  flex-wrap: wrap;
  gap: 3px;
  width: 280px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.chapter-picker--open {
  display: flex;
}

.ch-pick {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  width: 30px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg);
  transition: all var(--transition);
}

.ch-pick:hover {
  background: var(--accent-dim);
  color: var(--text);
}

.ch-pick--active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.ch-pick--read {
  color: var(--text);
  background: var(--bg-hover);
  border-bottom: 2px solid var(--accent-dim);
}

/* ── Reading progress in TOC ───────────────────────────────── */

.toc-ch--read {
  color: var(--text);
  background: var(--bg-hover);
  border-bottom: 2px solid var(--accent-dim);
}

/* ── SVG connector (verse → sidebar) ───────────────────────── */

.verse-connector-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: visible;
}

.connector-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0.4;
  stroke-dasharray: 6 3;
}

.connector-line--auto {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.75;
  opacity: 0.15;
  stroke-dasharray: 4 4;
  transition: opacity 0.2s, stroke-width 0.2s;
}

.connector-line--highlight {
  opacity: 0.5;
  stroke-width: 1.5;
  stroke-dasharray: none;
}

.connector-dot {
  fill: var(--accent);
  opacity: 0.6;
}

/* ── Sidebar sections (expandable) ─────────────────────────── */

.sidebar-verse-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.sidebar-verse-id {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-section-header:hover {
  background: var(--bg-hover);
}

.sidebar-section-title {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  flex: 1;
}

.sidebar-section-count {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.sidebar-section-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 200ms ease;
}

.sidebar-section--closed .sidebar-section-arrow {
  transform: rotate(-90deg);
}

.sidebar-section-body {
  padding: 0 0.5rem 0.5rem;
  max-height: 600px;
  overflow-y: auto;
  transition: max-height 300ms ease, padding 200ms ease;
}

.sidebar-section--closed .sidebar-section-body {
  max-height: 0;
  padding: 0 0.5rem;
  overflow: hidden;
}

/* Cross-reference text previews */
.xref-preview {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.2rem;
  font-style: italic;
}

/* ── Chapter connections timeline ───────────────────────────── */

.conn-entry {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

/* Timeline dot */
.conn-entry::before {
  content: '';
  position: absolute;
  left: -1.05rem;
  top: 0.55rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
  z-index: 1;
}

/* Connector line from dot to card */
.conn-entry::after {
  content: '';
  position: absolute;
  left: -0.6rem;
  top: 0.82rem;
  width: 0.6rem;
  height: 1px;
  background: var(--border);
}

.conn-entry:hover {
  border-color: var(--accent-dim);
}

.conn-entry-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

.conn-entry-verse {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 1.5rem;
}

.conn-entry-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.conn-badge {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

.conn-badge--theo { background: rgba(155, 114, 207, 0.15); color: var(--purple); }
.conn-badge--theo-cont { background: none; color: var(--purple); font-size: 0.85rem; opacity: 0.5; padding: 0; }
.conn-badge--prop { background: rgba(91, 141, 217, 0.15); color: var(--blue); }
.conn-badge--ful  { background: rgba(76, 175, 125, 0.15); color: var(--green); }
.conn-badge--quote { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }
.conn-badge--theme { background: rgba(76, 175, 125, 0.1); color: var(--green); }

/* Theophany full info block */
.conn-theo-full {
  margin-bottom: 0.3rem;
}

.conn-theo-tradition {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 0.15rem;
  font-style: italic;
}

.conn-theo-link {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--purple);
  text-decoration: none;
  display: inline-block;
  margin-top: 0.25rem;
}

.conn-theo-link:hover {
  color: var(--accent);
}

.conn-theo-verses {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--purple);
  opacity: 0.7;
  margin-top: 0.1rem;
}

/* Theophany span lines — connecting entry to each referenced verse */
.theo-span-line {
  position: absolute;
  left: 0.42rem;
  width: 2px;
  background: rgba(155, 114, 207, 0.4);
  pointer-events: none;
  z-index: 0;
}

.theo-span-dot {
  position: absolute;
  left: 0.2rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(155, 114, 207, 0.5);
  border: 1px solid var(--purple);
  pointer-events: none;
  z-index: 1;
}

.conn-entry-detail {
  max-height: 0;
  overflow: hidden;
  padding: 0 0.5rem;
  transition: max-height 250ms ease, padding 200ms ease;
}

.conn-entry--open .conn-entry-detail {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.25rem 0.5rem 0.5rem;
}

.conn-detail-item {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.2rem 0;
  line-height: 1.45;
}

.conn-detail-item a {
  text-decoration: none;
}

.conn-detail-item a:hover {
  color: var(--accent) !important;
}

.sidebar-loading {
  padding: 1.5rem 1rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ── Page transitions ───────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

main > *:not(.toc-panel):not(.toc-overlay) {
  animation: fadeIn 0.25s ease both;
}

/* ── Quiz & Flashcard styles ──────────────────────────────── */

.quiz-layout {
  max-width: 700px;
  margin: 0 auto;
}

.quiz-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.quiz-cat-card {
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}

.quiz-cat-card:hover {
  transform: translateY(-2px);
}

.quiz-cat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.quiz-cat-count {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Quiz in progress */
.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.quiz-question-num {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.quiz-question {
  font-family: var(--font-body);
  font-size: 1.3rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.quiz-option:hover:not(.quiz-option--answered) {
  border-color: var(--accent-dim);
  background: var(--bg-hover);
}

.quiz-option--correct {
  border-color: var(--green) !important;
  background: rgba(76, 175, 125, 0.1) !important;
  color: var(--green) !important;
}

.quiz-option--wrong {
  border-color: var(--red) !important;
  background: rgba(212, 93, 93, 0.08) !important;
  color: var(--red) !important;
  opacity: 0.7;
}

.quiz-option--answered {
  cursor: default;
  opacity: 0.5;
}

.quiz-option--answered.quiz-option--correct { opacity: 1; }

.quiz-feedback {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  animation: fadeIn 0.2s ease both;
}

.quiz-feedback--correct {
  background: rgba(76, 175, 125, 0.1);
  border: 1px solid var(--green);
  color: var(--green);
}

.quiz-feedback--wrong {
  background: rgba(212, 93, 93, 0.08);
  border: 1px solid var(--red);
  color: var(--text);
}

/* Results */
.quiz-result {
  text-align: center;
  padding: 2rem 1rem;
}

.quiz-score-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 6px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.quiz-score-ring--perfect { border-color: var(--accent); }
.quiz-score-ring--great { border-color: var(--green); }
.quiz-score-ring--good { border-color: var(--blue); }
.quiz-score-ring--try { border-color: var(--orange); }

.quiz-score-pct {
  font-family: var(--font-ui);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.quiz-result-title {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.quiz-result-subtitle {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.quiz-result-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Flashcard mode */
.flashcard {
  perspective: 1000px;
  width: 100%;
  max-width: 500px;
  height: 280px;
  margin: 2rem auto;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.flashcard--flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  text-align: center;
}

.flashcard-front {
  background: var(--bg-card);
}

.flashcard-back {
  background: var(--bg-hover);
  transform: rotateY(180deg);
}

.flashcard-front p {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
}

.flashcard-back p {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.flashcard-hint {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.flashcard-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.flashcard-counter {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* ── Connected verse indicator (non-invasive) ─────────────── */

.verse-unit--connected {
  position: relative;
}

.verse-unit--connected::before {
  display: none;
}

.verse-unit--connected > .verse-num {
  color: #c4a55a;
  text-shadow: 0 0 6px rgba(201, 162, 39, 0.3);
}

/* ── Verse of the Day ──────────────────────────────────────── */

.votd-card {
  max-width: 600px;
  margin: 1.5rem auto 0;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  text-align: center;
}

.votd-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.votd-text {
  font-family: var(--font-page);
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.votd-ref {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.votd-ref:hover {
  text-decoration: underline;
}

/* ── Verse bookmark button ─────────────────────────────────── */

.verse-bookmark-btn {
  font-size: 0.85rem;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0 0.2rem;
  vertical-align: super;
  line-height: 0;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.verse-bookmark-btn:hover {
  opacity: 1;
}

/* ── Timeline & Map ─────────────────────────────────────────── */

/* Timeline fills the full viewport height */
.tl-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* allow flex shrinking */
}

/* Top bar — compact, map-first layout */
.tl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.tl-topbar .breadcrumb { margin-bottom: 0; }
.tl-topbar-left { display: flex; align-items: center; gap: 0.5rem; }
.tl-topbar-right { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.tl-primary-select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
}
.tl-icon-btn {
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tl-icon-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* Collapsible filter panel */
.tl-filters-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
  animation: tl-slide-down 0.2s ease-out;
}
@keyframes tl-slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tl-filters-panel select {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
}

.tl-filters {
  display: flex;
  gap: 0.5rem;
}

.tl-cat-tag {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.tl-cat-tag.active { opacity: 1; }
.tl-cat-tag[data-cat="biblical"] { background: #d4af37; color: #000; }
.tl-cat-tag[data-cat="empire"]   { background: #c75c5c; color: #000; }
.tl-cat-tag[data-cat="cultural"] { background: #5ba3d9; color: #000; }

/* Status bar below timeline */
.tl-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
}

.tl-year-range {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tl-event-count {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.tl-map {
  flex: 1;
  min-height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

/* Override Leaflet for dark theme */
.tl-map .leaflet-control-zoom a {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.tl-map .leaflet-control-attribution {
  background: rgba(15,17,23,0.7);
  color: var(--text-muted);
  font-size: 0.6rem;
}
.tl-map .leaflet-control-attribution a { color: var(--accent); }

/* ── Places map (Explore > Places) ───────────────────────── */
#places-map .leaflet-control-zoom a {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
#places-map .leaflet-control-attribution {
  background: rgba(15,17,23,0.7);
  color: var(--text-muted);
  font-size: 0.6rem;
}
#places-map .leaflet-control-attribution a { color: var(--accent); }
[data-theme="light"] #places-map .leaflet-control-attribution {
  background: rgba(245,243,238,0.8);
}
#places-map .leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
#places-map .leaflet-popup-tip { background: var(--bg-card); }
#places-map .leaflet-popup-content a { color: var(--accent); }

.tl-strip-wrapper {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.tl-strip {
  flex: 1;
  height: 160px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: grab;
  position: relative;
}

.tl-strip canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.tl-zoom-btn {
  width: 32px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: var(--radius);
}

.btn--small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.tl-detail {
  margin-bottom: 1rem;
  transition: opacity 0.25s ease;
}
.tl-detail--active {
  animation: tl-detail-in 0.3s ease-out;
}
@keyframes tl-detail-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Welcome state */
.tl-welcome {
  text-align: center;
  padding: 1rem 0;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.tl-welcome kbd {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.tl-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tl-link {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tl-link:hover {
  background: var(--bg-hover);
}
.tl-link--wiki {
  color: var(--text-muted);
}
.tl-link--wiki:hover {
  color: var(--text);
}
.tl-link--empire {
  color: var(--text-muted);
  border-color: rgba(180,50,50,0.3);
}
.tl-link--empire:hover {
  color: var(--text);
  border-color: rgba(180,50,50,0.6);
}

.tl-waypoint-progress {
  margin-top: 0.5rem;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}
.tl-waypoint-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Journey transport controls (media player) */
.tl-transport {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.tl-transport button {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  width: 2rem;
  height: 2rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.tl-transport button:hover {
  background: var(--border);
  border-color: var(--text-muted);
}
.tl-transport button.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.tl-transport-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  min-width: 80px;
}
.tl-transport-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.15s ease;
  pointer-events: none;
}
.tl-transport-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 0.15s ease;
}
.tl-transport-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 3rem;
  text-align: center;
}

/* (title row removed — replaced by tl-topbar) */

/* Flash effect when journey auto-starts */
.tl-transport-flash {
  animation: tl-flash 1.2s ease-out;
}
@keyframes tl-flash {
  0% { box-shadow: 0 0 12px 4px var(--accent); border-color: var(--accent); }
  100% { box-shadow: none; border-color: var(--border); }
}

/* Full-window mode — centered content */
.tl-fullwindow-mode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: var(--bg);
  overflow: hidden;
  padding: 1rem;
  margin: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tl-fullwindow-mode > .tl-page {
  width: 100%;
  max-width: 1400px;
  flex: 1;
  min-height: 0;
}
.tl-fullwindow-mode .tl-map {
  flex: 1;
  min-height: 300px;
}
.tl-fullwindow-mode .tl-strip {
  height: 200px;
}

@media (max-width: 900px) {
  .tl-map { min-height: 250px; }
  .tl-strip { height: 120px; }
  .tl-topbar { flex-direction: column; align-items: flex-start; }
  .tl-topbar-right { width: 100%; }
  .tl-primary-select { flex: 1; min-width: 0; }
  .tl-filters-panel { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 500px) {
  .tl-map { min-height: 200px; }
  .tl-strip { height: 100px; }
}

/* ── Reader Font Controls ──────────────────────────────────── */

.reader-font-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.font-btn {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ── Reader Search ─────────────────────────────────────────── */

.reader-search {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  width: 140px;
  transition: border-color var(--transition);
}

.reader-search::placeholder {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.reader-search:focus {
  border-color: var(--accent);
}

.verse-unit--search-dim {
  opacity: 0.25;
  transition: opacity 200ms ease;
}

.verse-unit--search-match {
  opacity: 1;
  transition: opacity 200ms ease;
}

.scripture-text mark {
  background: rgba(201, 162, 39, 0.4);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Empty state ────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}
.empty-state p {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Toast ──────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--accent);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  z-index: 9999;
  animation: toast-in 0.3s ease-out, toast-out 0.3s ease-in 1.7s forwards;
  pointer-events: none;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Streak lost ───────────────────────────────────────────── */

.streak-lost-msg {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--orange);
  margin-top: 0.5rem;
}

/* ── Search count ──────────────────────────────────────────── */

.search-count {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  white-space: nowrap;
}

/* ── Prophecy Arcs Visualization ────────────────────────────── */

.prophecy-viz {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.pv-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.pv-topbar .breadcrumb { margin-bottom: 0; }
.pv-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.pv-controls select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
}
.pv-canvas-wrap {
  flex: 1;
  min-height: 350px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.pv-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.pv-detail {
  margin-top: 0.5rem;
}
.pv-detail--active {
  animation: tl-detail-in 0.3s ease-out;
}

/* ── Prophecy Viz — extended styles ────────────────────────── */

.prophecy-viz {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.pv-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.pv-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.pv-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.pv-legend-ful {
  background: #fff !important;
  box-sizing: border-box;
}
.pv-arc-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.pv-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  color: var(--text);
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  max-width: 280px;
  white-space: nowrap;
}
.pv-tooltip strong {
  color: var(--accent);
}
.pv-tooltip-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.pv-detail-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  position: relative;
  animation: tl-detail-in 0.3s ease-out;
}
.pv-detail-inner h3 {
  color: var(--accent);
  font-family: var(--font-page);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}
.pv-detail-inner h4 {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.pv-detail-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
.pv-detail-close:hover { color: var(--text); }
.pv-detail-desc {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin: 0.6rem 0;
  line-height: 1.5;
}
.pv-detail-verses {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 0.8rem 0;
}
.pv-detail-col a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.pv-detail-col a:hover { text-decoration: underline; }
.pv-detail-arrow {
  color: var(--text-muted);
  font-size: 1.4rem;
  padding-top: 1rem;
}
.pv-detail-traditions {
  margin-top: 0.5rem;
}
.pv-detail-traditions .tag {
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
}
.pv-subject-tag {
  background: var(--blue);
  color: #fff;
}
.pv-conf-high { background: #d4af37; color: #1a1500; }
.pv-conf-medium { background: #8b90a0; color: #1a1a20; }
.pv-conf-low { background: #4a4d5a; color: #ccc; }
.pv-loading, .pv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  gap: 0.8rem;
}
.pv-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: pv-spin 0.8s linear infinite;
}
@keyframes pv-spin {
  to { transform: rotate(360deg); }
}

/* ── Bible Heatmap ─────────────────────────────────────────── */

.heatmap-page {
  display: flex;
  flex-direction: column;
}
.hm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.hm-topbar .breadcrumb { margin-bottom: 0; }
.hm-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hm-controls select {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
}
.hm-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.hm-legend-bar {
  width: 120px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.hm-section-header {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 1rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.hm-section-header:first-child { margin-top: 0; }
.hm-book-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 2px;
}
.hm-book-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 40px;
  min-width: 40px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hm-cells {
  display: flex;
  gap: 1px;
  flex-wrap: nowrap;
}
.hm-cell {
  width: 10px;
  height: 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.1s ease;
  position: relative;
}
.hm-cell:hover {
  transform: scale(1.8);
  z-index: 10;
  outline: 1px solid var(--accent);
}
.hm-tooltip {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text);
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 200px;
}
.hm-tooltip-metric {
  font-weight: 600;
  color: var(--accent);
}
.hm-tooltip-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

@media (max-width: 600px) {
  .hm-cell { width: 7px; height: 10px; }
  .hm-book-label { width: 30px; min-width: 30px; font-size: 0.55rem; }
  .pv-controls { width: 100%; }
  .pv-controls select { flex: 1; }
}

/* ── Scrollbar ──────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Focus-visible (accessibility) ─────────────────────────── */

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a.card:focus-visible,
a.home-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

nav a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

.quiz-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tag:focus-visible,
.tradition-tab:focus-visible,
.theme-toggle:focus-visible,
.filter-select:focus-visible,
.select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Clickable card hover states ───────────────────────────── */

.entity-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-dim);
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.15);
}

.prophecy-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-dim);
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.15);
}

.entity-card,
.prophecy-card {
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

/* ── Base select styling ───────────────────────────────────── */

.select {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.select:focus {
  border-color: var(--accent);
}

/* ── Hamburger button ──────────────────────────────────────── */

.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition);
}

.nav-hamburger:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.nav-hamburger svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ── Mobile nav overlay ───────────────────────────────────── */

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

.nav-overlay--open { display: block; }

/* ── Mobile nav ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    max-width: 80vw;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    z-index: 150;
    flex-direction: column;
    gap: 0;
    padding: 1.5rem 0;
    transform: translateX(100%);
    transition: transform 250ms ease;
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
  }

  nav.nav--open {
    transform: translateX(0);
  }

  nav a {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-bottom: none;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  nav a:hover,
  nav a.active {
    background: var(--bg-hover);
    border-bottom: none;
    border-radius: 0;
  }

  .nav-search {
    margin: 0 1.5rem 1rem;
    border-radius: var(--radius);
    flex: none;
  }
  .nav-search input,
  .nav-search input:focus { width: 100%; }

  .theme-toggle,
  .reading-mode-toggle {
    margin: 0.25rem 1.5rem;
    min-height: 44px;
    min-width: 44px;
    align-self: flex-start;
  }

  .app > header {
    padding: 0.6rem 1rem;
  }

  .app > header h1 {
    font-size: 1.05rem;
  }

  .app > header h1 span {
    display: none;
  }
}

/* ── General mobile (small screens) ────────────────────────── */

@media (max-width: 600px) {
  main {
    padding: 1rem;
  }

  footer {
    padding: 0.75rem 1rem;
  }

  .hero {
    padding: 2rem 1rem 1.5rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-greek {
    font-size: 1.1rem;
  }

  .home-stats {
    gap: 1rem;
    padding: 0 1rem 1rem;
  }

  .home-stat-num {
    font-size: 1.3rem;
  }
}

/* ── Reader responsive helpers ──────────────────────────────── */

.reader-mobile-only { display: none; }

/* ── Annotations toggle (mobile: above text) ───────────────── */

.reader-annotations-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--bg-card, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: 0.35rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.annotations-toggle-icon {
  font-size: 1rem;
  color: var(--accent);
}

.annotations-toggle-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.annotations-toggle-arrow {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.reader-annotations-toggle.open .annotations-toggle-arrow {
  transform: rotate(180deg);
}

/* ── Reader nav wrap ───────────────────────────────────────── */

@media (max-width: 768px) {
  .reader-desktop-only { display: none !important; }
  .reader-mobile-only { display: inline-block; }

  .reader-nav {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0;
  }

  .reader-annotations-toggle { display: flex; }

  .sidebar--above {
    display: none;
    position: static;
    max-height: none;
    overflow-y: visible;
    margin-bottom: 1rem;
  }

  .sidebar--above.sidebar--mobile-open {
    display: block;
  }

  .sidebar-toggle-mobile { display: none !important; }

  .tradition-tabs {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .tradition-tab {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}

/* ── Reading mode toggle button ─────────────────────────────── */

.reading-mode-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  transition: background var(--transition), color var(--transition);
}

.reading-mode-toggle:hover {
  background: rgba(201,162,39,0.15);
}

/* ══════════════════════════════════════════════════════════════
   Reading Modes
   ══════════════════════════════════════════════════════════════ */

/* ── Heirloom Bible (default) ──────────────────────────────── */
/* The base styles above are already heirloom. These reinforce. */

[data-reading-mode="heirloom"] .page {
  background: #faf6ef;
}

/* ── Scholar Mode ──────────────────────────────────────────── */

[data-reading-mode="scholar"] .page {
  background: #f8f7f4;
  border: 1px solid #ddd;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

[data-reading-mode="scholar"] .page::before {
  display: none;
}

[data-reading-mode="scholar"] .chapter-ornament {
  display: none;
}

[data-reading-mode="scholar"] .chapter-number {
  font-size: 2rem;
  font-weight: 700;
  opacity: 0.8;
  margin-bottom: 1rem;
}

[data-reading-mode="scholar"] .chapter-number::after {
  display: none;
}

[data-reading-mode="scholar"] .scripture-text {
  font-family: 'Georgia', serif;
  font-size: 1.05rem;
  line-height: 1.7;
}

[data-reading-mode="scholar"] .scripture-para {
  margin-bottom: 0.5em;
}

[data-reading-mode="scholar"] .scripture-para--first .drop-cap {
  float: none;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  padding: 0;
  animation: none;
}

[data-reading-mode="scholar"] .verse-num {
  font-size: 0.6rem;
  font-weight: 600;
  color: #666;
}

[data-reading-mode="scholar"] .page-inner {
  padding: 2rem 2.5rem;
  max-width: 750px;
}

/* Scholar in dark mode — true dark reader */
[data-theme="dark"][data-reading-mode="scholar"] .page {
  background: #1e1e1e;
  border-color: #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

[data-theme="dark"][data-reading-mode="scholar"] .scripture-text {
  color: #d0d0d0;
}

[data-theme="dark"][data-reading-mode="scholar"] .verse-num {
  color: rgba(180,180,180,0.45);
}

[data-theme="dark"][data-reading-mode="scholar"] .page-header-book,
[data-theme="dark"][data-reading-mode="scholar"] .page-header-chapter {
  color: rgba(180,180,180,0.5);
}

[data-theme="dark"][data-reading-mode="scholar"] .page-header-sep {
  background: rgba(180,180,180,0.2);
}

[data-theme="dark"][data-reading-mode="scholar"] .page-header {
  border-bottom-color: rgba(180,180,180,0.1);
}

[data-theme="dark"][data-reading-mode="scholar"] .page-footer {
  border-top-color: rgba(180,180,180,0.1);
}

[data-theme="dark"][data-reading-mode="scholar"] .page-footer-link {
  color: rgba(180,180,180,0.5);
}

[data-theme="dark"][data-reading-mode="scholar"] .chapter-number {
  color: rgba(180,180,180,0.4);
}

/* ── Monastic Mode ─────────────────────────────────────────── */
/* Manuscript tradition: dim stone room, parchment pages,     */
/* rubricated verse numbers, illuminated initials.            */

[data-reading-mode="monastic"] .page {
  background: #24211b;
  border: 1px solid rgba(160,130,70,0.15);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    0 20px 60px rgba(0,0,0,0.6),
    inset 0 0 80px rgba(80,60,30,0.06),
    inset 0 1px 0 rgba(160,130,70,0.08);
}

[data-reading-mode="monastic"] .page::before {
  background:
    /* Vignette — darker edges like aged parchment */
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.15) 100%),
    /* Warm corner glow — like candlelight */
    radial-gradient(ellipse at 20% 20%, rgba(160,120,50,0.04) 0%, transparent 50%),
    /* Grain texture */
    linear-gradient(135deg, rgba(100,85,55,0.06) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(0,0,0,0.04) 0%, transparent 8%, transparent 92%, rgba(0,0,0,0.05) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(120,100,60,0.015) 2px,
      rgba(120,100,60,0.015) 3px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(120,100,60,0.012) 3px,
      rgba(120,100,60,0.012) 4px
    );
}

[data-reading-mode="monastic"] .scripture-text {
  color: #d4c9a8;
  font-size: 1.25rem;
  line-height: 1.9;
}

/* Rubrication — crimson verse numbers, the manuscript tradition */
[data-reading-mode="monastic"] .verse-num {
  color: rgba(138,45,45,0.6);
  font-weight: 500;
}

[data-reading-mode="monastic"] .verse-num:hover {
  color: rgba(180,60,60,0.8);
}

/* Chapter ornament — manuscript cross divider */
[data-reading-mode="monastic"] .chapter-ornament {
  color: rgba(138,45,45,0.5);
  font-size: 0.8rem;
  visibility: hidden;
  margin-bottom: 0.75rem;
  animation: ornamentReveal 1s ease-out 0.15s both;
}

[data-reading-mode="monastic"] .chapter-ornament::after {
  content: '\2014\2009\2720\2009\2014';
  visibility: visible;
  letter-spacing: 0.2em;
}

@keyframes monasticOrnamentReveal {
  from { opacity: 0; filter: blur(1px); }
  to   { opacity: 0.7; filter: blur(0); }
}

/* Chapter number — rubricated crimson */
[data-reading-mode="monastic"] .chapter-number {
  color: rgba(138,45,45,0.6);
  animation: monasticChapterReveal 1s ease-out 0.25s both;
}

@keyframes monasticChapterReveal {
  from { opacity: 0; letter-spacing: 0.12em; }
  to   { opacity: 0.5; letter-spacing: 0.05em; }
}

[data-reading-mode="monastic"] .chapter-number::after {
  background: linear-gradient(to right, transparent, rgba(138,45,45,0.4), transparent);
  animation: monasticRuleReveal 0.8s ease-out 0.4s both;
}

@keyframes monasticRuleReveal {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 0.8; transform: scaleX(1); }
}

/* Drop cap — illuminated initial: gold letter in a crimson frame */
[data-reading-mode="monastic"] .scripture-para--first .drop-cap {
  color: #d4aa3c;
  font-size: 4.8rem;
  font-weight: 600;
  background: rgba(120,30,30,0.2);
  border: 1px solid rgba(138,45,45,0.35);
  padding: 0.08em 0.15em 0.05em 0.12em;
  margin-right: 0.15em;
  margin-bottom: 0.05em;
  text-shadow:
    0 0 8px rgba(210,170,60,0.2),
    1px 1px 0 rgba(100,25,25,0.25);
  box-shadow:
    inset 0 0 12px rgba(120,30,30,0.15),
    0 1px 3px rgba(0,0,0,0.3);
  animation: monasticDropCapReveal 1s ease-out 0.5s both;
}

@keyframes monasticDropCapReveal {
  from { opacity: 0; transform: scale(0.92) translateY(1px); filter: blur(1px); }
  to   { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

/* Running header — rubricated */
[data-reading-mode="monastic"] .page-header {
  border-bottom-color: rgba(138,45,45,0.12);
}

[data-reading-mode="monastic"] .page-header-book {
  color: rgba(196,165,90,0.4);
}

[data-reading-mode="monastic"] .page-header-chapter {
  color: rgba(138,45,45,0.55);
}

[data-reading-mode="monastic"] .page-header-sep {
  background: rgba(138,45,45,0.25);
}

/* Footer */
[data-reading-mode="monastic"] .page-footer {
  border-top-color: rgba(138,45,45,0.12);
}

[data-reading-mode="monastic"] .page-footer-link {
  color: rgba(196,165,90,0.35);
}

[data-reading-mode="monastic"] .page-footer-link:hover {
  color: #c4a55a;
}

/* Spacing — wide margins like a manuscript leaf */
[data-reading-mode="monastic"] .page-inner {
  padding: 4rem 5.5rem 3.5rem;
  /* Keep manuscript pages tight even after the heirloom widening, so the
     red-rule ornaments stay proportional. */
  max-width: 920px;
}

/* Manuscript double-rule border */
[data-reading-mode="monastic"] .page-inner::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  right: 2rem;
  bottom: 1.5rem;
  border: 1px solid rgba(138,45,45,0.12);
  outline: 1px solid rgba(138,45,45,0.06);
  outline-offset: 4px;
  pointer-events: none;
}

/* Corner ornaments */
[data-reading-mode="monastic"] .page-inner::after {
  content: '\2726';
  position: absolute;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: rgba(138,45,45,0.3);
  pointer-events: none;
}

/* Paragraph separator flourish between paragraphs */
[data-reading-mode="monastic"] .scripture-para + .scripture-para {
  position: relative;
}

/* Page header — rubricated style */
[data-reading-mode="monastic"] .page-header {
  border-bottom: none;
  position: relative;
}

[data-reading-mode="monastic"] .page-header::after {
  content: '\2014\2009\2726\2009\2014';
  display: block;
  text-align: center;
  color: rgba(138,45,45,0.25);
  font-size: 0.7rem;
  margin-top: 0.5rem;
  letter-spacing: 0.3em;
}

/* Footer flourish */
[data-reading-mode="monastic"] .page-footer {
  border-top: none;
  position: relative;
}

[data-reading-mode="monastic"] .page-footer::before {
  content: '\2014\2009\2720\2009\2014';
  display: block;
  text-align: center;
  color: rgba(138,45,45,0.2);
  font-size: 0.65rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.3em;
}

/* Verse highlights — warmer, dimmer in candlelight */
[data-reading-mode="monastic"] .verse-unit--active {
  background: rgba(196,165,90,0.08);
}

[data-reading-mode="monastic"] .verse-unit:hover {
  background: rgba(196,165,90,0.04);
}

[data-reading-mode="monastic"] .verse-unit--playing {
  background: rgba(196,165,90,0.08);
  outline-color: rgba(196,165,90,0.12);
}

/* ── Reading mode: "print" ───────────────────────────────────────
   Approximates a printed reader's Bible (think ESV Reader's Bible):
   one tight column at ~65ch, justified text with automatic hyphenation,
   serif body. Justification is only meaningful with hyphenation —
   without it browsers create "rivers" of white space between words. */
[data-reading-mode="print"] .scripture-text,
[data-reading-mode="print"] .scripture-para,
[data-reading-mode="print"] .verse-text {
  text-align: justify;
  -webkit-hyphens: auto;
      -ms-hyphens: auto;
          hyphens: auto;
  hyphenate-limit-chars: 6 3 3; /* min word length 6, min before-break 3, after 3 */
}

[data-reading-mode="print"] .reader-main,
[data-reading-mode="print"] .page {
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

/* Don't justify on phone-narrow viewports — even with hyphens, a 6-word
   line tends to look stretched. Fall back to left-aligned. */
@media (max-width: 600px) {
  [data-reading-mode="print"] .scripture-text,
  [data-reading-mode="print"] .scripture-para,
  [data-reading-mode="print"] .verse-text {
    text-align: left;
  }
}

/* ── Genealogy ──────────────────────────────────────────────────── */

.genealogy-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.genealogy-view-toggle {
  display: flex;
  gap: 0.25rem;
}

.genealogy-btn {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
}

.genealogy-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.genealogy-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.genealogy-select {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 3px;
}

.genealogy-canvas {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.genealogy-svg {
  min-width: 960px;
}

.genealogy-svg .genealogy-bar:hover rect:not([fill="transparent"]) {
  opacity: 1 !important;
  filter: brightness(1.2);
}

.genealogy-svg .genealogy-bar:hover text {
  opacity: 1 !important;
  font-weight: 600;
}

/* ── Covenant Lineage ── */

.genealogy-lineage {
  text-align: center;
  padding: 2rem 1rem;
}

.lineage-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.lineage-subtitle {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2rem;
}

.lineage-chain {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.lineage-node {
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--node-color, var(--accent));
  background: var(--card-bg, var(--bg));
  border-radius: 4px;
  text-align: left;
  min-width: 180px;
  cursor: pointer;
  transition: all 0.2s;
}

.lineage-node:hover {
  border-color: var(--node-color, var(--accent));
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.lineage-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text);
}

.lineage-role {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--node-color, var(--text-muted));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lineage-years {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lineage-connector {
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.5;
  padding: 0.15rem 0;
}

/* ── Family Tree ── */

.genealogy-tree {
  padding: 1rem;
}

.tree-container {
  padding: 1rem 0;
}

.tree-node {
  padding-left: calc(var(--depth, 0) * 1.5rem);
  margin: 0.15rem 0;
}

.tree-name {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  border-left: 2px solid var(--node-color, var(--border));
  transition: all 0.15s;
  display: inline-block;
}

.tree-name:hover {
  background: rgba(201,168,76,0.1);
}

.tree-name.tree-covenant {
  font-weight: 600;
}

.tree-name.collapsed + .tree-children {
  display: none;
}

.tree-children.collapsed {
  display: none;
}

.tree-expand {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--accent);
  cursor: pointer;
  margin-left: 0.4rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.tree-expand:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Detail Panel ── */

.genealogy-detail {
  margin-top: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--card-bg, var(--bg));
  border: 1px solid var(--border);
  border-radius: 6px;
}

.detail-header {
  padding-left: 0.8rem;
  margin-bottom: 0.5rem;
}

.detail-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin: 0;
  color: var(--text);
}

.detail-role {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.75rem;
}

.detail-tribe {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.75rem;
}

.detail-covenant {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.detail-dates {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.detail-section {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  margin: 0.5rem 0;
  line-height: 1.6;
}

.detail-section strong {
  color: var(--text);
}

.detail-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.detail-link:hover {
  text-decoration: underline;
}

.detail-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.detail-more:hover {
  text-decoration: underline;
}

/* ── Typology page ─────────────────────────────────────────── */

.typology-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.typology-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.typology-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.typology-tab {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.typology-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.typology-tab.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.typology-card {
  cursor: pointer;
}

.typology-card-header {
  margin-bottom: 0.75rem;
}

.typology-pair {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.typology-figure {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.typology-figure--type {
  color: var(--orange);
  border-color: var(--orange);
  background: rgba(212, 148, 76, 0.08);
}

.typology-figure--antitype {
  color: var(--green);
  border-color: var(--green);
  background: rgba(76, 175, 125, 0.08);
}

.typology-arrow {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text-muted);
}

.typology-card-footer {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.typology-conf-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid;
}

.typology-conf--high {
  color: var(--green);
  border-color: var(--green);
  background: rgba(76, 175, 125, 0.1);
}

.typology-conf--medium {
  color: var(--orange);
  border-color: var(--orange);
  background: rgba(212, 148, 76, 0.1);
}

.typology-conf--low {
  color: var(--text-muted);
  border-color: var(--border);
  background: rgba(139, 144, 160, 0.08);
}

.typology-cat-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--purple);
  color: var(--purple);
  background: rgba(155, 114, 207, 0.08);
}

.typology-verses {
  margin-bottom: 1rem;
}

.typology-verse-card {
  cursor: default;
}

.typology-verse-card:hover {
  border-color: var(--accent-dim);
}

.typology-verse-ref {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.typology-verse-ref:hover {
  text-decoration: underline;
}

.typology-verse-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
}

/* ── Chapter Insights panel ───────────────────────────────── */

.chapter-insights {
  padding: 0.25rem 0;
}

/* ── Insight sections — study-margin style ─────────────────── */

.insight-section {
  --section-color: var(--accent);
}

.insight-section + .insight-section {
  border-top: 1px solid var(--border);
}

/* Section header — small dot + serif small-caps title */
.insight-section-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.5rem 0.3rem;
  cursor: pointer;
  user-select: none;
}

.insight-section-header:hover .insight-section-title {
  color: var(--text);
}

.insight-section-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--section-color);
  flex-shrink: 0;
  opacity: 0.85;
}

.insight-section-title {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  transition: color var(--transition);
}

.insight-section-count {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
  margin-left: auto;
}

.insight-expand-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  opacity: 0.3;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 0.2rem;
  transition: opacity var(--transition), color var(--transition);
  flex-shrink: 0;
}
.insight-expand-btn:hover {
  opacity: 1;
  color: var(--accent);
}

.insight-section-arrow {
  font-size: 0.55rem;
  color: var(--text-muted);
  opacity: 0.4;
  transition: transform 200ms ease;
  flex-shrink: 0;
}

/* Sidebar expand overlay */
.sidebar-expand-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 150ms ease;
}
.sidebar-expand-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.sidebar-expand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.sidebar-expand-title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}
.sidebar-expand-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.sidebar-expand-close:hover {
  color: var(--text);
}
.sidebar-expand-body {
  padding: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.sidebar-expand-body .insight-row,
.sidebar-expand-body .connection {
  padding: 0.6rem 0.75rem;
}
.sidebar-expand-body .insight-row-name,
.sidebar-expand-body .connection-ref {
  font-size: 0.95rem;
}
.sidebar-expand-body .insight-row-summary,
.sidebar-expand-body .connection-summary {
  font-size: 0.88rem;
}

.insight-section--closed .insight-section-arrow {
  transform: rotate(-90deg);
}

/* Section body */
.insight-section-body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 300ms ease;
  padding: 0 0 0.35rem;
}

.insight-section--closed .insight-section-body {
  max-height: 0;
  padding-bottom: 0;
}

/* ── Insight rows — clean inline entries ───────────────────── */

.insight-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.22rem 0.5rem 0.22rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
  cursor: default;
  font-family: var(--font-ui);
  font-size: 0.76rem;
  line-height: 1.55;
}

a.insight-row {
  cursor: pointer;
}

a.insight-row:hover,
.insight-row:hover {
  background: var(--bg-hover);
  border-radius: 3px;
}

.insight-row-name {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--text);
}

a.insight-row .insight-row-name {
  color: var(--section-color, var(--accent));
}

a.insight-row:hover .insight-row-name {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.insight-row-label {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.insight-row-verses {
  margin-left: auto;
  flex-shrink: 0;
}

/* Enriched claim rows: stacked layout with summary + traditions */
.insight-row--enriched {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  padding: 0.35rem 0.5rem 0.35rem 1.2rem;
}
.insight-row--enriched .insight-row-main {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  width: 100%;
}
.insight-row--enriched .insight-row-verses {
  margin-left: auto;
}
.insight-row-summary {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.insight-row-thesis {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  font-style: italic;
}
.insight-row-traditions {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
  line-height: 1.35;
}
.insight-chip--high { color: var(--green, #5a9a5a); }
.insight-chip--medium { color: var(--orange, #c9944d); }

/* Editorial badge + notice */
.editorial-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange, #c9944d);
  border: 1px solid var(--orange, #c9944d);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.75rem;
}
.editorial-notice {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
  padding-top: 0.6rem;
}
.editorial-notice a {
  color: var(--accent);
}

/* Definition aside — "What is a ___?" */
/* Definition aside — matches methodology-intro style */
.definition-aside {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.definition-aside-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.definition-aside-title::-webkit-details-marker { display: none; }
.definition-aside-title::before {
  content: '\25B6';
  font-size: 0.45rem;
  transition: transform 150ms ease;
}
.definition-aside[open] > .definition-aside-title::before { transform: rotate(90deg); }
.definition-aside-title:hover { color: var(--accent); }
.definition-aside[open] {
  padding: 0 0.75rem 0.75rem;
}
.definition-aside[open] > .definition-aside-title {
  padding-bottom: 0.35rem;
}
.definition-aside p {
  margin: 0.4rem 0 0.4rem 0;
}
.definition-aside .definition-method {
  border-top: 1px solid var(--border);
  padding-top: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  opacity: 0.7;
}

/* Clickable verse ranges */
.insight-verses {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.1rem 0;
  transition: color var(--transition);
  opacity: 0.7;
}

.insight-verses:hover {
  color: var(--accent);
  opacity: 1;
}

/* Verse highlight when hovering insight ranges */
.verse-unit--insight-highlight {
  background: rgba(201, 162, 39, 0.1) !important;
  box-shadow: inset 2px 0 0 var(--accent);
  transition: background 150ms ease, box-shadow 150ms ease;
}

/* Small chips — e.g. theophany type, speaker type */
.insight-chip {
  font-family: var(--font-ui);
  font-size: 0.56rem;
  font-weight: 500;
  padding: 0.06rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  vertical-align: 1px;
}

.insight-chip--divine {
  border-color: var(--accent);
  color: var(--accent);
}

.insight-chip--angelic {
  border-color: var(--purple);
  color: var(--purple);
}

/* ── Catechism sidebar rows ────────────────────────────────── */
.catechism-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem 0.4rem 0.8rem;
  text-decoration: none;
  color: var(--text);
  border-left: 2px solid transparent;
  transition: background 150ms ease, border-color 150ms ease;
}
.catechism-row:hover {
  background: var(--bg-hover);
  border-left-color: #c9a227;
  border-radius: 0 3px 3px 0;
}
.catechism-para {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: #c9a227;
  white-space: nowrap;
  min-width: 2.5rem;
  flex-shrink: 0;
  padding-top: 0.05rem;
}
.catechism-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.catechism-topic {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.35;
}
.catechism-row:hover .catechism-topic {
  color: #c9a227;
}
.catechism-breadcrumb {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.7;
  line-height: 1.3;
}
.catechism-verses {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Edge type labels (source / fulfilled / type / antitype) */
.insight-edge {
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.08rem 0.35rem;
  border-radius: 3px;
}

.insight-edge--source {
  background: rgba(91, 141, 217, 0.12);
  color: var(--blue);
}

.insight-edge--fulfill {
  background: rgba(76, 175, 125, 0.12);
  color: var(--green);
}

.insight-edge--type {
  background: rgba(217, 152, 60, 0.12);
  color: var(--orange);
}

.insight-edge--antitype {
  background: rgba(76, 175, 125, 0.12);
  color: var(--green);
}

/* ── Divider between insights and per-verse detail ─────────── */

.insight-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0;
  padding: 0 0.5rem;
}

.insight-divider::before,
.insight-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.insight-divider span {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0.7;
}

/* Empty state */
.sidebar-empty {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 1rem;
  font-style: italic;
  opacity: 0.7;
}

/* ── Reader search highlight in chapter ───────────────────── */

.verse-unit--search-match mark {
  background: rgba(201, 162, 39, 0.35);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.verse-unit--search-dim {
  opacity: 0.3;
}

/* ── Parable cards ─────────────────────────────────────────── */

.parable-card {
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.parable-card:hover {
  border-color: var(--accent-dim);
}

.parable-verses-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease, padding 300ms ease, margin 300ms ease;
  margin-top: 0;
}

.parable-verses-expand.expanded {
  max-height: 2000px;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.parable-verse-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.parable-verse-item {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.parable-verse-item:hover {
  background: var(--bg-hover);
}

/* ── Miracle cards ─────────────────────────────────────────── */

.miracle-card {
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.miracle-card:hover {
  border-color: var(--accent-dim);
}

.miracle-verses-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease, padding 300ms ease, margin 300ms ease;
  margin-top: 0;
}

.miracle-verses-expand.expanded {
  max-height: 2000px;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.miracle-verse-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.miracle-verse-item {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.miracle-verse-item:hover {
  background: var(--bg-hover);
}

/* ── Covenant timeline ─────────────────────────────────────── */

.covenant-timeline {
  position: relative;
  padding-left: 2rem;
  max-width: 800px;
}

/* Vertical line */
.covenant-timeline::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--green), var(--blue), var(--purple));
  border-radius: 1px;
}

.covenant-card-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.covenant-card-wrapper--last {
  margin-bottom: 0;
}

/* Timeline dot */
.covenant-timeline-dot {
  position: absolute;
  left: -1.55rem;
  top: 1.2rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent);
  z-index: 1;
}

.covenant-card {
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.covenant-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 2px 12px rgba(201, 162, 39, 0.1);
}

.covenant-verses-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease, padding 300ms ease, margin 300ms ease;
  margin-top: 0;
}

.covenant-verses-expand.expanded {
  max-height: 2000px;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.covenant-verse-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.covenant-verse-item {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.covenant-verse-item:hover {
  background: var(--bg-hover);
}

/* ── Hero gradient & pattern ──────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(201, 162, 39, 0.06) 0%, transparent 70%),
    radial-gradient(circle at 20% 80%, rgba(91, 141, 217, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(155, 114, 207, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] .hero::before {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(138, 109, 27, 0.06) 0%, transparent 70%),
    radial-gradient(circle at 20% 80%, rgba(58, 109, 181, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(122, 82, 176, 0.04) 0%, transparent 50%);
}

.hero > * {
  position: relative;
  z-index: 1;
}

/* ── Skeleton loading for stat numbers ────────────────────── */

.home-stat-num--loading {
  display: inline-block;
  width: 3rem;
  height: 1.4rem;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  vertical-align: middle;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Card hover glow ──────────────────────────────────────── */

.card {
  transition: border-color var(--transition), background var(--transition), box-shadow 300ms ease;
}

.home-card:hover,
.entity-card:hover,
.prophecy-card:hover {
  box-shadow:
    0 4px 20px rgba(201, 162, 39, 0.12),
    0 0 40px rgba(201, 162, 39, 0.06);
}

[data-theme="light"] .home-card:hover,
[data-theme="light"] .entity-card:hover,
[data-theme="light"] .prophecy-card:hover {
  box-shadow:
    0 4px 20px rgba(138, 109, 27, 0.1),
    0 0 30px rgba(138, 109, 27, 0.04);
}

/* ── Search bar polish ────────────────────────────────────── */

.search-bar {
  position: relative;
}

.search-bar-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0.6;
  z-index: 1;
}

.search-bar input {
  padding-left: 2.5rem;
  transition: border-color var(--transition), box-shadow 300ms ease;
}

.search-bar input:focus {
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}

[data-theme="light"] .search-bar input:focus {
  box-shadow: 0 0 0 3px rgba(138, 109, 27, 0.1);
}

/* ── Section dividers ─────────────────────────────────────── */

.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.section-divider-ornament {
  color: var(--accent);
  opacity: 0.5;
  font-size: 0.65rem;
}

/* ── Better empty states ──────────────────────────────────── */

.empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  max-width: 500px;
  margin: 2rem auto;
}

.empty-state-icon {
  opacity: 0.35;
  filter: grayscale(0.5);
}

.empty-state p {
  max-width: 320px;
  margin: 0 auto;
}

.empty-state a {
  color: var(--accent);
  text-decoration: none;
}

.empty-state a:hover {
  text-decoration: underline;
}

/* ── Page transitions ─────────────────────────────────────── */

main {
  animation: page-enter 250ms ease-out;
}

@keyframes page-enter {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Smooth stat number appearance ────────────────────────── */

@keyframes stat-pop {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  60% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.home-stat-num--loaded {
  animation: stat-pop 400ms ease-out;
}

/* ── Archaeology section (Place detail) ──────────────────── */

.arch-section {
  border-left: 3px solid var(--accent);
}

.arch-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  padding: 0.15em 0.55em;
  border-radius: 4px;
  line-height: 1.4;
}

.arch-badge--sm {
  font-size: 0.6rem;
  padding: 0.1em 0.4em;
  vertical-align: middle;
  margin-left: 0.35rem;
}

.arch-body {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.arch-field {
  margin-top: 0.75rem;
}

.arch-field-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.arch-citations {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
  background: var(--bg-panel);
  border-radius: 0 var(--radius) var(--radius) 0;
  white-space: pre-line;
}

/* ── Design System ─────────────────────────────────────────── */

.page-title {
  font-family: var(--font-page);
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.section-heading {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.flex-wrap-gap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mt-xs { margin-top: 0.15rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }

.text-muted { color: var(--text-muted); }
.text-sm {
  font-size: 0.85rem;
  font-family: var(--font-ui);
}
.text-xs {
  font-size: 0.75rem;
  font-family: var(--font-ui);
}
.ui-text { font-family: var(--font-ui); }

.back-link {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 1rem;
}
.back-link:hover { text-decoration: underline; }

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.detail-card h1 {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.confidence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.25rem;
}
.confidence-dot--high { background: #c9a227; }
.confidence-dot--medium { background: #5b8dd9; }
.confidence-dot--low { background: #4a4d5a; }

/* ── Explore Hub ───────────────────────────────────────────── */

.explore-tier { margin-bottom: 2.5rem; }

.explore-section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1rem;
  line-height: 1.5;
  max-width: 650px;
}

.explore-section-heading {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Tier 1 — hero grid */
.explore-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.explore-hero-card {
  padding: 2rem 1.75rem;
  border-left: 3px solid var(--accent);
}
.explore-hero-card h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem 0;
  color: var(--accent);
}
.explore-hero-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Flagship tier — "The Same God" */
.explore-flagship { margin-bottom: 3rem; }
.explore-flagship .explore-section-heading {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
}
.explore-flagship-card {
  padding: 2rem 1.75rem;
  border-left-width: 4px;
  box-shadow: 0 0 20px -6px var(--accent-dim);
}
.explore-flagship-card h3 {
  font-size: 1.3rem;
  font-family: var(--font-serif);
  font-weight: 600;
}
.explore-flagship-card p {
  font-size: 0.9rem;
  max-width: 700px;
}

.explore-pillar-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* Cross-cutting band — spans full width beneath the three pillars */
.explore-crosscut {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-top: 2px dashed var(--accent-dim);
  border-radius: 0 0 var(--radius) var(--radius);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 1.5rem;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}
.explore-crosscut:hover {
  border-color: var(--accent-dim);
  background: var(--bg-card);
}
.explore-crosscut h3 {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0;
  white-space: nowrap;
}
.explore-crosscut p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.explore-viz-link {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 0.75rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color var(--transition), border-color var(--transition);
}
.explore-viz-link:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* Tier 2 — mid grid */
.explore-mid-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* Tier 3 — compact pills */
.explore-compact-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.explore-pill {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.explore-pill:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--bg-hover);
}

/* Visualizations disclosure (progressive depth) */
.explore-more {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.explore-more > summary {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition);
}
.explore-more > summary::-webkit-details-marker { display: none; }
.explore-more > summary::before {
  content: '▸';
  font-size: 0.8rem;
  color: var(--accent);
  transition: transform var(--transition);
}
.explore-more[open] > summary::before { transform: rotate(90deg); }
.explore-more > summary:hover { color: var(--accent); }
.explore-more .explore-section-desc { margin-top: 0.6rem; }
.explore-more .explore-compact-section { margin-top: 0.5rem; }

/* Collapsible "Filter & sort" for list pages */
.list-filters { margin-bottom: 1.25rem; }
.list-filters > summary {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.list-filters > summary::-webkit-details-marker { display: none; }
.list-filters > summary::before {
  content: '▾';
  font-size: 0.7rem;
  color: var(--accent);
  transition: transform var(--transition);
}
.list-filters[open] > summary::before { transform: rotate(180deg); }
.list-filters > summary:hover { color: var(--accent); border-color: var(--accent-dim); }
.list-filters[open] > summary { margin-bottom: 0.85rem; }
.list-filters .filters { margin-bottom: 0; }

/* Start Here — quick-start links near the top */
.start-quicklinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0.5rem;
}
.start-quicklinks-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 0.15rem;
}
.start-quicklink {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}
.start-quicklink:hover { background: var(--accent); color: var(--bg); }

/* Keyboard focus visibility for the UX-refactor components */
.reader-tools-item:focus-visible,
.reader-tools-btn:focus-visible,
.list-filters > summary:focus-visible,
.explore-more > summary:focus-visible,
.start-quicklink:focus-visible,
.xref-card-ref:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
/* ─── Commentary chunk reader (Patristic / Reformer / Catechism etc. text) ─ */
.commentary-reader {
  max-width: 56rem;
  margin: 0 auto 2rem;
}
.commentary-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.commentary-author-row {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.1rem;
}
.commentary-author-text { flex: 1; min-width: 0; }
.commentary-portrait {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.commentary-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;            /* prefer faces over backgrounds */
  display: block;
}
.commentary-portrait-initials {
  font-family: var(--font-serif, var(--font-body));
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  user-select: none;
}
/* Subtle desaturation for dark mode so the engravings/paintings sit with the palette */
@media (prefers-color-scheme: dark) {
  [data-theme="dark"] .commentary-portrait-img,
  :root:not([data-theme="light"]) .commentary-portrait-img { filter: grayscale(0.15) brightness(0.95); }
}
.commentary-meta {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.commentary-period { color: var(--text-muted); font-style: italic; text-transform: none; letter-spacing: 0; }
.commentary-title {
  font-family: var(--font-serif, var(--font-body));
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 0.85rem;
  letter-spacing: -0.01em;
}
.commentary-intro {
  font-family: var(--font-serif, var(--font-body));
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  max-width: 42rem;
}
.commentary-actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.commentary-action {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.commentary-action:hover { color: var(--accent); }
.commentary-action--primary {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.95rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.commentary-action--primary:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Two-column body: prose on left, scripture refs as a sticky sidebar on right. */
.commentary-body-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 2.5rem;
  align-items: start;
}
/* When the chunk has no scripture refs (the 28% uncited case — Irenaeus AH 4.10.1 etc.)
   collapse to a single, centered prose column. */
.commentary-body-layout--no-refs {
  grid-template-columns: minmax(0, 1fr);
}
.commentary-body-layout--no-refs .commentary-prose {
  max-width: 44rem;
  margin: 0 auto;
}
.commentary-prose {
  font-family: var(--font-serif, var(--font-body));
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text);          /* FIX: was var(--text-primary) which is undefined → dark-on-dark */
  white-space: pre-wrap;
  max-width: 38rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
/* Drop cap — typographic flourish picking up the early-modern printed-book tradition.
   No image, no decoration; just a properly-set first letter. */
.commentary-prose::first-letter {
  font-family: var(--font-serif, var(--font-body));
  font-size: 3.4em;
  font-weight: 500;
  float: left;
  line-height: 0.88;
  margin: 0.08em 0.18em 0 0;
  color: var(--accent);
  font-feature-settings: "lnum" 1;
}
.commentary-prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted rgba(201, 162, 39, 0.35);
}
.commentary-prose a:hover { border-bottom-style: solid; }

.commentary-refs {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
}
.commentary-refs-heading {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}
.commentary-ref-group + .commentary-ref-group { margin-top: 1.1rem; }
.commentary-ref-chapter {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 0.35rem;
}
.commentary-ref-chapter:hover { text-decoration: underline; }
/* Folio thumbnails — the manuscripts that witness this chapter. Empty until async loaded. */
.commentary-ref-folios {
  display: flex;
  gap: 0.32rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0.55rem;
}
.commentary-folio-thumb {
  width: 38px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-card);
  cursor: pointer;
  overflow: hidden;
  transition: transform 120ms ease-out, border-color var(--transition), box-shadow var(--transition);
  display: block;
}
.commentary-folio-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.commentary-folio-thumb:hover {
  border-color: var(--accent);
  transform: scale(1.06);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 1;
  position: relative;
}
.commentary-ref-verse {
  display: block;
  padding: 0.32rem 0.5rem;
  margin: 0.1rem 0;
  text-decoration: none;
  border-radius: 4px;
  transition: background var(--transition);
}
.commentary-ref-verse:hover { background: var(--bg-card); }
.commentary-ref-num {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.1rem;
}
.commentary-ref-text {
  display: block;
  font-family: var(--font-serif, var(--font-body));
  font-size: 0.84rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Pager */
.commentary-pager {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  margin: 2rem auto;
  max-width: 56rem;
}
.commentary-pager-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition);
}
.commentary-pager-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.commentary-pager-link--next { text-align: right; }
.commentary-pager-dir {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.commentary-pager-label {
  font-family: var(--font-serif, var(--font-body));
  font-size: 1rem;
  color: var(--text);
  line-height: 1.3;
}

/* Mobile: drop the sidebar below the prose */
@media (max-width: 800px) {
  .commentary-body-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .commentary-refs {
    position: static;
    max-height: none;
    padding-left: 0;
    padding-top: 1.5rem;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .commentary-title { font-size: 1.5rem; }
  .commentary-prose { font-size: 1rem; }
  .commentary-portrait { width: 60px; height: 60px; }
  .commentary-portrait-initials { font-size: 1.1rem; }
  .commentary-author-row { gap: 0.9rem; }
}

/* iPhone-narrow: the commentary reader was designed for a wider column.
   Trim the drop cap (was eating 1/4 of a 375px viewport), tame the corpus
   chapter padding, stack the pager so prev/next labels don't get crammed
   into 130px columns, and let long ref-verse text wrap without overflow. */
@media (max-width: 600px) {
  .commentary-reader { margin-bottom: 1rem; }
  .commentary-prose::first-letter { font-size: 2.6em; margin: 0.05em 0.14em 0 0; }
  .commentary-prose { overflow-wrap: anywhere; }
  .commentary-actions { gap: 0.75rem; }
  .commentary-action--primary { padding: 0.35rem 0.7rem; }
  .commentary-pager {
    flex-direction: column;
    gap: 0.6rem;
    margin: 1.25rem 0;
  }
  .commentary-pager-link--next { text-align: left; }
  .commentary-ref-text { font-size: 0.82rem; }
  .corpus-chapter { padding: 0.9rem; }
  .body-text-block { overflow-wrap: anywhere; }
}

/* Reader modes on iPhone — scholar + monastic had desktop-only paddings
   that punched through the 600px-viewport rule on .page-inner. */
@media (max-width: 600px) {
  [data-reading-mode="scholar"] .page-inner {
    padding: 1.4rem 1rem 1.2rem;
    max-width: 100%;
  }
  [data-reading-mode="monastic"] .page-inner {
    padding: 2.25rem 1.1rem 2rem;
    max-width: 100%;
  }
  /* The double-rule manuscript border was inset 2rem on each side — that's
     half a phone screen of empty ornament. Pull the ornaments tighter. */
  [data-reading-mode="monastic"] .page-inner::before {
    left: 0.6rem;
    right: 0.6rem;
    top: 0.9rem;
    bottom: 0.9rem;
  }
}

/* ─── Search results page (tabs + grouped verse cards) ─────────────────── */
.search-query-echo {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}
.search-summary {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: -0.5rem 0 1.5rem;
}
.search-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  position: relative;
  bottom: -1px;  /* sit on top of the section's bottom border */
}
.search-tab:hover { color: var(--text); }
.search-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.search-tab-count {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0 0.35rem;
  background: var(--bg-card);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.search-tab--active .search-tab-count {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.search-tab-panel { animation: fade-in 180ms ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.search-tab-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.theme-pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  margin: 0 0.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text);
}
.theme-pill--link {
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 120ms ease-out;
}
.theme-pill--link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}
.theme-pill--link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Grouped verse card — one card per (book, chapter), with verse numbers inline and gap markers */
.verse-group-card {
  display: block;
  margin-bottom: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.verse-group-card:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(201, 162, 39, 0.08);
  transform: translateY(-1px);
}
.verse-group-ref {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}
.verse-group-body {
  font-family: var(--font-serif, var(--font-body, serif));
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}
.verse-line {
  display: inline;  /* let multiple verses flow as continuous prose, broken by line wrap only */
}
.verse-line + .verse-line { margin-left: 0.2rem; }
.verse-num-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  vertical-align: 0.45em;
  margin-right: 0.18rem;
  line-height: 1;
  letter-spacing: 0.04em;
}
.verse-text {
  /* Inherits font from .verse-group-body */
}
.verse-gap {
  display: inline-block;
  margin: 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.55;
  font-family: var(--font-ui);
  vertical-align: 0.1em;
  cursor: help;
}
.verse-text mark, .verse-group-body mark {
  background: rgba(201, 162, 39, 0.18);
  color: inherit;
  padding: 0.05rem 0.15rem;
  border-radius: 3px;
}

/* Auxiliary sections (Manuscripts, Variants) below the tabs */
.search-aux {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.search-aux-h {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.search-aux-count {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.05rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}

/* The header-search input lives inside a focus-within-styled pill; the pill's
   golden halo already signals focus. A second :focus-visible outline on the
   input was drawing an inner ring inside the rounded pill — removed. */
.nav-search input:focus-visible { outline: none; }

/* ── Cross-Reference Explorer ─────────────────────────────── */
.xref-search { display: flex; gap: 0.5rem; margin: 1rem 0 2rem; flex-wrap: wrap; }
.xref-input {
  font-family: var(--font-ui); font-size: 0.95rem;
  padding: 0.5rem 0.9rem; min-width: 240px; flex: 0 1 320px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); outline: none;
}
.xref-input:focus { border-color: var(--accent); }
.xref-starters-heading {
  font-family: var(--font-ui); font-size: 0.8rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem;
}
.xref-starters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.xref-source { padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.xref-source-ref { font-family: var(--font-page); font-size: 1.3rem; color: var(--accent); margin-bottom: 0.5rem; }
.xref-source-text {
  font-family: var(--font-page); font-size: 1.1rem; line-height: 1.6; color: var(--text);
  border-left: 2px solid var(--accent-dim); padding-left: 1rem; margin: 0.5rem 0 0.85rem;
}
.xref-read-link, .xref-card-read { font-family: var(--font-ui); font-size: 0.8rem; color: var(--accent); text-decoration: none; }
.xref-read-link:hover, .xref-card-read:hover { text-decoration: underline; }
.xref-count { font-family: var(--font-page); font-size: 1.4rem; margin-bottom: 0.25rem; }
.xref-hint { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.xref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.xref-card {
  display: flex; flex-direction: column; gap: 0.4rem; padding: 0.85rem 1rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color var(--transition);
}
.xref-card:hover { border-color: var(--accent-dim); }
.xref-card-ref { font-family: var(--font-ui); font-weight: 600; font-size: 0.9rem; color: var(--accent); text-decoration: none; }
.xref-card-ref:hover { text-decoration: underline; }
.xref-card-text {
  font-family: var(--font-page); font-size: 0.92rem; line-height: 1.5; color: var(--text); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.xref-card-read { align-self: flex-start; }
@media (max-width: 600px) { .xref-grid { grid-template-columns: 1fr; } }

/* ── Unified Claims explorer ──────────────────────────────── */
.explore-claims-link {
  display: inline-block; margin-top: 1rem;
  font-family: var(--font-ui); font-size: 0.9rem; color: var(--accent);
  text-decoration: none; border-bottom: 1px solid transparent;
}
.explore-claims-link:hover { border-bottom-color: var(--accent); }
.claims-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.claims-hub-card { position: relative; }
.claims-hub-pillar { display: block; font-family: var(--font-ui); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.2rem; }
.claims-hub-count { font-family: var(--font-ui); font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }
.claims-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.claims-tab {
  font-family: var(--font-ui); font-size: 0.82rem; color: var(--text-muted); text-decoration: none;
  padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.claims-tab:hover { color: var(--accent); }
.claims-tab--active { color: var(--accent); border-color: var(--accent-dim); background: rgba(201, 162, 39, 0.08); }
.claims-search {
  width: 100%; max-width: 420px; display: block; margin-bottom: 1.25rem;
  font-family: var(--font-ui); font-size: 0.9rem; padding: 0.5rem 0.85rem;
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); outline: none;
}
.claims-search:focus { border-color: var(--accent); }
.claims-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.85rem; }
.claims-card { position: relative; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.claims-card h3 { font-family: var(--font-page); font-size: 1.05rem; margin: 0; padding-right: 3.5rem; }
.claims-card-summary { font-size: 0.88rem; line-height: 1.5; color: var(--text-muted); margin: 0; }
.claims-card-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: auto; }
.claims-chip { font-family: var(--font-ui); font-size: 0.68rem; padding: 0.1rem 0.45rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); }
.claims-card-conf { position: absolute; top: 0.9rem; right: 1rem; font-family: var(--font-ui); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.1rem 0.4rem; border-radius: 3px; }
.claims-card-conf--high { color: #3f7d4f; background: rgba(80, 160, 100, 0.12); }
.claims-card-conf--medium { color: #9a7d2e; background: rgba(201, 162, 39, 0.12); }
.claims-card-conf--low { color: var(--text-muted); background: rgba(140, 140, 140, 0.12); }
.claims-card--static { cursor: default; }
@media (max-width: 600px) { .claims-grid, .claims-hub-grid { grid-template-columns: 1fr; } }

/* ── Reader inline manuscript folio strip ─────────────────── */
.reader-manuscripts { margin-top: 1.75rem; }
.reader-ms-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.6rem; }
.reader-ms-title { font-family: var(--font-ui); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.reader-ms-all { font-family: var(--font-ui); font-size: 0.78rem; color: var(--accent); text-decoration: none; }
.reader-ms-all:hover { text-decoration: underline; }
.reader-ms-strip { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.4rem; }
.reader-ms-folio {
  flex: 0 0 auto; width: 120px; display: flex; flex-direction: column; gap: 0.3rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.4rem; cursor: pointer; text-align: center; color: inherit;
  transition: border-color var(--transition), transform var(--transition);
}
.reader-ms-folio:hover { border-color: var(--accent); transform: translateY(-2px); }
.reader-ms-folio img { width: 100%; height: 130px; object-fit: cover; border-radius: 3px; background: #15110a; }
.reader-ms-folio-name { font-family: var(--font-ui); font-size: 0.72rem; color: var(--text); line-height: 1.2; }
.reader-ms-folio-folio { font-family: var(--font-ui); font-size: 0.66rem; color: var(--text-muted); }
.reader-ms-folio:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) { .reader-manuscripts { padding: 0 1rem; } }

/* ── How Scripture Is Written (literary forms) ────────────── */
.litform-device { margin: 2rem 0; }
.litform-device-name { font-family: var(--font-page); font-size: 1.6rem; color: var(--accent); margin-bottom: 0.4rem; }
.litform-device-def { font-size: 1rem; line-height: 1.6; color: var(--text-muted); max-width: 62ch; margin-bottom: 1rem; }
.litform-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.litform-card { padding: 1.1rem 1.25rem; }
.litform-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.litform-card-head h3 { font-family: var(--font-page); font-size: 1.15rem; margin: 0; }
.litform-read { font-family: var(--font-ui); font-size: 0.8rem; color: var(--accent); text-decoration: none; white-space: nowrap; }
.litform-read:hover { text-decoration: underline; }
.litform-ref { font-family: var(--font-ui); font-size: 0.8rem; color: var(--text-muted); }
.litform-summary { font-size: 0.92rem; line-height: 1.6; margin: 0 0 0.75rem; }
.litform-outline { font-family: var(--font-ui); font-size: 0.82rem; border-left: 2px solid var(--accent-dim); padding: 0.5rem 0 0.5rem 0.75rem; margin: 0.5rem 0 0.85rem; background: rgba(201, 162, 39, 0.03); }
.litform-out-row { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.12rem 0; }
.litform-out-label { flex: 0 0 auto; min-width: 1.7rem; font-weight: 700; color: var(--accent); }
.litform-out-ref { flex: 0 0 auto; color: var(--text-muted); font-size: 0.74rem; min-width: 4.5rem; }
.litform-out-text { color: var(--text); }
.litform-significance { font-size: 0.9rem; line-height: 1.6; color: var(--text); margin: 0 0 0.6rem; }
.litform-source { font-family: var(--font-ui); font-size: 0.74rem; color: var(--text-muted); font-style: italic; margin: 0; }
@media (max-width: 600px) { .litform-examples { grid-template-columns: 1fr; } }

/* Responsive — collapse grids on narrow screens */
@media (max-width: 1100px) {
  .explore-mid-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .explore-hero-grid { grid-template-columns: 1fr; }
  .explore-mid-grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .explore-hero-grid { grid-template-columns: 1fr; }
  .explore-mid-grid  { grid-template-columns: 1fr; }
  .explore-hero-card { padding: 1.25rem 1rem; }
  .explore-hero-card h3 { font-size: 1.05rem; }
  .explore-pill { padding: 0.45rem 0.9rem; min-height: 44px; display: inline-flex; align-items: center; }
}

/* ── Verse link (replaces div+onclick) ─────────────────────── */

a.verse-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.verse-link:hover {
  border-color: var(--accent-dim);
}

/* ── Line-clamp utility ─────────────────────────────────────── */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Debate Card ─────────────────────────────────────────── */

.debate-card {
  border-left: 3px solid var(--orange);
  background: var(--bg-card);
}

/* ── Centrality ──────────────────────────────────────────── */

.centrality-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.centrality-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition);
}
.centrality-row:hover {
  border-color: var(--accent);
}
.centrality-rank {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 2rem;
  text-align: right;
}
.centrality-verse {
  font-weight: 600;
  min-width: 10rem;
}
.centrality-score {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 3rem;
  text-align: right;
}
.centrality-breakdown {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  margin-left: auto;
}
@media (max-width: 600px) {
  .centrality-breakdown { display: none; }
  .centrality-verse { min-width: auto; }
}

/* ── Disputed Questions ─────────────────────────────────── */

.disputed-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.disputed-card {
  padding: 1rem 1.25rem;
}
.disputed-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.disputed-title {
  font-weight: 600;
  font-size: 1rem;
  color: inherit;
  text-decoration: none;
}
a.disputed-title:hover {
  color: var(--accent);
}

/* ── Curated Paths ──────────────────────────────────────── */

.path-stops {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.path-stop {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-left: 2px solid var(--border);
  margin-left: 1.25rem;
  padding-left: 1.5rem;
  position: relative;
}
.path-stop:last-child {
  border-left-color: transparent;
}
.path-stop-number {
  position: absolute;
  left: -1.25rem;
  top: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
}
.path-stop-content {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.path-stop-content h3 {
  margin: 0 0 0.25rem;
}
.path-stop-content a {
  color: var(--accent);
  text-decoration: none;
}
.path-stop-content a:hover {
  text-decoration: underline;
}
.path-stop-narrative {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

/* ── Intertextuality (OT in NT) ─────────────────────────── */

.intertext-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.intertext-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.intertext-refs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 14rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}
.intertext-ref {
  text-decoration: none;
  font-weight: 600;
}
.intertext-ref--ot { color: var(--blue); }
.intertext-ref--nt { color: var(--green); }
.intertext-ref:hover { text-decoration: underline; }
.intertext-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.intertext-summary {
  font-size: 0.85rem;
  flex: 1;
}

.match-type-badge {
  font-size: 0.75rem;
  font-family: var(--font-ui);
}
.match-type--exact_quote { background: var(--green); color: #fff; }
.match-type--adapted { background: var(--blue); color: #fff; }
.match-type--paraphrase { background: var(--orange); color: #fff; }
.match-type--allusion { background: var(--purple); color: #fff; }
.match-type--echo { background: var(--text-muted); color: #fff; }

@media (max-width: 600px) {
  .intertext-refs { min-width: auto; }
  .intertext-row { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}

/* ── Word Studies ────────────────────────────────────────── */

.word-card {
  text-align: center;
  padding: 1.25rem 1rem;
  cursor: pointer;
}
.word-card:hover {
  border-color: var(--accent);
}
.word-card-form {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}
.word-card-translit {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.4rem;
}
.word-card-gloss {
  font-size: 0.95rem;
}
.word-occ-link {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.8rem;
  background: var(--bg-secondary, #f5f5f5);
  border: 1px solid var(--border, #ddd);
  border-radius: 4px;
  color: var(--accent);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.word-occ-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Patristic / Fathers Section ──────────────────────────── */

.fathers-section {
  margin-top: 1.5rem;
}

.father-quote {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color var(--transition);
}
.father-quote:hover {
  border-left-color: var(--accent);
}

/* ── Corpus Reader (book-like reading) ────────────────────── */

.corpus-reader {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .corpus-reader {
    grid-template-columns: 1fr;
  }
  .corpus-toc {
    display: none;
  }
}

.corpus-toc {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.corpus-toc::-webkit-scrollbar {
  width: 4px;
}
.corpus-toc::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.corpus-toc-book {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}
.corpus-toc-book:first-child {
  margin-top: 0;
}

.corpus-toc-entry {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}
.corpus-toc-entry:hover {
  color: var(--accent);
  background: var(--bg-hover);
}

.corpus-chapter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

/* ── Author Detail ────────────────────────────────────────── */

.author-detail {
  max-width: 900px;
}

/* ── Scripture Reference (clickable) ──────────────────────── */

.scripture-ref {
  font-family: var(--font-ui);
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px dotted var(--blue);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.scripture-ref:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Claim Detail Pages ──────────────────────────────────── */

.claim-section {
  margin-bottom: 2rem;
}

.claim-section-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.claim-card {
  padding: 1.5rem;
}

.claim-summary {
  font-family: var(--font-page);
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.claim-description {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.claim-description:last-child {
  margin-bottom: 0;
}

.claim-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.claim-badge {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.claim-badge--high {
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent);
  border-color: var(--accent-dim);
}

.claim-badge--medium {
  background: rgba(91, 141, 217, 0.12);
  color: var(--blue);
  border-color: rgba(91, 141, 217, 0.3);
}

/* Verse cards */
.claim-verse-card {
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

.claim-verse-ref {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color var(--transition);
}

.claim-verse-ref:hover {
  border-bottom-color: var(--blue);
}

.claim-verse-text {
  font-family: var(--font-page);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin-top: 0.4rem;
}

/* Tradition cards */
.claim-tradition-card {
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

.claim-tradition-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.claim-tradition-name {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.claim-tradition-name:hover {
  color: var(--accent);
}

.claim-tradition-authors {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.claim-author-link {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}

.claim-author-link:hover {
  color: var(--accent);
}

.claim-author-period {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Evidence tags */
.claim-evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.claim-evidence-tag {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.claim-evidence-cat {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-left: 0.2rem;
}

/* Debate card */
.claim-debate-card {
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--orange);
}

/* Related claims */
.claim-related-card {
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  transition: background var(--transition);
}

a.claim-related-card:hover {
  background: var(--bg-hover);
}

.claim-related-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.claim-related-subject {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

/* ── Greek Vocabulary sidebar section ────────────────────── */

.greek-verse-group {
  display: flex;
  gap: 0.4rem;
  padding: 0.2rem 0.5rem;
  align-items: flex-start;
}

.greek-verse-group + .greek-verse-group {
  border-top: 1px solid var(--border);
}

.greek-verse-num {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 1.6rem;
  padding-top: 0.15rem;
  flex-shrink: 0;
}

.greek-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.4rem;
}

.greek-word-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--text);
  padding: 0.1rem 0;
  transition: color var(--transition);
}

.greek-word-item:hover {
  color: var(--accent);
}

.greek-word-form {
  font-size: 0.85rem;
}

.greek-word-translit {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.greek-word-gloss {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Cross-Tradition Comparison ──────────────────────────────── */

.compare-verse-header {
  text-align: center;
  padding: 1.5rem 2rem;
}

.compare-verse-ref {
  font-family: var(--font-page);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.compare-verse-text {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  border-left: 3px solid var(--accent-dim);
  padding: 0.75rem 1.25rem;
  margin: 0 auto;
  max-width: 700px;
  text-align: left;
  font-style: italic;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.compare-tradition {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.compare-tradition-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.compare-tradition-name {
  font-family: var(--font-page);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

.compare-tradition-link {
  color: var(--accent);
  text-decoration: none;
}

.compare-tradition-link:hover {
  text-decoration: underline;
}

.compare-tradition-count {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.compare-source {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color var(--transition);
}

.compare-source:hover {
  border-color: var(--accent-dim);
}

.compare-source-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.compare-source-author {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.compare-source-author:hover {
  color: var(--accent);
}

.compare-source-period {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.compare-source-work {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--blue);
  text-decoration: none;
  line-height: 1.4;
}

.compare-source-work:hover {
  text-decoration: underline;
}

.compare-source-summary {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}

.compare-source-excerpt {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.6;
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

/* Compare traditions link in sidebar */
.compare-link {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.compare-link:hover {
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Inline-style extraction utilities ────────────────────────── */

/* Card link — removes decoration, inherits color, renders as block */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* No-decoration link — just removes underline, inherits color */
.no-decoration {
  text-decoration: none;
  color: inherit;
}

/* No-decoration (text only) — just removes underline */
.no-underline {
  text-decoration: none;
}

/* Accent-colored heading text */
.color-accent { color: var(--accent); }

/* Color utilities */
.color-red { color: var(--red); }
.color-blue { color: var(--blue); }
.color-green { color: var(--green); }
.color-purple { color: var(--purple); }
.color-orange { color: var(--orange); }

/* Blue link styling */
.link-blue {
  color: var(--blue);
  text-decoration: none;
}

/* Claim detail page header (h1) */
.claim-detail-title {
  font-family: var(--font-page);
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

/* Column flex layout for insight/connection rows */
.flex-col-start {
  flex-direction: column;
  align-items: flex-start;
}

/* Flex row: space-between, baseline-aligned, full width */
.flex-between-baseline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
}

/* Flex row: baseline-aligned with small gap */
.flex-baseline-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  width: 100%;
}

/* Flex row: center-aligned with gap */
.flex-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Small body-font snippet text (commentary, summaries) */
.snippet-text {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Small UI metadata label */
.meta-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Tiny UI metadata (tradition lists, fine print) */
.meta-tiny {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Full-width pre-wrapped body text block */
.body-text-block {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
}

/* Large stat number */
.stat-number {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 600;
}

/* Show-more / centered action area */
.center-action {
  text-align: center;
  margin: 1.5rem 0;
}

/* Methodology card heading style */
.method-card-heading {
  margin: 0 0 0.35rem 0;
  font-size: 1rem;
}

/* Method card heading colors */
.method-card-heading--accent { color: var(--accent); }
.method-card-heading--blue { color: var(--blue); }
.method-card-heading--orange { color: var(--orange); }

/* Methodology list (ul) styling */
.method-list {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0.5rem 0 0 1.5rem;
}

/* Font-size utility: 0.95rem */
.text-base { font-size: 0.95rem; }

/* Font-size utility: 0.9rem */
.text-body { font-size: 0.9rem; }

/* Font-size utility: 0.8rem */
.text-caption { font-size: 0.8rem; }

/* Font-size utility: 1rem */
.text-md { font-size: 1rem; }

/* Font-size utility: 1.1rem */
.text-lg { font-size: 1.1rem; }

/* Small inline tag (0.6rem) */
.tag--tiny { font-size: 0.6rem; }

/* Loading spinner with padding */
.loading--inline { padding: 0.5rem; }

/* Compact card (methodology, etc.) */
.card--compact {
  margin-bottom: 1rem;
  padding: 1rem;
}

/* Auto-width container for centered content */
.content-narrow {
  max-width: 700px;
  margin: 0 auto;
}

/* Container: max-width 600px centered */
.content-600 {
  max-width: 600px;
  margin: 0 auto;
}

/* Source blockquote reset */
.source-passage--inline {
  margin: 0;
  font-size: 0.9rem;
}

/* Small margin: 0 (reset) with prose */
.prose-reset { margin: 0; }

/* Links inside cards — use accent color, not browser default blue */
.card a:not(.btn):not(.no-decoration):not(.card-link):not(.editorial-cta) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 2px;
}
.card a:not(.btn):not(.no-decoration):not(.card-link):not(.editorial-cta):hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

/* Font-weight 500 (medium) */
.fw-medium { font-weight: 500; }

/* Font-weight 600 (semibold) */
.fw-semibold { font-weight: 600; }

/* Margin-left auto (push right) */
.ml-auto { margin-left: auto; }

/* Flex grow to fill available space */
.flex-1 { flex: 1; }

/* Margin-bottom tiny variants */
.mb-xs { margin-bottom: 0.25rem; }
.mb-2xs { margin-bottom: 0.35rem; }

/* Margin-top variants */
.mt-2xs { margin-top: 0.3rem; }
.mt-xl { margin-top: 2rem; }

/* Flex-wrap with centered items */
.flex-wrap-center { align-items: center; }

/* ══════════════════════════════════════════════════════════════
   Mobile Responsiveness — comprehensive fixes
   ══════════════════════════════════════════════════════════════ */

/* ── Touch targets — ensure 44px minimum ──────────────────── */

@media (max-width: 768px) {
  .btn {
    min-height: 44px;
    padding: 0.6rem 1.25rem;
  }

  .btn--small {
    min-height: 36px;
    padding: 0.35rem 0.6rem;
  }

  .tag, .tradition-tab {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .toc-ch {
    width: 36px;
    height: 36px;
  }

  .filter-select, .select {
    min-height: 44px;
    padding: 0.5rem 0.6rem;
  }
}

/* ── Heatmap scroll container on mobile ───────────────────── */

@media (max-width: 600px) {
  .hm-book-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .story-title { font-size: 1.5rem; }
  .story-section-heading { font-size: 1.1rem; }

  .detail-card h1 { font-size: 1.25rem; }

  .centrality-row {
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
  }
  .centrality-verse { min-width: auto; font-size: 0.9rem; }
}

/* ── Timeline controls on very small screens ──────────────── */

@media (max-width: 400px) {
  .tl-topbar { gap: 0.35rem; }
  .tl-map { min-height: 180px; }
  .tl-strip { height: 80px; }

  .home-stat-num { font-size: 1.1rem; }
  .home-stats { gap: 0.75rem; }

  .hero h1 { font-size: 1.35rem; }
  .hero p { font-size: 0.9rem; }
}

/* ── Prevent horizontal overflow from wide elements ───────── */

@media (max-width: 768px) {
  .intertext-refs { min-width: auto; }
  .intertext-row { flex-direction: column; align-items: flex-start; gap: 0.25rem; }

  .path-stop {
    margin-left: 0.75rem;
    padding-left: 1rem;
  }
}

/* ── Story layout on small screens ────────────────────────── */

@media (max-width: 600px) {
  .story-meta {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ── Sidebar mobile — ensure no overlap ───────────────────── */

@media (max-width: 1000px) {
  .reader-layout {
    gap: 0;
  }
}

/* ── Badge base + active state ─────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-family: var(--font-ui);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Disputed page cards ──────────────────────────────────── */

.disputed-group {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.disputed-card {
  padding: 1rem;
}

.disputed-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.disputed-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

a.disputed-title:hover {
  color: var(--accent);
}

/* ── Reader Landing Page ──────────────────────────────────── */

.reader-landing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.reader-landing-header {
  text-align: center;
  margin-bottom: 2rem;
}

.reader-landing-header h1 {
  font-family: var(--font-page);
  font-size: 2.2rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.reader-landing-search {
  margin: 0 auto;
  position: relative;
}

.reader-landing-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  font-family: var(--font-ui);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.reader-landing-search input:focus {
  border-color: var(--accent);
  outline: none;
}

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

/* Continue reading card */
.reader-landing-continue {
  margin-bottom: 1.5rem;
}

.reader-continue-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
}

.reader-continue-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reader-continue-ref {
  font-family: var(--font-page);
  font-size: 1.2rem;
  color: var(--text);
  flex: 1;
}

.reader-continue-arrow {
  font-size: 1.3rem;
  color: var(--accent);
}

/* Bookmarks */
.reader-landing-bookmarks {
  margin-bottom: 1.5rem;
}

.reader-landing-section-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.reader-bookmark-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.reader-bookmark-chip {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}

.reader-bookmark-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Bookshelf */
.bookshelf-section {
  margin-bottom: 1.5rem;
}

.bookshelf-section-title {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.35rem;
}

.bookshelf-book {
  position: relative;
}

.bookshelf-book-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: background var(--transition);
}

.bookshelf-book-header:hover {
  background: var(--bg-hover);
}

.bookshelf-book-name {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}
.bookshelf-book-name:hover {
  color: var(--accent);
}

.bookshelf-expand-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}
.bookshelf-expand-btn:hover {
  color: var(--accent);
  background: var(--bg-hover);
}

.bookshelf-book-meta {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.bookshelf-progress-pip {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.5;
  border-radius: 1px;
}

/* Chapter grid — hidden by default, shown on click */
.bookshelf-chapters {
  display: none;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.3rem 0.5rem 0.6rem;
}

.bookshelf-chapters--open {
  display: flex;
}

.bookshelf-ch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
}

.bookshelf-ch:hover {
  background: var(--accent);
  color: #fff;
}

.bookshelf-ch--read {
  color: var(--accent);
  background: rgba(201, 162, 39, 0.1);
}

@media (max-width: 700px) {
  .reader-landing {
    padding: 1rem 0.75rem;
  }
  .bookshelf-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* ── Redesigned Home Page ─────────────────────────────────── */

.home-hero {
  padding: 3rem 2rem 2rem;
}

.home-hero h1 {
  margin-bottom: 0.4rem;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

/* Home hero — full-bleed dramatic */
.home-hero-full {
  background: linear-gradient(165deg, #0a0e18 0%, #121828 40%, #161224 70%, #0a0e18 100%);
  margin: -2rem -2rem 0;
  padding: 6rem 2rem 5rem;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  overflow: visible;
}
.home-hero-full::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(212, 171, 42, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
[data-theme="light"] .home-hero-full {
  background: linear-gradient(165deg, #1a1a2e 0%, #16213e 40%, #1a1a2e 100%);
}
.home-hero-inner {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.home-claim {
  font-family: var(--font-page);
  font-size: 2.2rem;
  font-weight: 400;
  color: #e8e9ed;
  line-height: 1.4;
  margin: 0 auto 0.5rem;
  letter-spacing: 0.01em;
}
.home-claim-line {
  font-family: var(--font-page);
  font-size: 2.2rem;
  font-weight: 400;
  color: #d4ab2a;
  margin: 0 auto;
  letter-spacing: 0.01em;
}
/* Home CTA */
.home-cta {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: #d4ab2a;
  text-decoration: none;
  margin-top: 1.5rem;
  padding: 0.6rem 1.5rem;
  border: 1px solid rgba(212, 171, 42, 0.3);
  border-radius: var(--radius);
  transition: background 150ms ease, border-color 150ms ease;
}
.home-cta:hover {
  background: rgba(212, 171, 42, 0.1);
  border-color: rgba(212, 171, 42, 0.5);
}

.home-hero-links {
  margin-top: 2rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.home-hero-links a {
  color: rgba(232, 233, 237, 0.5);
  text-decoration: none;
  transition: color 150ms ease;
}
.home-hero-links a:hover {
  color: #d4ab2a;
}
.home-hero-sep {
  color: rgba(232, 233, 237, 0.25);
  margin: 0 0.5rem;
}
@media (max-width: 700px) {
  .home-hero-full { padding: 3rem 1.25rem 2.5rem; margin-left: -1rem; margin-right: -1rem; }
  .home-claim, .home-claim-line { font-size: 1.35rem; }
  .home-hero-inner { padding: 0 0.25rem; }
}

/* Home search (below content) */
.home-search-section {
  max-width: 640px;
  margin: 1.5rem auto 0;
  text-align: center;
  padding: 0 1rem;
}

/* Home layout — thread + sidebar */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}

.home-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Today's Thread */
.home-thread {
  padding: 1.75rem 2rem;
  border-left: 3px solid var(--accent);
}

.home-thread-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.home-thread-title {
  font-family: var(--font-page);
  font-size: 1.35rem;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.home-thread-body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.home-thread-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
}

.home-thread-body a:hover {
  border-bottom-color: var(--accent);
}

.home-thread-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.home-thread-ref {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
  background: var(--bg-hover);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.home-thread-ref:hover {
  background: var(--accent);
  color: #fff;
}

.home-thread-explore {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: auto;
  transition: color var(--transition);
}

.home-thread-explore:hover {
  color: var(--accent);
}

/* Entry cards — sidebar stack */
.home-entry-card {
  padding: 1.1rem 1.25rem;
}

.home-entry-card h2 {
  font-family: var(--font-page);
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.home-entry-card p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Progress bar — inline in sidebar */
.home-progress-inline {
  padding: 0.5rem 0;
}

.home-progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.home-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.home-progress-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .home-hero {
    padding: 2rem 1rem 1.5rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .home-grid {
    grid-template-columns: 1fr;
  }
  .home-thread {
    padding: 1rem 1.25rem;
  }
}

/* ── Feature: Inline Source Text Expansion ─────────────────── */

.source-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--accent);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-family: var(--font-ui);
  opacity: 0.6;
  transition: opacity 150ms ease, background 150ms ease;
  flex-shrink: 0;
}
.source-expand-btn:hover {
  opacity: 1;
  background: rgba(201,162,39,0.1);
}

.source-expanded-text {
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.7;
  padding: 0.5rem 0.75rem;
  margin-top: 0.25rem;
  border-left: 2px solid var(--accent);
  background: var(--bg-hover);
  border-radius: 0 4px 4px 0;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text);
  animation: textReveal 0.3s ease-out;
}
.source-expanded-text--hidden {
  display: none;
}

.catechism-row-link {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
  flex: 1;
}
.catechism-row-link:hover .catechism-topic {
  color: #c9a227;
}

/* ── Feature: Thread Following Panel ──────────────────────── */

.thread-follow-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  opacity: 0.7;
  transition: opacity 150ms ease, background 150ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.thread-follow-btn:hover {
  opacity: 1;
  background: rgba(201,162,39,0.12);
}

.thread-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.thread-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card, #faf8f2);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 560px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1000;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

.thread-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.thread-panel-header h3 {
  font-family: var(--font-page);
  font-size: 1.1rem;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}
.thread-panel-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
}
.thread-panel-close:hover { color: var(--text); }

.thread-claim-summary {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.thread-traditions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.thread-tradition-badge {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: rgba(201,162,39,0.1);
  color: var(--accent);
}

.thread-section {
  margin-bottom: 0.5rem;
}
.thread-section-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
  padding-left: 0.5rem;
}
.thread-section-label--source { color: var(--blue, #5b8ab5); }
.thread-section-label--fulfillment { color: var(--green, #5b8a72); }

.thread-stop {
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--border);
  margin-bottom: 0.3rem;
  border-radius: 0 4px 4px 0;
  background: var(--bg-hover);
}
.thread-stop--source { border-left-color: var(--blue, #5b8ab5); }
.thread-stop--fulfillment { border-left-color: var(--green, #5b8a72); }

.thread-stop-ref {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.thread-stop-ref:hover { text-decoration: underline; }

.thread-stop-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  margin-top: 0.25rem;
}

.thread-connector {
  text-align: center;
  padding: 0.5rem 0;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.75rem;
}
.thread-connector-arrow {
  font-size: 1rem;
}
.thread-connector-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Feature: Cross-Tradition Comparison Claims ───────────── */

.compare-claims-section {
  margin-bottom: 1.5rem;
}
.compare-section-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.compare-claim-card {
  background: var(--bg-card, #faf8f2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.compare-claim-subject {
  font-family: var(--font-page);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.compare-claim-summary {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
.compare-claim-traditions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}
.compare-tradition-badge {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
}
.compare-consensus--broad {
  background: rgba(91,138,114,0.15);
  color: var(--green, #5b8a72);
}
.compare-consensus--majority {
  background: rgba(201,162,39,0.12);
  color: var(--accent);
}
.compare-consensus--single {
  background: rgba(180,140,100,0.1);
  color: var(--text-muted);
}

/* ── Prophecy Detail — Enhanced ───────────────────────────── */

.prophecy-header {
  margin-bottom: 1rem;
}

.prophecy-evidence-summary {
  padding: 1rem 1.25rem;
}
.prophecy-evidence-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.prophecy-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.prophecy-stat-value {
  font-family: var(--font-page);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.2;
}
.prophecy-stat-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.prophecy-tradition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.prophecy-evidence-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.prophecy-verse-sources {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.prophecy-verse-sources-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.prophecy-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0;
}
.prophecy-source-meta {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}
.prophecy-source-author {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.prophecy-source-work {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Claim Page — 10-Section Layout ───────────────────────── */

.claim-page-header {
  margin-bottom: 1.5rem;
}
.claim-page-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
}
.claim-header-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.claim-header-main {
  flex: 1;
  min-width: 0;
}
.claim-header-main > * + * {
  margin-top: 0.75rem;
}

/* Infobox — Wikipedia-style summary card */
.claim-infobox {
  flex-shrink: 0;
  width: 280px;
  background: var(--bg-card, #faf8f2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0;
  font-family: var(--font-ui);
  font-size: 0.72rem;
}
.claim-infobox-table {
  width: 100%;
  border-collapse: collapse;
}
.claim-infobox-table tr + tr {
  border-top: 1px solid var(--border);
}
.claim-infobox-key {
  padding: 0.35rem 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  width: 1%;
}
.claim-infobox-val {
  padding: 0.35rem 0.65rem;
  color: var(--text);
  font-weight: 600;
}
.claim-infobox-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.claim-infobox-link:hover {
  text-decoration: underline;
}

/* Section highlight animation (from infobox click) */
.claim-section--highlight {
  animation: sectionFlash 1.5s ease-out;
}
@keyframes sectionFlash {
  0% { background: rgba(201,162,39,0.15); }
  100% { background: transparent; }
}

/* Methodology intro */
.methodology-intro {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
}
.methodology-intro-title {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.methodology-intro-title::-webkit-details-marker { display: none; }
.methodology-intro-title::before {
  content: '\25B6';
  font-size: 0.45rem;
  transition: transform 150ms ease;
}
.methodology-intro[open] > .methodology-intro-title::before { transform: rotate(90deg); }
.methodology-intro-title:hover { color: var(--accent); }
.methodology-intro-body {
  padding: 0 0.75rem 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.methodology-intro-body p { margin: 0 0 0.5rem; }
.methodology-intro-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.methodology-term {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-hover);
  border-radius: 3px;
}
.methodology-intro-note {
  font-size: 0.7rem;
  font-style: italic;
  opacity: 0.8;
}

/* Sources page categories */
.sources-category {
  margin-bottom: 2rem;
}
.sources-category-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.75rem;
}
.sources-category-count {
  font-weight: 400;
  font-size: 0.75rem;
  opacity: 0.6;
}

@media (max-width: 700px) {
  .claim-header-layout { flex-direction: column; }
  .claim-infobox { width: 100%; }
}
.claim-page-oneliner {
  font-family: var(--font-page);
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--text);
  margin: 0.5rem 0 0;
}
.claim-page-thesis--expanded {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}
.claim-page-thesis {
  font-family: var(--font-page);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0.5rem 0 0.75rem;
  font-style: italic;
}
.claim-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.claim-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.claim-pill {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--bg-hover);
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
}
.claim-pill--explicit { background: rgba(91,138,114,0.1); color: var(--green, #5b8a72); border-color: rgba(91,138,114,0.2); }
.claim-pill--implicit { background: rgba(201,162,39,0.08); color: var(--accent); border-color: rgba(201,162,39,0.15); }
.claim-pill--inferential { background: transparent; color: var(--text-muted); }
.claim-pill--divergence { cursor: pointer; }
.claim-pill--divergence:hover { border-color: var(--accent); color: var(--accent); }
.claim-meta-item {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.claim-meta-item strong {
  color: var(--text);
}
.claim-confidence--high { color: var(--green, #5b8a72); }
.claim-confidence--medium { color: var(--accent); }
.claim-confidence--low { color: var(--text-muted); }

.claim-section-subtitle {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: -0.3rem 0 0.5rem;
}

.claim-formal {
  padding: 1rem 1.25rem;
}
.claim-formal-text {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

.claim-section-label--source { color: var(--blue, #5b8ab5); }
.claim-section-label--source::before { content: '\25C6  '; }
.claim-section-label--fulfillment { color: var(--green, #5b8a72); }
.claim-section-label--fulfillment::before { content: '\25C6  '; }
.claim-section-label--historical { color: #8b7355; }
.claim-section-label--historical::before { content: '\25C6  '; }

.claim-verse-card--source { border-left: 3px solid var(--blue, #5b8ab5); }
.claim-verse-card--fulfillment { border-left: 3px solid var(--green, #5b8a72); }
.claim-historical-card {
  border-left: 3px solid #8b7355;
  background: rgba(139,115,85,0.02);
  padding: 0.75rem 1rem;
}
.claim-historical-card .claim-witness-header { margin-bottom: 0.3rem; }
.claim-historical-work {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-muted);
}

/* Evidence table */
.claim-evidence-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.82rem;
}
.claim-evidence-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.claim-evidence-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  line-height: 1.4;
}
.claim-ev-category {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  width: 120px;
}

/* Tradition witnesses */
.claim-tradition-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}
.claim-witness-card {
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.claim-witness-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.claim-witness-author {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.claim-witness-tradition {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: rgba(201,162,39,0.1);
  color: var(--accent);
}
.claim-witness-work {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Confidence assessment */
.claim-confidence-card {
  padding: 1rem 1.25rem;
}
.claim-confidence-overall {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.claim-confidence-value {
  font-family: var(--font-page);
  font-size: 1.3rem;
  font-weight: 600;
  text-transform: capitalize;
}
.claim-confidence-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.claim-confidence-dimensions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.claim-confidence-dim {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  background: var(--bg-hover);
  border-radius: 4px;
}
.claim-confidence-dim-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.claim-confidence-dim-value {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}

/* Alternative readings */
.claim-alt-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.4rem;
  border-left: 3px solid var(--border);
  transition: border-color 150ms ease;
}
.claim-alt-card:hover {
  border-left-color: var(--accent);
}
.claim-alt-name {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.claim-alt-type {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.claim-alt-summary {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Scope note */
.claim-scope-note {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.5;
  font-style: italic;
}

/* Argument steps */
.claim-arg-step {
  padding: 0.75rem 1rem;
  margin-bottom: 0.4rem;
  border-left: 3px solid var(--accent);
}
.claim-arg-step-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.claim-arg-step-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.claim-arg-method {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.arg-step-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.4rem;
}
.arg-citation {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  text-decoration: none;
}
.arg-citation--verse {
  background: rgba(91,138,181,0.12);
  color: var(--blue, #5b8ab5);
  border: 1px solid rgba(91,138,181,0.2);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}
.arg-citation--verse:hover {
  background: rgba(91,138,181,0.25);
  border-color: rgba(91,138,181,0.4);
}
.arg-citation--chunk {
  background: rgba(201,162,39,0.08);
  color: var(--text-muted);
  font-size: 0.58rem;
}

/* Evidence items (descriptive, not evaluative) */
.claim-evidence-item {
  padding: 0.75rem 1rem;
  margin-bottom: 0.4rem;
  border-left: 3px solid var(--blue, #5b8ab5);
  background: rgba(91,138,181,0.02);
}
.claim-ev-category-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.claim-ev-explanation {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.5;
  font-style: italic;
}

/* Source coverage */
.claim-coverage-card { padding: 0.75rem 1rem; }
.claim-coverage-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.claim-coverage-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 100px;
}

/* Enriched witness cards */
.claim-witness-card--enriched {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--green, #5b8a72);
  background: rgba(91,138,114,0.02);
}
.claim-witness-summary {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0.3rem 0 0;
}
.claim-witness-quote {
  font-family: var(--font-page);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
  margin: 0.4rem 0;
  padding: 0.4rem 0.75rem;
  border-left: 2px solid var(--accent);
  opacity: 0.9;
}
.claim-witness-position {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.claim-witness-position--affirm { background: rgba(91,138,114,0.12); color: var(--green, #5b8a72); }
.claim-witness-position--qualify { background: rgba(201,162,39,0.1); color: var(--accent); }
.claim-witness-position--reinterpret { background: rgba(180,140,100,0.1); color: var(--text-muted); }
.claim-coverage-note {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}
.thread-tradition-badge--direct {
  background: rgba(91,138,114,0.15);
  color: var(--green, #5b8a72);
  border: 1px solid rgba(91,138,114,0.2);
}
.thread-tradition-badge--meta {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  opacity: 0.7;
}
.claim-meta-sub {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Claim strength badge */
.claim-strength-badge {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.claim-strength-badge--explicit {
  background: rgba(91,138,114,0.12);
  color: var(--green, #5b8a72);
  border: 1px solid rgba(91,138,114,0.2);
}
.claim-strength-badge--implicit {
  background: rgba(201,162,39,0.1);
  color: var(--accent);
  border: 1px solid rgba(201,162,39,0.2);
}
.claim-strength-badge--inferential {
  background: rgba(180,140,100,0.08);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Support assessment labels */
.claim-support-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
}
.claim-support--very-strong { color: var(--green, #5b8a72); }
.claim-support--strong { color: #6a9b7a; }
.claim-support--moderate { color: var(--accent); }
.claim-support--limited { color: var(--text-muted); }

/* ── Compression Layers (depth toggle) ────────────────── */
.claim-depth-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.claim-depth-btn {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms ease;
  margin-bottom: -1px;
}
.claim-depth-btn:hover { color: var(--text); }
.claim-depth-btn--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Summary mode: hide full + deep sections */
[data-claim-depth="summary"] .claim-depth-full { display: none; }
[data-claim-depth="summary"] .claim-depth-deep { display: none; }

/* Full mode: show everything */
[data-claim-depth="full"] .claim-depth-full { display: block; }
[data-claim-depth="full"] .claim-depth-deep { display: block; }

/* Default (no attribute set): show everything */
.claim-depth-full { display: block; }
.claim-depth-deep { display: block; }

/* Passage block verse numbers */
.passage-vnum {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--accent);
  vertical-align: super;
  margin-right: 0.15em;
  opacity: 0.7;
}

/* Evidence chain arrows */
.claim-ev-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.3rem;
}
.claim-ev-arrow {
  color: var(--accent);
  font-size: 0.8rem;
  margin: 0 0.15rem;
}
.claim-ev-description {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
}

/* Divergence anchor */
.claim-divergence-anchor {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-top: 0.4rem;
  transition: border-color 150ms ease, color 150ms ease;
}
.claim-divergence-anchor:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.claim-see-also {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
  padding: 0.35rem 0.6rem;
  border-left: 2px solid var(--border);
}
.claim-see-also a {
  color: var(--accent);
  text-decoration: none;
}
.claim-see-also a:hover {
  text-decoration: underline;
}

/* Confidence explanation */
.claim-confidence-explanation {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Cautions */
.claim-cautions { padding: 0.75rem 1rem; }
.claim-cautions-list {
  margin: 0;
  padding-left: 1.2rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Divergence analysis */
.claim-divergence-card {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.claim-divergence-issue {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.claim-divergence-depth {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.claim-divergence-depth--major { background: rgba(180,60,60,0.1); color: #b44; }
.claim-divergence-depth--moderate { background: rgba(201,162,39,0.1); color: var(--accent); }
.claim-divergence-depth--minor { background: rgba(91,138,114,0.08); color: var(--green, #5b8a72); }
.claim-divergence-position {
  margin: 0.5rem 0;
  padding: 0.4rem 0.6rem;
  border-left: 2px solid var(--border);
  border-radius: 0 3px 3px 0;
}
.claim-divergence-view {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.claim-divergence-traditions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-bottom: 0.2rem;
}
.claim-divergence-reasoning {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Alternative diff line */
.claim-alt-diff {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
  line-height: 1.4;
}
.claim-alt-traditions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin: 0.15rem 0;
}

@media (max-width: 600px) {
  .claim-confidence-dimensions { grid-template-columns: 1fr; }
  .claim-page-meta { gap: 0.5rem; }
}

/* ── Tradition Comparison Page ─────────────────────────────── */

.trad-compare-controls {
  padding: 1.5rem;
}

.trad-compare-selects {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.trad-compare-selects > div {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.trad-compare-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.95rem;
}

/* ── Summary card ─────────────────────────────────────────── */
.trad-cmp-summary {
  padding: 1.5rem;
}

.trad-cmp-summary-title {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.trad-cmp-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.trad-cmp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 120px;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.trad-cmp-stat-num {
  font-family: var(--font-ui);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.trad-cmp-stat-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-align: center;
}

.trad-cmp-stat--both .trad-cmp-stat-num { color: var(--green); }
.trad-cmp-stat--a .trad-cmp-stat-num { color: var(--blue); }
.trad-cmp-stat--b .trad-cmp-stat-num { color: var(--orange); }

/* ── Proportional bar ─────────────────────────────────────── */
.trad-cmp-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.trad-cmp-bar-seg {
  min-width: 3px;
  transition: width 0.4s ease;
}

.trad-cmp-bar-seg--both { background: var(--green); }
.trad-cmp-bar-seg--a { background: var(--blue); }
.trad-cmp-bar-seg--b { background: var(--orange); }

/* ── Disagreements section ────────────────────────────────── */
.trad-cmp-disagreements {
  padding: 1.5rem;
}

.trad-cmp-section-title {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.trad-cmp-section-title--disagree {
  color: var(--red);
}

.trad-cmp-disagree-group {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.trad-cmp-disagree-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.trad-cmp-disagree-category {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trad-cmp-disagree-side {
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

.trad-cmp-disagree-label {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.35rem;
}

.trad-cmp-disagree-label--a {
  color: var(--blue);
  background: rgba(91, 141, 217, 0.1);
}

.trad-cmp-disagree-label--b {
  color: var(--orange);
  background: rgba(212, 148, 76, 0.1);
}

.trad-cmp-disagree-item {
  font-size: 0.88rem;
  padding: 0.35rem 0.5rem;
  border-left: 3px solid transparent;
  margin-bottom: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.trad-cmp-disagree-item--a { border-left-color: var(--blue); }
.trad-cmp-disagree-item--b { border-left-color: var(--orange); }

.trad-cmp-disagree-thesis {
  display: block;
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

/* ── Claim cards ──────────────────────────────────────────── */
.trad-cmp-card {
  border-left: 4px solid var(--border);
  padding: 0.85rem 1rem;
}

.trad-cmp-card--both { border-left-color: var(--green); }
.trad-cmp-card--a { border-left-color: var(--blue); }
.trad-cmp-card--b { border-left-color: var(--orange); }

.trad-cmp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.trad-cmp-subject {
  font-weight: 600;
  flex: 1;
}

.trad-cmp-badges {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.trad-cmp-thesis {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

/* ── Notable tag ──────────────────────────────────────────── */
.trad-cmp-notable {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: rgba(155, 114, 207, 0.12);
  color: var(--purple);
  border: 1px solid rgba(155, 114, 207, 0.25);
}

/* ── Consensus badge ──────────────────────────────────────── */
.trad-cmp-consensus {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  background: rgba(76, 175, 125, 0.1);
  color: var(--green);
  border: 1px solid rgba(76, 175, 125, 0.2);
}

/* ── Collapsible classification groups ────────────────────── */
.trad-cmp-group {
  margin-bottom: 0.5rem;
}

.trad-cmp-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  transition: background var(--transition);
}

.trad-cmp-group-toggle:hover {
  background: var(--bg-hover);
}

.trad-cmp-group-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 1em;
  text-align: center;
  flex-shrink: 0;
}

.trad-cmp-group-label {
  flex: 1;
}

.trad-cmp-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 0.4em;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--bg);
}

.trad-cmp-group-body {
  padding: 0.5rem 0 0 0;
  transition: max-height 0.3s ease;
}

.trad-cmp-group-body--collapsed {
  display: none;
}

/* ── Core Concepts Comparison ──────────────────────────────── */
.trad-cmp-concepts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.trad-cmp-concepts-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid currentColor;
}

.trad-cmp-concept-item {
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}
.trad-cmp-concept-item:last-child { border-bottom: none; }

.trad-cmp-concept-term {
  display: block;
  font-weight: 700;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.trad-cmp-concept-meaning {
  display: block;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
}

/* ── Doctrinal Position Comparison ────────────────────────── */
.trad-cmp-doctrine-header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 0.5rem;
}

.trad-cmp-doctrine-subhead {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.trad-cmp-doctrine-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  align-items: start;
}
.trad-cmp-doctrine-row:last-child { border-bottom: none; }

.trad-cmp-doctrine-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.trad-cmp-doctrine-stances {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.trad-cmp-doctrine-stance-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.trad-cmp-doctrine-explain {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Section headings ─────────────────────────────────────── */
.trad-cmp-heading--both { color: var(--green); }
.trad-cmp-heading--a { color: var(--blue); }
.trad-cmp-heading--b { color: var(--orange); }

@media (max-width: 600px) {
  .trad-compare-selects { flex-direction: column; gap: 1rem; }
  .trad-cmp-stats { flex-direction: column; gap: 0.75rem; }
  .trad-cmp-stat { flex-direction: row; gap: 0.75rem; justify-content: center; }
  .trad-cmp-stat-num { font-size: 1.4rem; }
  .trad-cmp-card-header { flex-direction: column; }
  .trad-cmp-badges { justify-content: flex-start; }
  .trad-cmp-concepts-grid { grid-template-columns: 1fr; }
  .trad-cmp-doctrine-row { grid-template-columns: 1fr; }
  .trad-cmp-doctrine-header { grid-template-columns: 1fr; }
  .trad-cmp-doctrine-stances { grid-template-columns: 1fr; }
}

/* ── Tradition Detail Page ──────────────────────────────── */
.trad-detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .trad-detail-layout { grid-template-columns: 1fr; }
  .trad-detail-infobox { position: static; }
}

.trad-detail-main { min-width: 0; }

.trad-detail-infobox { position: sticky; top: 1rem; }

.trad-infobox-card {
  border-left: 3px solid var(--accent);
  padding: 1rem;
}

.trad-infobox-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.trad-infobox-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: collapse;
}
.trad-infobox-table th {
  text-align: left;
  padding: 0.3rem 0.5rem 0.3rem 0;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: top;
  width: 40%;
}
.trad-infobox-table td {
  padding: 0.3rem 0;
  vertical-align: top;
}
.trad-infobox-table tr + tr {
  border-top: 1px solid var(--border-light);
}

.trad-infobox-compare {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.trad-beliefs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.trad-beliefs-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  line-height: 1.5;
}
.trad-beliefs-list li:last-child { border-bottom: none; }
.trad-beliefs-list li::before {
  content: '\25B8';
  color: var(--accent);
  margin-right: 0.5rem;
}

.trad-confessions-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.trad-confessions-list li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
}
.trad-confessions-list li:last-child { border-bottom: none; }
.trad-confessions-list li::before {
  content: '\1F4DC';
  margin-right: 0.5rem;
}

.trad-founders-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.trad-founder-pill {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 2rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Core Concepts */
.trad-concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.trad-concept-card {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-alt);
  border-radius: 0 4px 4px 0;
}

.trad-concept-term {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
  font-style: italic;
}

.trad-concept-meaning {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

/* Doctrinal Landscape */
.trad-doctrine-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trad-doctrine-category {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.trad-doctrine-category:last-child { border-bottom: none; }

.trad-doctrine-cat-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.trad-doctrine-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  margin: 0.15rem 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.trad-doctrine-pill:hover {
  background: var(--surface-alt);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Doctrine Detail ──────────────────────────────────────── */
.doctrine-verses-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.doctrine-verse-item {
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-alt);
  border-radius: 0 4px 4px 0;
}

.doctrine-verse-item .scripture-ref {
  font-weight: 600;
  font-size: 0.85rem;
}

.doctrine-verse-text {
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0.25rem 0 0;
  color: var(--text);
  font-style: italic;
}

.doctrine-stance-summary {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.doctrine-stance-count {
  font-weight: 700;
  font-size: 0.9rem;
}

.doctrine-stances-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doctrine-stance-card {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--border-light);
  background: var(--surface-alt);
  border-radius: 0 6px 6px 0;
}

.doctrine-stance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.doctrine-stance-trad {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--link);
  text-decoration: none;
}
.doctrine-stance-trad:hover { text-decoration: underline; }

.doctrine-stance-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.doctrine-stance-explanation {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}

.doctrine-stance-evidence {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-light);
}

.doctrine-stance-evidence-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.doctrine-stance-evidence-item {
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border-light);
}
.doctrine-stance-evidence-item:last-child { margin-bottom: 0; }

.doctrine-stance-evidence-source {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.doctrine-stance-evidence-work {
  font-weight: 600;
  color: var(--text);
}

.doctrine-stance-evidence-quote {
  margin: 0.2rem 0;
  padding: 0.3rem 0.5rem;
  background: var(--surface);
  border-radius: 3px;
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
  border: none;
}

.doctrine-stance-evidence-refs {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.doctrine-claims-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.doctrine-claim-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  flex-wrap: wrap;
}
.doctrine-claim-link:hover { background: var(--surface-alt); }

.doctrine-claim-subject {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--link);
}

.doctrine-claim-thesis {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 200px;
}

@media (max-width: 768px) {
  .trad-detail-layout {
    grid-template-columns: 1fr;
  }
  .trad-detail-infobox {
    position: static;
    order: -1;
  }
  .trad-concepts-grid {
    grid-template-columns: 1fr;
  }
  .doctrine-stance-header { flex-direction: column; align-items: flex-start; }
}

/* ── Doctrine Enriched Fields ───────────────────────────────── */

/* Enriched thesis one-liner */
.doctrine-enriched-thesis {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
}

/* Enriched summary paragraphs */
.doctrine-enriched-summary-para {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.doctrine-enriched-summary-para:last-child { margin-bottom: 0; }

/* Prose blocks (pastoral, philosophical) */
.doctrine-prose-block {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;
}

/* ── Biblical Argument Steps ────────────────────────────────── */
.doctrine-argument-step {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.4rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 4px 4px 0;
}
.doctrine-argument-step-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}
.doctrine-argument-step-label {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}
.doctrine-argument-method {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: default;
}
.doctrine-argument-step-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.doctrine-argument-step-citations .scripture-ref {
  font-size: 0.72rem;
}

/* ── Historical Development Timeline ────────────────────────── */
.doctrine-timeline {
  position: relative;
  padding-left: 1.5rem;
}
.doctrine-timeline::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}
.doctrine-timeline-entry {
  position: relative;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}
.doctrine-timeline-entry:last-child { margin-bottom: 0; }
.doctrine-timeline-marker {
  position: absolute;
  left: -1.3rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.doctrine-timeline-content {
  padding-bottom: 0.25rem;
}
.doctrine-timeline-period {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.15rem;
}
.doctrine-timeline-event {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.2rem;
}
.doctrine-timeline-significance {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}
.doctrine-timeline-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.15rem;
}
.doctrine-timeline-figures .tag {
  font-size: 0.6rem;
  cursor: default;
}

/* ── Key Debates Cards ──────────────────────────────────────── */
.doctrine-debate-card {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}
.doctrine-debate-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.doctrine-debate-issue {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.doctrine-debate-status {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 3px;
}
.doctrine-debate-position {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.35rem 0.6rem;
  margin: 0.3rem 0;
  border-left: 2px solid var(--border);
  border-radius: 0 3px 3px 0;
}
.doctrine-debate-tradition {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  min-width: 6rem;
}
.doctrine-debate-view {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
}

/* ── Misconception Cards ────────────────────────────────────── */
.doctrine-misconception {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}
.doctrine-misconception-wrong {
  padding: 0.4rem 0.6rem;
  border-left: 3px solid #c44;
  margin-bottom: 0.5rem;
  border-radius: 0 3px 3px 0;
}
.doctrine-misconception-wrong p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
}
.doctrine-misconception-right {
  padding: 0.4rem 0.6rem;
  border-left: 3px solid var(--green, #5b8a72);
  margin-bottom: 0.4rem;
  border-radius: 0 3px 3px 0;
}
.doctrine-misconception-right p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
}
.doctrine-misconception-label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.15rem;
}
.doctrine-misconception-why {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0.25rem 0 0 0;
}

/* ── Responsive: Doctrine Enriched ──────────────────────────── */
@media (max-width: 768px) {
  .doctrine-debate-position {
    flex-direction: column;
    gap: 0.15rem;
  }
  .doctrine-debate-tradition {
    min-width: auto;
  }
}

/* ── Editorial HTML Blocks ─────────────────────────────────── */
.story-html {
  margin: 1.5rem 0;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

/* ── Manuscript Comparison Table ───────────────────────────── */
.manuscript-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0.5rem 0 1rem;
}

.manuscript-table thead {
  background: var(--bg-panel);
  border-bottom: 2px solid var(--accent-dim);
}

.manuscript-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.manuscript-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.manuscript-table tbody tr:last-child td {
  border-bottom: none;
}

.manuscript-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.manuscript-table tbody tr:nth-child(odd) {
  background: var(--bg-card);
}

.manuscript-table tbody tr:first-child {
  background: rgba(212, 171, 42, 0.06);
  font-weight: 500;
}

.manuscript-table tbody tr:hover {
  background: var(--bg-hover);
}

.manuscript-table .table-highlight {
  color: var(--accent);
  font-weight: 600;
}

.manuscript-table caption {
  caption-side: bottom;
  padding: 0.6rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: left;
  font-style: italic;
}

/* Light theme adjustments */
[data-theme="light"] .manuscript-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .manuscript-table tbody tr:nth-child(odd) {
  background: var(--bg-card);
}

[data-theme="light"] .manuscript-table tbody tr:first-child {
  background: rgba(124, 94, 16, 0.06);
}

/* Responsive: stack on small screens */
@media (max-width: 640px) {
  .manuscript-table {
    font-size: 0.8rem;
  }
  .manuscript-table th,
  .manuscript-table td {
    padding: 0.5rem 0.6rem;
  }
  .manuscript-table th {
    font-size: 0.75rem;
  }
}


/* ── Manuscript Catalog & Browser ──────────────────────────────── */

/* Grid for manuscript catalog cards */
.manuscript-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

/* Thumbnail grid (smaller cards for browsing pages) */
.manuscript-grid--thumbs {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* Manuscript catalog card */
.manuscript-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: var(--text);
}

.manuscript-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(212, 171, 42, 0.08);
}

.manuscript-card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #0a0d14;
  display: flex;
  align-items: center;
  justify-content: center;
}

.manuscript-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.manuscript-card-body {
  padding: 1rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.manuscript-card-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.manuscript-card-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.manuscript-card-siglum {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
}

.manuscript-card-date {
  color: var(--text-muted);
}

.manuscript-card-contents {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.manuscript-card-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.manuscript-card-pages {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

/* Placeholder for missing images */
.manuscript-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-serif);
  min-height: 80px;
}

.manuscript-card-image .manuscript-placeholder {
  width: 100%;
  height: 100%;
}

/* ── Manuscript Browser Layout ─────────────────────────────────── */

.manuscript-browser-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (max-width: 900px) {
  .manuscript-browser-layout { grid-template-columns: 1fr; gap: 1.25rem; padding: 0; }
}

.manuscript-browser-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.manuscript-browser-significance {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 1.5rem;
}

.manuscript-browser-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Metadata sidebar */
.manuscript-meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 5rem;
}

.manuscript-meta-card h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin: 0 0 1rem;
  color: var(--accent);
}

.manuscript-meta-item {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.manuscript-meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.manuscript-meta-value {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

/* Thumbnail card in browser grid */
.manuscript-thumb-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.manuscript-thumb-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.manuscript-thumb-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #0a0d14;
}

.manuscript-thumb-label {
  padding: 0.5rem 0.65rem 0.25rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
}

.manuscript-thumb-content {
  padding: 0 0.65rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Full-page Viewer Overlay ──────────────────────────────────── */

.manuscript-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ms-fade-in 200ms ease;
}

@keyframes ms-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.manuscript-viewer {
  display: flex;
  flex-direction: column;
  max-width: 95vw;
  max-height: 95vh;
  width: 100%;
  height: 100%;
}

.manuscript-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(20, 24, 37, 0.95);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.manuscript-viewer-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text);
}

.manuscript-viewer-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.manuscript-viewer-pos {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0 0.5rem;
}

.manuscript-viewer-btn {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
}

.manuscript-viewer-close {
  font-size: 1.3rem;
  padding: 0.25rem 0.6rem;
  margin-left: 0.5rem;
}

.manuscript-viewer-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  cursor: grab;
}
.manuscript-viewer-body:active {
  cursor: grabbing;
}

.manuscript-viewer-img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  min-width: min(100%, 1200px);
  object-fit: contain;
  border-radius: 4px;
  transition: transform 200ms ease;
}
.manuscript-viewer-img.zoomed {
  min-width: min(200%, 2400px);
}

.manuscript-viewer-zoom {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

/* ── Reader Sidebar: Manuscript Attestation ────────────────────── */

.manuscript-attestation-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.manuscript-attestation-item:last-child {
  border-bottom: none;
}

.manuscript-attestation-item[style*="cursor:pointer"]:hover {
  background: var(--bg-hover);
  border-radius: var(--radius);
  margin: 0 -0.35rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.manuscript-attestation-thumb {
  width: 60px;
  height: 48px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.manuscript-attestation-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.manuscript-attestation-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.manuscript-attestation-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.manuscript-attestation-folio {
  font-size: 0.75rem;
  color: var(--accent);
  font-family: var(--font-mono);
}

.manuscript-attestation-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Folio lightbox (manuscript page viewer in reader) ──── */
.folio-lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.folio-lightbox-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
}

.folio-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: 0.5rem;
  overflow: hidden;
}

.folio-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border, #333);
}

.folio-lightbox-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text, #eee);
}

.folio-lightbox-close {
  background: none;
  border: none;
  color: var(--text-muted, #999);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
}

.folio-lightbox-close:hover { color: var(--text, #eee); }

.folio-lightbox-body {
  overflow: auto;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.folio-lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  cursor: zoom-in;
}

.folio-lightbox-img.zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.folio-lightbox-footer {
  padding: 0.4rem 0.75rem;
  border-top: 1px solid var(--border, #333);
  text-align: center;
}

.folio-lightbox-link {
  font-size: 0.78rem;
  color: var(--accent, #c9a84c);
  text-decoration: none;
}

.folio-lightbox-link:hover { text-decoration: underline; }

/* ── Inline Manuscript Image (editorials) ──────────────────────── */

.manuscript-inline {
  margin: 1.5rem 0;
  text-align: center;
}

.manuscript-inline a {
  display: inline-block;
}

.manuscript-inline-img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.manuscript-inline a:hover .manuscript-inline-img {
  border-color: var(--accent);
}

.manuscript-inline figcaption {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .manuscript-grid {
    grid-template-columns: 1fr;
  }
  .manuscript-grid--thumbs {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .manuscript-browser-layout {
    grid-template-columns: 1fr;
  }
  .manuscript-browser-sidebar {
    order: -1;
  }
  .manuscript-meta-card {
    position: static;
  }
  .manuscript-viewer-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  .manuscript-card-image {
    height: 140px;
  }
}

/* ── Manuscript Article (scholarly description) ──────────────── */

.manuscript-article {
  margin: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.manuscript-article-section {
  margin-bottom: 2rem;
}

.manuscript-article-section:last-child {
  margin-bottom: 0;
}

.manuscript-article-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.manuscript-article-body {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  max-width: 72ch;
}

[data-theme="light"] .manuscript-article-body {
  color: var(--text);
}

/* ── Text Traditions Page ────────────────────────────────── */

.text-tradition-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 700px) {
  .text-tradition-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* Info link in reader tradition tabs */
.tradition-info-link {
  font-size: 0.75rem;
  opacity: 0.7;
  text-decoration: none;
  color: var(--text-muted);
  margin-left: auto;
}
.tradition-info-link:hover {
  opacity: 1;
  color: var(--accent);
}

/* ── Variant Explorer Landing Page ──────────────────────── */

.variant-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.variant-stat-card {
  background: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
}

.variant-stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent, #c9a227);
  font-family: 'EB Garamond', 'Georgia', serif;
  line-height: 1.2;
}

.variant-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.variant-featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.variant-featured-card {
  padding: 1.25rem !important;
  transition: border-color 0.2s, transform 0.15s;
  display: block;
}

.variant-featured-card:hover {
  border-color: var(--accent, #c9a227);
  transform: translateY(-2px);
}

.variant-featured-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.variant-featured-ref {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent, #c9a227);
  font-family: 'EB Garamond', 'Georgia', serif;
}

.variant-featured-title {
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary, #eee);
  line-height: 1.3;
}

.variant-featured-desc {
  font-size: 0.83rem;
  color: var(--text-secondary, #aaa);
  line-height: 1.5;
  margin: 0;
}

/* Variant detail "See also" section */
.variant-see-also {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border, #333);
  padding-top: 1rem;
}

.variant-see-also h3 {
  font-size: 0.9rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem 0;
}

.variant-see-also-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.variant-see-also-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  border: 1px solid var(--border, #333);
  border-radius: 4px;
  color: var(--text-secondary, #aaa);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.variant-see-also-link:hover {
  border-color: var(--accent, #c9a227);
  color: var(--accent, #c9a227);
}

/* Manuscript reading progress badge */
.manuscript-read-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent, #c9a227);
  margin-left: 0.4rem;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.03em;
}

@media (max-width: 768px) {
  .variant-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .variant-featured-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .variant-stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Prophecy Arcs — Animation Bar ────────────────────────── */

.pv-animation-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  flex-wrap: wrap;
}
.pv-anim-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1;
}
.pv-anim-btn:hover {
  background: var(--border);
  border-color: var(--accent);
}
.pv-anim-btn--reset {
  font-size: 1.1rem;
  color: var(--text-muted);
}
.pv-anim-btn--reset:hover {
  color: var(--text);
}
.pv-speed-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
}
.pv-speed-slider {
  width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
}
.pv-anim-year {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  min-width: 70px;
}
.pv-legend-sep {
  color: var(--border);
  margin: 0 0.2rem;
}

/* Prophecy type tags */
.pv-type-messianic      { background: #c9a84c; color: #1a1500; }
.pv-type-judgment        { background: #a83a3a; color: #fff; }
.pv-type-restoration     { background: #1d7a4e; color: #fff; }
.pv-type-eschatological  { background: #6b42a0; color: #fff; }

/* ── Argument Map ─────────────────────────────────────────── */

.argmap {
  margin: 2rem 0;
  padding: 0;
}
.argmap-title {
  font-family: var(--font-page);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.argmap-title-icon {
  font-size: 1.3rem;
}
.argmap-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  margin-left: auto;
  font-family: var(--font-ui);
  transition: color 0.2s, border-color 0.2s;
}
.argmap-toggle-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Central claim node */
.argmap-root {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.argmap-node {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  max-width: 520px;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.argmap-node:hover {
  border-color: var(--text-muted);
}
.argmap-node--claim {
  border-color: var(--accent);
  text-align: center;
}
.argmap-node--support {
  border-color: #1d7a4e;
}
.argmap-node--counter {
  border-color: #a83a3a;
}
.argmap-node--neutral {
  border-color: #6a6e7e;
}
.argmap-node-label {
  font-family: var(--font-page);
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}
.argmap-node--claim .argmap-node-label {
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 600;
}
.argmap-node-source {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-family: var(--font-ui);
  display: none;
}
.argmap-node.argmap-expanded .argmap-node-source {
  display: block;
}
.argmap-node-pills {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.argmap-pill {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.1em 0.45em;
  border-radius: 3px;
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent);
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.argmap-pill--counter {
  background: rgba(168, 58, 58, 0.15);
  color: #d66;
}
.argmap-expand-icon {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.argmap-node.argmap-expanded .argmap-expand-icon {
  transform: translateY(-50%) rotate(90deg);
}

/* Connector lines */
.argmap-connector {
  width: 2px;
  height: 20px;
  background: var(--border);
  margin: 0 auto;
}
.argmap-connector--support { background: #1d7a4e55; }
.argmap-connector--counter { background: #a83a3a55; }

/* Branch container */
.argmap-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 0;
}
.argmap-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 280px;
  max-width: 360px;
  min-width: 240px;
}

/* Sub-branches (children of a branch node) */
.argmap-children {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0;
}
.argmap-node.argmap-expanded + .argmap-children,
.argmap-children.argmap-visible {
  display: flex;
}
.argmap-child-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

@media (max-width: 768px) {
  .argmap-branches {
    flex-direction: column;
    align-items: center;
  }
  .argmap-branch {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }
  .argmap-node {
    max-width: 100%;
  }
}

/* ── Split View (Compare Passages) ──────────────────────── */

.reader-layout--split {
  grid-template-columns: 1fr 1fr;
}

.reader-layout--split .sidebar {
  display: none;
}

.reader-layout--split .reader-annotations-toggle {
  display: none;
}

.split-panel {
  order: 3;
  min-width: 0;
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
}

.split-panel-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.split-panel-nav .split-book-select {
  min-width: 120px;
  max-width: 160px;
}

.split-panel-nav .split-chapter-select {
  min-width: 60px;
  max-width: 80px;
}

.split-panel-nav .split-tradition-select {
  min-width: 60px;
  max-width: 100px;
}

.split-close-btn {
  margin-left: auto;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
}

.split-panel-body {
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.split-panel-body .page {
  margin: 0;
}

.split-connection-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius, 4px);
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent, #c9a227);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Connected verse highlight — subtle, verse number only */
.verse-unit--connected > .verse-num {
  color: var(--accent, #c9a227);
}

/* Split View button active state */
#split-view-btn.btn--active {
  background: var(--accent, #c9a227);
  color: #000;
  border-color: var(--accent, #c9a227);
}

/* Hide split view on mobile — not enough space */
@media (max-width: 1000px) {
  #split-view-btn {
    display: none !important;
  }
  .reader-layout--split {
    grid-template-columns: 1fr;
  }
  .split-panel {
    display: none;
  }
}

/* ── Canon Formation Timeline ─────────────────────────────────── */

.canon-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.canon-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.canon-play-btn {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.canon-play-btn:hover,
.canon-play-btn--active {
  background: var(--accent);
  color: #000;
}

.canon-counter {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.canon-counter-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}

.canon-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.canon-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.canon-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Timeline container */
.canon-timeline-container {
  position: relative;
  padding: 1rem 0;
}

.canon-testament-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0.75rem 0 0.25rem;
}

/* Book regions */
.canon-books-region {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem 0;
  min-height: 2rem;
}

.canon-book-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-right: 0.75rem;
}

.canon-group-label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0.6;
}

.canon-book-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.canon-book-chip {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-muted);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.3s ease, border-color 0.3s ease;
  cursor: default;
  white-space: nowrap;
}

.canon-book-chip--visible {
  opacity: 1;
  transform: scale(1);
  color: var(--text);
  border-color: var(--chip-accent, var(--accent-dim));
  background: var(--bg-hover);
}

.canon-book-chip--visible:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Timeline axis */
.canon-axis {
  position: relative;
  height: 36px;
  margin: 1rem 0;
  border-bottom: 2px solid var(--border);
}

.canon-axis-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 10px;
  background: var(--text-muted);
  transform: translateX(-50%);
}

.canon-axis-label {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Event markers on the timeline */
.canon-events-track {
  position: relative;
  height: 20px;
  margin: 0.5rem 0 1.5rem;
}

.canon-event-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.canon-event-marker--active {
  opacity: 1;
}

.canon-event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
  transition: transform 0.2s ease;
}

.canon-event-marker:hover .canon-event-dot {
  transform: scale(1.4);
}

/* Event list */
.canon-event-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.canon-event-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
}

.canon-event-entry--active {
  background: var(--bg-hover);
  border-color: var(--border);
}

.canon-event-year {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 5rem;
  flex-shrink: 0;
}

.canon-event-tradition {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.5rem;
  border: 1px solid;
  border-radius: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.canon-event-label {
  flex: 1;
  min-width: 200px;
}

.canon-event-books {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .canon-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .canon-legend {
    margin-left: 0;
  }
  .canon-book-chip {
    font-size: 0.55rem;
    padding: 0.15rem 0.35rem;
  }
  .canon-event-entry {
    font-size: 0.85rem;
  }
  .canon-event-year {
    min-width: 4rem;
    font-size: 0.75rem;
  }
  .canon-event-label {
    min-width: 150px;
  }
  .canon-axis-label {
    font-size: 0.55rem;
  }
}

/* ── Manuscript Discovery Timeline ───────────────────────────── */

.ms-timeline-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .ms-timeline-wrapper { grid-template-columns: 1fr; }
}

.ms-chart-area {
  overflow-x: auto;
}

.ms-timeline-svg {
  display: block;
}

.ms-dot {
  transition: r 150ms ease, stroke-width 150ms ease;
}
.ms-dot:hover {
  r: 10;
  stroke-width: 2.5;
  filter: brightness(1.2);
}

.ms-detail-panel {
  padding: 1rem;
}

.ms-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.ms-detail-table td {
  padding: 0.3rem 0.5rem 0.3rem 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.ms-detail-table tr:last-child td {
  border-bottom: none;
}
.ms-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  width: 90px;
}

.ms-type-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.ms-full-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.75rem;
}
.ms-full-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ms-full-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.ms-table-row:hover {
  background: var(--bg-hover);
}

.btn--small {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-family: var(--font-ui);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.btn--small:hover {
  background: var(--accent);
  color: var(--bg);
}

@media (max-width: 800px) {
  .ms-timeline-wrapper {
    grid-template-columns: 1fr;
  }
  .ms-chart-area {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ms-timeline-svg {
    min-width: 600px;
  }
  .hide-mobile {
    display: none;
  }
}

/* ── Lectionary ──────────────────────────────────────────────── */

.lect-section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.lect-today {
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.lect-today-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.lect-today-header h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 0;
}

.lect-season-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: #fff;
  font-weight: 500;
}

.lect-year-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.lect-readings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.lect-tradition-col h3 {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.lect-reading-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.lect-type {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 80px;
  flex-shrink: 0;
}

.lect-ref {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.lect-ref:hover {
  border-bottom-color: var(--accent);
}

/* Liturgical calendar strip */
.lect-calendar-strip {
  display: flex;
  gap: 3px;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 60px;
}

.lect-season-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  min-width: 0;
  transition: outline var(--transition);
  border-radius: 3px;
}
.lect-season-block:hover {
  filter: brightness(1.15);
}

.lect-season-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.lect-season-weeks {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.15rem;
}

.lect-season-block--active {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Season browser */
.lect-season-detail {
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

.lect-sundays-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.75rem;
}

.lect-sunday-card {
  padding: 0.75rem 1rem;
}
.lect-sunday-card h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.lect-year-tag {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  vertical-align: middle;
}

.lect-readings-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.lect-compact-col {
  min-width: 0;
}

.lect-compact-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.lect-compact-type {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

@media (max-width: 600px) {
  .lect-readings-grid {
    grid-template-columns: 1fr;
  }
  .lect-sundays-list {
    grid-template-columns: 1fr;
  }
  .lect-readings-compact {
    grid-template-columns: 1fr;
  }
  .lect-calendar-strip {
    flex-wrap: wrap;
  }
  .lect-season-block {
    min-width: 50px;
  }
}

/* ── Time Slider (Sidebar) ──────────────────────────────── */

.time-slider-wrap {
  padding: 0.6rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 5;
}
.time-slider-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  flex-shrink: 0;
}
.time-slider {
  flex: 1;
  min-width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  cursor: pointer;
}
.time-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  cursor: pointer;
}
.time-slider-value {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
  min-width: 8rem;
  text-align: right;
}

/* Hidden by time filter */
.time-filterable[style*="display: none"] + .time-filterable[style*="display: none"] {
  border-top: none;
}

/* ── Study Paths ─────────────────────────────────────────── */

.study-paths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.study-path-card {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--path-color, var(--accent));
  transition: border-color var(--transition), box-shadow var(--transition);
}
.study-path-card:hover {
  border-left-color: var(--path-color, var(--accent));
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.study-path-card-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.15rem;
}
.study-path-card-body {
  flex: 1;
  min-width: 0;
}
.study-path-card-title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}
.study-path-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.study-path-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.study-path-progress-label {
  color: var(--accent);
  font-weight: 500;
}
.study-path-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.study-path-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 300ms ease;
}

/* Path detail */

.study-path-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.study-path-detail-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.study-path-detail-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Timeline layout for stops */

.study-path-timeline {
  position: relative;
  padding: 0;
}

.study-path-stop {
  display: flex;
  gap: 0;
  position: relative;
  min-height: 3rem;
}

.study-path-stop-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 3rem;
}

.study-path-stop-dot {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--path-color, var(--accent));
  color: var(--path-color, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  z-index: 1;
  transition: background 200ms ease, color 200ms ease;
}

.study-path-stop--visited .study-path-stop-dot {
  background: var(--path-color, var(--accent));
  color: #fff;
}

.study-path-stop-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  min-height: 1rem;
}

.study-path-stop-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 0.75rem 0.5rem;
  transition: border-color var(--transition);
}
.study-path-stop:hover .study-path-stop-card {
  border-color: var(--path-color, var(--accent));
}
.study-path-stop--visited .study-path-stop-card {
  opacity: 0.8;
}

.study-path-stop-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.study-path-stop-label {
  margin: 0;
  font-size: 1rem;
  flex: 1;
}

.study-path-stop-ref {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.study-path-stop-ref:hover {
  text-decoration: underline;
}

.study-path-stop-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 0.5rem;
  font-style: italic;
}

.study-path-stop-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.study-path-stop-read-btn {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}
.study-path-stop-read-btn:hover {
  text-decoration: underline;
}

.study-path-stop-visit-btn {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: all var(--transition);
}
.study-path-stop-visit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 600px) {
  .study-paths-grid {
    grid-template-columns: 1fr;
  }
  .study-path-stop-marker {
    width: 2.25rem;
  }
  .study-path-stop-dot {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.7rem;
  }
  .study-path-stop-card {
    padding: 0.75rem 1rem;
  }
  .study-path-detail-icon {
    font-size: 2rem;
  }
}

/* ── Doctrine Evolution Page ────────────────────────────── */

.doctrine-evo-link {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
.doctrine-evo-link:hover {
  color: var(--link-hover, var(--accent));
  text-decoration: underline;
}

/* Key Verses grid */
.devo-key-verses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.5rem;
}
.devo-key-verse-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.devo-key-verse-card:hover {
  border-color: var(--accent);
  background: var(--surface-alt, var(--surface));
}
.devo-key-verse-ref {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.devo-key-verse-text {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Legend */
.devo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}
.devo-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.devo-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Timeline */
.devo-timeline {
  position: relative;
  padding-left: 2rem;
}
.devo-timeline::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}
.devo-timeline-entry {
  position: relative;
  margin-bottom: 1.25rem;
  padding-left: 0.75rem;
}
.devo-timeline-entry:last-child {
  margin-bottom: 0;
}
.devo-timeline-marker {
  position: absolute;
  left: -1.7rem;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg);
}
.devo-timeline-content {
  padding-bottom: 0.15rem;
}
.devo-timeline-year {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.1rem;
}
.devo-timeline-label {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.2rem;
}
.devo-timeline-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.devo-timeline-source {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}
.devo-timeline-family-tag {
  font-size: 0.6rem !important;
  padding: 0.1rem 0.35rem !important;
}

/* Tradition Comparison Grid */
.devo-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}
.devo-comparison-card {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
}
.devo-comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.devo-comparison-trad {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.devo-comparison-trad:hover {
  text-decoration: underline;
}
.devo-comparison-explanation {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Other Doctrines Grid */
.devo-other-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.devo-other-card {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  transition: border-color 0.15s, transform 0.12s;
}
.devo-other-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.devo-other-card h3 {
  font-size: 0.88rem;
  margin: 0 0 0.15rem;
  color: var(--text);
}

@media (max-width: 600px) {
  .devo-key-verses {
    grid-template-columns: 1fr;
  }
  .devo-comparison-grid {
    grid-template-columns: 1fr;
  }
  .devo-other-grid {
    grid-template-columns: 1fr;
  }
  .devo-timeline {
    padding-left: 1.5rem;
  }
  .devo-timeline-marker {
    left: -1.2rem;
    width: 10px;
    height: 10px;
  }
}


/* ── Phase 2: signed-in user commentary on verses ──────────────
   The badge sits beside the verse number; the panel expands inline
   below the verse line and shows comments + composer. */

/* Count indicator only — shown when a verse has user notes. Not interactive
   itself; the user clicks the verse number to open the inline panel. */
.ak-cmt-badge {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px;
  margin: 0 0.18rem 0 0.12rem;
  padding: 0;
  vertical-align: super;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: var(--accent, #d9b16a);
  color: #1a1410;
  border-radius: 50%;
  opacity: 0.85;
  pointer-events: none; /* clicks pass through to the verse-num */
  user-select: none;
}
.verse-num { cursor: pointer; }

.ak-cmt-panel {
  margin: 0.6rem 0 1.2rem;
  padding: 0.85rem 1rem 0.6rem;
  background: rgba(217,177,106,0.05);
  border: 1px solid rgba(217,177,106,0.25);
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
}
.ak-cmt-head {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(217,177,106,0.18);
}
.ak-cmt-ref {
  font-family: "Cormorant Garamond", "Adobe Garamond Pro", Garamond, Georgia, serif;
  font-size: 1.08rem;
  color: var(--accent, #d9b16a);
  flex: 1;
}
.ak-cmt-close {
  background: transparent; border: 0; color: var(--text-muted, #9aa3b2);
  font-size: 1.1rem; width: 24px; height: 24px;
  border-radius: 4px; cursor: pointer;
}
.ak-cmt-close:hover { background: rgba(255,255,255,0.04); color: var(--text, #e7e9ee); }

.ak-cmt-list {
  display: flex; flex-direction: column; gap: 0.55rem;
  margin-bottom: 0.7rem;
}
.ak-cmt-empty {
  color: var(--text-muted, #9aa3b2);
  font-style: italic;
  font-size: 0.88rem;
  padding: 0.35rem 0;
}
.ak-cmt-item {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
}
.ak-cmt-meta {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted, #9aa3b2);
  margin-bottom: 0.3rem;
}
.ak-cmt-meta strong { color: var(--text, #e7e9ee); font-weight: 600; }
.ak-cmt-when { color: var(--text-dim, #6b7383); }
.ak-cmt-action {
  background: transparent; border: 0; color: var(--text-muted, #9aa3b2);
  font-family: inherit; font-size: 0.78rem;
  padding: 1px 4px; border-radius: 3px;
  cursor: pointer;
  margin-left: auto;
}
.ak-cmt-action + .ak-cmt-action { margin-left: 0.35rem; }
.ak-cmt-action:hover { background: rgba(255,255,255,0.05); color: var(--text, #e7e9ee); }
.ak-cmt-action.ak-cmt-del:hover { color: #e07a7a; }
.ak-cmt-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text, #e7e9ee);
  white-space: pre-wrap;
}
.ak-cmt-edit {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(217,177,106,0.4);
  border-radius: 5px;
  padding: 0.4rem 0.55rem;
  color: var(--text, #e7e9ee);
  font-family: inherit; font-size: 0.95rem;
  outline: none; resize: none;
  min-height: 60px;
}
.ak-cmt-edit-actions {
  display: flex; gap: 0.4rem;
  margin-top: 0.4rem;
}
.ak-cmt-edit-actions .ak-cmt-action.save {
  background: var(--accent, #d9b16a); color: #1a1410; padding: 4px 11px; font-weight: 600;
}
.ak-cmt-edit-actions .ak-cmt-action.save:hover { background: #e7c084; }

.ak-cmt-composer {
  border-top: 1px solid rgba(217,177,106,0.15);
  padding-top: 0.55rem;
}
.ak-cmt-composer textarea {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(217,177,106,0.25);
  border-radius: 5px;
  padding: 0.5rem 0.7rem;
  color: var(--text, #e7e9ee);
  font-family: inherit; font-size: 0.95rem;
  line-height: 1.5;
  outline: none; resize: none;
  min-height: 44px;
  transition: border-color 120ms ease;
}
.ak-cmt-composer textarea:focus { border-color: var(--accent, #d9b16a); }
.ak-cmt-composer-row {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 0.45rem;
}
.ak-cmt-scope {
  font-size: 0.75rem; color: var(--text-dim, #6b7383);
  flex: 1;
}
.ak-cmt-composer button[type="submit"] {
  background: var(--accent, #d9b16a); color: #1a1410;
  border: 0; border-radius: 5px;
  padding: 5px 14px;
  font-family: inherit; font-size: 0.83rem; font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.ak-cmt-composer button[type="submit"]:hover:not(:disabled) { background: #e7c084; }
.ak-cmt-composer button[type="submit"]:disabled { opacity: 0.55; cursor: progress; }
.ak-cmt-signin {
  font-size: 0.88rem;
  color: var(--text-muted, #9aa3b2);
  padding: 0.55rem 0 0.2rem;
}
.ak-cmt-signin a { color: var(--accent, #d9b16a); text-decoration: underline; text-underline-offset: 2px; }
.ak-cmt-err {
  background: rgba(224,122,122,0.10);
  border: 1px solid rgba(224,122,122,0.35);
  color: #f0b6b6;
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}

/* Sources section header on the search page (added by site/js/app.js renderSearch) */
.search-sources { margin-top: 0; margin-bottom: 1.5rem; }

/* ── Churches module (#/churches and child routes) ─────────── */
.ch-loading { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-style: italic; }
.ch-filters .ch-filter-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
@media (max-width: 760px) {
  .ch-filters .ch-filter-row { grid-template-columns: 1fr; }
}
.ch-input {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.92rem;
  border-radius: var(--radius);
}
.ch-input:focus { outline: none; border-color: var(--accent); }
.ch-view-row {
  display: flex; gap: 0.4rem;
  margin-bottom: 0.2rem;
  align-items: center;
}
.ch-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
.ch-tab.active { color: var(--accent); border-color: var(--accent-dim); background: var(--bg-card); }
.ch-tab:hover { color: var(--text); }
.ch-semantic { display: flex; gap: 0.4rem; }
.ch-go-btn {
  background: var(--accent);
  border: none;
  color: var(--bg);
  padding: 0 1.2rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius);
  cursor: pointer;
}
.ch-go-btn:hover { background: var(--accent-dim); }

.ch-card { display: block; text-decoration: none; color: var(--text); }
.ch-card:hover { color: var(--text); }
.ch-card-loc, .ch-card-denom {
  font-size: 0.82rem; color: var(--text-muted);
}
.ch-state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.4rem;
}
.ch-state-tile {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  padding: 0.6rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms, transform 120ms;
}
.ch-state-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.ch-state-tile-bar {
  position: absolute; left: 0; bottom: 0; height: 3px;
  background: var(--accent);
  opacity: 0.55;
  border-radius: 0 2px 0 0;
}
.ch-state-tile-code {
  font-family: var(--font-page);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ch-state-tile-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.ch-card-affirms { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.ch-card-affirm {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-weight: 500;
}

.ch-hero h1 { margin: 0; }
.ch-hero-glyph {
  float: right;
  width: 96px; height: 96px;
  margin: 0 0 0.8rem 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--bg-card)) 0%, var(--bg-card) 100%);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 12px;
  font-family: var(--font-page);
}
.ch-hero-glyph-initials {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.ch-hero-meta {
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}
.ch-pastor {
  margin-top: 0.4rem;
  padding: 0.5rem 0.8rem;
  background: var(--bg-panel);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  font-size: 0.92rem;
}
.ch-actions {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 0.8rem;
}
.ch-btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-family: var(--font-ui);
  border-radius: 6px;
}
.ch-btn:hover { border-color: var(--accent); }
.ch-btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
.ch-btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: var(--bg); }
.ch-btn-signin { background: transparent; border-color: var(--accent-dim); color: var(--accent); }

.ch-prov-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-ui);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.prov-stated { background: rgba(80,184,130,0.15); color: var(--green); }
.prov-llm    { background: rgba(96,148,224,0.15); color: var(--blue); }
.prov-denom  { background: rgba(160,126,212,0.15); color: var(--purple); }
.prov-verified { background: rgba(80,184,130,0.25); color: var(--green); }

.ch-tier {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-ui);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}
.tier-verbatim   { background: rgba(80,184,130,0.18); color: var(--green); }
.tier-paraphrase { background: rgba(80,184,130,0.10); color: var(--green); }
.tier-indicated  { background: rgba(212,171,42,0.12); color: var(--accent); }
.tier-partial    { background: rgba(212,171,42,0.06); color: var(--text-muted); font-style: italic; }
.tier-inherited  { background: rgba(160,126,212,0.13); color: var(--purple); }

.ch-verdict {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
}
.ch-v-affirms { color: var(--green); }
.ch-v-denies { color: var(--red); }
.ch-v-ambiguous { color: var(--accent); }
.ch-v-silent { color: var(--text-muted); font-style: italic; }

.ch-major {
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.ch-inf-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.ch-inf-row:first-child { border-top: none; }

.ch-pill {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.ch-pill-agree { background: rgba(80,184,130,0.15); color: var(--green); border-color: rgba(80,184,130,0.3); }
.ch-pill-disagree { background: rgba(212,93,93,0.15); color: var(--red); border-color: rgba(212,93,93,0.3); }

.ch-score-strong { color: var(--green); }

/* ─── Church detail v2: organised section rhythm ─────────────────────────
   Wraps every block in a consistent .ch-section with eyebrow + heading +
   body. Hero gets a real grid instead of float:right thumbnail. Doctrines
   collapse evidence by default so the page reads as a summary, not a wall
   of inferences. Sources group by kind. */
.ch-detail-page { display: flex; flex-direction: column; gap: 1rem; }

.ch-hero-v2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: start;
  padding: 1.4rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.ch-hero-main { min-width: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.ch-hero-aside { flex-shrink: 0; }
.ch-hero-title {
  font-family: var(--font-page);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
  color: var(--text);
}
.ch-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  align-items: baseline;
}
.ch-hero-tag { display: inline-flex; align-items: baseline; gap: 0.3rem; }
.ch-hero-tag-icon { color: var(--accent); font-style: normal; font-size: 0.95em; }
.ch-hero-pastor {
  padding: 0.4rem 0.7rem;
  background: var(--bg-panel);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  font-size: 0.92rem;
  color: var(--text);
}
.ch-hero-pastor-date {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  margin-left: 0.4rem;
}
.ch-hero-summary {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text);
  margin: 0.2rem 0 0;
  max-width: 44rem;
  overflow-wrap: anywhere;
}
.ch-hero-thumb {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.ch-hero-glyph-v2 {
  width: 96px;
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--bg-card)) 0%, var(--bg-card) 100%);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 12px;
  font-family: var(--font-page);
}

/* Section component — used by every block below the hero. The class
   is named `ch-section` for historical reasons (introduced for church
   detail), but is reused as-is by speaker, doctrine, and other detail
   pages. Treat it as a generic detail-page section. */
.ch-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
}
.ch-section-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}
.ch-section-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.ch-section-heading {
  font-family: var(--font-page);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}
.ch-section-aside {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Historical details — tile grid */
.ch-hist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}
.ch-hist-tile { display: flex; flex-direction: column; gap: 0.2rem; }
.ch-hist-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ch-hist-value {
  font-family: var(--font-page);
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.2;
}

/* Statements list */
.ch-statement-list { display: flex; flex-direction: column; gap: 0.7rem; }
.ch-statement {
  padding: 0.85rem 1.05rem;
  background: var(--bg-panel);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
}
.ch-statement-kind {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.ch-statement-text {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  overflow-wrap: anywhere;
}
.ch-statement-original {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 0.5rem;
  text-decoration: none;
}
.ch-statement-original:hover { text-decoration: underline; }

/* Leadership grid */
.ch-leader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
}
.ch-leader-card {
  padding: 0.7rem 0.9rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.ch-leader-name { font-weight: 600; color: var(--text); }
.ch-leader-title { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.1rem; }
.ch-leader-since { color: var(--text-muted); font-size: 0.78rem; font-style: italic; margin-top: 0.1rem; }

/* Doctrinal positions — verdict pill on the right, evidence collapsed */
.ch-doctrine-legend {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  align-items: center;
}
.ch-doctrine-list { display: flex; flex-direction: column; gap: 0.4rem; }
.ch-doctrine-v2 {
  padding: 0.7rem 0.9rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.ch-doctrine-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
}
.ch-doctrine-name {
  font-family: var(--font-page);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
}
.ch-doctrine-name:hover { color: var(--accent); }
.ch-doctrine-cat {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-weight: 400;
}
.ch-doctrine-verdict-pill {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.ch-doctrine-verdict-pill.v-affirms { background: rgba(80,184,130,0.18); color: var(--green); }
.ch-doctrine-verdict-pill.v-denies { background: rgba(212,93,93,0.18); color: var(--red); }
.ch-doctrine-verdict-pill.v-ambiguous { background: rgba(212,171,42,0.18); color: var(--accent); }
.ch-doctrine-verdict-pill.v-silent { background: var(--bg-card); color: var(--text-muted); font-weight: 400; font-style: italic; }

.ch-doctrine-toggle {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: var(--font-ui);
  margin-top: 0.4rem;
  padding: 0;
  text-align: left;
}
.ch-doctrine-toggle::before { content: "▸ "; display: inline-block; }
.ch-doctrine-v2[data-open="true"] .ch-doctrine-toggle::before { content: "▾ "; }
.ch-doctrine-evidence {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border);
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
  display: none;
}
.ch-doctrine-v2[data-open="true"] .ch-doctrine-evidence { display: flex; }
.ch-evidence-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: baseline;
  font-size: 0.85rem;
}
.ch-evidence-quote {
  margin: 0.2rem 0 0;
  padding: 0.35rem 0.6rem;
  background: var(--bg-card);
  border-left: 2px solid var(--accent);
  font-style: italic;
  font-size: 0.86rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Sources — grouped by kind */
.ch-source-groups { display: flex; flex-direction: column; gap: 0.8rem; }
.ch-source-group-head {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.ch-source-list { display: flex; flex-direction: column; gap: 0.22rem; }
.ch-source-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.ch-source-row a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
  min-width: 0;
}
.ch-source-row a:hover { text-decoration: underline; }
.ch-source-when {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .ch-hero-v2 { grid-template-columns: 1fr; }
  .ch-hero-aside { order: -1; align-self: flex-start; }
  .ch-section { padding: 1rem 0.9rem; }
}

/* ─── Speaker detail v2: passages laid out inside the section pattern ── */
.speaker-passages { display: flex; flex-direction: column; gap: 0.5rem; }
.speaker-passage {
  display: block;
  padding: 0.7rem 0.95rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.speaker-passage:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.speaker-passage-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}
.speaker-verse-count {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
}
.speaker-passage-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  overflow-wrap: anywhere;
}
.speaker-verse-num {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-right: 0.15rem;
  vertical-align: super;
}

/* ─── Doctrine "What churches hold" panel ───
   Sparse-doctrine pages still have lots of church-level inferences. Show
   a verdict breakdown across the directory. */
.doctrine-church-stances {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  align-items: baseline;
}
.doctrine-church-stance-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 7rem;
}
.doctrine-church-stance-count {
  font-family: var(--font-page);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.1;
}
.doctrine-church-stance-verdict {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ch-score-good   { color: var(--accent); }
.ch-score-mixed  { color: var(--text-muted); }
.ch-score-weak   { color: var(--red); }

.leaflet-popup-content { color: #222; }

/* ── Historic churches showcase ─────────────────────────── */
.hist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.hist-card {
  display: flex; flex-direction: column;
  text-decoration: none;
  color: var(--text);
  padding: 0.6rem;
  transition: transform 0.12s, border-color 0.12s;
}
.hist-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.hist-thumb-wrap {
  width: 100%; height: 180px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-panel);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
}
.hist-thumb { width: 100%; height: 100%; object-fit: cover; }
.hist-thumb-placeholder {
  font-size: 3rem;
  color: var(--text-muted);
  opacity: 0.5;
}
.hist-name {
  font-family: var(--font-page);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.hist-meta {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.hist-yr {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-panel);
  padding: 1px 6px;
  border-radius: 3px;
}
.hist-style {
  font-size: 0.82rem;
  color: var(--purple);
  margin-bottom: 0.2rem;
}
.hist-heritage {
  font-size: 0.75rem;
  color: var(--accent);
  font-style: italic;
}

/* ── Studies — long-form Bible-study chapters ──────────────── */
.study-article {
  max-width: 760px;
  margin: 0 auto;
  font-family: 'EB Garamond', 'Crimson Pro', Georgia, serif;
}
.study-article-header {
  margin: 1.5rem 0 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}
.study-article-num {
  display: inline-block;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.study-article-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0.25rem 0 0.5rem;
  color: var(--text);
}
.study-article-subtitle {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0.5rem auto 0;
  max-width: 620px;
  line-height: 1.4;
}
.study-article-body {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text);
}
.study-article-body h2 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.55rem;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-subtle, var(--border));
  padding-bottom: 0.4rem;
}
.study-article-body h3 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.2rem;
  margin: 1.8rem 0 0.6rem;
  color: var(--accent);
  font-weight: 600;
}
.study-article-body p { margin: 0.9rem 0; }
.study-article-body ul, .study-article-body ol {
  margin: 0.9rem 0 0.9rem 1.5rem;
  padding-left: 0.5rem;
}
.study-article-body li { margin: 0.35rem 0; }
.study-article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem auto;
  width: 60%;
}
.study-article-body code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.95em;
  background: var(--surface-2, rgba(127,127,127,0.08));
  padding: 0.08em 0.35em;
  border-radius: 3px;
  color: var(--accent);
}
.study-quote {
  border-left: 3px solid var(--accent);
  margin: 1.2rem 0;
  padding: 0.4rem 0 0.4rem 1.2rem;
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
  background: var(--surface-1, transparent);
}
.study-table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.study-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
}
.study-table th {
  background: var(--surface-2, rgba(127,127,127,0.08));
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-weight: 600;
}
.study-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  vertical-align: top;
  line-height: 1.45;
}
.study-table tr:last-child td { border-bottom: none; }
.study-table code { font-size: 0.9em; }
.study-article-body a.study-bible-ref {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: background 120ms ease;
}
.study-article-body a.study-bible-ref:hover {
  background: rgba(var(--accent-rgb, 200,170,80), 0.12);
  border-bottom-style: solid;
}
.study-article-body a.study-source-ref {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--text-muted);
  transition: border-color 120ms ease;
}
.study-article-body a.study-source-ref:hover {
  border-bottom-color: var(--accent);
}
.study-article-body a.study-source-ref::after {
  content: '↗';
  font-size: 0.75em;
  margin-left: 0.15em;
  color: var(--text-muted);
  vertical-align: super;
}
/* Reader → Studies callout (small inline banner at top of chapter). */
.ak-study-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em;
  margin: 0 0 1rem 0;
  padding: 0.55rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-1, rgba(127,127,127,0.05));
  border-radius: 2px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.ak-study-callout-icon {
  font-size: 0.95em;
  opacity: 0.7;
}
.ak-study-callout-label {
  color: var(--text-muted);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.ak-study-callout-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: background 120ms ease;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
}
.ak-study-callout-link:hover {
  background: rgba(var(--accent-rgb, 200,170,80), 0.12);
  border-bottom-style: solid;
}
.ak-study-callout-tag {
  font-size: 0.7em;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.05em 0.4em;
  border-radius: 2px;
  background: rgba(var(--accent-rgb, 200,170,80), 0.16);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: none;
}
.ak-study-callout-link[data-type="examinations"] .ak-study-callout-tag {
  background: rgba(127, 167, 197, 0.18);
  color: rgba(127, 167, 197, 0.95);
}
.ak-study-callout-title {
  /* the actual chapter title */
}
.ak-study-callout-arrow {
  font-size: 1.1em;
  vertical-align: -0.05em;
}
.ak-study-callout-sep {
  color: var(--text-muted);
  opacity: 0.5;
}
@media (max-width: 640px) {
  .study-article-title { font-size: 1.7rem; }
  .study-article-body { font-size: 1rem; }
  .study-table { font-size: 0.85rem; }
}

/* ── Unified verse panel: hide the redundant AI badge. The Greek/Hebrew
   word-study glyph stays visible (it's a hand-curated signal worth showing
   at a glance); the verse-num click still opens the unified panel that
   includes the word study + AI synthesis + user notes. */
.verse-ai-badge {
  display: none !important;
}

/* Unified panel sections */
.ak-cmt-section {
  margin: 0 0 1rem 0;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border, rgba(127,127,127,0.15));
}
.ak-cmt-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.ak-cmt-section-h {
  margin: 0 0 0.4rem 0;
  font-size: 0.8rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--text-muted, #666);
}
.ak-cmt-section-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 2px;
  margin-right: 0.4rem;
  text-transform: uppercase;
}
.ak-cmt-section-tag--ws    { background: rgba(110, 155, 122, 0.18); color: #4f7560; }
.ak-cmt-section-tag--ai    { background: rgba(122, 140, 170, 0.18); color: #4f6580; }
.ak-cmt-section-tag--notes { background: rgba(176, 138, 62, 0.18); color: #8b6b27; }
.ak-cmt-ws-original {
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}
.ak-cmt-ws-translit {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-muted, #666);
  margin-bottom: 0.35rem;
}
.ak-cmt-ws-note {
  margin: 0.2rem 0 0.5rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.ak-cmt-ws-link {
  font-size: 0.85rem;
  color: var(--accent, #b08a3e);
  text-decoration: none;
}
.ak-cmt-ws-link:hover { text-decoration: underline; }
.ak-cmt-ai-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  font-style: italic;
  color: var(--text, #222);
}

/* ── Biblical place names → inline map popover (study-places.js) ── */
.ak-place {
  cursor: pointer;
  border-bottom: 1px dotted #6e9b7a;
  padding-bottom: 1px;
}
.ak-place:hover { background: rgba(110, 155, 122, 0.08); }
.ak-place-pop {
  position: absolute;
  width: 320px;
  background: var(--surface-0, #fff);
  color: var(--text, #222);
  border: 1px solid var(--border, rgba(127,127,127,0.4));
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  z-index: 1000;
  overflow: hidden;
}
.ak-place-pop-header {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border, rgba(127,127,127,0.2));
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  position: relative;
}
.ak-place-pop-coord {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-left: auto;
  margin-right: 1.2rem;
}
.ak-place-pop-close {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  background: transparent;
  border: 0;
  font-size: 1.1rem;
  color: var(--text-muted, #888);
  cursor: pointer;
}
.ak-place-pop-map {
  width: 100%;
  height: 180px;
  background: #ddd;
}
.ak-place-pop-blurb {
  margin: 0;
  padding: 0.7rem 0.9rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #555);
  max-height: 240px;
  overflow-y: auto;
}

/* ── Greek/Hebrew term popover (study-terms.js) ── */
code.ak-term {
  cursor: help;
  border-bottom: 1px dotted var(--accent, #b08a3e);
  padding-bottom: 1px;
}
code.ak-term-known {
  background: rgba(176, 138, 62, 0.08);
}
.ak-term-pop {
  position: absolute;
  max-width: 380px;
  background: var(--surface-0, #fff);
  color: var(--text, #222);
  border: 1px solid var(--border, rgba(127,127,127,0.4));
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 0.9rem 1.05rem 0.7rem;
  font-size: 0.92rem;
  line-height: 1.45;
  z-index: 1000;
}
.ak-term-pop-original {
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}
.ak-term-pop-translit {
  font-style: italic;
  color: var(--text-muted, #666);
  margin-bottom: 0.25rem;
}
.ak-term-pop-gloss {
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.ak-term-pop-note {
  margin: 0.4rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary, #555);
}
.ak-term-pop-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent, #b08a3e);
  text-decoration: none;
}
.ak-term-pop-link:hover { text-decoration: underline; }
.ak-term-pop-close {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  background: transparent;
  border: 0;
  font-size: 1.1rem;
  color: var(--text-muted, #888);
  cursor: pointer;
}

/* ── Footnotes (markdown [^N]) in studies ── */
.ak-fn-ref {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
  margin-left: 0.05em;
}
.ak-fn-ref a {
  color: var(--accent, #b08a3e);
  text-decoration: none;
  padding: 0 0.2em;
  border-bottom: none;
}
.ak-fn-ref a:hover { text-decoration: underline; }
.ak-footnotes {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, rgba(127,127,127,0.2));
  font-size: 0.92rem;
}
.ak-footnotes h3 {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--text-muted, #666);
  margin: 0 0 0.5rem 0;
}
.ak-footnote-list { padding-left: 0; list-style: none; }
.ak-footnote-list li {
  padding: 0.3rem 0;
  margin-left: 1.5rem;
  text-indent: -1.5rem;
  line-height: 1.5;
}
.ak-fn-num {
  display: inline-block;
  width: 1.4rem;
  color: var(--accent, #b08a3e);
  font-weight: 600;
}
.ak-fn-pop {
  position: absolute;
  max-width: 360px;
  background: var(--surface-0, #fff);
  color: var(--text, #222);
  border: 1px solid var(--border, rgba(127,127,127,0.4));
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 0.7rem 0.9rem;
  font-size: 0.92rem;
  line-height: 1.45;
  z-index: 1000;
}
.ak-fn-pop-body { padding-right: 1.2rem; }
.ak-fn-pop-close {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  background: transparent;
  border: 0;
  font-size: 1.1rem;
  color: var(--text-muted, #888);
  cursor: pointer;
}

/* ── Bookmark button (studies / examinations) ── */
.ak-bookmark-btn {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border, rgba(127,127,127,0.3));
  border-radius: 2px;
  background: transparent;
  color: var(--text-muted, #555);
  cursor: pointer;
  margin-left: 0.4rem;
}
.ak-bookmark-btn:hover {
  border-color: var(--accent, #b08a3e);
  color: var(--accent, #b08a3e);
}
.ak-bookmark-btn.is-bookmarked {
  background: rgba(176, 138, 62, 0.1);
  border-color: rgba(176, 138, 62, 0.5);
  color: #b08a3e;
}
.study-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 1rem 0;
}

/* ── Homepage "Continue reading" tile ── */
.home-continue-card {
  border-left: 3px solid var(--accent, #b08a3e);
  margin-bottom: 1rem;
}
.home-continue-label {
  font-size: 0.78rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--text-muted, #888);
  margin-bottom: 0.3rem;
}
.home-continue-title {
  margin: 0 0 0.3rem 0;
  font-size: 1.15rem;
  line-height: 1.3;
}
.home-continue-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--accent, #b08a3e);
}

/* ── Translation picker (studies/examinations) ── */
.ak-trad-picker {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.5rem 0 1rem 0;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  background: var(--surface-1, rgba(127,127,127,0.05));
  border-left: 2px solid var(--accent, #b08a3e);
  border-radius: 2px;
}
.ak-trad-picker-label {
  color: var(--text-muted, #555);
  font-variant: small-caps;
  letter-spacing: 0.04em;
}
.ak-trad-select {
  font: inherit;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  /* Use the theme's actual variables (--bg-card and --text) — they switch
     correctly via the [data-theme="light"] attribute. Previously used
     nonexistent vars so the fallbacks left light text on white background. */
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}
.ak-trad-select option {
  background: var(--bg-card);
  color: var(--text);
}
/* Inline verse swap target — visually neutral by default. Subtle dotted
   underline on hover so users know it's a swappable quote. */
.ak-verse-inline {
  /* no border, no italic, no color change — looks like normal quoted text */
}
.ak-verse-inline:hover {
  background: rgba(176, 138, 62, 0.06);
  border-radius: 2px;
}
.ak-verse-inline.ak-verse-loading {
  opacity: 0.7;
}
.ak-verse-inline[data-tradition]::after {
  /* no badge for inline — the page picker already shows the active translation */
  content: none;
}
.ak-verse-compare-sep {
  color: var(--text-muted, #888);
  margin: 0 0.2em;
  font-size: 0.85em;
}
.ak-verse-compare-alt {
  color: var(--text-secondary, #555);
  font-style: italic;
}

/* Verse-swap loading + error states */
blockquote.ak-verse-loading {
  position: relative;
  opacity: 0.7;
}
blockquote.ak-verse-loading::before {
  content: "loading translation…";
  position: absolute;
  top: 0.2rem;
  right: 0.6rem;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-muted, #888);
  letter-spacing: 0.04em;
}
blockquote.ak-verse-error::before {
  content: "translation service unavailable — showing original";
  position: absolute;
  top: 0.2rem;
  right: 0.6rem;
  font-size: 0.7rem;
  font-style: italic;
  color: #b06868;
  letter-spacing: 0.04em;
}
/* Compare-mode (two translations stacked) */
.ak-verse-compare-row {
  margin: 0.4em 0;
  display: flex;
  gap: 0.6em;
  align-items: baseline;
}
.ak-verse-compare-label {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--text-muted, #888);
  border: 1px solid var(--border, rgba(127,127,127,0.3));
  padding: 0.05em 0.4em;
  border-radius: 2px;
  min-width: 2.5em;
  text-align: center;
}
.ak-verse-compare-row:first-child .ak-verse-compare-label {
  background: rgba(176, 138, 62, 0.1);
  border-color: rgba(176, 138, 62, 0.4);
}

/* Swapped blockquote indicator */
blockquote[data-verse-ref] {
  position: relative;
}
blockquote[data-verse-ref][data-tradition]::after {
  content: attr(data-tradition);
  position: absolute;
  bottom: 0.2rem;
  right: 0.6rem;
  font-size: 0.7rem;
  color: var(--text-muted, #888);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
}
blockquote[data-verse-ref][data-tradition="tradition-text-kjv"]::after { content: "KJV"; }
blockquote[data-verse-ref][data-tradition="tradition-text-asv"]::after { content: "ASV"; }
blockquote[data-verse-ref][data-tradition="tradition-text-web"]::after { content: "WEB"; }
blockquote[data-verse-ref][data-tradition="tradition-text-bsb"]::after { content: "BSB"; }
blockquote[data-verse-ref][data-tradition="tradition-text-ylt"]::after { content: "YLT"; }
blockquote[data-verse-ref][data-tradition="tradition-text-dra"]::after { content: "DRA"; }

/* ── Reader outage card — friendly fallback when the API is unreachable ── */
.ak-outage-card {
  border-left: 3px solid #b08a3e;
  background: rgba(176, 138, 62, 0.07);
}
.ak-outage-card code {
  font-size: 0.82rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* ── Canonical-tier banner (above chapter text for non-Protestant-canon books) ── */
.ak-canonical-banner {
  margin: 0 0 1rem 0;
  padding: 0.7rem 0.95rem;
  border-left: 3px solid var(--text-muted, #888);
  background: rgba(127, 127, 127, 0.06);
  border-radius: 2px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted, #555);
}
.ak-canonical-banner strong {
  color: var(--text, #222);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.ak-canonical-deuterocanon       { border-left-color: #b08a3e; background: rgba(176, 138, 62, 0.07); }
.ak-canonical-pseudepigrapha     { border-left-color: #7a8caa; background: rgba(122, 140, 170, 0.07); }
.ak-canonical-apostolic_fathers  { border-left-color: #6e9b7a; background: rgba(110, 155, 122, 0.07); }
.ak-canonical-nt_apocrypha       { border-left-color: #b06868; background: rgba(176, 104, 104, 0.07); }

/* Severity 2: "Not Scripture" — stronger background tint */
.ak-canonical-banner.ak-canonical-sev-2 { background: rgba(176, 138, 62, 0.12); border-left-width: 4px; }
/* Severity 3: REJECTED — red warning tone */
.ak-canonical-banner.ak-canonical-sev-3 {
  border-left-color: #c34a4a;
  border-left-width: 5px;
  background: rgba(195, 74, 74, 0.10);
  color: var(--text, #222);
}
.ak-canonical-banner.ak-canonical-sev-3 strong { color: #c34a4a; }
.ak-canonical-icon {
  display: inline-block;
  font-weight: 700;
  font-size: 1.05em;
  margin-right: 0.15em;
  opacity: 0.85;
}

/* ── Word-study markers — small glyph on annotated verses ──── */
.ak-ws-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.25rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-family: 'EB Garamond', 'Crimson Pro', Georgia, serif;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.ak-ws-marker:hover {
  background: var(--accent);
  color: var(--bg, #fff);
}
.ak-ws-marker[data-lang="hebrew"],
.ak-ws-marker[data-lang="aramaic"] {
  font-size: 0.9rem;
}
.ak-ws-popover {
  margin: 0.5rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-1, rgba(127,127,127,0.06));
  border-radius: 0 4px 4px 0;
  font-family: 'EB Garamond', 'Crimson Pro', Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  max-width: 640px;
  position: relative;
}
.ak-ws-pop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}
.ak-ws-pop-lang {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.ak-ws-pop-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.ak-ws-pop-close:hover { color: var(--text); }
.ak-ws-pop-original {
  font-size: 1.25rem;
  margin: 0.2rem 0 0.1rem;
  color: var(--text);
}
.ak-ws-pop-translit {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.ak-ws-pop-note {
  margin: 0.5rem 0 0.7rem;
}
.ak-ws-pop-link {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.ak-ws-pop-link:hover { text-decoration: underline; }
