/* ==========================================================================
   Bible Navigator - Visual Design
   Calm, intentional, warm. Headspace meets a beautiful study Bible.
   ========================================================================== */

/* ---------- World-Class Color Scheme | Light + Dark ---------- */
/* Light Mode: Warm, elegant, premium study Bible on fine paper */
:root {
  --color-bg: #f9f5ed;              /* Cleaner, warmer cream */
  --color-bg-alt: #f2ebdf;          /* Soft deeper cream */
  --color-surface: #fffdf8;         /* Warm off-white */
  --color-text: #2c2721;            /* Rich deep brown-black */
  --color-text-muted: #544d44;      /* Darker muted for better contrast */
  --color-primary: #3f2c23;         /* Refined deep walnut */
  --color-primary-light: #5f4738;
  --color-primary-dark: #241b16;
  --color-accent: #8b6914;          /* Richer illuminated manuscript gold */
  --color-accent-light: #a07a1a;
  --color-accent-soft: rgba(139, 105, 20, 0.10);
  --color-border: #ddd0b8;          /* Slightly stronger for card definition */
  --color-border-light: #e8dcc8;
  --color-link: #4a3728;
  --color-link-hover: #5c4638;
  --color-nav-bg: #1f1a15;
  --color-nav-text: #f5efe8;
  --color-nav-active: #c5a46f;      /* Beautiful warm gold */
  --color-verse-num: #8a7f6f;
  --color-hero-start: #2c241b;
  --color-hero-end: #463528;

  /* Typography */
  --font-ui: 'Inter', -apple-system, system-ui, sans-serif;
  --font-reading: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-reading-display: 'EB Garamond', Georgia, serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'Menlo', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.875rem;
  --space-lg: 1.5rem;
  --space-xl: 2.25rem;
  --space-2xl: 3.5rem;

  /* Radius & Shadows */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(44, 36, 22, 0.05), 0 4px 12px rgba(44, 36, 22, 0.04);
  --shadow-hover: 0 10px 30px rgba(44, 36, 22, 0.1);
  --shadow-card: 0 1px 2px rgba(44, 36, 22, 0.03), 0 6px 18px rgba(44, 36, 22, 0.05);
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.03);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --max-width: 1080px;
  --max-width-narrow: 720px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-reading);
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: linear-gradient(160deg, #f9f5ed 0%, #f5ede0 25%, #f0e8d8 50%, #f5ede0 75%, #f9f5ed 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Disable fixed background on mobile (causes scroll jank on iOS) */
@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }
}

/* Subtle page fade-in */
main {
  animation: pageIn 0.35s ease;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

@keyframes pageIn {
  from { opacity: 0.9; }
  to { opacity: 1; }
}

/* ---------- Safe Area Insets (iPhone notch, Dynamic Island, Android gestures) ---------- */
@supports (padding: env(safe-area-inset-top)) {
  .container {
    padding-left: calc(2rem + env(safe-area-inset-left));
    padding-right: calc(2rem + env(safe-area-inset-right));
  }

  .chapter-sticky-bar {
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
  }

  .breadcrumbs {
    padding-left: calc(2rem + env(safe-area-inset-left));
    padding-right: calc(2rem + env(safe-area-inset-right));
  }

  .back-to-top {
    bottom: calc(2rem + env(safe-area-inset-bottom));
    right: calc(2rem + env(safe-area-inset-right));
  }

  .copy-toast {
    bottom: calc(2rem + env(safe-area-inset-bottom));
  }
}

/* brand-domain hidden at 768px in responsive section below */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  line-height: 1.15;
  margin-top: 0;
  color: var(--color-primary-dark);
  letter-spacing: -0.025em;
  font-feature-settings: "tnum";
}

h1 { font-size: 2.35rem; font-weight: 800; margin-bottom: var(--space-lg); }
h2 { font-size: 1.55rem; font-weight: 700; margin-bottom: var(--space-md); letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: var(--space-sm); }
h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: var(--space-sm); }

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover,
a:focus {
  color: var(--color-link-hover);
  text-decoration: underline;
}

/* Focus rings for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  /* Remove ugly tap highlight, use our active states instead */
  a, button, .verse, .feature-card, .dim-card, .home-card, .nav-card {
    -webkit-tap-highlight-color: rgba(160, 125, 61, 0.15);
  }
  /* Eliminate 300ms tap delay */
  a, button, input, select, textarea, label {
    touch-action: manipulation;
  }
  /* Stronger active feedback for touch */
  a:active, button:active {
    opacity: 0.85;
    transition: opacity 0.05s;
  }
  .verse:active {
    background-color: rgba(139, 105, 20, 0.12);
  }
  /* Prevent text selection on interactive elements during tap */
  .nav-toggle, .filter-pill, .audio-toggle, .reading-control-btn {
    -webkit-user-select: none;
    user-select: none;
  }
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

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

/* ---------- Reduced Motion (accessibility) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Navigation Bar - Premium refined ---------- */
.navbar {
  display: flex;
  align-items: center;
  width: 100%;
  background-color: var(--color-nav-bg);
  padding: 0 2rem;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: calc(2rem + env(safe-area-inset-left, 0px));
  padding-right: calc(2rem + env(safe-area-inset-right, 0px));
  height: auto;
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 1100;
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Ensure navbar is sticky on desktop */
@media (min-width: 769px) {
  .navbar {
    position: sticky;
  }
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-nav-text);
  text-decoration: none;
  white-space: nowrap;
}

.navbar-brand:hover {
  color: var(--color-nav-active);
  text-decoration: none;
}

.brand-icon {
  font-size: 1.3rem;
  color: var(--color-nav-active);
}

.brand-text {
  letter-spacing: -0.02em;
}

.brand-domain {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: normal;
  opacity: 0.6;
  margin-left: 0.3rem;
  vertical-align: middle;
}

/* Prominent Listen CTA in header (desktop only) */
.nav-cta {
  display: none;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--color-accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.81rem;
  font-weight: 600;
  padding: 0.32rem 0.95rem 0.32rem 0.65rem;
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 2px 8px rgba(160, 125, 61, 0.25);
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(160, 125, 61, 0.35);
  filter: brightness(1.08);
}

.nav-cta svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

@media (min-width: 769px) {
  .nav-cta {
    display: inline-flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
  }
  .nav-cta:hover {
    transform: translateX(-50%) translateY(-1px);
  }
}

/* ---------- Nav Toggle (Mobile Hamburger) ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition);
}

.nav-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-nav-text);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ---------- Nav Items ---------- */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
}

.navbar-nav > li {
  display: inline-block;
}

.navbar-nav > li > a {
  display: block;
  padding: 0.45rem 0.65rem;
  color: var(--color-nav-text);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  letter-spacing: 0.01em;
}

.navbar-nav > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 2px;
  background-color: var(--color-nav-active);
  transition: left var(--transition), right var(--transition);
  border-radius: 1px;
}

.navbar-nav > li > a:hover {
  color: var(--color-nav-active);
  text-decoration: none;
}

.navbar-nav > li > a:hover::after {
  left: 20%;
  right: 20%;
}

.navbar-nav > li > a.active {
  color: var(--color-nav-active);
  font-weight: 600;
}

.navbar-nav > li > a.active::after {
  left: 15%;
  right: 15%;
  background-color: var(--color-nav-active);
}

/* ---------- Dropdown (Legacy - kept for mobile fallback) ---------- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  cursor: pointer;
}
/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  background-color: var(--color-bg-alt);
  padding: 0.6rem 2rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 56px;
  z-index: 1090;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.breadcrumbs li::after {
  content: '›';
  margin-left: 0.4rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.breadcrumbs li:last-child::after {
  content: '';
}

.breadcrumbs a {
  color: var(--color-primary);
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs li[aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

/* ---------- Main Container - Premium spacious layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.25rem 2rem 4rem;
  min-height: calc(100vh - 180px);
}

/* Better vertical rhythm for content sections */
.character-detail-page,
.miracle-detail,
.theme-detail,
.geography-detail,
.parable-detail {
  margin: 0 auto;
}

.character-detail-page > section,
.miracle-detail > section,
.theme-detail > section {
  margin-bottom: var(--space-xl);
}

/* Premium detail page typography */
.character-detail-page h1,
.miracle-detail h1,
.theme-detail h1 {
  font-size: 2.15rem;
  margin-bottom: 0.6rem;
}

.character-bio,
.detail-description {
  font-size: 1.05rem;
  line-height: 1.75;
  width: 100%;
  max-width: 100%;
}

/* Ensure intro paragraphs just below hero images on all detail pages use full content width */
.character-detail-page > p,
.timeline-event-detail > p,
.event-description {
  width: 100%;
  max-width: 100%;
}

/* Key chapters / bidirectional connections on detail pages */
.key-chapters {
  margin: 0.85rem 0 1.4rem;
}
.key-chapters-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 0.35rem;
}
.key-chapters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.key-chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.65rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-link);
  text-decoration: none;
  transition: all var(--transition);
}
.key-chapter-pill:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-alt);
  text-decoration: none;
}
.key-chapter-pill .pill-count {
  font-size: 0.65rem;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  padding: 0.02rem 0.3rem;
  border-radius: 4px;
}

/* ---------- Hero Section ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-hero-start) 0%, var(--color-hero-end) 100%);
  padding: 5rem 2rem;
  text-align: center;
  margin: -2.5rem -2rem 3rem -2rem;
  width: calc(100% + 4rem);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(212, 168, 83, 0.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(212, 168, 83, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
}

.hero-content {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-ui);
  font-size: 2.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin: 0 0 2rem 0;
}

.hero-cta {
  display: inline-block;
  padding: 0.8rem 2rem;
  background-color: var(--color-accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
  background-color: #c99a0c;
  color: #fff;
  text-decoration: none;
}

/* ---------- Home Sections ---------- */
.home-sections {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.home-section {
  /* grouped cards */
}

.section-heading {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--color-accent);
}

.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* ---------- Group Headings (Category Sections) ---------- */
.group-heading {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 1rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-border);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 50px;
  background-color: var(--color-accent-soft);
  color: var(--color-primary);
  border: 1px solid rgba(184, 134, 11, 0.2);
}

/* ---------- Feature Cards ---------- */
.feature-card {
  display: block;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
}

.feature-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-hover);
  border-left-color: var(--color-accent);
  text-decoration: none;
}

.feature-card--primary {
  border-left-color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-alt) 100%);
}

.feature-icon {
  display: block;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.feature-card h3 {
  font-family: var(--font-ui);
  color: var(--color-primary);
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
}

.feature-card p {
  color: var(--color-text-muted);
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ==========================================================================
   Premium Book & Chapter Pages - Design + Usability Overhaul
   ========================================================================== */

/* --- Books Index: Elevated Cards --- */
.book-group {
  margin-bottom: 3rem;
}

.book-group h2 {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
}

.testament-summary {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

/* Modern Book Cards (replacing character-item reuse) */
.book-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
  align-items: stretch;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-accent);
  text-decoration: none;
}

.book-card .book-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.book-card .book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-card .book-info {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1.1rem 1rem;
}

.book-card .book-title {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.25rem;
  line-height: 1.25;
}

.book-card .book-meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.book-card .book-summary {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--color-text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card .book-outline-preview {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.book-card .book-outline-preview strong {
  color: var(--color-accent);
}

/* Filter improvements - see main filter section below */

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-right: 0.5rem;
}

.filter-pill {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* --- Chapters Page: Stronger Hierarchy --- */
.book-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.book-header-main {
  flex: 1;
  min-width: 260px;
}

.book-header-main h1 {
  font-size: 2.1rem;
  margin-bottom: 0.35rem;
  line-height: 1.1;
}

.book-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.book-header-meta a {
  color: var(--color-accent);
}

.book-header .book-cover-large {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}

.book-header .book-cover-large img {
  width: 100%;
  height: auto;
  display: block;
}

/* Book hero image shown at the top of Chapter 1 in the reading view */
.chapter-book-hero {
  margin: 0 auto 1.5rem;
  max-width: 860px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.09);
  border: 1px solid #d8c9a8;
  background: #f4ecdf;
}
.chapter-book-hero-img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .chapter-book-hero {
    margin-bottom: 1rem;
    border-radius: 10px;
  }
}

.book-glance {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: var(--color-bg-alt);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.25rem 0 1.75rem;
  font-size: 0.9rem;
}

.book-glance-item {
  display: flex;
  flex-direction: column;
}

.book-glance-item strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 0.15rem;
}

/* Prominent primary action */
.primary-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-accent);
  color: white;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  margin: 0.75rem 0 1.25rem;
  box-shadow: 0 4px 14px rgba(160, 125, 61, 0.3);
  transition: all var(--transition);
}

.primary-cta:hover {
  background: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(160, 125, 61, 0.35);
  color: white;
  text-decoration: none;
}

/* Improved chapter list */
.chapter-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chapter-list-item {
  display: flex;
  align-items: center;
}

.chapter-list-item .chapter-list-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  transition: all var(--transition);
}

.chapter-list-item .chapter-list-link:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-alt);
  box-shadow: var(--shadow);
}

/* The clickable title/info portion inside the pill */
.chapter-list-item .chapter-main-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}

.chapter-list-item .chapter-number {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  min-width: 2rem;
  flex-shrink: 0;
  text-align: center;
}

.chapter-list-item .chapter-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.chapter-list-item .chapter-title-text {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-ui);
}

.chapter-meta-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.chapter-verses,
.chapter-duration {
  white-space: nowrap;
}

.chapter-duration::before {
  content: '•';
  margin-right: 0.6rem;
  opacity: 0.4;
}

.chapter-characters {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  color: var(--color-accent);
  font-weight: 500;
}

.chapter-characters::before {
  content: '•';
  margin-right: 0.6rem;
  opacity: 0.4;
  color: var(--color-text-muted);
}

.chapter-list-item .chapter-read-badge {
  color: var(--color-accent);
  font-size: 0.95rem;
}

/* Chapter action buttons (download + listen) inside the pill */
.chapter-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}

.chapter-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}

.chapter-action-btn svg {
  flex-shrink: 0;
}

.chapter-download-btn {
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.chapter-download-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

.chapter-listen-btn {
  background: var(--color-accent);
  color: #fff;
  border: none;
}

.chapter-listen-btn:hover {
  filter: brightness(1.1);
  text-decoration: none;
  color: #fff;
}

.chapter-read-btn {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.chapter-read-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

@media (max-width: 600px) {
  .chapter-action-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.68rem;
  }
  .chapter-action-btn span {
    display: none;
  }
}

/* View toggle polish */
.view-toggle {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.view-toggle-btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.view-toggle-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* Facts section upgrade */
.book-facts {
  margin-top: 2.75rem;
  padding: 1.5rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
}

.book-facts .section-heading {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.facts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem 1.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.fact-item {
  font-size: 0.92rem;
  line-height: 1.5;
  position: relative;
  padding-left: 1.1rem;
}

.fact-item::before {
  content: "•";
  color: var(--color-accent);
  position: absolute;
  left: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .book-header {
    flex-direction: column;
  }
  .book-header .book-cover-large {
    width: 100%;
    max-width: 420px;
  }
  .book-glance {
    flex-direction: column;
    gap: 0.85rem;
  }
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.4rem 1.5rem;
}

.book-list li {
  padding: 0.4rem 0;
}

.book-list a {
  font-weight: 500;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.chapter-count {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  margin-left: 0.3rem;
}

/* ---------- Book Summary ---------- */
.book-summary {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0.25rem 0 0.5rem 0;
}

/* ---------- Chapter Title (reading page) ---------- */
.chapter-title {
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-style: italic;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

.book-author {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.book-author a {
  color: var(--color-primary);
  font-weight: 500;
}

/* ---------- Chapter List ---------- */
.chapter-list-item .chapter-number {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
  min-width: 2rem;
}

.chapter-list-item .chapter-title-text {
  color: var(--color-text);
  font-size: 0.95rem;
}

.chapter-list-item > .chapter-list-link:first-child {
  flex: 1;
}
.chapter-play-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-accent) !important;
  color: #fff !important;
  font-size: 0.75rem;
  text-decoration: none !important;
  margin-right: 0;
  transition: transform 0.15s, opacity 0.15s;
  flex-shrink: 0;
  line-height: 1;
  border: none !important;
  padding: 0;
  min-width: 36px;
}
.chapter-play-btn:hover {
  transform: scale(1.1);
  opacity: 0.9;
  text-decoration: none !important;
  color: #fff !important;
  background: var(--color-accent) !important;
  box-shadow: none !important;
}

/* Play All button on book page */
.book-progress-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.book-progress-row .book-progress {
  flex: 1;
  margin: 0;
}
.btn-play-all {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 1rem;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}
.btn-play-all:hover {
  transform: scale(1.03);
  opacity: 0.9;
  text-decoration: none;
  color: #fff;
}

/* ---------- Chapter Grid ---------- */

/* Book Navigation Bar (prev/next book on chapters page) */
.book-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}
.book-nav-prev, .book-nav-next {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-decoration: none;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-nav-prev:hover, .book-nav-next:hover {
  color: var(--color-accent);
}
.book-nav-center {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-decoration: none;
}
.book-nav-center:hover {
  color: var(--color-accent);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.chapter-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}

.chapter-link:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  text-decoration: none;
  transform: scale(1.05);
}

/* ---------- Verse / Chapter Text - Premium Reading Experience ---------- */
.chapter-text {
  max-width: 100%;
  margin: 2rem auto;
  padding: 2.5rem 3rem;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border-light);
  font-family: var(--font-reading);
  font-size: 2.0rem;
  line-height: 1.85;
  font-feature-settings: "kern" 1, "tnum" 1, "onum" 1;
  text-rendering: optimizeLegibility;
}

.verse {
  margin: 0 0 0.45rem 0;
  text-indent: -0.25rem;
  padding-left: 0.25rem;
  line-height: 1.82;
  font-size: inherit;
  clear: none;
  transition: background-color 0.2s ease;
  scroll-margin-top: 220px;
}

.verse-number {
  font-family: var(--font-ui);
  font-size: 0.61rem;
  font-weight: 600;
  color: var(--color-verse-num);
  vertical-align: super;
  margin-right: 0.22rem;
  line-height: 0;
  letter-spacing: 0.03em;
  opacity: 0.65;
}

sup.verse-number {
  font-size: 0.62em;
}

.verse-text {
  line-height: 1.82;
  font-size: 1.08rem;
}

/* Subtle verse hover for better interaction */
.verse:hover {
  background-color: rgba(139, 105, 20, 0.035);
  border-radius: 3px;
}

.verse-text .verse {
  display: inline;
}

/* ---------- Verse Highlighting ---------- */
.verse-highlighted {
  background-color: var(--color-accent-soft);
  border-radius: 0;
  padding-left: 0.2rem;
  margin-left: -0.2rem;
}

.verse-highlighted:first-of-type {
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.verse-highlighted:last-of-type {
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.highlight-wrapper {
  background-color: var(--color-accent-soft);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin: 1rem -1rem;
  /* Generous offset so the highlight box doesn't get hidden behind the sticky navbar + chapter bar */
  scroll-margin-top: 180px;
}

/* ---------- Red Letter (Jesus's Words) ---------- */
.verse-red-letter {
  color: #9f2a2a; /* Rich, elegant deep red */
  position: relative;
}

.verse-red-letter::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: 1.4em;
  height: 1.4em;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32' fill='%239f2a2a'%3E%3Crect x='10' y='0' width='4' height='32' rx='1'/%3E%3Crect x='3' y='8' width='18' height='4' rx='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  pointer-events: none;
}

.verse-red-letter .verse-number {
  color: #9f2a2a;
}

/* ---------- Passage Links ---------- */
.passage-link {
  color: var(--color-primary);
  text-decoration: underline;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.passage-link:hover {
  color: var(--color-link-hover);
}

/* ---------- Chapter Navigation ---------- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.chapter-nav a {
  padding: 0.55rem 1.2rem;
  border-radius: 50px;
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  font-weight: 500;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}

.chapter-nav a:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.chapter-nav .disabled {
  visibility: hidden;
}

.back-to-chapters {
  font-weight: 500;
}

/* ---------- Timeline ---------- */
.timeline-list h1 {
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.6rem;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  padding: 0.5rem 1rem;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  font-family: var(--font-ui);
  font-size: 0.75rem;
}

/* ---------- Certainty Badges ---------- */
.certainty-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 50px;
  vertical-align: middle;
  white-space: nowrap;
}

.certainty-confirmed {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.certainty-approximate {
  background-color: #fff8e1;
  color: #f57f17;
  border: 1px solid #ffe082;
}

.certainty-traditional {
  background-color: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ce93d8;
}

.historical-source {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.timeline-list > p {
  display: none;
}
}

.timeline-era {
  margin-bottom: 2.5rem;
  position: relative;
  padding-left: 1.5rem;
  border-left: 3px solid var(--color-accent);
}

.timeline-era h2 {
  color: var(--color-primary);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.9rem;
  background-color: var(--color-bg-alt);
  border-radius: 50px;
  display: inline-block;
}

.timeline-events {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-event-item {
  position: relative;
}

.timeline-event-item::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 1rem;
  width: 10px;
  height: 10px;
  background-color: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-bg);
}

.timeline-event-item a {
  display: block;
  padding: 1.1rem 1.4rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.timeline-event-item a:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--color-accent);
  text-decoration: none;
  transform: translateX(4px);
}

.timeline-event-item h3 {
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}

.event-date {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent);
  background-color: var(--color-accent-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  margin-bottom: 0.4rem;
}

.timeline-event-item p {
  color: var(--color-text-muted);
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
}

/* ---------- Timeline Event Detail ---------- */
.timeline-event-detail h1 {
  margin-bottom: 1rem;
}

.event-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.event-meta dt {
  font-weight: 600;
  color: var(--color-text-muted);
}

.event-meta dd {
  margin: 0;
  color: var(--color-text);
}

.event-description {
  font-size: 1.05rem;
  margin-bottom: 2rem;
  color: var(--color-text-muted);
}

/* ---------- Character List ---------- */
.character-list-page h1,
.beginners-page h1 {
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.6rem;
}

.character-list-page > .character-bio {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.character-search {
  margin-bottom: 0.6rem;
}

.character-search input {
  width: 100%;
  padding: 0.5rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: 50px;
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.character-search input:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(107, 66, 38, 0.1);
}

.character-search input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Single-column list layout for text-heavy pages */
.character-list.list-layout {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.list-layout .character-item a {
  padding: 1rem 1.25rem;
}

.list-layout .character-name {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.list-layout .character-description {
  font-size: 0.85rem;
}

.character-item a {
  display: block;
  padding: 1.4rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: var(--shadow-card);
  border-left: 3px solid transparent;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition), background-color var(--transition);
}

.character-item a:hover {
  box-shadow: var(--shadow-hover);
  border-left-color: var(--color-accent);
  transform: translateY(-3px);
  text-decoration: none;
  background-color: var(--color-surface);
}

.character-name {
  color: var(--color-primary);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.character-description {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.5;
  font-family: var(--font-ui);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Major character badge */
.major-badge {
  color: var(--color-accent);
  font-size: 0.75em;
  vertical-align: middle;
}

.no-results {
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  padding: 2rem 0;
}

/* ---------- Character Detail ---------- */
.character-detail-page h1 {
  margin-bottom: 0.5rem;
}

.character-bio {
  font-size: 1.12rem;
  color: var(--color-text);
  margin-bottom: 2rem;
  line-height: 1.85;
  width: 100%;
  max-width: 100%;
  font-family: var(--font-reading);
  letter-spacing: 0.01em;
  padding: 1.5rem 1.75rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-subtle);
  position: relative;
}

.character-bio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-accent-light));
  border-radius: 4px 0 0 4px;
}

/* Audio player for narrated descriptions */
.bio-audio-player {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-light);
}

.bio-audio-player audio {
  display: none;
}

.bio-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.2s;
}

.bio-play-btn:hover {
  transform: scale(1.08);
  background: var(--color-accent-light);
}

.bio-play-btn:active {
  transform: scale(0.95);
}

.bio-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  min-width: 60px;
}

.bio-progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s linear;
}

.bio-time {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  min-width: 2.5rem;
  text-align: right;
}

.bio-audio-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
}

.bio-autoplay-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.bio-autoplay-toggle input {
  width: 12px;
  height: 12px;
  accent-color: var(--color-accent);
  cursor: pointer;
  margin: 0;
}

.bio-autoplay-text {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
}

/* Inline links in bio descriptions (characters, places, themes) */
.bio-inline-link {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--color-accent);
  transition: border-color 0.2s, color 0.2s;
}

.bio-inline-link:hover {
  color: var(--color-accent-light);
  border-bottom-style: solid;
  text-decoration: none;
}

.character-passages {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---------- Collapsible Passages ---------- */
details.passage-section {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 1.05rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

details.passage-section:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-card);
}

details.passage-section[open] {
  padding-bottom: 1.65rem;
  box-shadow: var(--shadow-card);
}

details.passage-section summary.passage-summary {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

details.passage-section summary.passage-summary::-webkit-details-marker {
  display: none;
}

details.passage-section summary.passage-summary::before {
  content: '▸';
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details.passage-section[open] summary.passage-summary::before {
  transform: rotate(90deg);
}

details.passage-section summary.passage-summary:hover {
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

details.passage-section summary .passage-label {
  margin: 0;
  font-size: 1rem;
}

details.passage-section summary .passage-link {
  margin: 0;
}

details.passage-section .passage-commentary {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.6;
  padding: 0.85rem 1.65rem;
  margin: 0;
  border-left: 4px solid var(--color-accent);
  background-color: var(--color-bg-alt);
}

details.passage-section .verse-text {
  padding: 0 1.5rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  margin-top: 0;
}

details.event-passage {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

details.event-passage summary {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  list-style: none;
}

details.event-passage summary::-webkit-details-marker {
  display: none;
}

details.event-passage .verse-text {
  padding: 0 1.5rem 1.5rem;
}

.passage-label {
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.passage-reference {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.no-verses {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ---------- Error Pages ---------- */
.error-page {
  text-align: center;
  padding: 4rem 1rem;
}

.error-page h1 {
  font-size: 2.5rem;
  color: var(--color-primary-dark);
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-family: var(--font-ui);
}

.error-nav {
  text-align: center;
}

.error-nav p {
  margin-bottom: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
}

.error-nav ul {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.error-nav a {
  font-weight: 500;
  font-family: var(--font-ui);
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 4rem;
  border-top: none;
  background-color: var(--color-nav-bg);
  color: var(--color-nav-text);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.3rem 0;
}

.footer-domain {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: normal;
  opacity: 0.6;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.footer-text {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0.15rem 0;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-links a:hover {
  color: var(--color-nav-active);
}

/* ---------- Legacy Home Page (kept for compatibility) ---------- */
.home-intro {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 1rem 0;
}

.home-intro h1 {
  font-size: 2rem;
  color: var(--color-primary-dark);
}

.home-intro p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.nav-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.nav-card {
  display: block;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.nav-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-accent);
  text-decoration: none;
}

.nav-card h2 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

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

/* ==========================================================================
   Responsive - Mobile (below 768px)
   ========================================================================== */
@media (max-width: 900px) {
  .navbar-nav > li > a {
    padding: 0.45rem 0.5rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 768px) {
  /* Navigation - show hamburger, hide nav */
  .nav-toggle {
    display: flex;
  }

  .navbar {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    padding-left: calc(1rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1rem + env(safe-area-inset-right, 0px));
    height: auto;
    min-height: 52px;
    align-items: center;
    gap: 0;
  }

  .navbar-brand {
    font-size: 1rem;
    flex: 1;
  }

  .brand-domain {
    display: none;
  }

  .brand-icon {
    font-size: 1.1rem;
  }

  .nav-toggle {
    margin-left: auto;
    width: 40px;
    height: 40px;
    padding: 10px;
  }

  .navbar-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 0;
    order: 3;
  }

  .navbar-nav.nav-open {
    display: flex;
  }

  .navbar-nav > li {
    display: block;
  }

  .navbar-nav > li > a {
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
  }

  /* Dropdown on mobile - always visible when nav open */
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background-color: transparent;
    padding: 0 0 0 1rem;
    margin-top: 0;
    min-width: auto;
  }

  .nav-dropdown-menu li a {
    color: var(--color-nav-text);
    padding: 0.4rem 0.85rem;
  }

  .nav-dropdown-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--color-nav-active);
  }

  .dropdown-section-label {
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 0.85rem 0.2rem;
  }

  .dropdown-section-label:not(:first-child) {
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  /* Container */
  .container {
    padding: 1.5rem 1rem;
  }

  /* Hero */
  .hero {
    padding: 3rem 1.25rem;
    margin: -1.5rem -1rem 2rem -1rem;
    width: calc(100% + 2rem);
  }

  .hero-title {
    font-size: 2rem;
  }

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

  /* Home sections */
  .section-cards {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .feature-card {
    padding: 1.25rem;
  }

  /* Legacy home cards */
  .nav-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .nav-card {
    padding: 1.5rem 1.25rem;
  }

  /* Book list - single column */
  .book-list {
    grid-template-columns: 1fr;
  }

  /* Chapter list */
  .chapter-list-item .chapter-list-link {
    padding: 0.5rem 0.75rem;
  }

  /* Chapter grid - smaller cells */
  .chapter-grid {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 0.4rem;
  }

  /* Verse text */
  .chapter-text {
    margin: 1rem auto;
    padding: 1.25rem;
    font-size: 1rem;
  }

  /* Chapter navigation */
  .chapter-nav {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  /* Timeline */
  .timeline-era {
    padding-left: 1rem;
  }

  .timeline-event-item::before {
    left: -1.3rem;
    width: 8px;
    height: 8px;
  }

  /* Character list - single column */
  .character-list {
    grid-template-columns: 1fr;
  }

  /* Filter pills - horizontal scroll on mobile */
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Headings */
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }

  /* Breadcrumbs */
  .breadcrumbs {
    padding: 0.5rem 1rem;
  }

  .breadcrumbs ol {
    font-size: 0.78rem;
  }

  /* Touch-friendly form controls */
  input[type="text"], input[type="search"], select, .chapter-jump-select {
    min-height: 44px;
  }
}

/* ==========================================================================
   Print styles (see enhanced version at end of file)
   ========================================================================== */


/* ---------- Character Portrait ---------- */
.character-portrait {
  text-align: center;
  margin-bottom: 2rem;
}

.character-portrait img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  margin-bottom: 1rem;
}

.portrait-placeholder {
  width: 100%;
  height: 200px;
  background-color: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait-icon {
  font-size: 3rem;
  opacity: 0.4;
}

.portrait-actions {
  margin-top: 0.75rem;
}

.btn-generate,
.btn-regenerate {
  padding: 0.5rem 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
}

.btn-generate {
  background-color: var(--color-accent);
  color: #fff;
}

.btn-generate:hover {
  background-color: #c99a0c;
  transform: translateY(-1px);
}

.btn-regenerate {
  background-color: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  margin-left: 0.5rem;
}

.btn-regenerate:hover {
  background-color: var(--color-border);
}

.portrait-loading {
  padding: 1rem;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-style: italic;
}

/* ---------- Character Portrait ---------- */
.character-portrait {
  margin-bottom: 2rem;
  text-align: center;
}

.portrait-actions {
  margin-top: 0.75rem;
}

.btn-generate,
.btn-regenerate {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: 50px;
  background-color: var(--color-surface);
  color: var(--color-primary);
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn-generate:hover,
.btn-regenerate:hover {
  background-color: var(--color-bg-alt);
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.portrait-status {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ---------- Related Section - Premium, calm, elegant ---------- */
.related-section {
  margin-top: 3.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--color-border-light);
}

.related-section h2 {
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
}

.related-intro {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin: 0 0 0.85rem;
  line-height: 1.4;
}

.mention-count {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  margin-left: 0.25rem;
  white-space: nowrap;
}

.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 1.35rem;
}

.related-group h3 {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-accent);
  margin-bottom: 0.55rem;
}

.nearby-note {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-muted);
  opacity: 0.75;
}

.nearby-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.nearby-header h3 {
  margin-bottom: 0;
}

.related-group ul {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.related-group li a {
  font-family: var(--font-ui);
  font-size: 0.94rem;
  color: var(--color-text);
  transition: color var(--transition);
}

.related-group li a:hover {
  color: var(--color-primary);
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  align-items: center;
}

.filter-bar input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: 50px;
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-bar input[type="text"]::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.filter-bar input[type="text"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.1);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.filter-group {
  margin-bottom: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border);
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.filter-row:last-child {
  margin-bottom: 0;
}
.filter-row-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  min-width: 65px;
  padding-top: 0.35rem;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .filter-row {
    flex-direction: column;
    gap: 0.25rem;
  }
  .filter-row-label {
    min-width: auto;
    padding-top: 0;
  }
}

.filter-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 0.25rem 0.4rem 0.25rem 0;
  align-self: center;
}

.filter-pill {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: 50px;
  background-color: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.filter-pill:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.filter-pill.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(92, 61, 46, 0.2);
}

/* ---------- Biography Card ---------- */
.bio-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.65rem 1.85rem;
  margin-bottom: 2.25rem;
  box-shadow: var(--shadow-card);
}

.bio-card h2 {
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--color-border-light);
}

.bio-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.bio-grid dt {
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.bio-grid dd {
  margin: 0;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .bio-grid {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .bio-grid dt {
    margin-top: 0.5rem;
  }
}


/* ---------- Leaflet Map ---------- */
.leaflet-map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 1;
}

.leaflet-map--detail {
  height: 300px;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .leaflet-map {
    height: 280px;
  }
  .leaflet-map--detail {
    height: 220px;
  }
}

/* ---------- Drop Cap ---------- */
.dropcap {
  float: left;
  width: 90px;
  height: 90px;
  margin: 0.12rem 0.6rem 0.1rem 0;
  border-radius: 3px;
  object-fit: cover;
  shape-outside: margin-box;
}

.dropcap-fallback {
  float: left;
  font-size: 4.5rem;
  line-height: 0.8;
  font-family: Georgia, serif;
  font-weight: bold;
  color: var(--color-primary-dark);
  margin: 0 0.35rem 0 0;
  padding-top: 0.05rem;
}

.verse-first {
  line-height: 1.7;
  text-indent: 0 !important;
  display: block !important;
  min-height: 75px; /* ensure space for larger dropcap */
}

.verse-first .verse-number {
  font-size: 0.6em;
  vertical-align: super;
  margin-right: 0.1rem;
}

@media (max-width: 768px) {
  .dropcap {
    width: 66px;
    height: 66px;
  }
  .verse-first {
    min-height: 55px;
  }
  .dropcap-fallback {
    font-size: 3.3rem;
  }
}

/* ---------- Verse of the Day ---------- */
.verse-of-the-day {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.5rem;
  padding: 2rem 1.5rem;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.votd-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.votd-text {
  font-family: var(--font-reading);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--color-text);
  margin: 0 0 0.75rem;
  font-style: italic;
  border: none;
  padding: 0;
}

.votd-ref {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: normal;
}

/* ---------- Quick Start ---------- */
.quick-start {
  margin-bottom: 3rem;
}

.quick-start-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}

.quick-action:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.5rem 0;
  margin-bottom: 3rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

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

/* ---------- How to Use ---------- */
.how-to-use {
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.how-to-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.how-to-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.how-to-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.how-to-card h3 {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin: 0 0 0.5rem;
}

.how-to-card p {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ---------- Footer Links ---------- */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.footer-links a {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer-links a:hover {
  color: var(--color-primary);
}

/* ---------- Legal Pages ---------- */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.legal-page h1 {
  font-family: var(--font-ui);
  font-size: 1.8rem;
  color: var(--color-primary-dark);
  margin-bottom: 0.25rem;
}

.legal-updated {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.legal-section p {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.legal-section ul {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--color-text);
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-section li {
  margin-bottom: 0.3rem;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  margin-top: 1rem;
}

.cookie-table th,
.cookie-table td {
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.cookie-table th {
  font-weight: 600;
  color: var(--color-primary-dark);
  background-color: var(--color-bg-alt);
}

.cookie-table td {
  color: var(--color-text);
}

/* ---------- Reading Plan Config ---------- */
.reading-plan-config {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.reading-plan-config label {
  font-weight: 600;
  color: var(--color-text-muted);
}

.reading-plan-config input[type="date"] {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-text);
  background-color: var(--color-surface);
}

.reading-date {
  min-width: 3.5rem;
  font-size: 0.8rem;
  color: var(--color-accent);
}

/* ---------- Responsive: New Sections ---------- */
@media (max-width: 768px) {
  .stats-bar {
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  .stat-number {
    font-size: 1.2rem;
  }
  .quick-start-actions {
    flex-direction: column;
    align-items: center;
  }
  .how-to-cards {
    grid-template-columns: 1fr;
  }
  .verse-of-the-day {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

/* ---------- Reading Plan Progress ---------- */
.progress-container {
  width: 100%;
  height: 6px;
  background-color: var(--color-border);
  border-radius: 3px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

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

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

.reading-check {
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- Nav Search Link ---------- */
.nav-search-link {
  font-size: 1rem;
  padding: 0.45rem 0.6rem !important;
}

/* Search shown as a button on desktop */
.nav-search-label {
  display: none;
}
@media (min-width: 769px) {
  .nav-search-button {
    display: inline-flex !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.85rem !important;
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }
  .nav-search-button:hover {
    background-color: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.28);
  }
  .nav-search-button .nav-search-label {
    display: inline;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
  }
}

/* ---------- Era Timeline Bar ---------- */
.era-timeline-bar {
  display: flex;
  gap: 2px;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  height: 36px;
}

.era-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  transition: opacity var(--transition), transform var(--transition);
  padding: 0 0.3rem;
  text-align: center;
}

.era-segment:nth-child(odd) {
  background-color: var(--color-primary-light);
}

.era-segment:hover {
  opacity: 0.85;
  text-decoration: none;
  transform: scaleY(1.1);
}

.era-segment-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .era-timeline-bar {
    height: 30px;
  }
  .era-segment-label {
    font-size: 0.55rem;
  }
}

/* ---------- Character Thumbnails ---------- */
.char-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.character-item a {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

/* ---------- Keyboard Hint ---------- */
.keyboard-hint {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  opacity: 0.6;
  display: none;
}

@media (min-width: 769px) {
  .keyboard-hint {
    display: block;
  }
}

/* ---------- Footer Links ---------- */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

.footer-links a {
  color: var(--color-text-muted);
}

.footer-links a:hover {
  color: var(--color-primary);
}


/* ---------- Chapter Sticky Navigation Bar - Premium & Calm ---------- */
.chapter-sticky-bar {
  position: sticky;
  top: 95px;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  padding: 0.5rem 1rem;
  margin: 0 -1rem 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.chapter-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.nav-bar-prev, .nav-bar-next {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition);
}
.nav-bar-prev:hover, .nav-bar-next:hover {
  color: var(--color-accent);
  background: var(--color-bg-alt);
  text-decoration: none;
}
.nav-bar-prev.disabled, .nav-bar-next.disabled {
  visibility: hidden;
  width: 60px;
}

.nav-bar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
}

.chapter-jump-select {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 1.5rem 0.3rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.nav-bar-label {
  display: inline;
}

@media (max-width: 600px) {
  .nav-bar-label { display: none; }
  .nav-bar-prev, .nav-bar-next { 
    max-width: 44px; 
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0.25rem;
  }
  .chapter-sticky-bar { 
    padding: 0.35rem calc(0.5rem + env(safe-area-inset-right, 0px)) 0.35rem calc(0.5rem + env(safe-area-inset-left, 0px)); 
    margin: 0 calc(-0.5rem - env(safe-area-inset-right, 0px)) 0.5rem calc(-0.5rem - env(safe-area-inset-left, 0px));
    top: 87px;
  }
}

/* ---------- Reading Controls (Font Size + Share) - Premium subtle ---------- */
.reading-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

/* Group font controls visually */
.font-controls {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 1px;
}

.font-controls .reading-control-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.55rem;
}

.font-controls .reading-control-btn:hover {
  background: var(--color-surface);
}

.reading-control-btn {
  padding: 0.38rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.reading-control-btn:hover {
  border-color: var(--color-accent);
  background: var(--color-surface);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.reading-control-btn:active {
  transform: scale(0.95);
  background-color: var(--color-bg-alt);
}

.reading-control-btn.active-size {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background-color: var(--color-accent-soft);
}

/* ---------- Reading Time ---------- */
.reading-time {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* ---------- Copy Verse ---------- */
.chapter-text .verse {
  cursor: pointer;
  position: relative;
}

.chapter-text .verse:hover {
  background-color: rgba(139, 105, 20, 0.06);
  border-radius: 3px;
}

.chapter-text .verse:hover::after {
  content: 'tap to play';
  position: absolute;
  right: 0;
  top: -0.2rem;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--color-text-muted);
  opacity: 0.6;
  pointer-events: none;
}

@media (max-width: 768px) {
  .chapter-text .verse:hover::after {
    display: none;
  }
  /* Larger tap targets for verse audio on phones/tablets */
  .chapter-text .verse {
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
    margin-top: 0.1rem;
    margin-bottom: 0.35rem;
  }
}

.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  85% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 50;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ---------- Reading Plan Today Highlight ---------- */
.reading-today {
  border-left: 3px solid var(--color-accent) !important;
  background-color: var(--color-accent-soft) !important;
}

.reading-overdue {
  border-left: 3px solid #c0392b !important;
  opacity: 0.7;
}

/* ---------- Custom Modal ---------- */
.custom-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease;
}

.custom-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.custom-modal-content {
  position: relative;
  background-color: var(--color-surface);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.custom-modal-message {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--color-text);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.custom-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.custom-modal-btn {
  padding: 0.6rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 50px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition);
}

.custom-modal-btn.cancel {
  background-color: var(--color-bg-alt);
  color: var(--color-text-muted);
}

.custom-modal-btn.cancel:hover {
  background-color: var(--color-border);
}

.custom-modal-btn.confirm {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.custom-modal-btn.confirm:hover {
  background-color: var(--color-primary-dark);
}

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

/* ---------- Dark Mode - World-Class Sophisticated Night Reading ---------- */
/* Deep, warm, luxurious - like reading a beautiful leather Bible by firelight */
html.dark-mode {
  /* Dark Mode — Rich, deep, warm, and highly readable (premium dark study Bible) */
  --color-bg: #141210;              /* Deep true dark with warmth */
  --color-bg-alt: #1c1915;          /* Subtle lift for cards */
  --color-surface: #2a2520;         /* Warmer surface — better card separation */
  --color-text: #ede5d4;            /* Warm cream — slightly softer for long reading */
  --color-text-muted: #a89070;      /* Warm secondary for metadata/badges */
  --color-primary: #d4b06a;         /* Desaturated aged gilt — less neon */
  --color-primary-light: #e0c080;
  --color-primary-dark: #b8943a;
  --color-accent: #d4b06a;          /* Aged gilt accent */
  --color-accent-light: #e0c080;
  --color-accent-soft: rgba(212, 176, 106, 0.12);
  --color-border: #3d3428;          /* Warm subtle border */
  --color-border-light: #4d4238;    /* Slightly more visible */
  --color-link: #c9a85e;            /* Slightly lighter gold for links — distinct from headings */
  --color-link-hover: #e0c080;      /* Brighter on hover */
  --color-nav-bg: #0e0c0a;          /* Near-black nav */
  --color-nav-text: #ede5d4;
  --color-nav-active: #d4b06a;
  --color-verse-num: #a89880;       /* Readable verse numbers */
  --color-hero-start: #0e0c0a;
  --color-hero-end: #1a1612;
}

html.dark-mode img {
  opacity: 0.94;
  filter: contrast(1.0) saturate(0.92);
}

html.dark-mode body {
  background-image: linear-gradient(160deg, #141210 0%, #181512 25%, #1c1815 50%, #181512 75%, #141210 100%);
}

html.dark-mode .chapter-text {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

html.dark-mode .verse-red-letter {
  color: #e39a9a; /* Warmer, more elegant red that reads well in dark mode */
}

html.dark-mode .verse-red-letter::before {
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32' fill='%23e39a9a'%3E%3Crect x='10' y='0' width='4' height='32' rx='1'/%3E%3Crect x='3' y='8' width='18' height='4' rx='1'/%3E%3C/svg%3E");
}

html.dark-mode .passage-section,
html.dark-mode .bio-card,
html.dark-mode .next-chapter-card {
  background-color: var(--color-surface);
  border-color: var(--color-border);
}

/* ---------- Dark Mode Toggle ---------- */
.nav-dark-toggle {
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.45rem;
  line-height: 1;
  border-radius: 50%;
  transition: background-color var(--transition);
  color: var(--color-nav-text);
}

.nav-dark-toggle:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-nav-active);
}

/* Mobile dark mode toggle - visible next to hamburger */
.nav-dark-mobile {
  display: none;
}

@media (max-width: 768px) {
  .nav-dark-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border-radius: 50%;
    color: var(--color-nav-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-dark-mobile:hover,
  .nav-dark-mobile:active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-nav-active);
  }
}

/* ---------- Continue Reading Card ---------- */
.continue-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius);
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
}

.continue-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.continue-icon {
  font-size: 1.5rem;
}

.continue-card strong {
  color: var(--color-primary);
  font-family: var(--font-ui);
  display: block;
}

.continue-card p {
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  margin: 0;
}

/* ---------- Reading Streak ---------- */
.streak-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  box-shadow: var(--shadow-card);
}

.streak-flame {
  font-size: 1.3rem;
}

.streak-count {
  font-family: var(--font-ui);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-accent);
}

.streak-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-left: 0.25rem;
}

/* ---------- VOTD Share Button ---------- */
.votd-share {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.4rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: 50px;
  background-color: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.votd-share:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---------- Detail Page Image ---------- */
.detail-image {
  width: 100%;
  margin-bottom: 1.5rem;
}
.detail-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: block;
}

/* ---------- Status Badges ---------- */
.badge-fulfilled {
  background-color: rgba(39, 174, 96, 0.12);
  color: #1e8449;
  border-color: rgba(39, 174, 96, 0.25);
}

.badge-partially-fulfilled {
  background-color: rgba(243, 156, 18, 0.12);
  color: #b7791f;
  border-color: rgba(243, 156, 18, 0.25);
}

.badge-unfulfilled {
  background-color: rgba(142, 68, 173, 0.12);
  color: #6c3483;
  border-color: rgba(142, 68, 173, 0.25);
}

/* ---------- Sepia Reading Mode ---------- */
.chapter-text.sepia-mode {
  background-color: #f4ecd8;
  border-color: #d4c5a0;
  color: #3d2e1c;
}

html.dark-mode .chapter-text.sepia-mode {
  background-color: #2a2418;
  border-color: #3d3020;
  color: #d4c5a0;
}

/* ---------- Quick Jump Input ---------- */
.quick-jump-input {
  padding: 0.35rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text);
  width: 140px;
  transition: border-color var(--transition), width var(--transition);
}

.quick-jump-input:focus {
  border-color: var(--color-accent);
  outline: none;
  width: 180px;
}

@media (max-width: 768px) {
  .quick-jump-input {
    display: none;
  }
}

/* ---------- Book Reading Progress ---------- */
.book-progress {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.book-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: rgba(39, 174, 96, 0.08);
  border-right: 2px solid rgba(39, 174, 96, 0.3);
  transition: width 0.3s ease;
}

.book-progress-text {
  position: relative;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.chapter-read a {
  opacity: 0.7;
}

.chapter-list-item .chapter-read-badge {
  color: #27ae60;
  font-size: 0.75rem;
  margin-left: auto;
}

/* ---------- Mega Menu ---------- */
.nav-dropdown--mega {
  position: static;
}

.nav-dropdown--mega > button,
.nav-dropdown--mega > .nav-dropdown-toggle {
  position: relative;
}

.nav-mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.85rem;
  padding: 1.85rem 2.25rem;
  background-color: var(--color-nav-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  border-radius: 0 0 12px 12px;
}

/* Bridge the gap between trigger and menu */
.nav-mega-menu::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
}

.nav-dropdown--mega:hover .nav-mega-menu,
.nav-dropdown--mega:focus-within .nav-mega-menu,
.nav-mega-menu.mega-open {
  display: grid;
}

/* Touch devices (iPad, Android tablets, phones): prevent hover from opening mega menu */
@media (hover: none) and (pointer: coarse) {
  .nav-dropdown--mega:hover .nav-mega-menu {
    display: none;
  }
  /* Ensure click toggle works reliably */
  .nav-mega-menu.mega-open {
    display: grid;
  }
}

.mega-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mega-heading {
  font-family: var(--font-ui);
  font-size: 0.61rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-nav-active);
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.mega-col a {
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: var(--color-nav-text);
  text-decoration: none;
  padding: 0.18rem 0;
  transition: color var(--transition);
}

.mega-col a:hover {
  color: var(--color-nav-active);
  text-decoration: none;
}
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition), color var(--transition);
}

.mega-col a:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-nav-active);
}

@media (max-width: 768px) {
  .nav-mega-menu {
    position: static;
    display: none;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 0.5rem 0;
    box-shadow: none;
    border-top: none;
    max-height: 65vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-dropdown--mega:hover .nav-mega-menu {
    display: none;
  }

  .nav-open .nav-dropdown--mega .nav-mega-menu,
  .nav-mega-menu.mega-open {
    display: grid;
  }

  .mega-col {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .mega-col:last-child {
    border-bottom: none;
  }

  .mega-heading {
    font-size: 0.65rem;
    margin-bottom: 0.3rem;
    padding: 0 0.5rem;
    color: var(--color-nav-active);
  }

  .mega-col a {
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    display: block;
  }

  .mega-col a:hover,
  .mega-col a:active {
    background-color: rgba(255, 255, 255, 0.08);
  }

  .mega-personal {
    padding: 0 0.5rem;
  }

  .mega-personal h4 {
    font-size: 0.6rem;
  }

  .mega-personal a {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
  }

  /* Explore toggle button on mobile */
  .nav-dropdown-toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    color: var(--color-nav-text);
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
  }

  .nav-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-nav-active);
  }
}

/* ---------- Mega Menu on Tablets (iPad, Android tablets 769-1024px) ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav-mega-menu {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
  }
  .mega-col {
    gap: 0.15rem;
  }
  .mega-col a {
    padding: 0.15rem 0;
    font-size: 0.82rem;
  }
  /* Tighten top nav on tablets so it never overflows */
  .navbar-nav > li > a {
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
  }
  .navbar {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .container {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
  }
}

/* ---------- Dimension Grid (Home Page) - Modernized ---------- */
.home-dimensions {
  margin: 3.25rem 0 2.75rem;
}
.home-dimensions h2 {
  margin-bottom: 1.35rem;
  font-size: 1.28rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-primary-dark);
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.85rem;
}

.dim-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.15rem 0.85rem 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background-color var(--transition);
  box-shadow: var(--shadow-card);
}

.dim-card .dim-icon {
  font-size: 1.65rem;
  margin-bottom: 0.55rem;
  display: block;
  line-height: 1;
  opacity: 0.9;
}

.dim-card h3 {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.15rem;
  line-height: 1.2;
}

.dim-card p {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin: 0;
  opacity: 0.85;
}

.dim-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-accent);
  background-color: var(--color-bg-alt);
  text-decoration: none;
}

.dim-card:hover .dim-icon {
  opacity: 1;
}

/* ---------- Discovery Banner (Home page) ---------- */
.discovery-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(90deg, var(--color-accent-soft), rgba(212, 181, 122, 0.06));
  border-bottom: 1px solid var(--color-border-light);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  overflow: hidden;
  min-height: 40px;
}
.discovery-banner-label {
  font-weight: 700;
  color: var(--color-accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.discovery-banner-link {
  display: none;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  animation: bannerFadeIn 0.5s ease;
}
.discovery-banner-link.active {
  display: inline;
}
.discovery-banner-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}
@keyframes bannerFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  @keyframes bannerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}
html.dark-mode .discovery-banner {
  background: linear-gradient(90deg, rgba(212, 181, 122, 0.08), rgba(212, 181, 122, 0.02));
}

/* ---------- New Home Page ---------- */
.home-hero {
  text-align: center;
  padding: 4.5rem 1.5rem 3rem;
  background: linear-gradient(145deg, rgba(30,25,50,0.55) 0%, rgba(20,15,40,0.65) 100%), url('/images/hero-bg.jpg') center center / cover no-repeat;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(197, 164, 111, 0.12) 0%, transparent 60%);
  pointer-events: none;
}
.home-hero-inner { max-width: 680px; margin: 0 auto; position: relative; z-index: 1; }
.home-hero-title { 
  font-size: 2.75rem; 
  font-weight: 800; 
  color: #fff; 
  margin: 0 0 0.9rem; 
  letter-spacing: -0.03em; 
  line-height: 1.08;
}
.hero-title-accent {
  background: linear-gradient(135deg, #f5e6c8, #c5a46f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@media (prefers-reduced-motion: reduce) {
  .hero-title-accent {
    -webkit-text-fill-color: #f5e6c8;
    background: none;
  }
}
.home-hero-sub { 
  font-size: 1.05rem; 
  color: rgba(255,255,255,0.85); 
  line-height: 1.65; 
  margin: 0 0 1.75rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.home-hero-actions { display: flex; gap: 0.65rem; justify-content: center; flex-wrap: wrap; }
@media (max-width: 420px) {
  .home-hero-actions { gap: 0.45rem; flex-direction: column; align-items: center; }
  .hero-btn { padding: 0.7rem 1.4rem; font-size: 0.85rem; width: 100%; max-width: 280px; }
  .hero-btn-listen { padding: 0.8rem 1.6rem; font-size: 0.92rem; }
}
.hero-btn { 
  padding: 0.75rem 2rem; 
  border-radius: 8px; 
  font-family: var(--font-ui); 
  font-size: 0.9rem; 
  font-weight: 600; 
  text-decoration: none; 
  transition: all var(--transition); 
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.hero-btn-listen {
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.9rem 2.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--color-border-light);
  position: relative;
  overflow: hidden;
}
.hero-btn-listen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(197, 164, 111, 0.08) 100%);
  pointer-events: none;
}
.hero-btn-listen:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  color: var(--color-primary);
  text-decoration: none;
  border-color: var(--color-accent);
}

html.dark-mode .hero-btn-listen {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

html.dark-mode .hero-btn-listen:hover {
  border-color: var(--color-accent);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}

.hero-btn-primary { 
  background: rgba(255, 255, 255, 0.15); 
  color: #fff; 
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.hero-btn-primary:hover { 
  background: rgba(255, 255, 255, 0.25); 
  transform: translateY(-1px); 
  color: #fff; 
  text-decoration: none; 
}
.hero-btn-secondary { 
  background: transparent; 
  color: rgba(255, 255, 255, 0.8); 
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.hero-btn-secondary:hover { 
  background: rgba(255, 255, 255, 0.1); 
  border-color: rgba(255, 255, 255, 0.4); 
  color: #fff; 
  text-decoration: none; 
}

.hero-secondary-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.hero-btn-share-cta {
  display: none; /* Removed from hero for cleaner layout */
}
.hero-btn-secondary { 
  background: rgba(255,255,255,0.12); 
  color: #fff; 
  border: 1px solid rgba(255,255,255,0.35); 
  backdrop-filter: blur(8px);
}
.hero-btn-secondary:hover { 
  background: rgba(255,255,255,0.22); 
  border-color: rgba(255,255,255,0.5); 
  color: #fff; 
  text-decoration: none; 
  transform: translateY(-1px);
}

/* Trust strip under hero */
.home-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin: -1rem 0 2.5rem;
  padding: 0 1rem;
  text-align: center;
  letter-spacing: 0.01em;
}
.home-trust-sep {
  opacity: 0.35;
  font-size: 0.6rem;
  align-self: center;
}

/* Hero secondary links */
.home-hero-secondary {
  margin-top: 0.85rem;
  margin-bottom: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: 0.82rem;
}
.hero-secondary-link {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-family: var(--font-ui);
  transition: color 0.15s;
}
.hero-secondary-link:hover {
  color: #fff;
  text-decoration: underline;
}
.hero-secondary-dot {
  color: rgba(255,255,255,0.35);
  font-size: 0.6rem;
}

/* New pathways section */
.home-pathways {
  margin-bottom: 2.75rem;
}
.home-pathways-title {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}
.home-pathway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.home-pathway {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.18s ease;
  box-shadow: var(--shadow-subtle);
}
.home-pathway:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.home-pathway:active {
  transform: translateY(0);
}
.home-pathway-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--color-accent);
  opacity: 0.85;
}
.home-pathway-icon svg {
  width: 100%;
  height: 100%;
}
.home-pathway strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: var(--color-text);
}
.home-pathway p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Small share button inside pathway cards */
.pathway-share-btn {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-self: flex-start;
  margin-left: 0.4rem;
  flex-shrink: 0;
}
.pathway-share-btn:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* Explore header improvements */
.home-explore-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.home-explore-header h2 {
  margin: 0;
}
.home-explore-all {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}
.home-explore-all:hover {
  text-decoration: underline;
}
.home-explore-note {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
  margin-bottom: 0;
  line-height: 1.5;
}
@media (max-width: 600px) {
  .home-explore-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-explore-all {
    font-size: 0.78rem;
  }
}

/* Dimensions intro text */
.home-dimensions-intro {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin: -0.4rem 0 1rem;
  max-width: 680px;
}

/* Personalized section titles */
.home-personal-title {
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
  color: var(--color-text);
}

.home-votd {
  max-width: 680px;
  margin: 0 auto 2.75rem;
  text-align: center;
  padding: 2.25rem 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
}
.home-votd::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  border-radius: 2px;
}

.votd-quote { 
  font-family: var(--font-reading-display); 
  font-size: 1.22rem; 
  font-style: italic; 
  line-height: 1.68; 
  color: var(--color-text);
  max-width: 68ch;
  margin: 0 auto 1rem;
  padding: 0 0.5rem;
}
.votd-meta { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 0.6rem; }
.votd-ref { 
  font-family: var(--font-ui); 
  font-size: 0.82rem; 
  font-weight: 600; 
  color: var(--color-accent); 
  text-decoration: none; 
  letter-spacing: 0.01em;
}
.votd-ref:hover { text-decoration: underline; }
.votd-share-btn { 
  font-family: var(--font-ui); 
  font-size: 0.72rem; 
  padding: 0.35rem 0.75rem; 
  border: 1px solid var(--color-border); 
  border-radius: var(--radius-sm); 
  background: var(--color-bg); 
  color: var(--color-text-muted); 
  cursor: pointer; 
  transition: all var(--transition);
}
.votd-share-btn:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.home-continue { margin-bottom: 2rem; }
.home-cards { display: flex; gap: 1rem; flex-wrap: wrap; }
.home-card { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); text-decoration: none; color: var(--color-text); flex: 1; min-width: 200px; transition: border-color 0.15s; }
.home-card:hover { border-color: var(--color-accent); text-decoration: none; }
.home-card-icon { font-size: 1.5rem; }
.home-card strong { display: block; font-size: 0.9rem; }
.home-card p { margin: 0.2rem 0 0; font-size: 0.75rem; color: var(--color-text-muted); }

.home-explore { margin-bottom: 2.5rem; }
.home-explore h2 { margin-bottom: 1rem; }
.home-dim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 0.85rem; }
.home-dim { display: flex; flex-direction: column; align-items: center; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--color-surface); border: 1px solid var(--color-border); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; box-shadow: var(--shadow-subtle); }
.home-dim:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); text-decoration: none; border-color: var(--color-accent); }
.home-dim:active { transform: translateY(-1px); }
.home-dim-img { width: 100%; height: 105px; object-fit: cover; }
.home-dim span { padding: 0.55rem 0.5rem; font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600; color: var(--color-text); text-align: center; }

.home-quickstart { margin-bottom: 2.75rem; }
.home-quickstart h2 { margin-bottom: 1rem; font-size: 1.15rem; }
.home-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.6rem; }
.home-quick-link { display: block; padding: 0.8rem 1.05rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); font-family: var(--font-ui); font-size: 0.9rem; color: var(--color-text); text-decoration: none; transition: all var(--transition); box-shadow: var(--shadow-card); }
.home-quick-link:hover { border-color: var(--color-accent); color: var(--color-primary); transform: translateX(3px); box-shadow: var(--shadow-hover); text-decoration: none; }

.home-quick-grid--books {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.5rem;
}
.home-quick-book {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  text-decoration: none;
}
.home-quick-book:hover {
  transform: translateY(-1px);
  border-color: var(--color-accent);
}
.home-quick-book .quick-book-thumb {
  width: 54px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-bg-alt);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.home-quick-book .quick-book-info {
  min-width: 0;
  line-height: 1.15;
}
.home-quick-book .quick-book-info strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1px;
}
.home-quick-book .quick-book-info span {
  display: block;
  font-size: 0.76rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-quick-note {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-align: center;
}

.home-recent { margin-bottom: 2rem; }
.home-recent h2 { margin-bottom: 0.75rem; }

@media (max-width: 600px) {
  .home-hero-title { font-size: 1.75rem; line-height: 1.12; }
  .home-hero { padding: 2.25rem 1.15rem 1.5rem; }
  .home-hero-sub { font-size: 0.92rem; margin-bottom: 1.25rem; }
  .home-dim-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .home-pathway-grid { grid-template-columns: 1fr; }
  .home-pathway { padding: 0.85rem 1rem; }
  .home-pathway strong { font-size: 0.88rem; }
  .home-pathway p { font-size: 0.78rem; }
  .home-trust { font-size: 0.72rem; gap: 0.35rem 0.7rem; margin-bottom: 1.8rem; }
  .home-hero-secondary { font-size: 0.78rem; gap: 0.3rem 0.55rem; }
  .home-quick-grid--books { grid-template-columns: repeat(2, 1fr); gap: 0.45rem; }
  .home-quick-book { padding: 0.45rem 0.55rem; gap: 0.5rem; }
  .home-quick-book .quick-book-thumb { width: 44px; height: 36px; }
  .home-votd { padding: 1.75rem 1.25rem; }
  .votd-quote { font-size: 1.1rem; }
}

/* Tablet-optimized grids (iPad portrait/landscape, Android tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
  .home-dim-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .home-quick-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .home-quick-grid--books { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .dimension-grid { grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
  .character-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .book-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .section-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

.dim-card h3 {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.2rem;
}

.dim-card p {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------- Hero Actions ---------- */
.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-cta--secondary {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}

.hero-cta--secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
  .dimension-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
  }

  .dim-card {
    padding: 1rem 0.6rem;
  }

  .dim-icon {
    font-size: 1.45rem;
  }

  .dim-card h3 {
    font-size: 0.82rem;
  }

  .dim-card p {
    font-size: 0.68rem;
  }

  .container {
    padding: 2.25rem 1.25rem 3rem;
  }
}

/* ---------- Book Facts ---------- */
.book-facts {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.facts-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.fact-item {
  padding: 0.85rem 1rem 0.85rem 3rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

.fact-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.fact-item::before {
  content: '✦';
  position: absolute;
  left: 1rem;
  top: 0.85rem;
  color: var(--color-accent);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .facts-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Chapter Facts (Reading Page) ---------- */
.chapter-facts-section {
  margin: 2.5rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
}

.facts-heading {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.chapter-facts-section h2 {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.chapter-facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.chapter-fact {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.chapter-fact:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow);
}

.fact-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  border: 1px solid rgba(139, 105, 20, 0.2);
}

.chapter-fact p {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text);
  line-height: 1.45;
}

@media (max-width: 768px) {
  .chapter-facts-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Psalm Guidance Cards ---------- */
.psalm-guidance {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.psalm-summary-card {
  padding: 1rem 1.25rem;
  background-color: var(--color-accent-soft);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
}

.psalm-summary-card h3 {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 0.3rem;
}

.psalm-summary-card p {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
  font-style: italic;
}

/* ---------- First Visit Welcome ---------- */
.first-visit-welcome {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.welcome-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.welcome-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.welcome-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(139, 105, 20, 0.2);
}

.welcome-step strong {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.15rem;
}

.welcome-step p {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

.welcome-tip {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  font-style: italic;
}

/* ---------- Clear Filters Button ---------- */
.filter-clear {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  color: #c0392b;
  background: rgba(192, 57, 43, 0.06);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: 50px;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all var(--transition);
}

.filter-clear:hover {
  background: rgba(192, 57, 43, 0.12);
  border-color: rgba(192, 57, 43, 0.4);
}

/* ---------- Improved Filter Count ---------- */
.filter-count {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  padding: 0.35rem 0.75rem;
  background-color: var(--color-bg-alt);
  border-radius: 50px;
  border: 1px solid var(--color-border);
}

/* ---------- Symbol Type Cards ---------- */
.symbol-type-card {
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-text-muted);
  border-radius: var(--radius-sm);
}

.symbol-type-card h3 {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.symbol-type-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.symbol-type-card--fulfilled {
  border-left-color: var(--color-accent);
  background-color: var(--color-accent-soft);
}

/* ---------- Mega Menu Personal Sections ---------- */
.mega-personal a {
  font-size: 0.78rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  display: block;
}

/* Enhanced recent/bookmark items as nice reference pills */
.mega-personal .mega-recent-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  margin: 0.15rem 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, border-color 0.15s;
}

.mega-personal .mega-recent-item:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--color-nav-active);
  text-decoration: none;
}

.mega-personal .mega-recent-thumb {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
  aspect-ratio: 1 / 1;
}

.mega-personal .mega-recent-thumb.fallback {
  display: none;
}

.mega-personal .mega-recent-item span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Chapter Header (Compact) ---------- */
.chapter-header {
  margin-bottom: 0.75rem;
}

.chapter-header h1 {
  margin-bottom: 0.25rem;
}

.h1-kjv {
  font-size: 0.5em;
  font-weight: 400;
  color: var(--color-text-muted);
  vertical-align: middle;
  letter-spacing: 0.05em;
}

.chapter-subtitle {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
  font-style: italic;
}

.seo-chapter-heading {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.seo-chapter-intro {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

.chapter-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

@media (max-width: 600px) {
  .chapter-meta {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
}

.chapter-meta .chapter-title {
  font-style: italic;
  color: var(--color-text);
}

.chapter-meta .reading-time {
  margin: 0;
  padding: 0.15rem 0.5rem;
  background-color: var(--color-bg-alt);
  border-radius: 50px;
  font-size: 0.75rem;
}

.chapter-meta .book-author {
  margin: 0;
}

.chapter-meta .book-author a {
  font-weight: 500;
}

/* ---------- Genre Badge ---------- */
.genre-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 50px;
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
  border: 1px solid rgba(139, 105, 20, 0.2);
  text-decoration: none;
}

.genre-badge:hover {
  text-decoration: none;
  background-color: rgba(139, 105, 20, 0.2);
}

/* ---------- Parallel Passages ---------- */
.parallel-passages,
.prophecy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

.parallel-label,
.prophecy-label {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.parallel-link {
  padding: 0.15rem 0.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  color: var(--color-link);
  text-decoration: none;
  font-size: 0.75rem;
  transition: all var(--transition);
}

.parallel-link:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.prophecy-link {
  padding: 0.15rem 0.5rem;
  background-color: rgba(142, 68, 173, 0.06);
  border: 1px solid rgba(142, 68, 173, 0.2);
  border-radius: 50px;
  color: #6c3483;
  text-decoration: none;
  font-size: 0.75rem;
  transition: all var(--transition);
}

.prophecy-link:hover {
  background-color: rgba(142, 68, 173, 0.12);
  text-decoration: none;
}

/* ---------- Echoes & Connections (new unified linking UI) ---------- */
.echoes-section {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.95rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-subtle);
}

.echoes-header {
  margin-bottom: 0.5rem;
}

.echoes-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
}

.echoes-count {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.echoes-content {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

@media (max-width: 480px) {
  .echoes-section {
    padding: 0.65rem 0.75rem;
    margin: 0.6rem 0 0.9rem;
  }
  .echo-item {
    font-size: 0.78rem;
  }
}

.echo-item {
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

.echo-item.literary {
  background: linear-gradient(90deg, var(--color-accent-soft) 0%, transparent 100%);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-accent);
}

.echo-item .echo-type {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}

.echo-text {
  margin: 0;
  line-height: 1.45;
  color: var(--color-text);
  font-size: 0.82rem;
}

.echo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.echo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  color: var(--color-link);
  text-decoration: none;
  font-size: 0.78rem;
  transition: all var(--transition);
  max-width: 100%;
}

.echo-link:hover {
  border-color: var(--color-accent);
  background: var(--color-surface);
  text-decoration: none;
  transform: translateY(-1px);
}

.echo-meta {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  opacity: 0.85;
}

.echo-more {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  padding: 0.2rem 0.5rem;
  background: var(--color-bg-alt);
  border-radius: 9999px;
  border: 1px solid var(--color-border);
}

/* ---------- World History Context ---------- */
.world-context {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary-light);
  border-radius: var(--radius-sm);
}

.world-context h3 {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary-light);
  margin: 0 0 0.4rem;
}

.world-context p {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--color-text);
}

.world-context .world-description {
  margin-bottom: 0.5rem;
}

.world-context .world-meta {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0;
}

.world-context .world-references {
  font-size: 0.82rem;
  margin-top: 0.35rem;
}

.world-context .world-notes {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

/* ---------- Textual Note (Manuscript) ---------- */
.textual-note {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background-color: rgba(231, 76, 60, 0.04);
  border: 1px solid rgba(231, 76, 60, 0.15);
  border-left: 3px solid rgba(231, 76, 60, 0.4);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--color-text);
}

.textual-note strong {
  color: #c0392b;
}

/* ---------- Storyline Grid ---------- */
.storyline-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.storyline-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform var(--transition), border-color var(--transition);
}

.storyline-card:hover {
  transform: translateX(4px);
  border-color: var(--color-accent);
  text-decoration: none;
}

.storyline-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.storyline-card strong {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.15rem;
}

.storyline-card p {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

.storyline-ref {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--color-accent);
  margin-top: 0.25rem;
  display: block;
}

/* ---------- Glossary Grid ---------- */
.glossary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.glossary-item {
  padding: 0.6rem 0.9rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.glossary-item dt {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.15rem;
}

.glossary-item dd {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .glossary-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Start Today Button ---------- */
.start-today-btn {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  background-color: var(--color-primary);
  color: #fff;
  border-radius: 50px;
  text-decoration: none;
  margin-left: 0.5rem;
  transition: background-color var(--transition), transform var(--transition);
}

.start-today-btn:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

/* ---------- Dropcap inside passage sections (smaller context) ---------- */
.passage-section .dropcap,
.event-passage .dropcap {
  width: 52px;
  height: 52px;
}

.passage-section .verse-first,
.event-passage .verse-first {
  overflow: hidden;
  line-height: 1.8;
}

/* ---------- Red Letter Note ---------- */
.red-letter-note {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  color: var(--color-text-muted);
  margin: 0.75rem 0 1.25rem;
  font-style: italic;
  opacity: 0.85;
}

/* ---------- Next Chapter Preview ---------- */
.next-chapter-preview {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 1rem 0;
  padding: 0.5rem 0.75rem;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-accent);
}

.next-chapter-preview a {
  font-weight: 500;
}

/* ---------- Chapter Audio Player ---------- */
.chapter-audio {
  margin: 0.5rem 0;
  padding: 0.35rem 0.75rem;
  background: var(--color-card-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}
.audio-player-inner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}
.audio-player-inner audio {
  display: none;
}

/* Custom chapter player controls — single compact row */
.chapter-player-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.ch-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.2s;
}

.ch-play-btn:hover {
  transform: scale(1.08);
  background: var(--color-accent-light);
}

.ch-play-btn:active {
  transform: scale(0.95);
}

.ch-time {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ch-time-sep {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.ch-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  min-width: 40px;
}

.ch-progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s linear;
}

/* Jump controls (book/chapter/verse selects) */
.ch-jump-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.ch-jump-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 1.1rem 0.25rem 0.4rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%236f685f'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
  max-width: 120px;
}

/* Verse select should be wider to show text preview */
#ch-jump-verse {
  max-width: 220px;
  flex: 1;
}

.ch-jump-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.audio-toggles {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Toggle switch */
.audio-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--color-muted);
}
.audio-toggle input {
  display: none;
}
.toggle-slider {
  position: relative;
  width: 28px;
  height: 16px;
  background: var(--color-border);
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.audio-toggle input:checked + .toggle-slider {
  background: var(--color-accent);
}
.audio-toggle input:checked + .toggle-slider::after {
  transform: translateX(12px);
}
.toggle-text {
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .audio-player-inner {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .chapter-player-controls {
    width: 100%;
    flex: none;
    order: 1;
  }
  .ch-jump-controls {
    order: 2;
  }
  .audio-toggles {
    width: 100%;
    padding: 0.3rem 0 0.15rem;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    order: 3;
  }
  .audio-toggle {
    font-size: 0.78rem;
    gap: 0.4rem;
    padding: 0.3rem 0;
  }
  .toggle-slider {
    width: 34px;
    height: 20px;
    border-radius: 10px;
  }
  .toggle-slider::after {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
  }
  .audio-toggle input:checked + .toggle-slider::after {
    transform: translateX(14px);
  }
  .chapter-audio {
    padding: 0.4rem 0.75rem;
    margin: 0.4rem 0;
  }
  .animate-activate-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
  }
}

/* Active verse during audio playback */
.verse-audio-active {
  background-color: rgba(212, 175, 55, 0.12);
  border-left: 3px solid var(--color-accent);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

/* Sepia mode: warmer/more yellow highlight */
.chapter-text.sepia-mode .verse-audio-active {
  background-color: rgba(218, 165, 32, 0.22);
  border-left-color: #b8860b;
}

/* Dark mode highlight */
html.dark-mode .verse-audio-active {
  background-color: rgba(212, 175, 55, 0.18);
}

/* Dark mode: audio player */
html.dark-mode .chapter-audio {
  background-color: var(--color-surface);
  border-color: var(--color-border);
}

html.dark-mode .audio-toggle .toggle-text {
  color: var(--color-text-muted);
}

/* Dark mode: sticky bar */
html.dark-mode .chapter-sticky-bar {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

html.dark-mode .chapter-jump-select {
  background-color: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
  font-family: var(--font-ui);
}

html.dark-mode .reading-control-btn {
  background-color: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

html.dark-mode .reading-control-btn.active-size {
  background-color: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---------- Inline Glossary Tooltips ---------- */
.glossary-word {
  border-bottom: 1px dotted var(--color-accent);
  cursor: help;
}

.glossary-tooltip {
  position: absolute;
  z-index: 9000;
  max-width: 280px;
  padding: 0.5rem 0.75rem;
  background-color: var(--color-nav-bg);
  color: var(--color-nav-text);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  pointer-events: auto;
}

.glossary-tooltip strong {
  color: var(--color-nav-active);
}

.glossary-tooltip .tooltip-link {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.72rem;
  pointer-events: auto;
}
.glossary-tooltip .tooltip-link:hover {
  text-decoration: underline;
}

/* Original language in tooltip */
.glossary-tooltip .tooltip-original {
  color: #a8d8a8;
  font-size: 0.72rem;
  display: block;
  margin-top: 0.2rem;
}

/* Word count in tooltip */
.glossary-tooltip .tooltip-count {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.68rem;
  display: block;
  margin-top: 0.15rem;
}

/* Character inline links */
.character-link {
  border-bottom: 1.5px solid var(--color-accent);
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.character-link:hover {
  color: var(--color-accent);
  background-color: rgba(212, 175, 55, 0.1);
}

/* Place inline links */
.place-link {
  border-bottom: 1.5px solid #5b8a72;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.place-link:hover {
  color: #5b8a72;
  background-color: rgba(91, 138, 114, 0.1);
}

/* ---------- Book Meta Info ---------- */
.book-meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.book-meta-info a {
  font-weight: 500;
}

/* ---------- Crisis Helpline ---------- */
.crisis-helpline {
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background-color: rgba(231, 76, 60, 0.06);
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-left: 4px solid #e74c3c;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.5;
}

.crisis-helpline strong {
  color: #c0392b;
}

/* ---------- Passage Commentary Preview (visible when collapsed) ---------- */
.passage-commentary-preview {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

/* ---------- Glossary Category Badge ---------- */
.glossary-cat-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background-color: var(--color-bg-alt);
  padding: 0.1rem 0.4rem;
  border-radius: 50px;
  margin-top: 0.3rem;
}


/* ==========================================================================
   UI Fixes - Visual/UX Improvements (10 issues)
   ========================================================================== */

/* ---------- FIX 1: Sticky chapter nav bar mobile overflow ----------
   The reading controls wrap awkwardly on small screens, causing overflow.
   Add horizontal scroll and better spacing for the controls row. */
@media (max-width: 600px) {
  .reading-controls {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.2rem;
    padding-bottom: 0.25rem;
  }
  .reading-controls::-webkit-scrollbar {
    display: none;
  }
  .reading-control-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
    flex-shrink: 0;
    min-height: 36px; /* Better touch target */
  }
  .chapter-sticky-bar {
    top: 87px; /* Match mobile navbar height + offset */
  }
  /* Make chapter jump select thumb-friendly */
  .chapter-jump-select {
    padding: 0.4rem 1.8rem 0.4rem 0.7rem;
    font-size: 0.85rem;
    min-height: 36px;
  }
}

/* ---------- FIX 2: Filter pills missing scroll indicator on mobile ----------
   Add a fade-out gradient hint so users know they can scroll horizontally. */
@media (max-width: 768px) {
  .filter-bar {
    position: relative;
  }
  .filter-pills {
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    padding-right: 1.5rem;
  }
  .filter-pill {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
  }
}

/* ---------- FIX 3: Missing hover/focus states on interactive elements ----------
   Audio toggles, filter pills, and dim-cards lack proper cursor and transitions. */
.audio-toggle {
  transition: opacity var(--transition);
}
.audio-toggle:hover {
  opacity: 0.8;
}
.toggle-slider {
  cursor: pointer;
}
.filter-pill:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.dim-card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.chapter-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.reading-control-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.feature-card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}
.nav-card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}
.character-item a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.hero-cta:focus-visible,
.hero-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---------- FIX 4: Detail page images missing bottom spacing ----------
   Images on detail pages (battles, characters) need consistent margin below. */
.detail-image {
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}

.detail-image img {
  display: block;
  width: 100%;
  height: auto;
}
.detail-image img {
  margin-bottom: 0;
}
.character-portrait img {
  margin-bottom: 1.5rem;
}

/* ---------- FIX 5: Glossary tooltip overflow on narrow screens ----------
   Tooltip can clip off-screen on mobile. Constrain width and position. */
@media (max-width: 480px) {
  .glossary-tooltip {
    max-width: calc(100vw - 2rem);
    left: 1rem !important;
    right: 1rem;
    width: auto;
  }
}

/* ---------- FIX 6: Dimension grid gap too tight on mobile ----------
   The dimension cards on the home page need more breathing room on small screens. */
@media (max-width: 480px) {
  .dimension-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }
  .dim-card {
    padding: 0.95rem 0.55rem;
  }
  .home-dim-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }

  .chapter-text {
    padding: 1.65rem 1.25rem;
  }
}

/* ---------- FIX 7: Breadcrumbs truncation on mobile ----------
   Long breadcrumb text overflows on narrow screens. Add ellipsis. */
@media (max-width: 480px) {
  .breadcrumbs ol {
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .breadcrumbs li {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
  }
  .breadcrumbs li:last-child {
    max-width: 150px;
    flex-shrink: 0;
  }
  .breadcrumbs li:first-child {
    flex-shrink: 0;
    max-width: none;
  }
}

/* ---------- FIX 8: Book navigation bar mobile adjustments ----------
   The prev/next book nav needs better touch targets and spacing on mobile. */
@media (max-width: 600px) {
  .book-nav-bar {
    padding: 0.6rem 0;
    gap: 0.5rem;
  }
  .book-nav-prev, .book-nav-next {
    font-size: 0.75rem;
    max-width: 110px;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition), color var(--transition);
  }
  .book-nav-prev:hover, .book-nav-next:hover {
    background-color: var(--color-bg-alt);
  }
  .book-nav-center {
    font-size: 0.7rem;
  }
}

/* ---------- FIX 9: Chapter list play buttons alignment ----------
   Play buttons in the chapter list need vertical centering with the row. */
.chapter-play-btn {
  align-self: center;
  width: 36px;
  height: 36px;
  min-width: 20px;
  max-width: 20px;
  max-height: 20px;
  font-size: 0.5rem;
  margin-right: 0.4rem;
  padding: 0 !important;
}
.chapter-list-item {
  align-items: center;
}
.chapter-list-item > .chapter-list-link:first-child {
  min-height: 44px; /* Minimum touch target */
  align-items: center;
}

/* ---------- FIX 10: Inconsistent border-radius and shadow on cards ----------
   Ensure consistent visual polish across all card-like elements. */
.bio-card,
.psalm-summary-card,
.world-context,
.textual-note,
.chapter-audio,
.first-visit-welcome,
.verse-of-the-day,
.next-chapter-preview {
  transition: box-shadow var(--transition), border-color var(--transition);
}

.bio-card:hover,
.first-visit-welcome:hover {
  box-shadow: var(--shadow);
}

/* Consistent card hover lift for home page cards */
.home-card {
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.home-pathway-listen {
  border-color: var(--color-accent);
  background: var(--color-surface);
  position: relative;
}

.home-pathway-listen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--color-accent-soft), transparent);
  border-radius: inherit;
  pointer-events: none;
}

.home-pathway-listen:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-alt);
}

/* ========================================
   Sanctuary Calm + Micro-delight Polish
   (for features 4,6,9,10)
   ======================================== */

/* Gentler, more reverent audio player */
.chapter-audio {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
}
.chapter-audio audio {
  filter: saturate(0.9);
}
.audio-toggles label {
  transition: opacity 0.2s ease;
}
.audio-toggles label:hover {
  opacity: 1;
}

/* Warm, non-pressured streak + continue cards */
#streak-card {
  background: linear-gradient(145deg, var(--color-surface), var(--color-bg-alt));
  border-color: var(--color-border);
}
.streak-note {
  display: block;
  font-size: 0.65rem;
  color: #8a7354;
  margin-top: 2px;
  font-style: italic;
}
.gentle-clear-btn {
  margin-top: 0.75rem;
  font-size: 0.7rem;
  color: #8a7354;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.gentle-clear-btn:hover {
  color: #5c4a35;
  background: rgba(0,0,0,0.04);
}

/* Calmer verse hover delight (reading experience) */
.verse:hover {
  background: rgba(160, 125, 61, 0.035);
  border-radius: 3px;
}
.verse-audio-active {
  background: rgba(160, 125, 61, 0.12) !important;
  border-radius: 4px;
  transition: background 0.3s ease;
}

/* Home personal section feels like a gentle welcome, not a dashboard */
.home-continue {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-border);
}
.home-personal-title {
  font-size: 1rem;
  color: #5c4a35;
  margin-bottom: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Micro-delight on primary actions */
a[href="/listen"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(160,125,61,0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Smoother, calmer focus states everywhere */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #c9b38a;
  outline-offset: 2px;
  transition: outline 0.1s ease;
}

/* Reading page feels like a quiet room */
.chapter-text {
  font-size: 2.6rem;
  line-height: 1.78;
}
.verse {
  transition: background-color 0.25s ease, padding 0.2s ease;
  padding: 1px 4px;
  margin: 1px 0;
  position: relative;
}

/* Verse-level highlights & notes (for features 2 & 3) */
.verse.user-highlight {
  background: rgba(160, 125, 61, 0.18);
  border-radius: 3px;
}
.verse.user-highlight.color-yellow { background: rgba(245, 220, 80, 0.35); }
.verse.user-highlight.color-blue { background: rgba(100, 160, 220, 0.22); }
.verse.user-highlight.color-green { background: rgba(110, 170, 130, 0.22); }
.verse.user-highlight.color-pink { background: rgba(210, 140, 170, 0.22); }

/* Prominent note indicator on verses */
/* Note button on the right side of each verse.
   - Appears on hover for verses without notes (invitation to add one).
   - Stays persistently visible (with stronger styling) for verses that already have a saved note,
     giving a clear right-side indication next to the verse text line. */
.chapter-text .verse .verse-note-btn {
  position: absolute;
  right: -24px;
  top: 0;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease, transform 0.1s ease;
  background: #e8d9b8;
  border: 1px solid #d4c3a0;
  border-radius: 4px;
  padding: 2px 6px 3px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  z-index: 6;
  cursor: pointer;
  color: #5c4733;
}
html.dark-mode .chapter-text .verse .verse-note-btn {
  background: #3a2f22;
  border-color: #5c4733;
  color: #d4c3a0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.chapter-text .verse:hover .verse-note-btn {
  opacity: 0.9;
  pointer-events: auto;
}
.chapter-text .verse .verse-note-btn:hover {
  opacity: 1;
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Touch / mobile: always afford the note button (no reliable hover) */
@media (hover: none), (max-width: 768px) {
  .chapter-text .verse .verse-note-btn {
    font-size: 0.85rem;
    opacity: 0.65;
    pointer-events: auto;
  }
  .chapter-text .verse .verse-note-btn:hover {
    opacity: 0.95;
  }
}

/* Persistent indication on the right when a note has been saved for this verse.
   The button is still the trigger, but now visibly signals "this verse has a note". */
.chapter-text .verse.has-note .verse-note-btn {
  opacity: 0.85;
  pointer-events: auto;
  font-size: 0.95rem;
  background: #d9c8a3;
  border-color: #b89f6e;
}
html.dark-mode .chapter-text .verse.has-note .verse-note-btn {
  font-size: 0.95rem;
  background: #4a3a2a;
  border-color: #7a664a;
}
.chapter-text .verse.has-note .verse-note-btn:hover {
  opacity: 1;
  background: #e8d9b8;
  border-color: #d4c3a0;
}
html.dark-mode .chapter-text .verse.has-note .verse-note-btn:hover {
  background: #3a2f22;
  border-color: #5c4733;
}

/* Shift the "tap to play" label left on hover so it doesn't overlap the note button
   (whether the button is persistently visible because of a note, or only appears on hover). */
.chapter-text .verse:hover::after {
  right: 22px !important;
}

/* Subtle left accent bar for verses that have a saved private note */
.verse.has-note {
  position: relative;
}
.verse.has-note::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 2px;
  bottom: 2px;
  width: 3px;
  background: linear-gradient(to bottom, #c9a66b, #a67c52);
  border-radius: 2px;
  opacity: 0.55;
}

/* Modern verse action menu (replaces the old emoji-button look) */
.verse-action-menu {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 0.35rem 0.4rem;
  min-width: 218px;
  font-size: 0.82rem;
  color: var(--color-text);
  overflow: hidden;
}

html.dark-mode .verse-action-menu {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.verse-menu-header {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0.3rem 0.55rem 0.4rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.25rem;
}

html.dark-mode .verse-menu-header {
  border-bottom-color: var(--color-border);
  color: var(--color-text-muted);
}

.verse-action-menu .menu-section {
  padding: 0.25rem 0.35rem 0.15rem;
}

.verse-action-menu .menu-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}

.color-swatches {
  display: flex;
  gap: 7px;
  padding: 2px 0;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  cursor: pointer;
  transition: transform 0.1s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.1s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  padding: 0;
}

.color-swatch:hover {
  transform: scale(1.18);
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  border-color: #e8d9b8;
}

.color-swatch.yellow { background: #f5dc50; }
.color-swatch.blue  { background: #64a0dc; }
.color-swatch.green { background: #6eaa82; }
.color-swatch.pink  { background: #d28caa; }

.verse-action-menu .menu-actions {
  border-top: 1px solid #e8d9b8;
  margin-top: 0.25rem;
  padding-top: 0.15rem;
}

.verse-action-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.38rem 0.55rem;
  font-size: 0.82rem;
  color: #3f2e1f;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
}

.verse-action-menu button:hover {
  background: #f0e2c9;
}

.verse-action-menu button.danger {
  color: #8a4a4a;
  font-size: 0.78rem;
}

/* Embedded note editor inside the right-side annotation popup (colors + notes together) */
.verse-action-menu .note-editor {
  border-top: 1px solid #e8d9b8;
  margin-top: 0.2rem;
  padding: 0.25rem 0.35rem 0.1rem;
}
.verse-action-menu .note-editor .menu-label {
  margin-bottom: 3px;
}
.verse-action-menu .note-editor textarea.verse-note-text {
  width: 100%;
  min-height: 68px;
  max-height: 140px;
  font-size: 0.76rem;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #d4c3a0;
  background: #fffef8;
  resize: vertical;
  line-height: 1.35;
}
.verse-action-menu .note-btn-row {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}
.verse-action-menu .note-btn-row button {
  flex: 1;
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}
.verse-action-menu .note-save-btn {
  background: #6b553f;
  color: #f9f4e9;
}
.verse-action-menu .note-save-btn:hover {
  background: #5a4733;
}
.verse-action-menu .note-delete-btn {
  background: none;
  border: 1px solid #c9b48a !important;
  color: #8a7354;
  padding: 3px 7px;
}
.verse-action-menu .note-delete-btn:hover {
  background: #f5e9d2;
}

html.dark-mode .verse-action-menu .note-editor {
  border-color: #5c4733;
}
html.dark-mode .verse-action-menu .note-editor textarea.verse-note-text {
  background: #2a2219;
  border-color: #5c4733;
  color: #e8d9b8;
}
html.dark-mode .verse-action-menu .note-delete-btn {
  border-color: #66533a !important;
  color: #b8a47d;
}
html.dark-mode .verse-action-menu .note-delete-btn:hover {
  background: #3a2f22;
}
.verse-note-popup {
  position: absolute;
  z-index: 100;
  background: #f9f4e9;
  border: 1px solid #d8c9a8;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  max-width: 290px;
  font-size: 0.9rem;
  color: #3f2e1f;
}

.verse-note-popup textarea {
  font-family: inherit;
  border: 1px solid #d4c3a0 !important;
  background: #fffef8;
}

.verse-note-popup button.verse-note-save {
  background: #6b553f;
  color: #f9f4e9;
  border: none;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}

.verse-note-popup button.verse-note-save:hover {
  background: #5a4733;
}

/* Backdrop for mobile verse action menu */
.verse-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
}

/* Insight card preview style (used by feature #4) */
.insight-card {
  background: #f9f4e9;
  border: 1px solid #d8c9a8;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  font-family: Georgia, serif;
  color: #3f2e1f;
}
.insight-card .insight-meta {
  font-size: 0.85rem;
  color: #6b553f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #d8c9a8;
}

/* Insight Card Modal — calm and reverent */
.insight-modal {
  position: fixed;
  inset: 0;
  background: rgba(60, 45, 30, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.insight-modal-content {
  background: #f9f4e9;
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow: hidden;
}
.insight-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid #d8c9a8;
}
.insight-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #3f2e1f;
  font-weight: 500;
}
.insight-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #8a7354;
  cursor: pointer;
}
.insight-controls {
  padding: 1rem 1.25rem 1.25rem;
  background: #f4ecdf;
}
.insight-controls textarea {
  width: 100%;
  border: 1px solid #d8c9a8;
  border-radius: 8px;
  padding: 0.65rem;
  font-size: 0.95rem;
  background: #fffdf8;
  resize: vertical;
  margin-bottom: 0.75rem;
}
.insight-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.insight-action-btn {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border: 1px solid #d8c9a8;
  background: #fffdf8;
  color: #3f2e1f;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.insight-action-btn.primary {
  background: #3f2e1f;
  color: #f9f4e9;
  border-color: #3f2e1f;
}
.insight-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.insight-hint {
  font-size: 0.7rem;
  color: #8a7354;
  text-align: center;
  margin-top: 0.75rem;
}

/* Insight card verse with drop cap support */
.insight-card .insight-verse {
  font-size: 1.02rem;
  line-height: 1.52;
  margin-bottom: 0.5rem;
  min-height: 60px;
  color: #3f2e1f;
  overflow: hidden; /* contain the floated dropcap */
  position: relative;
}
.insight-card .insight-dropcap {
  float: left;
  width: 56px;
  height: 56px;
  margin: 0.02rem 0.48rem 0.06rem 0;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.insight-card .insight-open-quote {
  font-size: 1.55rem;
  font-weight: 700;
  color: #8a7354;
  opacity: 0.38;
  margin-right: 0;
  line-height: 1;
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-0.15rem, -0.2rem);
}
.insight-card .insight-verse-body {
  display: inline;
}

/* Standard screen-reader only utility (used by insight card dropcap a11y fix) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Rich My Library styles (feature #3) */
.library-search input {
  width: 100%;
  max-width: 420px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.library-section {
  margin-bottom: 2rem;
}
.library-section-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.library-section-header h2 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--color-primary);
}
.library-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-accent-soft);
  padding: 1px 7px;
  border-radius: 999px;
}
.library-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0 0 0.6rem;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
}

.library-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  position: relative;
  min-height: 52px;
}
.library-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}
.library-card-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-alt);
}
.library-card-main {
  flex: 1;
  min-width: 0;
}
.library-card strong {
  display: block;
  font-size: 0.95rem;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.library-subtitle {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 3px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.9rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 1px 5px;
  border-radius: 4px;
  z-index: 2;
}
.library-remove:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

/* Focus / Ritual mode (Feature #4) */
body.focus-mode-active .chapter-header,
body.focus-mode-active .chapter-audio,
body.focus-mode-active .echoes-section,
body.focus-mode-active .controls,
body.focus-mode-active .related-chapters-section,
body.focus-mode-active .chapter-meta {
  display: none !important;
}
body.focus-mode-active .chapter-text {
  max-width: 72ch;
  margin: 2rem auto;
  font-size: 2.2rem;
  line-height: 1.9;
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0;
}

@media (max-width: 768px) {
  body.focus-mode-active .chapter-text {
    font-size: 2.0rem;
    line-height: 1.85;
  }
}

.reading-control-btn.insight-btn {
  font-size: 0.78rem;
  padding: 0 0.6rem;
  border: 1px solid #c9b38a;
  color: #5c4a35;
  background: #f9f4e9;
}
.reading-control-btn.insight-btn:hover {
  background: #f0e4d0;
  border-color: #a07d3d;
}

.audio-save-btn {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid #c9b38a;
  background: #f9f4e9;
  color: #5c4a35;
  cursor: pointer;
  white-space: nowrap;
  margin-left: 0.25rem;
  transition: all 0.2s ease;
}
.audio-save-btn:hover {
  background: #f0e4d0;
}

/* Consistent border-radius on audio player */
.chapter-audio {
  border-radius: var(--radius);
}

/* Ensure all interactive cards have pointer cursor */
.feature-card,
.nav-card,
.dim-card,
.character-item a,
.timeline-event-item a,
.storyline-card,
.home-dim,
.home-quick-link,
.continue-card,
.quick-action {
  cursor: pointer;
}

/* Smooth transitions on chapter-nav buttons */
.chapter-nav a {
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition), color var(--transition);
}

/* Stats bar responsive fix - prevent overflow */
@media (max-width: 480px) {
  .stats-bar {
    gap: 1rem;
    padding: 1rem 0;
  }
  .stat-number {
    font-size: 1.1rem;
  }
  .stat-label {
    font-size: 0.68rem;
  }
}

/* Home hero responsive text sizing */
@media (max-width: 380px) {
  .home-hero-title {
    font-size: 1.5rem;
  }
  .hero-title {
    font-size: 1.6rem;
  }
  .hero-subtitle {
    font-size: 0.9rem;
  }
  .chapter-text {
    padding: 0.9rem 0.75rem;
  }
  .verse-text {
    font-size: 0.96rem;
  }
}

/* ==========================================================================
   Usability Fixes
   ========================================================================== */

/* ---------- Skip to Content (Keyboard Accessibility) ---------- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-primary);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- Back to List Navigation ---------- */
.detail-back-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.back-to-list-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 1.2rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-primary);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
  min-height: 44px;
  min-width: 44px;
}

.back-to-list-link:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ---------- Empty State (Search No Results) ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.empty-state-message {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.empty-state-hint {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ---------- Search Zero State / Examples ---------- */
.search-examples {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.search-examples-lead {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
  font-weight: 500;
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.search-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.search-chip:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-alt);
  transform: translateY(-1px);
  text-decoration: none;
}

.search-chip:active {
  transform: scale(0.985);
}

.search-examples-more {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0.4rem 0 0.75rem;
  line-height: 1.5;
}

.search-examples-more a {
  color: var(--color-accent);
  text-decoration: none;
}

.search-examples-more a:hover {
  text-decoration: underline;
}

.search-examples-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  opacity: 0.85;
  max-width: 520px;
  line-height: 1.45;
  margin-top: 0.5rem;
}

/* ---------- Mobile Touch Targets (min 44px) ---------- */
@media (max-width: 768px) {
  .nav-search-link {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .nav-dark-toggle {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .back-to-top {
    width: 44px;
    height: 44px;
  }

  .filter-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .reading-check {
    width: 22px;
    height: 22px;
    min-width: 44px;
    min-height: 44px;
    padding: 11px;
  }
}

/* ---------- Explore Menu Button (Keyboard Accessible) ---------- */
.nav-dropdown-toggle {
  background: none;
  border: none;
  color: var(--color-nav-text);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition);
}

.nav-dropdown-toggle:hover {
  color: var(--color-nav-active);
}

.nav-dropdown-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- Image Loading State ---------- */
.detail-image {
  position: relative;
  min-height: 200px;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-border) 50%, var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 0;
}

.detail-image img {
  position: relative;
  z-index: 1;
}

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

.detail-image img[src] {
  /* Once loaded, hide the shimmer */
}


/* ==========================================================================
   Usability Fixes (10 issues)
   ========================================================================== */

/* ---------- FIX 2: Search dimension badges ----------
   Show which dimension each search result belongs to. */
.search-dimension-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 50px;
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
  border: 1px solid rgba(139, 105, 20, 0.2);
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* ---------- FIX 3: Resume button on book page ---------- */
.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 1rem;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}
.btn-resume:hover {
  transform: scale(1.03);
  opacity: 0.9;
  text-decoration: none;
  color: #fff;
}

/* ---------- FIX 6: Loading states / skeleton for images ----------
   Add a subtle placeholder background so broken images don't leave empty space. */
.detail-image {
  background-color: var(--color-bg-alt);
  border-radius: var(--radius);
  min-height: 120px;
  position: relative;
  overflow: hidden;
}
.detail-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-border) 50%, var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  z-index: 0;
}
.detail-image img {
  position: relative;
  z-index: 1;
}

.char-thumb {
  background-color: var(--color-bg-alt);
  position: relative;
}

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

/* ---------- FIX 7: Touch-friendly tap targets ----------
   Ensure filter pills and small buttons have minimum 44px height for mobile. */
@media (max-width: 768px) {
  .filter-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
  }
  .reading-control-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .chapter-link {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ---------- FIX 8: Verse number visibility ----------
   Make verse numbers slightly larger and add padding for better touch targets. */
.verse-number {
  font-size: 0.75rem;
  padding: 0.2rem 0.25rem;
  margin-right: 0.2rem;
  cursor: default;
}

sup.verse-number {
  font-size: 0.75em;
  padding: 0.15rem 0.2rem;
}

@media (max-width: 768px) {
  .verse-number {
    font-size: 0.8rem;
    padding: 0.3rem 0.35rem;
    margin-right: 0.25rem;
  }
  sup.verse-number {
    font-size: 0.8em;
    padding: 0.25rem 0.3rem;
  }
}

/* ---------- FIX 9: Audio indicator in sticky nav ---------- */
.audio-indicator {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--color-accent-soft);
  border: 1px solid rgba(139, 105, 20, 0.2);
  cursor: pointer;
  transition: transform 0.15s;
  line-height: 1;
}
.audio-indicator:hover {
  transform: scale(1.1);
}

/* ---------- FIX 10: Breadcrumb home link styling ----------
   Ensure the Home link in breadcrumbs is always clearly styled as a clickable link. */
.breadcrumbs a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(92, 61, 46, 0.3);
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color var(--transition), text-decoration-color var(--transition);
}
.breadcrumbs a:hover {
  color: var(--color-link-hover);
  text-decoration-color: var(--color-link-hover);
}

/* ---------- Reading Plan Progress Percentage ---------- */
.progress-percentage {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* ---------- Glossary Letter Index ---------- */
.glossary-letter-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  justify-content: center;
}

.letter-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-primary);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.letter-link:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  text-decoration: none;
}

.letter-disabled {
  color: var(--color-text-muted);
  opacity: 0.4;
  cursor: default;
  background-color: transparent;
  border-color: transparent;
}

.letter-disabled:hover {
  background-color: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}

.glossary-letter-heading {
  grid-column: 1 / -1;
  font-family: var(--font-ui);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  padding: 1rem 0 0.5rem;
  margin-top: 1rem;
  border-bottom: 2px solid var(--color-accent);
  scroll-margin-top: 80px;
}

/* ---------- Chapter Nav Title Truncation ---------- */
.chapter-nav a {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.chapter-nav-title {
  display: inline;
}

@media (max-width: 768px) {
  .chapter-nav a {
    max-width: 140px;
  }
}

/* ---------- Enhanced Print Stylesheet ---------- */
@media print {
  .navbar,
  .breadcrumbs,
  .chapter-nav,
  .site-footer,
  .character-search,
  .hero,
  .chapter-sticky-bar,
  .reading-controls,
  .chapter-audio,
  .back-to-top,
  .character-portrait,
  .btn-generate,
  .btn-regenerate,
  .filter-bar,
  .filter-pills,
  .filter-group,
  .nav-toggle,
  .keyboard-hint,
  .quick-start,
  .continue-card,
  .streak-card,
  .votd-share,
  .reading-plan-config,
  .progress-container,
  .progress-text,
  .progress-percentage,
  .reading-check,
  .glossary-letter-index,
  .copy-toast,
  .custom-modal,
  .echoes-section,
  .parallel-passages,
  .prophecy-links,
  .next-chapter-preview,
  .red-letter-note,
  .chapter-facts-section,
  .related-section,
  .detail-back-nav,
  #back-to-top,
  .skip-to-content,
  .audio-indicator,
  .book-progress-row {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.6;
  }

  .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .chapter-text {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
  }

  .verse {
    line-height: 1.8;
    page-break-inside: avoid;
  }

  .verse-number {
    color: #666;
    font-size: 0.65em;
  }

  .verse-red-letter {
    color: #000;
    font-weight: normal;
  }

  h1 {
    font-size: 18pt;
    margin-bottom: 0.5rem;
    page-break-after: avoid;
  }

  h2, h3 {
    page-break-after: avoid;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .character-bio {
    font-size: 10pt;
  }

  .bio-card {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }

  details.passage-section {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }

  details.passage-section[open] summary.passage-summary::before {
    display: none;
  }

  .chapter-title {
    font-size: 10pt;
  }

  .dropcap {
    display: none;
  }

  .dropcap-fallback {
    display: inline !important;
    float: none;
    font-size: 1em;
    margin: 0;
  }

  img {
    max-width: 300px;
  }

  @page {
    margin: 2cm;
  }
}

/* ==========================================================================
   Scholar Improvements - Word Cloud, Cross-References, Red Letter Toggle,
   Verse/Word Count, Testament Summary, Read Full Chapter
   ========================================================================== */

/* Chapter word cloud tags */
.chapter-word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.word-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  background-color: var(--color-accent-soft);
  color: var(--color-primary);
  border-radius: 50px;
  border: 1px solid rgba(184, 134, 11, 0.2);
}

.word-tag small {
  opacity: 0.7;
  font-size: 0.65rem;
}

/* Verse count and word count in chapter meta */
.verse-count,
.word-count {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* Cross-references section */
.cross-refs-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.cross-refs-section h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.cross-refs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cross-ref-item {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-card);
}

.cross-ref-item h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

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

.cross-ref-link {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  color: var(--color-primary);
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition);
}

.cross-ref-link:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  text-decoration: none;
}

/* Red letter toggle - when off, remove red styling */
.redletter-off .verse-red-letter {
  color: inherit;
  font-weight: inherit;
}

.redletter-off .verse-red-letter::before {
  display: none;
}

.redletter-off .verse-red-letter .verse-number {
  color: var(--color-verse-num);
}

/* Testament summary on books index */
.testament-summary {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: -0.75rem 0 1.25rem 0;
  font-style: italic;
}

/* Read full chapter link on character detail pages */
.read-full-chapter {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.read-full-chapter a {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
}

.read-full-chapter a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* ==========================================================================
   Feature: Verse Link Icons
   ========================================================================== */
.verse-link-icon {
  display: none;
  font-family: var(--font-ui);
  font-size: 0.55em;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.5;
  margin-left: 0.15rem;
  margin-right: 0.1rem;
  vertical-align: super;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: 0.02em 0.3em;
  line-height: 1;
  color: var(--color-accent);
  transition: all 0.15s ease;
}

.verse:hover .verse-link-icon {
  display: inline;
}

.verse-link-icon:hover {
  opacity: 1;
  background: var(--color-accent);
  color: var(--color-bg);
}

/* ==========================================================================
   Feature: Cross-Reference Inline Markers
   ========================================================================== */
.cross-ref-marker {
  margin-left: 0.2rem;
  vertical-align: super;
}

.cross-ref-marker a {
  font-family: var(--font-ui);
  font-size: 0.58em;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: 0.05em 0.4em;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cross-ref-marker a:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

/* ==========================================================================
   Feature: Chapter Paragraph Breaks
   ========================================================================== */
.verse-paragraph-start {
  margin-top: 1.25rem !important;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.verse-paragraph-start:first-child {
  margin-top: 0 !important;
  padding-top: 0;
  border-top: none;
}


/* ==========================================================================
   Feature: About This Book (Collapsible Section)
   ========================================================================== */
.about-book-section {
  margin: 1.5rem 0;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.about-book-toggle {
  padding: 1rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  list-style: none;
  transition: background-color var(--transition);
}

.about-book-toggle::-webkit-details-marker {
  display: none;
}

.about-book-toggle:hover {
  background-color: var(--color-bg-alt);
}

.about-book-content {
  padding: 0 1.5rem 1.5rem;
}

.about-book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.about-book-item h3 {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.about-book-item p {
  font-size: 0.92rem;
  color: var(--color-text);
  margin: 0;
  line-height: 1.6;
}

.about-book-themes {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.about-book-themes li {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background-color: var(--color-accent-soft);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: 50px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-primary);
}

.about-book-outline {
  padding-left: 1.25rem;
  margin: 0;
}

.about-book-outline li {
  margin-bottom: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-text);
}

/* Prominent Book Outline on chapters page */
.book-outline {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.book-outline .section-heading {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.book-outline-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.25rem 1rem;
}

.book-outline-list li {
  font-size: 0.9rem;
  color: var(--color-text);
}

.book-outline-list .outline-range {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  margin-left: 0.35rem;
}

/* Mini outlines on main books page */
.book-outline-mini {
  border-top: 1px dashed var(--color-border);
  padding-top: 0.5rem;
  margin-top: 0.5rem !important;
}

.book-outline-mini-list {
  margin: 0.25rem 0 0;
  padding-left: 1rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--color-text);
}

.book-outline-mini-list li {
  margin-bottom: 0.1rem;
}

/* Interactive outline highlights */
.outline-highlight {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  background-color: var(--color-accent-soft) !important;
  border-radius: var(--radius-sm);
}

.outline-section {
  transition: background-color 0.15s ease;
}

.outline-section:hover {
  background-color: var(--color-accent-soft);
  border-radius: 4px;
}

.btn-clear-highlight {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-clear-highlight:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-text);
}

/* Book cover loading states */
.cover-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
}

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

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

html.dark-mode .cover-loading {
  background: rgba(0,0,0,0.4);
}

/* Continue reading cards on books index */
.continue-card {
  display: block;
  padding: 0.85rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-subtle);
}

.continue-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

/* Dark mode support for new outline components */
html.dark-mode .book-outline {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

html.dark-mode .book-outline-list .outline-range {
  color: var(--color-text-muted);
}

html.dark-mode .book-outline-mini {
  border-color: var(--color-border);
}

/* Outline toggle pill */
#outline-filter .outline-toggle {
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  user-select: none;
}

#outline-filter .outline-toggle input {
  accent-color: var(--color-accent);
}

.outline-chapters {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

@media (max-width: 768px) {
  .about-book-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ==========================================================================
   Feature: Next Chapter Card (Continue Reading)
   ========================================================================== */
.next-chapter-card {
  max-width: 720px;
  margin: 2.75rem auto;
  padding: 1.85rem 2.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-left: 5px solid var(--color-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: all var(--transition);
}

.next-chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-left-color: var(--color-accent-light);
}

.next-chapter-card .next-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 0.55rem;
  opacity: 0.9;
}

.next-chapter-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--color-primary);
  font-family: var(--font-ui);
}

.next-chapter-card a:hover {
  text-decoration: none;
  color: var(--color-accent);
}

.next-chapter-card a strong {
  font-size: 1.15rem;
  font-weight: 700;
}

.next-chapter-card .next-title {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ==========================================================================
   Feature: Daily Devotional
   ========================================================================== */
.home-devotional {
  position: relative;
}

.devotional-theme {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 0.85rem;
  opacity: 0.9;
}

.devotional-reflection {
  font-family: var(--font-reading);
  font-size: 1.02rem;
  color: var(--color-text);
  line-height: 1.65;
  font-style: italic;
  margin: 1rem 0 0.75rem;
}

.devotional-application {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0 0 1rem;
}

.devotional-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.devotional-link {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.devotional-link-inline {
  margin-top: 0.5rem;
  display: inline-block;
}

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

/* Devotional Full Page */
.devotional-page {
  max-width: 680px;
  margin: 0 auto;
}

.devotional-page h1 {
  text-align: center;
}

.devotional-date {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.devotional-card-full {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.devotional-theme-badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background-color: var(--color-accent-soft);
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: 50px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}

.devotional-verse {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--color-text);
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25rem;
  margin: 0 0 1rem;
  font-style: italic;
}

.devotional-ref {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.devotional-ref a {
  color: var(--color-accent);
  font-weight: 600;
}

.devotional-body h2 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.devotional-body p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
}

.devotional-question {
  background-color: var(--color-bg-alt);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-style: italic;
}

.devotional-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.devotional-nav-link {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  text-decoration: none;
}

.devotional-nav-link:hover {
  background-color: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

.devotional-read-link {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ==========================================================================
   Feature: Chapter Context Card
   ========================================================================== */
.chapter-context-card {
  max-width: 680px;
  margin: 1rem auto;
  padding: 0.75rem 1.25rem;
  background-color: var(--color-bg-alt);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.chapter-context-card .context-label {
  font-weight: 600;
  color: var(--color-primary);
}

/* ==========================================================================
   Feature: Continue Exploring (Related Chapters)
   ========================================================================== */
.related-chapters-section {
  max-width: 680px;
  margin: 2.5rem auto;
}

.related-chapters-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

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

.related-chapter-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.related-chapter-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-accent);
  text-decoration: none;
}

.related-chapter-card strong {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--color-primary);
}

.related-chapter-card .related-reason {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Feature: Collections Dropdown
   ========================================================================== */
.collection-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.collection-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  z-index: 1000;
  min-width: 160px;
  padding: 0.4rem 0;
  margin-top: 0.25rem;
}

.collection-option {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition);
}

.collection-option:hover {
  background-color: var(--color-bg-alt);
}

.collection-option.collection-active {
  color: var(--color-accent);
  font-weight: 600;
}

.collection-option.collection-active::after {
  content: ' ✓';
}

/* ==========================================================================
   Feature: Collections Page
   ========================================================================== */
.collections-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
}

.collections-page h1 {
  margin-bottom: 0.5rem;
}

.collections-intro {
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.collections-empty {
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  padding: 3rem 1rem;
}

.collection-group {
  margin-bottom: 2rem;
}

.collection-group h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.collection-remove-btn {
  display: inline-block;
  margin-left: 0.5rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
  opacity: 0.5;
  transition: opacity var(--transition), color var(--transition);
}

.collection-remove-btn:hover {
  opacity: 1;
  color: #c62828;
}

/* ==========================================================================
   Feature: Home Collections Section
   ========================================================================== */
.home-collections {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 2.5rem;
}

.home-collections h2 {
  margin-bottom: 1rem;
}

/* ==========================================================================
   Feature: Explain This Verse
   ========================================================================== */
.verse {
  position: relative;
}

.verse-explain-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 50px;
  border: 1.5px solid var(--color-accent);
  background: rgba(212, 175, 55, 0.08);
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  margin-left: 0.4rem;
  vertical-align: middle;
  white-space: nowrap;
  transition: background-color var(--transition), color var(--transition);
  z-index: 5;
}

.verse:hover .verse-explain-btn {
  display: inline-flex;
}

.verse-explain-btn:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.verse-explain-btn:active {
  transform: scale(0.92);
  background: var(--color-accent);
  color: #fff;
}

.verse-explanation {
  display: block;
  margin: 0.5rem 0 0.75rem 1.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-alt);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  animation: fadeIn 0.2s ease;
}

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

/* Mobile + Tablet: explain button - proper touch target */
@media (max-width: 1024px) {
  .verse-explain-btn {
    padding: 0.2rem 0.5rem;
    height: auto;
    width: auto;
    font-size: 0.55rem;
    margin-left: 0.25rem;
    min-width: unset;
  }
  .verse-explain-btn:active {
    transform: scale(0.92);
  }
}

/* ==========================================================================
   Feature: Sticky Audio Player
   ========================================================================== */
/* Audio player is inside the sticky bar - keep it compact */
.chapter-sticky-bar .chapter-audio {
  margin: 0.3rem 0 0;
  padding: 0.3rem 0.5rem;
  border: none;
  background: transparent;
}
.chapter-sticky-bar .audio-player-inner audio {
  height: 32px;
}

@media (max-width: 600px) {
  .chapter-sticky-bar .chapter-audio {
    padding: 0.5rem;
    margin: 0.25rem 0 0;
  }
  .chapter-sticky-bar .audio-player-inner audio {
    height: 40px;
  }
  .chapter-sticky-bar .audio-toggles {
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0.4rem 0 0.15rem;
  }
}

/* ==========================================================================
   Feature: Ctrl+K Keyboard Hint
   ========================================================================== */
.kbd-hint {
  font-family: var(--font-ui);
  font-size: 0.55rem;
  padding: 0.1rem 0.3rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  opacity: 0.5;
  vertical-align: middle;
  margin-left: 0.2rem;
}
@media (max-width: 768px) {
  .kbd-hint { display: none; }
}

/* ==========================================================================
   Feature: Verse Count Badge on Chapter List
   ========================================================================== */
.chapter-verse-count {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-left: auto;
  opacity: 0.6;
}

/* ==========================================================================
   Feature: Last Read Badge on Books Page
   ========================================================================== */
.last-read-badge {
  margin-left: 0.5rem;
  font-size: 0.65rem;
  vertical-align: middle;
}

/* ==========================================================================
   Feature: Fixed Aspect Ratio for Images
   ========================================================================== */
.detail-image img {
  aspect-ratio: 16/9;
  object-fit: cover;
}
.char-thumb {
  aspect-ratio: 1;
  object-fit: cover;
}

/* ==========================================================================
   Atropos 3D Parallax for Detail Images
   ========================================================================== */
.detail-image-atropos {
  width: 100%;
  border-radius: var(--radius);
}
.detail-image-atropos .atropos-inner {
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-image-atropos .atropos-shadow {
  border-radius: var(--radius);
}
.detail-image-atropos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius);
}
/* Book cover large (chapters page) */
.book-cover-large .detail-image-atropos img {
  aspect-ratio: auto;
}
/* Chapter hero (read page, chapter 1) */
.chapter-book-hero .detail-image-atropos img {
  aspect-ratio: auto;
}

/* ==========================================================================
   Feature: Chapter Progress Indicator (#1)
   ========================================================================== */
.chapter-progress-indicator {
  height: 3px;
  background: var(--color-border);
  width: 100%;
  margin-bottom: 0.3rem;
}
.chapter-progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.3s;
}

/* ==========================================================================
   Feature: Prominent Search on Home Page (#2)
   ========================================================================== */
.home-search-form {
  margin-top: 1.5rem;
  margin-bottom: 1.75rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}
.home-search-input {
  width: 100%;
  padding: 0.85rem 1.35rem;
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(4px);
}
.home-search-input::placeholder { color: rgba(255,255,255,0.55); }
.home-search-input:focus { 
  border-color: var(--color-accent); 
  background: rgba(255,255,255,0.12); 
  box-shadow: 0 0 0 4px rgba(197, 164, 111, 0.15);
}

/* ==========================================================================
   Autocomplete / Typeahead Dropdown (used on home + /search)
   ========================================================================== */
.search-autocomplete {
  position: absolute;
  z-index: 1000;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 420px;
  overflow-y: auto;
  min-width: 360px;
  margin-top: 6px;
  padding: 6px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  box-sizing: border-box;
}
.search-autocomplete.hidden {
  display: none;
}
.search-suggestion {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.search-suggestion:hover,
.search-suggestion.active {
  background: var(--color-bg-alt);
}
.search-suggestion .sugg-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.search-suggestion .sugg-type {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.search-suggestion .sugg-type.book { background: #2a3f2a; color: #a3d9a3; }
.search-suggestion .sugg-type.character { background: #3a2f4a; color: #d2b3f0; }
.search-suggestion .sugg-type.place { background: #2f3f4a; color: #9ed0ff; }
.search-suggestion .sugg-type.verse { background: #4a3a2a; color: #f0d9a3; }
.search-suggestion .sugg-type.theme { background: #3f3a2a; color: #f0e0a3; }
.search-suggestion .sugg-type.miracle,
.search-suggestion .sugg-type.parable,
.search-suggestion .sugg-type.prayer,
.search-suggestion .sugg-type.prophecy { background: #3a2f3a; color: #e8b3e0; }
.search-suggestion .sugg-type.life-situation { background: #2f4a3f; color: #a3e0c8; }

.search-suggestion .sugg-label {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.88rem;
}
.search-suggestion .sugg-sub {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  padding-left: 0;
}
.search-autocomplete .sugg-footer {
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  margin-top: 4px;
  text-align: center;
}

/* ==========================================================================
   Feature: Overflow Menu for Reading Controls (#3)
   ========================================================================== */
.controls-overflow-wrapper {
  position: relative;
  display: inline-block;
}
.controls-overflow-btn {
  font-size: 1.1rem;
  letter-spacing: 1px;
}
.controls-overflow-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  padding: 0.4rem;
  z-index: 200;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.controls-overflow-menu .reading-control-btn,
.controls-overflow-menu .collection-dropdown-wrapper {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
}
.controls-overflow-menu .reading-control-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
}

/* ==========================================================================
   Feature: Back to Chapter Link (#4)
   ========================================================================== */
.back-to-reading {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 90;
  transition: transform 0.15s;
}
.back-to-reading:hover { transform: translateY(-2px); color: #fff; text-decoration: none; }
@media print { .back-to-reading { display: none !important; } }

/* ==========================================================================
   Feature: Collapse Dimensions on Home Page (#5)
   ========================================================================== */
.dim-toggle-btn {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 50px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.dim-toggle-btn:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-accent);
}

/* ==========================================================================
   Feature: Loading Spinner (#7)
   ========================================================================== */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Feature: Grid View for Chapter Lists (#8)
   ========================================================================== */
.chapter-grid-view {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 0.4rem;
}
.chapter-grid-view .chapter-list-item {
  display: block;
}
.chapter-grid-view .chapter-list-item > .chapter-list-link:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  min-height: 44px;
}
.chapter-grid-view .chapter-title-text,
.chapter-grid-view .chapter-read-badge,
.chapter-grid-view .chapter-play-btn {
  display: none !important;
}
.chapter-grid-view .chapter-number {
  margin: 0;
  min-width: auto;
}
.view-toggle {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.view-toggle-btn {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 0.85rem;
}
.view-toggle-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ==========================================================================
   Feature: Visual Hierarchy on Home Page (#10)
   ========================================================================== */
.home-continue {
  margin-bottom: 2.5rem;
}
.home-card-continue {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  border: none;
  padding: 1.25rem 1.5rem;
}
.home-card-continue strong { color: #fff; font-size: 1.1rem; }
.home-card-continue p { color: rgba(255,255,255,0.8); }
.home-card-continue:hover { border: none; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* ==========================================================================
   Beginners Page - World Class
   ========================================================================== */
.beginners-page {
  max-width: 800px;
  margin: 0 auto;
}
.beginners-hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}
.beginners-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}
.beginners-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}
.beginners-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
  padding: 0.75rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.beginners-toc a {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  transition: background 0.15s, color 0.15s;
}
.beginners-toc a:hover {
  background: var(--color-accent);
  color: #fff;
}
.beginners-section {
  margin-bottom: 3rem;
  scroll-margin-top: 80px;
}
.beginners-section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  display: inline-flex;
  color: var(--color-accent);
  opacity: 0.85;
}
.section-icon svg {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
}
.beginners-intro {
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.beginners-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.beginners-card {
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.beginners-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.card-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  margin-bottom: 0.6rem;
  color: var(--color-accent);
  opacity: 0.85;
  overflow: hidden;
}

.card-icon svg {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
}
.beginners-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}
.beginners-link {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
}
.beginners-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.beginners-start-card {
  display: block;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.beginners-start-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.beginners-start-card .start-book {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-accent);
  letter-spacing: 0.03em;
}
.beginners-start-card strong {
  display: block;
  margin: 0.3rem 0;
  font-size: 0.95rem;
  color: var(--color-text);
}
.beginners-start-card p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}
.beginners-tips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.tip-card {
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.tip-icon {
  display: block;
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  opacity: 0.9;
}

.tip-icon svg {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
}
.tip-card h3 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.tip-card p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}
.beginners-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.plan-card {
  display: block;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.plan-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.plan-card h3 {
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.plan-icon {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  opacity: 0.85;
}

.plan-icon svg {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
}
.plan-card p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.plan-duration {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
}
.beginners-cta {
  text-align: center;
  padding: 2rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.beginners-cta h2 {
  margin-bottom: 1.25rem;
}
.beginners-cta-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .beginners-hero h1 { font-size: 1.6rem; }
  .beginners-cards, .beginners-tips, .beginners-plans { grid-template-columns: 1fr; }
  .beginners-start-grid { grid-template-columns: 1fr 1fr; }
  .card-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  .card-icon svg {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
  }
  .section-icon svg {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
  }
  .tip-icon {
    width: 24px;
    height: 24px;
  }
  .tip-icon svg {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
  }
  .plan-icon {
    width: 24px;
    height: 24px;
  }
  .plan-icon svg {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
  }
}

/* ==========================================================================
   Reading Plans — World Class Redesign
   ========================================================================== */

.reading-plans-hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  max-width: 720px;
  margin: 0 auto 1.5rem;
}

.reading-plans-hero h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.reading-plans-hero .lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Card grid */
.reading-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .reading-plan-grid {
    grid-template-columns: 1fr;
  }
}

/* Individual plan card */
.reading-plan-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), 
              box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1),
              border-color 0.2s;
  height: 100%;
}

.reading-plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.12), 
              0 4px 12px -2px rgba(0, 0, 0, 0.08);
  border-color: var(--color-accent);
  text-decoration: none;
}

.reading-plan-card__media {
  position: relative;
  height: 148px;
  background: #f4f1e9;
  overflow: hidden;
}

.reading-plan-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.reading-plan-card:hover .reading-plan-card__media img {
  transform: scale(1.04);
}

.reading-plan-card__duration {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.95);
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 4px 10px 3px;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.6);
}

.dark-mode .reading-plan-card__duration {
  background: rgba(30, 28, 26, 0.94);
  color: #d4af7a;
  border-color: rgba(255,255,255,0.06);
}

.reading-plan-card__body {
  padding: 1.1rem 1.2rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.reading-plan-card__body h3 {
  font-size: 1.12rem;
  line-height: 1.28;
  margin: 0 0 0.4rem 0;
  color: var(--color-text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.reading-plan-card__body .desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0.95rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reading-plan-card__footer {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.reading-plan-card__progress {
  flex: 1;
  min-width: 0;
}

.reading-plan-card__progress .progress-label {
  font-family: var(--font-ui);
  font-size: 0.73rem;
  color: var(--color-text-muted);
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.reading-plan-card__progress .progress-text {
  font-weight: 500;
}

.reading-plan-card__progress .bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.reading-plan-card__progress .bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--color-accent), #b38b5e);
  transition: width 0.45s cubic-bezier(0.2, 0, 0, 1);
  border-radius: 999px;
}

/* Stronger "Continue" treatment when user has progress */
.reading-plan-card.has-progress .reading-plan-card__footer {
  border-top-color: var(--color-accent);
  border-top-width: 1.5px;
}

.reading-plan-card.has-progress .start-label {
  background: var(--color-accent);
  color: #fff !important;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(139, 105, 20, 0.25);
}

/* Progress ring used on detail pages */
.progress-ring {
  position: relative;
  width: 108px;
  height: 108px;
  flex-shrink: 0;
}

.progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 7;
}

.progress-ring .bg {
  stroke: var(--color-border);
}

.progress-ring .progress {
  stroke: var(--color-accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.2, 0, 0, 1);
}

.progress-ring .value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
}

.progress-ring .value .pct {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
}

.progress-ring .value .label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  letter-spacing: 0.3px;
  margin-top: 1px;
}

/* Plan detail hero + stats */
.plan-hero {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.75rem;
  align-items: center;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 720px) {
  .plan-hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }
  .plan-hero .plan-image {
    margin: 0 auto;
  }

  /* Mobile improvements for new reading plan elements */
  .today-reading-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
  }

  .today-read-btn {
    text-align: center;
    padding: 0.7rem 1rem;
  }

  .today-jump-btn {
    align-self: flex-start;
  }

  .plan-reading-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .plan-reading-actions .btn-primary {
    width: 100%;
    text-align: center;
  }

  .full-schedule > summary,
  .advanced-dates > summary {
    padding: 0.6rem 0;
    font-size: 0.95rem;
  }
}

.plan-hero .plan-image {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 4px 16px -4px rgba(0,0,0,0.15),
              0 0 0 1px var(--color-border);
  border: 6px solid var(--color-surface);
}

.plan-hero .plan-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plan-hero .plan-meta h1 {
  font-size: 1.85rem;
  margin: 0 0 0.35rem;
  line-height: 1.1;
}

.plan-hero .plan-meta .plan-duration-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-bg-alt);
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.plan-hero .plan-meta .plan-duration-pill svg {
  width: 14px;
  height: 14px;
}

.plan-hero .plan-meta p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 52ch;
}

/* Stats row under hero — calmer, more generous */
.plan-stats {
  display: flex;
  gap: 2.25rem;
  align-items: center;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
  padding: 0.35rem 0;
}

.plan-stat {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.plan-stat .number {
  font-size: 1.45rem;
  font-weight: 700;
  font-family: var(--font-ui);
  line-height: 1;
  color: var(--color-text);
}

.plan-stat .label {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  line-height: 1.25;
  max-width: 7.5em;
}

/* Config bar — softer, less form-like */
.reading-plan-config {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.65rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}

.reading-plan-config label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.reading-plan-config input[type="date"] {
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.84rem;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-ui);
}

.reading-plan-config .config-actions {
  display: flex;
  gap: 0.45rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.reading-plan-config button {
  font-size: 0.73rem;
  padding: 0.32rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-weight: 500;
}

.reading-plan-config button:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* Premium day list */
.readings-section h2 {
  font-size: 1.18rem;
  margin-bottom: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* New wrapper so preview content can be full-width below the row without breaking flex layout */
.day-row {
  display: block;
}
.day-row .day-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.82rem 1.05rem;
  background: var(--color-surface);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

/* Preview block now lives cleanly below the row */
.day-row .reading-inline-text {
  margin: 0;
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Visual day row (now inside .day-row wrapper for clean preview layout) */
.day-item,
.day-row .day-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.82rem 1.05rem;
  background: var(--color-surface);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.day-item:hover,
.day-row .day-item:hover {
  background: var(--color-bg-alt);
}

.day-item.today,
.day-row .day-item.today {
  background: var(--color-accent-soft);
  border-left: 4px solid var(--color-accent);
  padding-left: 0.95rem;
}

.day-item.overdue,
.day-row .day-item.overdue {
  opacity: 0.72;
}

/* Completed rows feel calm and done */
.day-item input[type="checkbox"]:checked ~ * .day-label,
.day-item:has(input:checked) .day-label,
.day-row .day-item input[type="checkbox"]:checked ~ * .day-label,
.day-row .day-item:has(input:checked) .day-label {
  color: var(--color-text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(139,105,20,0.35);
  text-decoration-thickness: 1px;
}

.day-item .check-wrapper,
.day-row .day-item .check-wrapper {
  flex-shrink: 0;
}

.day-item input[type="checkbox"],
.day-row .day-item input[type="checkbox"] {
  width: 21px;
  height: 21px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.day-item .day-number,
.day-row .day-item .day-number {
  font-family: var(--font-ui);
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--color-accent);
  min-width: 58px;
  letter-spacing: 0.3px;
}

.day-item .day-content,
.day-row .day-item .day-content {
  flex: 1;
  min-width: 0;
}

.day-item .day-label,
.day-row .day-item .day-label {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.35;
}

.day-item .day-actions,
.day-row .day-item .day-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.day-item .btn-read,
.day-row .day-item .btn-read {
  font-size: 0.76rem;
  padding: 0.28rem 0.75rem;
  border-radius: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-weight: 500;
}

.day-item .btn-read:hover,
.day-row .day-item .btn-read:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.day-item .reading-expand-btn,
.day-row .day-item .reading-expand-btn {
  background: var(--color-bg-alt);
  font-size: 0.74rem;
  padding: 0.28rem 0.6rem;
}

/* Inline expanded reading text */
.reading-inline-text {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background: var(--color-bg-alt);
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.6;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.reading-inline-text h4 {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.15rem;
}

.reading-inline-text p {
  margin: 0.15rem 0;
}

.reading-inline-text sup {
  color: #8b6914;
  margin-right: 0.3rem;
  font-size: 0.75em;
}

/* Completion celebration */
.plan-complete-banner {
  background: linear-gradient(135deg, #2c1810, #4a2f1f);
  color: #f4e9d8;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.plan-complete-banner::before {
  content: "✦";
  position: absolute;
  font-size: 4rem;
  opacity: 0.08;
  top: -10px;
  right: 20px;
}

.plan-complete-banner h3 {
  margin: 0 0 0.35rem;
  color: #f4e9d8;
  font-size: 1.15rem;
}

.plan-complete-banner p {
  margin: 0 0 0.85rem;
  opacity: 0.9;
  font-size: 0.9rem;
}

.plan-complete-banner .actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Dark mode tweaks for reading plans */
.dark-mode .reading-plan-card__media {
  background: #252320;
}

.dark-mode .day-item.today {
  background: rgba(180, 140, 80, 0.12);
}

.dark-mode .progress-ring .bg {
  stroke: #3a3835;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .plan-hero .plan-image {
    width: 120px;
    height: 120px;
  }

  .plan-stats {
    gap: 1.25rem;
  }

  /* Extra small screen tweaks for reading plans */
  .day-item,
  .day-row .day-item {
    padding: 0.6rem 0.75rem;
    gap: 0.55rem;
  }

  .day-item .btn-read,
  .day-row .day-item .btn-read {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
  }

  .reading-expand-btn {
    font-size: 0.68rem !important;
    min-height: 32px;
    min-width: 52px;
  }

  .plan-reading-actions {
    margin-top: 1.1rem;
  }

  .plan-reading-actions .btn-primary {
    padding: 0.6rem 1rem;
    font-size: 0.92rem;
  }

  /* Daily reading page - mark complete bar on mobile */
  .plan-reading-actions {
    gap: 0.5rem;
  }
}

/* ==========================================================================
   Cross-Linking Improvements - New Styles
   ========================================================================== */

/* ---------- Chapter Context Sidebar ---------- */
.chapter-context-sidebar {
  max-width: 720px;
  margin: 2rem auto;
  padding: 1.5rem 1.75rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.chapter-context-sidebar h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

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

.context-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border-light);
}

.context-item:last-child {
  border-bottom: none;
}

.context-item .context-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
}

.context-item a {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
}

.context-links {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ---------- Author Reading Plan ---------- */
.author-reading-plan {
  margin-top: 2rem;
}

.author-reading-plan h2 {
  margin-bottom: 0.5rem;
}

.reading-plan-meta {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.author-chapters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: flex-start;
}

.author-book-heading {
  width: 100%;
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-border);
}

.author-book-heading:first-child {
  margin-top: 0;
}

.author-chapter-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  text-decoration: none;
  transition: all var(--transition);
}

.author-chapter-link:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  text-decoration: none;
}

.author-ch-num {
  font-weight: 700;
  color: var(--color-primary);
}

.author-ch-title {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Prophecy Journey Timeline ---------- */
.prophecy-journey {
  margin-top: 2rem;
}

.prophecy-journey h2 {
  margin-bottom: 1rem;
}

.prophecy-journey-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 1.5rem;
  border-left: 3px solid var(--color-accent);
}

.prophecy-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  position: relative;
}

.prophecy-step-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: -2.25rem;
}

.prophecy-step-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.prophecy-step-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.prophecy-step-ref {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 500;
}

/* ---------- Family Tree ---------- */
.family-tree-section {
  margin-top: 1.5rem;
}

.family-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 1.25rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.family-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.family-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-right: 0.5rem;
}

.family-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.family-member {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}

a.family-member:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  text-decoration: none;
}

.family-current {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
  font-weight: 700;
}

.family-connector {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  padding: 0.25rem 0;
}

.family-spouse-connector {
  font-size: 1.1rem;
  color: var(--color-accent);
  margin: 0 0.25rem;
}

/* ---------- Journey Paths (Geography) ---------- */
.journey-paths-section {
  margin-top: 2rem;
}

.journey-paths-section h2 {
  margin-bottom: 1rem;
}

.journey-path {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.journey-path h3 {
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.journey-stops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.journey-stop {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}

a.journey-stop:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  text-decoration: none;
}

.journey-stop-current {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
  font-weight: 700;
}

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

/* ---------- Key Chapters (Themes) ---------- */
.key-chapters-section {
  margin: 1.5rem 0 2rem;
}

.key-chapters-section h2 {
  margin-bottom: 0.75rem;
}

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

.key-chapter-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition);
}

.key-chapter-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.key-chapter-card strong {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--color-primary);
}

.key-chapter-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text);
}

.key-chapter-meta {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.key-chapter-commentary {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: 0.25rem;
}

/* ---------- Reading Plan Context Link ---------- */
.reading-plan-context-link {
  display: inline-block;
  margin-left: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.reading-plan-context-link:hover {
  background: var(--color-accent);
  color: white;
  text-decoration: none;
}

/* === New styles for daily reading plan integration (rp-6) === */
.plan-reading-context {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.plan-reading-context .plan-context-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}
.plan-reading-context .plan-context-link:hover {
  text-decoration: underline;
}
.plan-reading-context .plan-context-sep {
  opacity: 0.5;
}

.plan-reading-actions {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.plan-reading-actions .btn-primary {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.plan-reading-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(139, 105, 20, 0.35);
}
.plan-reading-actions .btn-primary:active {
  transform: translateY(0);
}

.plan-reading-actions .next-day-link,
.plan-reading-actions .day-complete-status {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--color-accent);
}
.plan-reading-actions .day-complete-status {
  color: #2e7d32;
  border-color: rgba(46, 125, 50, 0.4);
  background: rgba(46, 125, 50, 0.08);
}
.plan-reading-actions .next-day-link:hover {
  background: var(--color-accent);
  color: #fff;
}

.plan-reading-actions .pulse-hint {
  animation: pulse 1.6s ease 2;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* === rp-5: Today's Reading card on plan detail === */
.today-reading-card {
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.today-reading-meta {
  flex: 1;
  min-width: 180px;
}

.today-reading-meta .today-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}

.today-reading-meta .today-day {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.today-reading-meta .today-streak {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.today-read-btn {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: 0 2px 8px -2px rgba(139, 105, 20, 0.3);
}
.today-read-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(139, 105, 20, 0.35);
}

.today-jump-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.today-jump-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Collapsed schedule for long plans (rp-5) */
.full-schedule {
  margin-top: 0.5rem;
}

.full-schedule > summary {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.5rem 0;
  user-select: none;
}

.full-schedule > summary:hover {
  color: var(--color-accent);
}

.full-schedule[open] > summary {
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.55rem;
}

/* Performance: Skip rendering offscreen day rows when schedule is closed (big win for Bible in a Year on mobile) */
.full-schedule:not([open]) .day-list {
  content-visibility: auto;
  contain-intrinsic-size: 40px 100%;
}

/* Extra mobile polish for reading plans */
@media (max-width: 480px) {
  .full-schedule > summary {
    padding: 0.75rem 0.25rem;
    font-size: 0.95rem;
    line-height: 1.35;
    min-height: 44px; /* better thumb target */
    display: flex;
    align-items: center;
  }

  .today-reading-card {
    padding: 0.75rem 0.9rem;
  }

  .reading-inline-text {
    font-size: 0.88rem;
    padding: 0.6rem 0.75rem;
  }
}

.full-schedule .schedule-hint {
  font-weight: 400;
  opacity: 0.7;
  font-size: 0.85em;
}

/* Advanced date controls (de-emphasized) */
.advanced-dates {
  margin-bottom: 1rem;
}

.advanced-dates > summary {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.35rem 0;
  user-select: none;
  opacity: 0.85;
}

.advanced-dates > summary:hover {
  opacity: 1;
  color: var(--color-accent);
}

/* Dark mode for new reading plan components */
.dark-mode .today-reading-card {
  background: var(--color-bg-alt);
  border-color: var(--color-accent);
}

.dark-mode .full-schedule > summary {
  color: var(--color-text-muted);
}

.dark-mode .full-schedule > summary:hover {
  color: var(--color-accent);
}

.dark-mode .full-schedule .schedule-hint {
  opacity: 0.65;
}

.dark-mode .advanced-dates > summary {
  color: var(--color-text-muted);
}

.dark-mode .advanced-dates > summary:hover {
  color: var(--color-accent);
}

.dark-mode .plan-reading-actions .day-complete-status {
  background: rgba(46, 125, 50, 0.15);
  border-color: rgba(46, 125, 50, 0.5);
  color: #81c784;
}

/* ---------- Dark Mode Overrides for New Components ---------- */
.dark-mode .chapter-context-sidebar {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

.dark-mode .family-tree {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

.dark-mode .family-member {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.dark-mode .journey-path {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

.dark-mode .journey-stop {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.dark-mode .key-chapter-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.dark-mode .author-chapter-link {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* ==========================================================================
   Animate Mode - Full-screen verse display during audio playback
   ========================================================================== */

.animate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #1a1510;
  padding: 2rem;
  transition: opacity 0.4s ease;
  overflow: hidden;
  /* Always dark cinematic look regardless of light/dark mode */
  color: #e8dcc8;
}

/* Ambient background scene - blurred book image */
.animate-bg-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.animate-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(40px) saturate(0.7) brightness(0.3);
  opacity: 0.3;
  transform: scale(1.2);
  transition: opacity 1.5s ease, filter 3s ease;
  animation: kenBurns 30s ease-in-out infinite alternate;
}

.dark-mode .animate-bg-img {
  filter: blur(40px) saturate(0.65) brightness(0.25);
  opacity: 0.25;
}

/* Ken Burns slow pan/zoom effect */
@keyframes kenBurns {
  0% {
    transform: scale(1.2) translate(0, 0);
  }
  33% {
    transform: scale(1.3) translate(-2%, 1%);
  }
  66% {
    transform: scale(1.25) translate(1%, -1%);
  }
  100% {
    transform: scale(1.35) translate(-1%, 2%);
  }
}

/* Mood-based background color overlays */
.animate-bg-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 1;
  transition: background 1.5s ease;
  background: transparent;
  z-index: 1;
}

/* Warm mood: praise, promises, love — golden hint */
.animate-overlay.mood-warm .animate-bg-img {
  opacity: 0.15;
  filter: blur(40px) saturate(1) brightness(0.3);
}
.animate-overlay.mood-warm .animate-bg-scene::after {
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 195, 50, 0.35), rgba(220, 160, 30, 0.2) 50%, rgba(140, 90, 10, 0.08) 80%, transparent 100%);
  opacity: 1;
}

/* Cool mood: judgment, lament, prophecy — blue tint */
.animate-overlay.mood-cool .animate-bg-img {
  opacity: 0.12;
  filter: blur(40px) saturate(0.5) brightness(0.2);
}
.animate-overlay.mood-cool .animate-bg-scene::after {
  background: radial-gradient(ellipse at 50% 40%, rgba(30, 50, 120, 0.4), rgba(20, 35, 80, 0.3) 55%, rgba(8, 10, 30, 0.15) 100%);
  opacity: 1;
}

/* Solemn mood: death, suffering, warning — crimson tint */
.animate-overlay.mood-solemn .animate-bg-img {
  opacity: 0.1;
  filter: blur(40px) saturate(0.4) brightness(0.2);
}
.animate-overlay.mood-solemn .animate-bg-scene::after {
  background: radial-gradient(ellipse at 50% 50%, rgba(100, 18, 18, 0.35), rgba(60, 10, 10, 0.25) 55%, rgba(15, 4, 4, 0.1) 100%);
  opacity: 1;
}

/* === Creation Narrative Moods (Genesis 1) === */

/* Void: total darkness, the deep — pure black */
.animate-overlay.mood-void .animate-bg-img {
  opacity: 0;
  transition: opacity 1.5s ease;
}
.animate-overlay.mood-void .animate-bg-scene::after {
  background: #000;
  opacity: 1;
}

/* Light: the first light breaks through darkness */
.animate-overlay.mood-light .animate-bg-img {
  opacity: 0.06;
  filter: blur(40px) saturate(0) brightness(1.5);
}
.animate-overlay.mood-light .animate-bg-scene::after {
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 250, 220, 0.4), rgba(255, 230, 150, 0.2) 35%, rgba(180, 140, 50, 0.08) 60%, transparent 100%);
  opacity: 1;
  animation: lightPulse 4s ease-in-out infinite alternate;
}

@keyframes lightPulse {
  from { opacity: 0.85; }
  to { opacity: 1; }
}

/* Sky: the firmament, heavens above */
.animate-overlay.mood-sky .animate-bg-img {
  opacity: 0.08;
  filter: blur(40px) saturate(0.5) brightness(0.2);
}
.animate-overlay.mood-sky .animate-bg-scene::after {
  background: linear-gradient(to bottom, rgba(70, 130, 200, 0.35) 0%, rgba(45, 95, 170, 0.25) 50%, rgba(20, 45, 100, 0.35) 100%);
  opacity: 1;
  animation: skyDrift 8s ease-in-out infinite alternate;
}

@keyframes skyDrift {
  from { background-position: 0% 0%; }
  to { background-position: 0% 10%; }
}

/* Earth: dry land appears */
.animate-overlay.mood-earth .animate-bg-img {
  opacity: 0.08;
  filter: blur(40px) saturate(0.6) brightness(0.2);
}
.animate-overlay.mood-earth .animate-bg-scene::after {
  background: linear-gradient(to bottom, rgba(60, 110, 160, 0.1) 0%, rgba(130, 95, 45, 0.18) 60%, rgba(80, 55, 20, 0.22) 100%);
  opacity: 1;
}

/* Green: vegetation, grass, trees */
.animate-overlay.mood-green .animate-bg-img {
  opacity: 0.1;
  filter: blur(40px) saturate(1.2) brightness(0.25);
}
.animate-overlay.mood-green .animate-bg-scene::after {
  background: radial-gradient(ellipse at 50% 60%, rgba(40, 140, 40, 0.35), rgba(25, 95, 25, 0.25) 50%, rgba(10, 45, 10, 0.15) 100%);
  opacity: 1;
  animation: greenSway 6s ease-in-out infinite alternate;
}

@keyframes greenSway {
  from { transform: scale(1); }
  to { transform: scale(1.02); }
}

/* Cosmos: sun, moon, stars — deep space with lights */
.animate-overlay.mood-cosmos .animate-bg-img {
  opacity: 0.02;
}
.animate-overlay.mood-cosmos .animate-bg-scene::after {
  background: 
    radial-gradient(circle at 25% 25%, rgba(255, 230, 150, 0.15) 0%, transparent 10%),
    radial-gradient(circle at 75% 40%, rgba(180, 190, 230, 0.08) 0%, transparent 7%),
    radial-gradient(circle at 50% 70%, rgba(255, 255, 200, 0.05) 0%, transparent 4%),
    radial-gradient(circle at 15% 60%, rgba(255, 255, 255, 0.03) 0%, transparent 2%),
    radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.03) 0%, transparent 2%),
    linear-gradient(to bottom, rgba(4, 4, 20, 0.15) 0%, rgba(8, 8, 30, 0.1) 100%);
  opacity: 1;
  animation: starTwinkle 5s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  from { opacity: 0.9; }
  to { opacity: 1; }
}

/* Ocean: waters teeming with life */
.animate-overlay.mood-ocean .animate-bg-img {
  opacity: 0.08;
  filter: blur(40px) saturate(0.8) brightness(0.2);
}
.animate-overlay.mood-ocean .animate-bg-scene::after {
  background: linear-gradient(to bottom, rgba(15, 75, 125, 0.35) 0%, rgba(8, 45, 90, 0.35) 50%, rgba(4, 22, 45, 0.3) 100%);
  opacity: 1;
  animation: oceanWave 7s ease-in-out infinite alternate;
}

@keyframes oceanWave {
  from { transform: translateY(0); }
  to { transform: translateY(-2%); }
}

/* Divine: God creates man in His image */
.animate-overlay.mood-divine .animate-bg-img {
  opacity: 0.06;
  filter: blur(40px) saturate(0) brightness(1);
}
.animate-overlay.mood-divine .animate-bg-scene::after {
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 245, 210, 0.35), rgba(255, 215, 120, 0.2) 40%, rgba(160, 120, 40, 0.08) 70%, transparent 100%);
  opacity: 1;
  animation: divineGlow 3.5s ease-in-out infinite alternate;
}

@keyframes divineGlow {
  from { opacity: 0.85; transform: scale(1); }
  to { opacity: 1; transform: scale(1.01); }
}

/* Crossfade transition between chapters */
.animate-overlay.animate-crossfade-out {
  animation: crossfadeOut 0.8s ease forwards;
}

.animate-overlay.animate-crossfade-out .animate-verse-container,
.animate-overlay.animate-crossfade-out .animate-progress-text,
.animate-overlay.animate-crossfade-out .animate-progress-ref,
.animate-overlay.animate-crossfade-out .animate-facts-footer {
  opacity: 0;
  transition: opacity 0.4s ease;
}

@keyframes crossfadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Keyword emphasis in verse text */
.animate-keyword {
  color: #c5a46f;
}

/* Title card - cinematic chapter intro (desktop only) */
.animate-title-card {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.animate-title-card.active {
  display: flex;
  opacity: 1;
}

/* During the 4-second cinematic intro on Chapter 1, hide everything except the title card */
.animate-overlay.intro-title-active .animate-verse-container,
.animate-overlay.intro-title-active .animate-progress-track,
.animate-overlay.intro-title-active .animate-progress-text,
.animate-overlay.intro-title-active .animate-progress-ref,
.animate-overlay.intro-title-active .animate-verse-dots,
.animate-overlay.intro-title-active .animate-facts-footer,
.animate-overlay.intro-title-active .animate-play-pause-btn,
.animate-overlay.intro-title-active .animate-header-controls,
.animate-overlay.intro-title-active .animate-music-btn,
.animate-overlay.intro-title-active .animate-fullscreen-btn {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.animate-title-img {
  width: clamp(200px, 40vw, 480px);
  height: clamp(200px, 40vw, 480px);
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
}

.animate-title-book {
  font-family: var(--font-reading);
  font-size: clamp(3rem, 8vw, 5rem);
  color: #e8dcc8;
  letter-spacing: 0.02em;
}

.animate-title-chapter {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  color: #c5a46f;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}

/* Progressive verse dots (desktop only) */
.animate-verse-dots {
  display: none;
  position: absolute;
  bottom: 4.8rem;
  left: 2rem;
  right: 2rem;
  height: 3px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
  z-index: 2;
}

.animate-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.4s ease, transform 0.3s ease, box-shadow 0.4s ease;
}

.animate-dot.dot-done {
  background: rgba(197, 164, 111, 0.5);
}

.animate-dot.dot-active {
  background: #c5a46f;
  transform: scale(1.5);
  box-shadow: 0 0 6px rgba(197, 164, 111, 0.6);
}

@media (min-width: 768px) {
  .animate-verse-dots {
    display: flex;
  }

  /* Desktop: show verse dots */
}

/* Ensure all overlay content sits above the background */
.animate-overlay > .animate-close-btn,
.animate-overlay > .animate-play-pause-btn,
.animate-overlay > .animate-fullscreen-btn,
.animate-overlay > .animate-music-btn {
  z-index: 10;
  pointer-events: auto;
}
.animate-overlay > .animate-progress-track,
.animate-overlay > .animate-progress-text,
.animate-overlay > .animate-progress-ref,
.animate-overlay > .animate-title-card,
.animate-overlay > .animate-verse-container,
.animate-overlay > .animate-verse-dots,
.animate-overlay > .animate-facts-footer {
  z-index: 1;
}
.animate-overlay > .animate-header-controls {
  z-index: 10;
  pointer-events: auto;
}

.animate-close-btn {
  position: absolute;
  top: calc(1.25rem + env(safe-area-inset-top, 0px));
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 1;
}

.animate-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.animate-play-pause-btn {
  position: absolute;
  bottom: 1.25rem;
  left: 4.5rem;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 10001;
  letter-spacing: -2px;
}

.animate-play-pause-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

/* Animate header controls: prev verse + book/chapter jump */
.animate-header-controls {
  position: absolute;
  top: calc(1.25rem + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10002;
}

.animate-ctrl-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.animate-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.animate-jump-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 1.5rem 0.35rem 0.6rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  max-width: 140px;
}
.animate-verse-select {
  max-width: 200px;
}
.animate-jump-select:hover,
.animate-jump-select:focus {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}
.animate-jump-select option {
  background: #2a2520;
  color: #f0e6d8;
}

@media (max-width: 768px) {
  .animate-header-controls {
    top: calc(0.6rem + env(safe-area-inset-top, 0px));
    gap: 0.4rem 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 2rem);
    padding: 0 0.5rem;
  }
  /* Row 1: prev + verse select + next (take full width) */
  .animate-verse-select {
    order: 1;
    flex: 1;
    min-width: 0;
    max-width: none;
    text-align: center;
  }
  #animate-prev-verse-btn {
    order: 0;
  }
  #animate-next-verse-btn {
    order: 2;
  }
  /* Row 2: book + chapter (force wrap) */
  #animate-jump-book {
    order: 4;
  }
  #animate-jump-chapter {
    order: 5;
  }
  .animate-jump-select {
    font-size: 0.74rem;
    padding: 0.32rem 1.2rem 0.32rem 0.5rem;
    max-width: 130px;
  }
  .animate-ctrl-btn {
    width: 32px;
    height: 32px;
  }
}
    width: 30px;
    height: 30px;
  }
}

.animate-verse-container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 80%;
  width: 80%;
  max-height: 80%;
  padding: 1rem 0;
  text-align: center;
  margin: 0 auto;
  margin-top: -2.5rem;
  overflow: hidden;
}

.animate-verse-wrap {
  display: inline;
}

.animate-dropcap {
  float: left;
  width: 108px;
  height: 108px;
  object-fit: contain;
  margin: 0.1em 0.2em 0 0;
  shape-outside: margin-box;
}

.animate-verse-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.6rem, 6.4vw, 4.5rem);
  font-weight: 400;
  line-height: 1.3;
  color: #e8dcc8;
  margin: 0;
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  letter-spacing: 0.005em;
  width: 100%;
}

/* Only shrink text when too long — never grow beyond default */
.animate-verse-text.verse-long {
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
  line-height: 1.3;
}

.animate-verse-text.verse-very-long {
  font-size: clamp(1.5rem, 3.7vw, 2.5rem);
  line-height: 1.3;
}

.animate-verse-text:has(.animate-dropcap) {
  text-align: left;
}

.animate-verse-text.animate-verse-out {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.animate-verse-text.animate-verse-in {
  animation: verseAppear 0.6s ease forwards;
}

@keyframes verseAppear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-verse-ref {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: #c5a46f;
  margin-top: 1.5rem;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

/* Facts footer - locked at bottom */
.animate-facts-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.75rem 2.5rem;
  background: rgba(20, 16, 12, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.animate-facts-label {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c5a46f;
}

.dark-mode .animate-facts-footer {
  background: rgba(20, 16, 12, 0.92);
  border-color: rgba(255,255,255,0.08);
}

.animate-fact {
  display: none;
  font-family: var(--font-ui);
  font-size: 1.15rem;
  color: rgba(232, 220, 200, 0.85);
  text-align: center;
  max-width: 800px;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.animate-fact.animate-fact-active {
  display: block;
  animation: factFadeIn 0.6s ease forwards;
}

@keyframes factFadeIn {
  0% { opacity: 0; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Hide page chrome when animate mode is active — overlay covers content */
body.animate-mode-active {
  overflow: hidden !important;
}
body.animate-mode-active .navbar,
body.animate-mode-active .breadcrumbs,
body.animate-mode-active .site-footer,
body.animate-mode-active .back-to-top,
body.animate-mode-active .back-to-reading,
body.animate-mode-active .echoes-section,
body.animate-mode-active .chapter-connections {
  z-index: 0;
  display: none !important;
}

/* Hide all user annotation UI (highlights + note icons) during cinematic animate mode */
body.animate-mode-active .verse.user-highlight,
body.animate-mode-active .verse .verse-note-btn,
body.animate-mode-active .verse.has-note::before {
  display: none !important;
}

/* Hide annotation UI (especially the notes icon) while the Insight card modal is open */
body.insight-modal-open .verse-note-btn,
body.insight-modal-open .has-note::before {
  display: none !important;
}

/* Animate activate button (replaces toggle) */
.animate-activate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.animate-activate-btn:hover {
  background: var(--color-accent-light);
  transform: scale(1.05);
}

/* Fullscreen button inside animate overlay - desktop only */
.animate-fullscreen-btn {
  display: inline-flex;
  position: absolute;
  top: 1.25rem;
  right: 4.5rem;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  z-index: 10001;
}

.animate-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.1);
}

/* Ambient music toggle button */
.animate-music-btn {
  display: inline-flex;
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, color 0.2s;
  z-index: 10001;
}

.animate-music-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
  transform: scale(1.1);
}

.animate-music-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: #c5a46f;
}

.animate-music-btn.active:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Animate mode: red letter (words of Jesus) — radiant divine light, the brightest mood */
.animate-verse-text.animate-red-letter {
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 240, 200, 0.8), 0 0 50px rgba(255, 220, 140, 0.5), 0 0 80px rgba(255, 200, 80, 0.3);
}

.animate-overlay:has(.animate-red-letter) .animate-bg-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 235, 180, 0.5) 0%, rgba(255, 210, 120, 0.3) 30%, rgba(255, 180, 60, 0.12) 55%, transparent 80%);
  z-index: 1;
  pointer-events: none;
  animation: auraBreath 3s ease-in-out infinite alternate;
}

/* Override mood colors when Jesus speaks — always radiant gold-white */
.animate-overlay:has(.animate-red-letter) .animate-bg-scene::after {
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 240, 190, 0.45), rgba(255, 200, 100, 0.2) 50%, transparent 85%) !important;
  opacity: 1 !important;
}

/* Cross silhouette behind text when Jesus speaks in animate mode */
.animate-overlay:has(.animate-red-letter) .animate-verse-container::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 320px;
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 180' fill='none'%3E%3Crect x='50' y='0' width='20' height='180' rx='4' fill='rgba(255,240,200,0.15)'/%3E%3Crect x='15' y='40' width='90' height='20' rx='4' fill='rgba(255,240,200,0.15)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  pointer-events: none;
  z-index: 0;
  animation: crossFadeIn 1.5s ease-out forwards;
}

@keyframes crossFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes auraBreath {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 1; transform: scale(1.05); }
}

.dark-mode .animate-verse-text.animate-red-letter {
  color: #fffbf0;
  text-shadow: 0 0 20px rgba(255, 240, 200, 0.9), 0 0 50px rgba(255, 220, 140, 0.6), 0 0 80px rgba(255, 200, 80, 0.35);
}

.dark-mode .animate-overlay:has(.animate-red-letter) .animate-verse-container::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 180' fill='none'%3E%3Crect x='50' y='0' width='20' height='180' rx='4' fill='rgba(255,240,200,0.18)'/%3E%3Crect x='15' y='40' width='90' height='20' rx='4' fill='rgba(255,240,200,0.18)'/%3E%3C/svg%3E");
}

/* Animate mode: progress bar */
.animate-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
}

.animate-progress-fill {
  height: 100%;
  background: #c5a46f;
  transition: width 0.6s ease;
  width: 0%;
}

.animate-progress-text {
  display: none; /* Replaced by header controls (book/chapter selectors) */
}

.animate-progress-ref {
  display: none;
}

/* ==========================================================================
   BibleProject Video Section
   ========================================================================== */
.bp-videos-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
}
.bp-videos-section h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}
.bp-videos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.bp-video-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bp-video-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.bp-video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #111;
}
.bp-video-embed lite-youtube {
  width: 100%;
  height: 100%;
}
.bp-video-info {
  padding: 0.75rem 1rem;
}
.bp-video-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--color-text);
}
.bp-video-desc {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}
.bp-credit {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.bp-credit a {
  color: var(--color-link);
}
@media (max-width: 700px) {
  .bp-videos-grid {
    grid-template-columns: 1fr;
  }
}

/* lite-youtube custom element styles */
lite-youtube {
  background-color: #000;
  position: relative;
  display: block;
  contain: content;
  background-position: center center;
  background-size: cover;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
lite-youtube::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 100%);
  height: 60px;
  padding-bottom: 50px;
  width: 100%;
  transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
  z-index: 1;
}
lite-youtube::after {
  content: "";
  display: block;
  padding-bottom: 56.25%;
}
lite-youtube > .lty-playbtn {
  display: block;
  width: 68px;
  height: 48px;
  position: absolute;
  cursor: pointer;
  transform: translate3d(-50%, -50%, 0);
  top: 50%;
  left: 50%;
  z-index: 1;
  background-color: transparent;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>');
  filter: grayscale(100%);
  transition: filter .1s cubic-bezier(0, 0, 0.2, 1);
  border: none;
}
lite-youtube:hover > .lty-playbtn,
lite-youtube .lty-playbtn:focus {
  filter: none;
}
lite-youtube.lyt-activated {
  cursor: unset;
}
lite-youtube.lyt-activated::before,
lite-youtube.lyt-activated > .lty-playbtn {
  opacity: 0;
  pointer-events: none;
}
.lyt-visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Glossary related links */
.glossary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.glossary-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-family: var(--font-ui);
  padding: 0.15rem 0.5rem;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border-light);
  border-radius: 9999px;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.glossary-link-pill:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-alt);
  text-decoration: none;
}
.glossary-original {
  display: block;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

/* Rich dimension links inside glossary definitions */
.glossary-definition-rich .glossary-dim-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.glossary-definition-rich .glossary-dim-link:hover {
  text-decoration-style: solid;
}

/* Rich content inside glossary tooltips (auto-related pills etc.) */
.glossary-tooltip .glossary-auto-links {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.glossary-tooltip .glossary-link-pill {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border-light);
  border-radius: 3px;
  color: var(--color-text);
  text-decoration: none;
}
.glossary-tooltip .glossary-link-pill:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-accent);
}

/* Commentary Video Section */
.commentary-video-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border-light);
}
.commentary-video-section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.85rem;
}
.commentary-videos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (max-width: 700px) {
  .commentary-videos-grid {
    grid-template-columns: 1fr;
  }
}
.commentary-video-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}
.commentary-video-embed {
  position: relative;
  width: 100%;
  background: #111;
}
.commentary-video-embed video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}
.commentary-video-embed lite-youtube {
  width: 100%;
  height: 100%;
}
.commentary-video-info {
  padding: 0.65rem 0.9rem;
}
.commentary-video-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--color-text);
}
.commentary-video-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}
.commentary-credit {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* Commentary transcript */
.commentary-transcript-toggle {
  padding: 0.5rem 0.9rem;
}
.commentary-transcript-btn {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.commentary-transcript-btn:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}
.commentary-transcript {
  max-height: 280px;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  margin: 0 0.9rem 0.9rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-reading);
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--color-text);
}
.commentary-transcript .transcript-line {
  margin-bottom: 0.5rem;
  text-indent: 0;
}
.commentary-transcript .transcript-line:last-child {
  margin-bottom: 0;
}

/* Commentary of the Day (home page) */
.home-commentary-day {
  margin-bottom: 2.5rem;
}
.cotd-card {
  display: grid;
  grid-template-columns: minmax(280px, 480px) 1fr;
  gap: 1.5rem;
  align-items: start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.cotd-video video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #000;
}
.cotd-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}
.cotd-info p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.cotd-related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  grid-column: 1 / -1;
}
.cotd-transcript {
  max-height: 200px;
  overflow-y: auto;
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-reading);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}
.cotd-transcript p {
  margin-bottom: 0.35rem;
}
.cotd-transcript p:last-child {
  margin-bottom: 0;
}
.cotd-related-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
}
.cotd-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-ui);
  padding: 0.2rem 0.6rem;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border-light);
  border-radius: 9999px;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.cotd-pill:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-alt);
  text-decoration: none;
}
@media (max-width: 700px) {
  .cotd-card {
    grid-template-columns: 1fr;
  }
}

/* Commentary index page grid */
.commentary-all-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}
.commentary-all-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.commentary-all-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.commentary-all-video video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}
.commentary-all-info {
  padding: 0.9rem 1.1rem;
}
.commentary-all-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.commentary-all-info p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0.6rem;
}
.commentary-all-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.commentary-count {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}
@media (max-width: 600px) {
  .commentary-all-grid {
    grid-template-columns: 1fr;
  }
}

/* Commentary disclaimer */
.commentary-disclaimer {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: 0.4rem;
  opacity: 0.75;
}

/* About page explainer video */
.about-explainer {
  max-width: 70%;
  margin: 1.5rem auto 2rem;
}
.about-explainer video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #000;
}
.about-explainer-credit {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}
.about-explainer-credit a {
  color: var(--color-link);
}
@media (max-width: 600px) {
  .about-explainer {
    max-width: 100%;
  }
}

/* ==========================================================================
   USABILITY FIX: Minimum readable text sizes + touch targets
   Ensures all text is at least 12px on desktop and 14px on mobile.
   Does NOT change desktop layout — only enforces minimums.
   ========================================================================== */

/* --- Fix 1: Footer text too small (was 0.68-0.75rem inline) --- */
.site-footer .footer-text {
  font-size: 0.8rem !important;
  opacity: 0.85 !important;
  line-height: 1.5;
}
.site-footer .footer-text.footer-legal {
  font-size: 0.78rem !important;
  opacity: 0.7 !important;
  margin-top: 0.2rem;
}
.site-footer .footer-text.footer-legal a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer .footer-links a {
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Fix 2: Mega menu headings too small (was 0.61rem) --- */
.mega-heading {
  font-size: 0.72rem;
}

/* --- Fix 3: Discovery banner label too small (was 0.72rem) --- */
.discovery-banner-label {
  font-size: 0.78rem;
}

/* --- Fix 4: Audio toggle labels too small (was 0.7rem) --- */
.audio-toggle .toggle-text {
  font-size: 0.78rem;
}

/* --- Fix 5: Verse numbers too small with low opacity --- */
.verse-number {
  font-size: 0.65rem;
  opacity: 0.75;
}

/* --- Fix 6: Related section headings too small (was 0.7rem) --- */
.related-group h3 {
  font-size: 0.8rem;
}

/* --- Fix 7: Badges and pills too small --- */
.search-dimension-badge,
.glossary-cat-badge,
.mention-count,
.pill-count,
.certainty-badge,
.badge {
  font-size: 0.72rem;
}

/* --- Fix 8: Era timeline labels too small on mobile --- */
@media (max-width: 768px) {
  .era-segment-label {
    font-size: 0.68rem;
  }
}

/* --- Fix 9: Dim card descriptions too small --- */
.dim-card p {
  font-size: 0.78rem;
}

/* --- Fix 10: Stat labels and small metadata --- */
.stat-label,
.key-chapters-label,
.next-chapter-card .next-label,
.devotional-theme,
.streak-note,
.echo-type,
.chapter-estimate,
.red-letter-note,
.insight-hint {
  font-size: 0.75rem;
}

/* ==========================================================================
   MOBILE READABILITY: Enforce minimum 14px for body text on touch devices
   ========================================================================== */
@media (max-width: 768px) {
  /* Breadcrumbs */
  .breadcrumbs ol {
    font-size: 0.82rem;
  }

  /* Filter pills */
  .filter-pill {
    font-size: 0.84rem;
  }

  /* Footer */
  .site-footer .footer-text {
    font-size: 0.84rem !important;
  }
  .site-footer .footer-links a {
    font-size: 0.84rem;
    padding: 0.4rem 0;
    display: inline-block;
  }

  /* Home pathway descriptions */
  .home-pathway p {
    font-size: 0.84rem;
  }

  /* Home dimension labels */
  .home-dim span {
    font-size: 0.84rem;
  }

  /* Book navigation */
  .book-nav-prev,
  .book-nav-next {
    font-size: 0.82rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .book-nav-center {
    font-size: 0.78rem;
  }

  /* Sticky bar nav */
  .nav-bar-prev,
  .nav-bar-next {
    font-size: 0.82rem;
  }

  /* Progress text */
  .progress-text {
    font-size: 0.84rem;
  }

  /* Section headings */
  .section-heading {
    font-size: 0.84rem;
  }

  /* Card descriptions */
  .home-card p {
    font-size: 0.82rem;
  }

  /* Character descriptions in lists */
  .character-description {
    font-size: 0.88rem;
  }

  /* Audio toggles */
  .audio-toggle .toggle-text {
    font-size: 0.82rem;
  }

  /* Verse text in detail pages */
  .verse-text {
    font-size: 1.02rem;
  }

  /* Commentary transcript */
  .commentary-transcript {
    font-size: 0.88rem;
  }

  /* Tooltip text */
  .tooltip-original,
  .tooltip-link,
  .tooltip-count {
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   TOUCH TARGET FIXES: Ensure all interactive elements are at least 44px
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
  /* Color swatches in highlight picker */
  .color-swatch {
    min-width: 44px;
    min-height: 44px;
  }

  /* Letter links (alphabet navigation) */
  .letter-link {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Chapter play button */
  .chapter-play-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }

  /* Cross-reference markers */
  .cross-ref-marker a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Timeline event - read passage link */
.event-read-passage {
  margin: 1.5rem 0;
}

.passage-read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.passage-read-link:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* Passage play button - listen to any referenced passage */
.passage-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  margin-left: 0.4rem;
  vertical-align: middle;
  transition: transform 0.15s, filter 0.2s;
  flex-shrink: 0;
}

.passage-play-btn:hover {
  transform: scale(1.12);
  filter: brightness(1.1);
  text-decoration: none;
  color: #fff;
}

/* ---------- Tag Badges (pill-shaped) ---------- */
.character-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  background-color: var(--color-accent-soft);
  border: 1px solid var(--color-accent);
  border-radius: 50px;
  padding: 0.25em 0.75em;
  white-space: nowrap;
  line-height: 1.4;
}

/* ---------- Commentary Transcript Toggle ---------- */
.cotd-transcript-details {
  margin-top: 0.75rem;
}

.cotd-transcript-toggle {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary);
  cursor: pointer;
  padding: 0.4rem 0;
}

.cotd-transcript-toggle:hover {
  text-decoration: underline;
}

/* ---------- Search Page Section Titles ---------- */
.search-section-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 1.25rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.search-section-title:first-of-type {
  margin-top: 0.75rem;
}

/* ---------- Free Bible Films Section ---------- */
.home-bible-films {
  max-width: var(--max-width);
  margin: 2.5rem auto;
  padding: 0 2rem;
}

.home-films-intro {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 1.25rem;
}

.home-films-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.home-film-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow var(--transition), transform var(--transition);
}

.home-film-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.home-film-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1612;
}

.home-film-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-film-duration {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.home-film-info {
  padding: 0.85rem 1rem;
}

.home-film-info strong {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.home-film-info p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.home-film-source {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--color-accent);
  font-weight: 500;
}

.home-films-legal {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  opacity: 0.7;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .home-bible-films {
    padding: 0 1rem;
  }
  .home-films-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Homepage Polish (Design & Content Expert Pass)
   ========================================================================== */

/* Subtle section breathing room */
.home-explore,
.home-pathways,
.home-quickstart,
.home-dimensions,
.home-bible-films,
.home-commentary-day {
  padding-top: 0.5rem;
}

/* Improved section heading style */
.home-explore-header h2,
.home-pathways-title,
.home-quickstart h2,
.home-dimensions h2 {
  position: relative;
  display: inline-block;
}

/* Dimension grid toggle button refinement */
.dim-toggle-btn {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: middle;
  margin-left: 0.5rem;
}
.dim-toggle-btn:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* Improved explore note */
.home-explore-note {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.85rem;
  margin-bottom: 0;
  line-height: 1.55;
  max-width: 600px;
}

/* Hero gradient accent for dark mode */
html.dark-mode .home-hero::before {
  background: radial-gradient(ellipse at 50% 0%, rgba(197, 164, 111, 0.08) 0%, transparent 60%);
}

html.dark-mode .hero-title-accent {
  background: linear-gradient(135deg, #e8d5a8, #c5a46f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Improved VOTD card in dark mode */
html.dark-mode .home-votd::before {
  background: linear-gradient(90deg, transparent, rgba(197, 164, 111, 0.2), transparent);
}

/* Pathway icon color in dark mode */
html.dark-mode .home-pathway-icon {
  color: var(--color-accent-light);
}

/* Smooth hover for dimension cards */
.home-dim-img {
  transition: transform 0.3s ease;
}
.home-dim:hover .home-dim-img {
  transform: scale(1.03);
}

/* Better focus states for cards */
.home-dim:focus-visible,
.home-pathway:focus-visible,
.home-quick-book:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Reduced motion: disable transforms */
@media (prefers-reduced-motion: reduce) {
  .home-dim:hover,
  .home-pathway:hover,
  .hero-btn-listen:hover,
  .home-quick-book:hover {
    transform: none;
  }
  .home-dim:hover .home-dim-img {
    transform: none;
  }
  main {
    animation: none;
  }
}

/* Print styles for homepage */
@media print {
  .home-hero {
    background: #2c241b;
    box-shadow: none;
  }
  .discovery-banner,
  .home-hero-actions,
  .home-search-form,
  .home-hero-secondary {
    display: none;
  }
}
