/* ==========================================================================
   Ethiopian Bible Reader & Player PWA Stylesheet
   Google Pixel Mobile-First, OLED True Black & Daylight Warm Paper Themes
   ========================================================================== */

:root {
  /* Common Metrics */
  --header-height: 64px;
  --player-height: 120px;
  --font-serif: 'Lora', 'Georgia', 'Cambria', 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Cinzel', 'Trajan Pro', 'Georgia', serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.18s ease;
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --scripture-font-size: 19px;
}

/* ==========================================================================
   THEMES: OLED DARK (Default) vs DAYLIGHT BRIGHT
   ========================================================================== */

/* DARK MODE: True OLED Black for Google Pixel Battery Saving */
html[data-theme="dark"] {
  --bg-app: #000000;
  --bg-surface: #121212;
  --bg-elevated: #1e1e1e;
  --bg-overlay: rgba(0, 0, 0, 0.82);
  --border-subtle: #242424;
  --border-gold: rgba(229, 179, 80, 0.35);

  --text-primary: #E6DEC8;      /* Warm biblical parchment */
  --text-secondary: #9E9885;    /* Muted sand */
  --text-muted: #666255;
  --text-inverse: #0d0d0d;

  --gold-primary: #E5B350;      /* Ethiopian Radiant Gold */
  --gold-glow: rgba(229, 179, 80, 0.22);
  --gold-highlight-bg: rgba(229, 179, 80, 0.18);
  --gold-border: #E5B350;

  --player-bg: rgba(18, 18, 18, 0.94);
  --scrubber-bg: #2a2a2a;
  --scrubber-fill: #E5B350;
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

/* BRIGHT MODE: High-Contrast Warm Daylight Paper for Sunny Walks */
html[data-theme="bright"] {
  --bg-app: #FBF8F1;            /* Warm daylight parchment paper */
  --bg-surface: #FFFFFF;
  --bg-elevated: #F2ECE1;
  --bg-overlay: rgba(240, 235, 222, 0.85);
  --border-subtle: #E2DAC8;
  --border-gold: rgba(184, 115, 20, 0.35);

  --text-primary: #1A1A1A;      /* Deep obsidian charcoal */
  --text-secondary: #5C574E;    /* Deep warm earth */
  --text-muted: #8A8377;
  --text-inverse: #FFFFFF;

  --gold-primary: #B87314;      /* Deep rich amber gold */
  --gold-glow: rgba(184, 115, 20, 0.18);
  --gold-highlight-bg: rgba(230, 165, 50, 0.22);
  --gold-border: #B87314;

  --player-bg: rgba(255, 255, 255, 0.94);
  --scrubber-bg: #E2DAC8;
  --scrubber-fill: #B87314;
  --card-shadow: 0 6px 24px rgba(138, 120, 90, 0.14);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: auto !important;
  min-height: 100vh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  width: 100%;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  user-select: text;
  -webkit-font-smoothing: antialiased;
}

/* Root Layout */
.app-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh !important;
  height: auto !important;
  overflow: visible !important;
  position: relative;
  background-color: var(--bg-app);
}

/* ==========================================================================
   APP HEADER (Pinned to Top of Viewport)
   ========================================================================== */
.app-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9600 !important;
  height: var(--header-height);
  padding: env(safe-area-inset-top, 0) 16px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-sizing: border-box !important;
  flex-shrink: 0;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.brand:hover, .brand:focus {
  background-color: var(--bg-elevated);
}

.cross-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(212, 175, 55, 0.45);
  filter: drop-shadow(0 2px 6px var(--gold-glow));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--gold-primary);
  line-height: 1.1;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background-color: #10B981;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
  line-height: 1.2;
}

.brand-chapter {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.chevron-down {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

/* Icon Buttons */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.icon-btn:hover {
  background-color: var(--bg-elevated);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon {
  width: 24px;
  height: 24px;
}

.icon-small {
  width: 18px;
  height: 18px;
}

/* Badge on Notes Button */
.badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Voice Mic Pulse Button */
.mic-btn {
  position: relative;
}

.mic-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  opacity: 0;
  pointer-events: none;
}

.mic-btn.active {
  color: var(--gold-primary);
  background-color: var(--gold-glow);
}

.mic-btn.active .mic-pulse {
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

/* Theme Toggle Button Icons */
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="bright"] .icon-sun { display: none; }
html[data-theme="bright"] .icon-moon { display: block; }

/* ==========================================================================
   READER TOOLBAR (Fixed directly under Top Header)
   ========================================================================== */
.reader-toolbar {
  position: fixed !important;
  top: var(--header-height) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9300 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-sizing: border-box !important;
  flex-shrink: 0;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-canon {
  background-color: var(--bg-elevated);
  color: var(--gold-primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  border: 1px solid var(--border-gold);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-btn.active {
  background-color: var(--gold-glow);
  color: var(--gold-primary);
  border-color: var(--border-gold);
}

.tool-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Voice Assistant Banner HUD */
.voice-hud {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-surface);
  border-bottom: 2px solid var(--gold-primary);
  color: var(--text-primary);
  padding: 10px 16px;
  font-size: 13px;
  animation: slide-down 0.25s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.voice-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.voice-hud-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Live On-Screen Transcript Pill ("Listening: ...") */
.live-transcript-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid #00E676;
  color: #00E676;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="bright"] .live-transcript-pill {
  background: rgba(0, 200, 83, 0.12);
  border-color: #00A854;
  color: #008744;
}

.live-transcript-pill.mini {
  padding: 4px 10px;
  font-size: 12px;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #00E676;
  animation: pill-blink 1.2s infinite alternate;
  flex-shrink: 0;
}

html[data-theme="bright"] .pill-dot {
  background-color: #00A854;
}

@keyframes pill-blink {
  from { opacity: 0.3; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

/* Mic Input Selector & Volume Meter */
.mic-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  max-width: 240px;
  flex: 1;
}

.icon-tiny {
  width: 16px;
  height: 16px;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.mic-dropdown {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  width: 100%;
  cursor: pointer;
}

.mic-dropdown option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.mic-meter-box {
  flex: 1;
  height: 8px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  min-width: 70px;
  max-width: 180px;
}

.mic-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00E676, #76FF03);
  border-radius: var(--radius-full);
  transition: width 0.06s ease-out;
}

.close-hud-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.close-hud-btn:hover {
  border-color: #D32F2F;
  color: #D32F2F;
}
  cursor: pointer;
  padding: 4px 8px;
}

/* ==========================================================================
   READING AREA & SCRIPTURE TYPOGRAPHY
   ========================================================================== */
.reading-area {
  flex: 1;
  overflow-y: visible !important;
  overflow-x: hidden;
  padding: 118px 20px 120px 20px !important;
  padding-top: 118px !important;
  padding-bottom: 120px !important;
  margin-top: 0 !important;
  scroll-behavior: smooth;
  box-sizing: border-box !important;
}

/* Subtle Style Badge under Chapter Title */
.meta-style-badge {
  color: var(--gold-primary) !important;
  border-color: var(--border-gold) !important;
  background-color: var(--gold-highlight-bg) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   FLOATING QUICK NAVIGATION PILLS (Above Bottom Player Bar)
   ========================================================================== */
.floating-nav-controls {
  position: fixed !important;
  bottom: 125px !important;
  right: 18px !important;
  z-index: 9990 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 8px !important;
  pointer-events: none;
}

.floating-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

.floating-pill:hover {
  background-color: var(--bg-elevated);
  transform: translateY(-2px);
}

.floating-pill:active {
  transform: scale(0.95);
}

.floating-pill.resume-pill {
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  border-color: var(--gold-primary);
  box-shadow: 0 4px 18px var(--gold-glow);
  animation: pulse-resume-pill 1.6s infinite;
}

.pill-pulse-dot {
  width: 7px;
  height: 7px;
  background-color: currentColor;
  border-radius: 50%;
  animation: blink-dot 1.2s infinite alternate;
}

@keyframes pulse-resume-pill {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes blink-dot {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.floating-pill.hidden {
  display: none !important;
}

.scripture-article {
  max-width: 680px;
  margin: 0 auto;
}

/* Chapter Heading Card */
.chapter-title-card {
  text-align: center;
  padding: 0 16px 24px 16px;
  margin-top: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.cross-divider {
  color: var(--gold-primary);
  font-size: 14px;
  letter-spacing: 0.5em;
  margin-bottom: 12px;
  opacity: 0.85;
}

.chapter-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.25;
}

.chapter-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-tag {
  font-size: 12px;
  color: var(--text-secondary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* Scripture Content Typography */
.scripture-content {
  font-family: var(--font-serif);
  font-size: var(--scripture-font-size);
  line-height: 1.85;
  letter-spacing: 0.015em;
  color: var(--text-primary);
}

.scripture-p {
  margin-bottom: 22px;
  text-align: justify;
  text-justify: inter-word;
  position: relative;
}

/* Drop cap for first paragraph */
.scripture-p:first-of-type::first-letter {
  font-family: var(--font-title);
  font-size: 2.8em;
  float: left;
  line-height: 0.85;
  padding-right: 10px;
  padding-top: 4px;
  color: var(--gold-primary);
}

/* Synchronized Sentence Cues (v3.0 Unified .verse-cue + .cue-span) */
.verse-cue, .cue-span {
  display: inline;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.15s ease, box-shadow 0.18s ease;
  position: relative;
}

.verse-cue:hover, .cue-span:hover {
  background-color: var(--bg-elevated);
}

/* Subtle Superscript Verse Numbers tucked cleanly at start of each verse */
.verse-num {
  font-size: 0.68em;
  font-weight: 700;
  color: var(--gold-primary, #d4af37);
  opacity: 0.72;
  vertical-align: super;
  line-height: 0;
  margin-right: 4px;
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: 0.01em;
}

html[data-theme="bright"] .verse-num {
  color: #8a6414;
  opacity: 0.78;
}

.verse-cue.active .verse-num, .cue-span.active .verse-num {
  opacity: 0.92;
}

/* DIVINE RED-LETTER SPEECH (Warm Gold / Crimson Text) */
.verse-cue.divine-cue, .cue-span.divine-cue {
  color: #f4a261;
  font-weight: 500;
  text-shadow: 0 0 1px rgba(244, 162, 97, 0.25);
}

html[data-theme="bright"] .verse-cue.divine-cue, html[data-theme="bright"] .cue-span.divine-cue {
  color: #a82323;
  font-weight: 600;
  text-shadow: none;
}

/* ACTIVE HIGHLIGHT: Radiant Gold Highlight */
.verse-cue.active, .cue-span.active {
  background: rgba(212, 175, 55, 0.28) !important;
  border-bottom: 2px solid #f5c542 !important;
  color: #ffffff !important;
  font-weight: 600;
  border-radius: 4px;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
}

html[data-theme="bright"] .verse-cue.active, html[data-theme="bright"] .cue-span.active {
  background: rgba(212, 175, 55, 0.35) !important;
  color: #1f1400 !important;
  border-bottom: 2px solid #b8860b !important;
}

.verse-cue.divine-cue.active, .cue-span.divine-cue.active {
  background: rgba(212, 175, 55, 0.28) !important;
  border-bottom: 2px solid #f5c542 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(245, 197, 66, 0.45);
}

html[data-theme="bright"] .verse-cue.divine-cue.active, html[data-theme="bright"] .cue-span.divine-cue.active {
  background: rgba(212, 175, 55, 0.38) !important;
  color: #7a0000 !important;
  border-bottom: 2px solid #b71c1c !important;
}

/* Tap-to-define glossary terms inside scripture text */
.glossary-term {
  border-bottom: 1.5px dotted var(--gold-primary);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.glossary-term:hover {
  color: var(--gold-primary);
  background-color: var(--gold-highlight-bg);
}

/* Chapter End Decorator */
.chapter-end-decor {
  text-align: center;
  padding: 40px 16px 20px 16px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 36px;
}

.end-text {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* Primary Button */
.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  border: none;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--transition-fast), filter var(--transition-fast);
  box-shadow: 0 4px 14px var(--gold-glow);
}

.primary-btn:hover {
  filter: brightness(1.1);
}

.primary-btn:active {
  transform: scale(0.96);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.link-btn {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
}

/* Spinner */
.loading-spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  gap: 16px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   STICKY BOTTOM AUDIO PLAYER BAR (Google Pixel Optimized)
   ========================================================================== */
#player-bar, .player-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-height: 78px !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 2147483647 !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
  background-color: var(--player-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 20px 8px 20px !important;
  display: flex;
  flex-direction: column;
  gap: 4px !important;
  box-shadow: var(--card-shadow);
}

/* Scrubber Bar */
.scrubber-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.time-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}

#time-current { text-align: right; }
#time-duration { text-align: left; }

.progress-container {
  flex: 1;
  position: relative;
  min-height: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.progress-track {
  width: 100%;
  min-height: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.progress-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  background-color: var(--scrubber-bg);
  border-radius: var(--radius-full);
}

.progress-buffered {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  width: 0%;
  background-color: rgba(229, 179, 80, 0.2);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  width: 0%;
  background-color: var(--scrubber-fill);
  border-radius: var(--radius-full);
  transition: width 0.08s linear;
  pointer-events: none;
}

#seek-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 24px;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  z-index: 5;
}

/* Clickable Verse & Sentence Spans */
[data-start] {
  cursor: pointer !important;
}

/* Controls Row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.player-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.player-btn:hover {
  background-color: var(--bg-elevated);
}

.player-btn:active {
  transform: scale(0.9);
}

.speed-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: auto;
  padding: 4px 8px;
}

.speed-btn:hover {
  color: var(--gold-primary);
}

.seek-btn {
  color: var(--text-secondary);
}

.seek-btn:hover {
  color: var(--text-primary);
}

.play-main-btn {
  width: 42px !important;
  height: 42px !important;
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  border-radius: 50%;
  box-shadow: 0 4px 16px var(--gold-glow);
}

.play-main-btn:hover {
  filter: brightness(1.1);
  background-color: var(--gold-primary);
}

.icon-play-large {
  width: 22px !important;
  height: 22px !important;
}

.dictate-btn {
  color: var(--gold-primary);
}

/* ==========================================================================
   NAVIGATION DRAWER (TABLE OF CONTENTS - 88 BOOKS)
   ========================================================================== */
.drawer, .modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#drawer-toc {
  z-index: 9500 !important;
}

#drawer-toc .drawer-backdrop {
  z-index: 9400 !important;
}

#drawer-toc .drawer-content {
  position: fixed;
  top: var(--header-height, 58px);
  left: 0;
  height: calc(100vh - var(--header-height, 58px) - 78px);
  max-height: calc(100vh - var(--header-height, 58px) - 78px);
  padding-top: 12px;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 9500;
  box-sizing: border-box;
}

#drawer-toc .drawer-header {
  padding: 6px 18px 10px 18px;
}

.drawer-offline-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  padding: 12px 16px max(12px, env(safe-area-inset-bottom, 12px)) 16px;
  background-color: var(--bg-surface);
}

.drawer-offline-footer-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-primary);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.drawer-offline-footer-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-primary);
}

#btn-close-toc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  font-size: 16px;
  font-weight: 700;
  background: var(--bg-elevated);
  cursor: pointer;
}

.drawer.hidden, .modal.hidden {
  display: none !important;
  pointer-events: none !important;
}

.drawer.hidden .drawer-backdrop,
.modal.hidden .modal-backdrop {
  pointer-events: none !important;
}

.drawer-backdrop, .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.drawer-content {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 100%;
  max-height: 100%;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-in-left 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

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

.drawer-header {
  flex-shrink: 0;
  padding: calc(16px + env(safe-area-inset-top, 0)) 20px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-cross {
  width: 26px;
  height: 26px;
}

.drawer-title-box h2 {
  font-family: var(--font-title);
  font-size: 17px;
  color: var(--text-primary);
  font-weight: 700;
}

.drawer-search {
  flex-shrink: 0;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-elevated);
  margin: 8px 16px 6px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.drawer-search input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  color: var(--text-primary);
  font-size: 14px;
}

.filter-chips {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 6px 16px 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.chip {
  flex-shrink: 0;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip.active {
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  border-color: var(--gold-primary);
}

/* ==========================================================================
   SCROLLING BOOK LIST & CARDS (Strict Overrides to Prevent Collapsing)
   ========================================================================== */
#books-list, .books-list {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  padding: 10px 16px 18px 16px !important;
  -webkit-overflow-scrolling: touch;
}

/* Individual Book Item / Card */
.book-card, .book-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-height: 62px !important;
  height: auto !important;
  margin-bottom: 10px !important;
  padding: 14px 18px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.book-card:hover, .book-item:hover {
  border-color: var(--border-gold);
  background-color: rgba(229, 179, 80, 0.08);
}

.book-card:active, .book-item:active {
  transform: scale(0.99);
}

.book-name {
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  color: inherit !important;
  line-height: 1.35;
}

.book-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-gold);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 8px;
  padding: 14px 16px 16px 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-top: -4px;
  margin-bottom: 12px;
}

.chapter-grid.hidden {
  display: none !important;
}

.ch-btn {
  min-width: 44px !important;
  min-height: 44px !important;
  height: 44px !important;
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.ch-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  transform: translateY(-1px);
}

.ch-btn.active {
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  border-color: var(--gold-primary);
  box-shadow: 0 2px 8px var(--gold-glow);
}

.ch-btn.has-audio::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #00E676;
  box-shadow: 0 0 4px #00E676;
}

/* ==========================================================================
   SPOKEN NOTES & REFLECTIONS MODAL
   ========================================================================== */
.modal {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  position: fixed !important;
  top: 108px !important;
  bottom: 90px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(560px, 94vw) !important;
  max-width: 560px;
  max-height: calc(100vh - 198px) !important;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  overflow-y: auto !important;
  padding-bottom: 36px !important;
  z-index: 10005 !important;
  animation: modal-fade-in 0.2s ease-out;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: var(--bg-surface);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-gold {
  width: 24px;
  height: 24px;
  color: var(--gold-primary);
}

.modal-title-box h2 {
  font-family: var(--font-title);
  font-size: 17px;
  color: var(--text-primary);
}

/* Dictate Input Box */
.dictate-box {
  padding: 16px 20px;
  background-color: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.dictate-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}

.dictate-meta {
  color: var(--gold-primary);
  font-weight: 600;
}

.dictation-status {
  color: var(--text-secondary);
  font-style: italic;
}

.dictate-mic-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dictate-input-row textarea {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px;
  resize: vertical;
  outline: none;
}

.dictate-input-row textarea:focus {
  border-color: var(--gold-primary);
}

.dictate-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 10px;
}

.dictate-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

/* Dictation pulse animation */
.dictate-pulse-btn.listening {
  background-color: #D32F2F;
  box-shadow: 0 0 16px rgba(211, 47, 47, 0.4);
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Saved Notes Section */
.saved-notes-header {
  padding: 14px 20px 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.saved-notes-header h3 {
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.saved-notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-notes {
  text-align: center;
  padding: 40px 10px;
  color: var(--text-secondary);
  font-size: 14px;
}

.empty-notes .subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.note-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.note-chapter-tag {
  color: var(--gold-primary);
  font-weight: 600;
}

.note-timestamp-badge {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.note-timestamp-badge:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.note-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.note-delete-btn {
  background: none;
  border: none;
  color: #D32F2F;
  font-size: 11px;
  cursor: pointer;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
  position: fixed;
  bottom: calc(var(--player-height) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--gold-primary);
  box-shadow: var(--card-shadow);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  z-index: 2000;
  animation: toast-in 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Utility Classes */
.hidden { display: none !important; }

/* ==========================================================================
   MULTI-VOICE SWITCHER, AMBIENT SOUNDSCAPES & TOOLS (v2.4 LIVE)
   ========================================================================== */

/* Voice Switcher Pill */
.voice-pill {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.voice-pill:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.voice-icon {
  font-size: 14px;
}

/* Header Active Indicators */
.active-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-primary);
}

.timer-badge {
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Ambient Soundscape Mixer Popover (v2.5 Compact Sleek Card) */
/* Standalone Compact Ambient Soundscape Popover (v2.9 LIVE) */
#ambience-popover, #modal-ambience, .ambience-popover {
  position: fixed !important;
  top: 108px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  width: 310px !important;
  max-width: 92vw !important;
  z-index: 99999 !important;
  background: #141414 !important;
  color: #f4efe6 !important;
  border: 1px solid #d4af37 !important;
  border-radius: 14px !important;
  padding: 16px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85) !important;
  display: none;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto !important;
  box-sizing: border-box !important;
}

#ambience-popover .popover-card, #modal-ambience .popover-card, .ambience-popover .popover-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popover-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.popover-title-box h3 {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  color: #f4efe6 !important;
  margin: 0;
}

.icon-gold-sm {
  width: 18px;
  height: 18px;
  color: #d4af37;
}

.icon-btn-sm {
  background: transparent;
  border: none;
  color: #b7afa1;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.icon-btn-sm:hover {
  color: #d4af37;
  background-color: rgba(212, 175, 55, 0.12);
}

.ambience-pills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ambience-pill-btn {
  height: 44px !important;
  padding: 8px 10px !important;
  font-size: 0.88rem !important;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background-color: #1f1e1c;
  color: #f4efe6;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ambience-pill-btn:hover {
  border-color: #d4af37;
}

.ambience-pill-btn.active {
  border-color: #d4af37 !important;
  background-color: rgba(212, 175, 55, 0.18) !important;
  color: #f0c954 !important;
  font-weight: 700;
}

.ambience-pill-btn .amb-icon {
  font-size: 15px;
}

.ambience-pill-btn .amb-name {
  font-size: 12.5px;
  white-space: nowrap;
}

.ambience-slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.slider-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #c8c0b4;
}

.slider-label-row strong {
  color: #d4af37;
  font-variant-numeric: tabular-nums;
}

.ambience-slider-row input[type="range"] {
  width: 100%;
  accent-color: #d4af37;
  cursor: pointer;
}

/* Walk & Sleep Timer */
.timer-status-banner {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.timer-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.timer-status-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-primary);
  font-variant-numeric: tabular-nums;
}

.timer-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.timer-preset-btn {
  background-color: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.timer-preset-btn:hover {
  border-color: var(--gold-primary);
}

.timer-preset-btn.active {
  border-color: var(--gold-primary);
  background-color: var(--gold-highlight-bg);
  color: var(--gold-primary);
}

/* Scripture Search Drawer */
.search-icon-gold {
  width: 24px;
  height: 24px;
  color: var(--gold-primary);
}

.search-stats-row {
  padding: 6px 20px 10px 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.search-results-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 40px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-result-card:hover {
  border-color: var(--gold-primary);
  background-color: var(--gold-highlight-bg);
}

.search-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.search-result-chapter {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-primary);
}

.search-result-time {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.search-result-text {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.45;
}

.search-highlight {
  background-color: rgba(212, 160, 23, 0.35);
  color: var(--gold-primary);
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 2px;
}

/* Ethiopian Canon Glossary & 88 Books Modal */
.modal-card-wide {
  max-width: 720px !important;
  width: min(720px, 95vw) !important;
  top: 108px !important;
  bottom: 90px !important;
  max-height: calc(100vh - 198px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  padding-bottom: 36px !important;
}

.glossary-tabs-row {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated);
}

.glossary-tabs-row::-webkit-scrollbar { display: none; }

.g-tab-btn {
  flex-shrink: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.g-tab-btn:hover {
  border-color: var(--gold-primary);
}

.g-tab-btn.active {
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  border-color: var(--gold-primary);
}

.glossary-search-bar {
  padding: 12px 20px 8px 20px;
  flex-shrink: 0;
}

.glossary-search-bar input {
  width: 100%;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.glossary-search-bar input:focus {
  border-color: var(--gold-primary);
}

.glossary-terms-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 20px 30px 20px;
}

.glossary-term-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition-fast);
}

.glossary-term-card:hover {
  border-color: var(--border-gold);
}

.glossary-term-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.glossary-term-name {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-primary);
}

.glossary-term-category {
  font-size: 11px;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.glossary-term-desc {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* 88 Books Card in Glossary */
.glossary-book-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition-fast);
}

.glossary-book-card:hover {
  border-color: var(--border-gold);
}

.glossary-book-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.glossary-book-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.glossary-book-name {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-primary);
}

.glossary-book-geez {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

.glossary-book-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.glossary-badge-cat {
  font-size: 11px;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.glossary-badge-exclusive {
  font-size: 11px;
  background-color: rgba(229, 179, 80, 0.15);
  color: var(--gold-primary);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gold-primary);
}

.glossary-book-context {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

.glossary-book-desc {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

.glossary-read-btn {
  align-self: flex-start;
  margin-top: 4px;
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.glossary-read-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ==========================================================================
   THEOLOGY & HISTORICAL STUDY CENTER (v2.5 LIVE)
   ========================================================================== */
.modal-card-study {
  max-width: 960px !important;
  width: min(960px, 96vw) !important;
  top: 108px !important;
  bottom: 90px !important;
  max-height: calc(100vh - 198px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  padding-bottom: 36px !important;
}

.study-tabs-row {
  display: flex;
  gap: 10px;
  padding: 6px 20px 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated);
  flex-shrink: 0;
  overflow-x: auto;
}

.study-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--text-secondary);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.study-tab-btn:hover {
  color: var(--text-primary);
}

.study-tab-btn.active {
  color: var(--gold-primary);
  border-bottom-color: var(--gold-primary);
  font-weight: 700;
}

.study-tab-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.study-tab-pane.hidden {
  display: none !important;
}

/* Tab 1: Layout with Sidebar + Main Content */
.study-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 768px) {
  .study-layout {
    flex-direction: column;
  }
  .study-sidebar {
    width: 100% !important;
    max-height: 160px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }
}

.study-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-surface);
}

.study-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 4px 8px;
}

.study-papers-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.study-paper-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background-color: var(--bg-elevated);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.study-paper-nav-btn:hover {
  border-color: var(--border-gold);
}

.study-paper-nav-btn.active {
  background-color: var(--gold-highlight-bg);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.study-paper-nav-btn .paper-nav-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.study-paper-nav-btn .paper-nav-cat {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.study-main-pane {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 24px 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: var(--bg-surface);
}

/* Scholarly Paper Typography */
.paper-article {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.paper-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 6px;
}

.paper-category-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-primary);
  font-weight: 700;
  margin-bottom: 6px;
  display: inline-block;
}

.paper-title {
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.paper-meta-row {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.paper-meta-row strong {
  color: var(--text-primary);
}

.paper-abstract {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-elevated);
  padding: 12px 16px;
  border-left: 3px solid var(--gold-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.paper-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.paper-section h3 {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-top: 10px;
}

.paper-section p {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
}

.paper-citations {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 10px;
}

.paper-citations h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

.paper-citations ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Cross-reference interactive pills */
.paper-xrefs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.paper-xrefs-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.study-xref-pill {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.study-xref-pill:hover {
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  transform: translateY(-1px);
}

/* Inline notes inside paper */
.study-inline-notes-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.study-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.study-notes-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.pill-btn.mic-pill {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.pill-btn.mic-pill:hover {
  background-color: var(--gold-highlight-bg);
}

.pill-btn.mic-pill.recording {
  background-color: #ff3b30;
  border-color: #ff3b30;
  color: #ffffff;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.mic-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--gold-primary);
}

.pill-btn.mic-pill.recording .mic-dot {
  background-color: #ffffff;
}

.study-inline-notes-card textarea {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
}

.study-inline-notes-card textarea:focus {
  border-color: var(--gold-primary);
}

.study-notes-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.note-status-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

.primary-btn-sm {
  background-color: var(--gold-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.primary-btn-sm:hover {
  filter: brightness(1.1);
}

/* Tab 2: Study Notes Library */
.study-notes-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated);
}

.notes-stats-info span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.notes-export-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

.secondary-btn-sm {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.secondary-btn-sm:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.link-btn-danger {
  background: transparent;
  border: none;
  color: #ff453a;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
}

.study-notes-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.study-note-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.study-note-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.study-note-subject {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
}

.study-note-date {
  font-size: 11px;
  color: var(--text-muted);
}

.study-note-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.study-note-delete-btn {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

.study-note-delete-btn:hover {
  color: #ff453a;
}

/* Tab 3: Contextual Cross-Reference Search */
.study-xref-search-box {
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.study-xref-search-box input {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.study-xref-search-box input:focus {
  border-color: var(--gold-primary);
}

.quick-topics-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.quick-topics-row::-webkit-scrollbar { display: none; }

.quick-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.topic-pill {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.topic-pill:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.study-xref-results {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.xref-result-card {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.xref-result-card:hover {
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

.xref-result-source {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gold-primary);
  font-weight: 700;
}

.xref-result-title {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.xref-result-snippet {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ==========================================================================
   VOICE AUDITION & INDEPENDENT CASTING STUDIO MODAL (v2.9 LIVE)
   ========================================================================== */
.voice-studio-card {
  position: fixed !important;
  top: 108px !important;
  bottom: 90px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(720px, 94vw) !important;
  max-width: 720px !important;
  max-height: calc(100vh - 198px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  padding-bottom: 36px !important;
  z-index: 10005 !important;
  border: 1px solid var(--border-gold) !important;
  background-color: var(--bg-surface) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85) !important;
}

.voice-studio-body {
  padding: 16px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.casting-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .casting-summary-grid {
    grid-template-columns: 1fr;
  }
}

.casting-role-card {
  background-color: var(--bg-elevated);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.casting-role-narrator {
  border: 1.5px solid rgba(212, 175, 55, 0.65);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), var(--bg-elevated));
}

.casting-role-god {
  border: 1.5px solid rgba(220, 68, 82, 0.65);
  background: linear-gradient(135deg, rgba(200, 45, 65, 0.12), rgba(212, 175, 55, 0.05), var(--bg-elevated));
}

.casting-role-badge-gold {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(212, 175, 55, 0.2);
  border: 1px solid #d4af37;
  color: #f0c954;
}

.casting-role-badge-crimson {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(90deg, rgba(200, 45, 65, 0.25), rgba(212, 175, 55, 0.2));
  border: 1px solid #e05263;
  color: #ffb3ba;
}

.casting-active-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.casting-role-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.same-as-narrator-btn {
  margin-top: 4px;
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(224, 82, 99, 0.45);
  background-color: var(--bg-surface);
  color: #ffb3ba;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.same-as-narrator-btn:hover {
  border-color: #d4af37;
  color: #f0c954;
}

.same-as-narrator-btn.active {
  background: linear-gradient(90deg, #a83242, #c9972b);
  color: #fff;
  border-color: transparent;
}

.voice-gender-heading {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 6px 0 4px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.voice-roster-item.is-narrator {
  border-color: rgba(212, 175, 55, 0.7);
}

.voice-roster-item.is-god {
  border-color: rgba(224, 82, 99, 0.7);
}

.roster-role-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cast-role-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cast-role-btn.narrator-btn:hover {
  border-color: #d4af37;
  color: #d4af37;
}

.cast-role-btn.narrator-btn.active {
  background-color: #d4af37;
  border-color: #d4af37;
  color: #000;
}

.cast-role-btn.god-btn:hover {
  border-color: #e05263;
  color: #ff9aa6;
}

.cast-role-btn.god-btn.active {
  background: linear-gradient(90deg, #b83344, #d4af37);
  border-color: transparent;
  color: #fff;
}

.voice-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.voice-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Casting Pairings Cards (Track A vs Track B) */
.pairings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.pairing-card {
  background-color: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: all var(--transition-fast);
}

.pairing-card:hover {
  border-color: rgba(212, 175, 55, 0.5);
}

.pairing-card.active {
  border-color: var(--gold-primary);
  background-color: var(--gold-highlight-bg);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.2);
}

.pairing-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-primary);
}

.pairing-names {
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-primary);
}

.pairing-names .narrator-name {
  color: var(--text-primary);
  font-weight: 700;
}

.pairing-names .pairing-plus {
  color: var(--gold-primary);
  font-weight: 700;
  margin: 0 4px;
}

.pairing-names .divine-name {
  color: #ff9b9b;
  font-weight: 600;
}

.pairing-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.pairing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.pill-btn-sm {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-btn-sm:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.primary-btn-sm {
  background: var(--gold-primary);
  color: #000;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.primary-btn-sm:hover {
  filter: brightness(1.1);
}

/* 6 Audition Voice Gallery Items */
.voice-roster-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-roster-item {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast);
}

.voice-roster-item:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

.voice-roster-item.sample-playing {
  border-color: var(--gold-primary);
  background-color: var(--gold-highlight-bg);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}

.roster-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roster-avatar {
  font-size: 22px;
  line-height: 1;
}

.roster-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.roster-meta strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.roster-role {
  font-size: 11px;
  color: var(--text-muted);
}

.roster-quote {
  font-family: var(--font-serif);
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.4;
  padding: 6px 10px;
  background-color: rgba(0, 0, 0, 0.2);
  border-left: 2px solid var(--gold-primary);
  border-radius: 4px;
}

.roster-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.audition-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.audition-play-btn:hover {
  background-color: var(--gold-primary);
  color: #000;
}

.audition-play-btn.playing {
  background-color: var(--gold-primary);
  color: #000;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.roster-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.roster-select-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.divine-tag-badge {
  font-size: 11px;
  color: #ff9b9b;
  background-color: rgba(255, 100, 100, 0.12);
  border: 1px solid rgba(255, 100, 100, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

/* ==========================================================================
   v3.2 LIVE FEATURES:
   1. Daily Reading & Senkesar Modal
   2. Guided Walk Plans & SVG Streak Ring
   3. Verse Quote Card Generator (1080x1080 Canvas) & Action Bar
   4. Offline Book Download Manager Tab (IndexedDB)
   ========================================================================== */

.streak-mini-badge {
  background: linear-gradient(135deg, #d4af37, #f59e0b);
  color: #000;
  font-weight: 800;
  font-size: 9px;
}

.quote-pill {
  border-color: rgba(212, 175, 55, 0.45) !important;
  color: var(--gold-primary) !important;
}

/* Contextual Verse Action Bar (Hover / Tap on .verse-cue) */
.verse-action-bar {
  position: fixed;
  z-index: 10020;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(15, 15, 18, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.verse-action-bar.hidden {
  display: none !important;
  pointer-events: none !important;
}

.verse-action-btn {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.verse-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.verse-action-btn.gold {
  background: var(--gold-primary);
  color: #000;
  font-weight: 700;
}

/* TOC Drawer Tabs & Offline Storage Manager */
.drawer-tabs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 16px 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-tab-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-tab-btn.active {
  background: var(--gold-highlight-bg);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.toc-tab-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.toc-tab-pane.hidden {
  display: none !important;
}

.offline-summary-card {
  margin: 12px 16px 8px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.offline-summary-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.offline-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.offline-stat-value {
  font-size: 20px;
  color: var(--gold-primary);
  font-weight: 800;
}

.offline-stat-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.offline-filter-bar {
  padding: 4px 16px 10px;
}

.offline-filter-bar input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
}

.offline-books-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offline-book-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offline-book-card.cached {
  border-color: rgba(16, 185, 129, 0.55);
}

.offline-book-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.offline-book-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.offline-ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.offline-book-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.offline-book-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.offline-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--gold-primary);
  background: var(--gold-primary);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.offline-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.offline-btn.delete {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.55);
  color: #f87171;
}

.offline-btn.delete:hover {
  background: rgba(239, 68, 68, 0.12);
}

/* Daily Devotional & Senkesar Modal */
.daily-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}

.daily-switcher-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.daily-pill-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.daily-pill-btn.active {
  background: var(--gold-highlight-bg);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.daily-section-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.daily-section-card.saint-card {
  border-color: rgba(212, 175, 55, 0.32);
}

.daily-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.daily-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-primary);
}

.daily-canon-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-primary);
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.daily-heading {
  margin: 0;
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--text-primary);
}

.daily-blockquote {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--gold-primary);
  background: rgba(212, 175, 55, 0.06);
  border-radius: 6px;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.daily-meditation,
.daily-saint-bio {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.daily-saint-subtitle {
  margin: -4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-primary);
}

.daily-collect-box {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--text-secondary);
}

.daily-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

/* Guided Walk Plans & Streak Tracker */
.plans-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}

.streak-dashboard-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 16px;
  flex-wrap: wrap;
}

.streak-ring-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
}

.streak-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.streak-ring-bg {
  fill: none;
  stroke: rgba(212, 175, 55, 0.16);
  stroke-width: 10;
}

.streak-ring-progress {
  fill: none;
  stroke: #d4af37;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
}

.streak-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.streak-ring-days {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-primary);
}

.streak-ring-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 3px;
}

.streak-stats-grid {
  flex: 1;
  min-width: 210px;
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 10px;
}

.streak-stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-caption {
  font-size: 11px;
  color: var(--text-muted);
}

.plans-tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-tab-btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.plan-tab-btn.active {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #000;
  font-weight: 700;
}

.plan-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
}

.plan-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.plan-item-row.completed {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.06);
}

.plan-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.plan-check-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-gold);
  background: transparent;
  color: #000;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.plan-check-btn.checked {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.plan-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.plan-item-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}

.plan-item-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Verse Quote Card Studio */
.quote-studio-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: start;
  padding-top: 8px;
}

@media (max-width: 720px) {
  .quote-studio-layout {
    grid-template-columns: 1fr;
  }
}

.quote-canvas-wrap {
  background: #050507;
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#quote-card-canvas {
  width: 100%;
  max-width: 380px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  display: block;
}

.quote-controls-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quote-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quote-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-primary);
}

.quote-controls-pane textarea,
.quote-controls-pane input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
}

.quote-themes-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quote-theme-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.quote-theme-btn.active {
  border-color: var(--gold-primary);
  background: var(--gold-highlight-bg);
  color: var(--gold-primary);
}

.theme-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.swatch-obsidian {
  background: linear-gradient(135deg, #09090b, #d4af37);
}

.swatch-parchment {
  background: linear-gradient(135deg, #f3e4c6, #8b1e24);
}

.swatch-midnight {
  background: linear-gradient(135deg, #0b1120, #38bdf8);
}

.quote-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

html[data-theme="bright"] .verse-action-bar {
  background: rgba(255, 251, 240, 0.96);
  border-color: #b48a1e;
}

html[data-theme="bright"] .verse-action-btn {
  background: rgba(0, 0, 0, 0.06);
  color: #1f2937;
}

html[data-theme="bright"] .verse-action-btn.gold {
  background: #d4af37;
  color: #000;
}

/* v3.3 LIVE On-Demand Chapter Audio Synthesis Controls */
.meta-gen-btn {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(180, 138, 30, 0.14)) !important;
  border: 1px solid var(--gold-primary) !important;
  color: var(--gold-primary) !important;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
}

.meta-gen-btn:hover {
  background: var(--gold-primary) !important;
  color: #000 !important;
  transform: translateY(-1px);
}

.meta-gen-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.synthesis-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--gold-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
}

.synthesis-pill.hidden {
  display: none !important;
}

.synth-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-top-color: var(--gold-primary);
  animation: synthSpin 0.8s linear infinite;
}

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

/* ==========================================================================
   v3.5 LIVE: PC-TO-PIXEL CONNECT MODAL, QR BRIDGE & OFFLINE ACTIONS
   ========================================================================== */
.offline-summary-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.pixel-connect-card {
  max-width: 600px !important;
  width: min(600px, 95vw) !important;
}

.pixel-connect-body {
  padding: 16px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pixel-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pixel-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pixel-panel-head h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-primary);
  margin: 0;
}

.pixel-subtext {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.qr-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 4px;
}

.qr-frame {
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#pixel-qr-canvas {
  display: block;
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
}

.pixel-url-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
  flex: 1;
}

.pixel-url-code {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  font-size: 13px;
  font-weight: 700;
  word-break: break-all;
}

.pixel-status-pill {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.4;
}

.pixel-status-pill.ok {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.pixel-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pixel-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.pixel-progress-wrap.hidden {
  display: none !important;
}

.pixel-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.pixel-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b87314, #d4af37, #f5c542);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.pixel-progress-text {
  font-size: 12px;
  color: var(--gold-primary);
  font-weight: 600;
}

/* ==========================================================================
   GOOGLE PIXEL PORTRAIT RESPONSIVE LAYOUT (v3.5 LIVE)
   ========================================================================== */
@media (max-width: 640px) {
  /* Compact Swipeable 2-Row Mobile Header (38x38 touch targets, gap 6px) */
  .app-header {
    height: auto !important;
    min-height: 88px !important;
    flex-wrap: wrap !important;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px 10px !important;
    gap: 6px !important;
    align-items: center !important;
  }

  .header-left {
    width: 100% !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    min-width: 0 !important;
  }

  .brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 2px 6px !important;
    gap: 8px !important;
  }

  .brand-text {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .brand-chapter {
    font-size: 13.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .header-right {
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px !important;
    padding: 2px 0 !important;
    justify-content: flex-start !important;
  }

  .header-right::-webkit-scrollbar {
    display: none;
  }

  .app-header .icon-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    flex: 0 0 38px !important;
  }

  .app-header .icon-btn .icon {
    width: 20px !important;
    height: 20px !important;
  }

  .app-header .badge {
    top: 2px;
    right: 2px;
    font-size: 9px;
    min-width: 15px;
    height: 15px;
  }

  .reader-toolbar {
    top: calc(96px + env(safe-area-inset-top, 0px)) !important;
    padding: 6px 12px !important;
    gap: 6px !important;
  }

  .toolbar-left, .toolbar-right {
    gap: 6px !important;
  }

  .badge-canon {
    max-width: 112px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Comfortable Mobile Scripture Reading Margins & Typography */
  .reading-area {
    padding-left: 18px !important;
    padding-right: 18px !important;
    padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .scripture-content {
    font-size: var(--scripture-font-size-active, 1.12rem) !important;
    line-height: 1.75 !important;
  }

  .scripture-p {
    text-align: left;
  }

  .chapter-title {
    font-size: 22px;
  }

  /* Center All Popovers & Modals Cleanly on Mobile Screens */
  #ambience-popover,
  #modal-ambience,
  .ambience-popover {
    top: calc(104px + env(safe-area-inset-top, 0px)) !important;
    left: 8px !important;
    right: 8px !important;
    bottom: auto !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 196px) !important;
    overflow-y: auto !important;
    transform: none !important;
  }

  .modal-card,
  .modal-card-wide,
  .modal-card-study {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    transform: none !important;
    top: calc(104px + env(safe-area-inset-top, 0px)) !important;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100vh - 192px - env(safe-area-inset-bottom, 0px)) !important;
  }

  .drawer-content {
    width: min(360px, 94vw) !important;
    max-width: calc(100vw - 12px) !important;
  }

  #drawer-toc .drawer-content {
    top: calc(96px + env(safe-area-inset-top, 0px)) !important;
    height: calc(100vh - 96px - 78px - env(safe-area-inset-top, 0px)) !important;
    max-height: calc(100vh - 96px - 78px - env(safe-area-inset-top, 0px)) !important;
    padding-top: 16px !important;
  }

  .offline-summary-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .offline-summary-actions {
    align-items: stretch;
  }

  .offline-summary-actions .offline-btn {
    width: 100%;
    text-align: center;
  }

  /* Android Safe-Area Padding on Bottom Player Bar */
  #player-bar,
  .player-bar {
    max-height: none !important;
    padding: 6px 12px calc(10px + env(safe-area-inset-bottom, 0px)) 12px !important;
  }

  .controls-row {
    gap: 6px;
  }

  .player-btn {
    width: 40px;
    height: 40px;
  }

  /* Move Floating "Active Verse / Top / Quote" Pills Higher on Phone */
  .floating-nav-controls {
    bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    transform: scale(0.9);
    transform-origin: bottom right;
  }

  .app-header .offline-header-btn,
  .app-header .update-pc-header-btn {
    height: 38px !important;
    padding: 0 10px !important;
    font-size: 11.5px !important;
    flex-shrink: 0 !important;
  }
}

/* ==========================================================================
   v3.6 LIVE: VISIBLE OFFLINE MANAGER BUTTON, GOLD BANNER & CANON BUILDER UI
   ========================================================================== */
.offline-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.7);
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.offline-header-btn:hover {
  background: var(--gold-primary);
  color: #0b0b0f;
}

.toc-offline-gold-banner {
  margin: 10px 14px 4px 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #f5c542;
  background: linear-gradient(135deg, #d4af37, #b87314);
  color: #0b0b0f;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.28);
  text-align: left;
  flex-shrink: 0;
}

.toc-offline-gold-banner:hover {
  filter: brightness(1.06);
}

.toc-offline-gold-banner .banner-arrow {
  font-size: 15px;
  font-weight: 900;
}

.book-build-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.book-build-whole-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.book-build-whole-btn:hover {
  background: var(--gold-primary);
  color: #000;
}

.book-build-whole-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.offline-manager-modal {
  z-index: 100000 !important;
}

.offline-manager-modal .modal-card {
  z-index: 100001 !important;
}

.offline-manager-body {
  padding: 16px 20px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mgr-gen-stats-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mgr-big-stat {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.mgr-status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}

.mgr-status-pill.paused {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fcd34d;
}

.mgr-mb-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
}

.mgr-gen-controls,
.mgr-sync-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mgr-bulk-sync-btn {
  flex: 1 1 240px;
  justify-content: center;
}

.mgr-books-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.mgr-book-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mgr-book-card.offline-ok {
  border-color: rgba(16, 185, 129, 0.45);
}

.mgr-book-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mgr-book-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.mgr-book-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.mgr-book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   v3.7 LIVE: ONE-TAP "UPDATE APP FROM PC" BUTTONS
   ========================================================================== */
.update-pc-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.65);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.update-pc-header-btn:hover {
  background: #10b981;
  color: #061812;
}

.mgr-update-panel {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.09), rgba(212, 175, 55, 0.06));
}

.mgr-update-btn {
  width: 100%;
  justify-content: center;
}

/* ==========================================================================
   v3.8 LIVE: APP ICON PREVIEW IN OFFLINE MANAGER
   ========================================================================== */
.mgr-icon-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mgr-icon-preview-img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  border: 1.5px solid var(--border-gold);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  background: #12100e;
  flex-shrink: 0;
}

.mgr-icon-preview-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ==========================================================================
   v4.0 LIVE: EXCLUSIVE FULL-SCREEN PAGE VIEWS & WALK PLAYLIST ENGINE
   ========================================================================== */
body.in-pageview #reader-toolbar,
body.in-pageview #reading-area,
body.in-pageview #floating-nav-controls,
body.in-pageview #verse-action-bar {
  display: none !important;
}

aside.fullscreen-page-view {
  position: fixed !important;
  top: 58px !important;
  bottom: 78px !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100vw !important;
  max-height: none !important;
  background: #0d0d0d !important;
  color: #f4f1ea !important;
  overflow-y: auto !important;
  z-index: 9000 !important;
  padding: 20px 16px 40px !important;
  margin: 0 !important;
  display: block !important;
}

aside.fullscreen-page-view.hidden {
  display: none !important;
}

aside.fullscreen-page-view > .modal-backdrop,
aside.fullscreen-page-view > .drawer-backdrop {
  display: none !important;
}

aside.fullscreen-page-view > .modal-card,
aside.fullscreen-page-view > .modal-card-wide,
aside.fullscreen-page-view > .modal-card-study,
aside.fullscreen-page-view > .drawer-content {
  position: static !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 920px !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 0 24px 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

aside.fullscreen-page-view .modal-header,
aside.fullscreen-page-view .drawer-header {
  display: none !important;
}

.page-gold-topbar {
  position: sticky;
  top: -20px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -20px -16px 20px -16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #2b2110 0%, #15120c 100%);
  border-bottom: 1.5px solid var(--gold-primary);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

.page-back-book-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #f5c542;
  background: linear-gradient(135deg, #d4af37, #b8841c);
  color: #0b0b0f;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.page-back-book-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.page-topbar-title {
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-primary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn.active-page-btn,
.offline-header-btn.active-page-btn {
  outline: 2px solid var(--gold-primary) !important;
  background: rgba(212, 175, 55, 0.22) !important;
  color: var(--gold-primary) !important;
}

/* Reader Sub-Header Active Playlist Queue Banner */
.active-playlist-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(184, 115, 20, 0.14));
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: 700;
  max-width: 100%;
}

.active-playlist-banner.hidden {
  display: none !important;
}

.playlist-stop-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: inherit;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Walk Playlist Controls Bar */
.playlist-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.14), rgba(212, 175, 55, 0.04));
  border: 1px solid rgba(212, 175, 55, 0.45);
  margin-bottom: 10px;
}

.playlist-play-btn {
  font-weight: 800;
}

@media (max-width: 640px) {
  aside.fullscreen-page-view {
    top: 58px !important;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 16px 12px 36px !important;
  }

  .page-gold-topbar {
    top: -16px;
    margin: -16px -12px 16px -12px;
    padding: 10px 12px;
  }

  .page-topbar-title {
    font-size: 14px;
  }
}

/* ==========================================================================
   v4.1 LIVE: BULLETPROOF AMBIENCE MIXER POPOVER & ACTIVE GLOW
   ========================================================================== */
#ambience-popover.ambience-open {
  display: block !important;
  position: fixed !important;
  top: 62px !important;
  right: 12px !important;
  left: auto !important;
  bottom: auto !important;
  width: min(320px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  z-index: 2147483646 !important;
  background: #141414 !important;
  border: 1px solid #d4af37 !important;
  border-radius: 14px !important;
  padding: 16px !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.9) !important;
  pointer-events: auto !important;
}

#btn-ambience.ambience-playing-glow {
  border-color: #f5c542 !important;
  background: rgba(212, 175, 55, 0.24) !important;
  box-shadow: 0 0 14px rgba(245, 197, 66, 0.55), inset 0 0 6px rgba(212, 175, 55, 0.35) !important;
  color: #f5c542 !important;
}

/* ==========================================================================
   v4.2 LIVE: EXPANDED GLOSSARY, INLINE MEASUREMENT TOOLTIP, SCHOLARLY
   RESOURCES & INTERACTIVE DARK-GOLD HISTORICAL MAPS STUDIO
   ========================================================================== */
.glossary-equivalent-badge {
  display: inline-block;
  margin: 6px 0 8px 0;
  padding: 5px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(184, 132, 28, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #f5c542;
  font-size: 12.5px;
  font-weight: 700;
}

.glossary-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.glossary-ref-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* Inline Tap-to-Define Tooltip Pill above Player Bar */
.glossary-tooltip-pill {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  z-index: 9500;
  background: linear-gradient(145deg, #1b1710 0%, #110f0c 100%);
  border: 1.5px solid #d4af37;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.88);
  color: #f4efe6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.glossary-tooltip-pill.hidden {
  display: none !important;
}

.glossary-tooltip-text {
  font-size: 13px;
  line-height: 1.45;
  color: #f4efe6;
  flex: 1 1 auto;
}

.glossary-tooltip-text strong {
  color: #f5c542;
}

.glossary-tooltip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ==========================================================================
   v4.3 LIVE: 🕊️ COMFORT, HOPE & GUIDANCE 12-PLAYLIST HUB
   ========================================================================== */
.comfort-hub-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 36px 0;
}

.comfort-offline-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(184, 132, 28, 0.06));
  border: 1.5px solid rgba(212, 175, 55, 0.55);
}

.comfort-offline-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 260px;
}

.comfort-offline-info strong {
  color: #f5c542;
  font-family: var(--font-title);
  font-size: 15px;
}

.comfort-offline-info span {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.comfort-save-offline-btn {
  white-space: nowrap;
  font-weight: 800;
}

.comfort-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.comfort-filter-pill {
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.comfort-filter-pill.active {
  background: linear-gradient(135deg, #d4af37, #b8841c);
  border-color: #f5c542;
  color: #0b0b0f;
}

.comfort-playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.comfort-playlist-card {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.comfort-playlist-card:hover {
  border-color: rgba(212, 175, 55, 0.7);
  transform: translateY(-1px);
}

.comfort-playlist-card.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(20, 18, 14, 0.96));
  border-color: #f5c542;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.comfort-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comfort-card-title {
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.comfort-playlist-card.active .comfort-card-title {
  color: #f5c542;
}

.comfort-card-cat {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  color: #d4af37;
  white-space: nowrap;
}

.comfort-card-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.comfort-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.comfort-active-playlist-panel {
  background: var(--bg-elevated);
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comfort-active-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comfort-active-header h3 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 18px;
  color: #f5c542;
}

.comfort-active-header p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.peaceful-listen-btn {
  border-color: rgba(125, 211, 252, 0.55) !important;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.28), rgba(30, 58, 138, 0.22)) !important;
  color: #bae6fd !important;
  font-weight: 700 !important;
}

.peaceful-listen-btn:hover {
  border-color: #7dd3fc !important;
  filter: brightness(1.1);
}

.comfort-tracks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comfort-track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s ease;
}

.comfort-track-row:hover {
  border-color: rgba(212, 175, 55, 0.55);
}

.comfort-track-row.active-track {
  border-color: #f5c542;
  background: rgba(212, 175, 55, 0.12);
}

.comfort-track-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.comfort-track-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.comfort-track-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.comfort-track-offline-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.comfort-track-summary {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   v4.4 LIVE: STICKY COMFORT HUB HEADER + CARD ACTION BUTTONS + CUSTOM PLAYLIST MODAL
   ========================================================================== */
.comfort-sticky-header {
  position: sticky;
  top: 46px;
  z-index: 25;
  background: #0d0d0d;
  padding: 6px 0 8px 0;
  margin-top: -6px;
}

.comfort-header-action-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.comfort-create-playlist-btn {
  border-color: rgba(245, 197, 66, 0.7) !important;
  background: rgba(212, 175, 55, 0.14) !important;
  color: #f5c542 !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

.comfort-create-playlist-btn:hover {
  background: rgba(212, 175, 55, 0.28) !important;
}

.comfort-playlists-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.comfort-playlist-card {
  justify-content: space-between;
  gap: 10px;
}

.comfort-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.comfort-card-play-btn {
  padding: 6px 11px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.comfort-card-actions .peaceful-listen-btn {
  padding: 6px 10px !important;
  font-size: 11.5px !important;
}

.comfort-card-delete-btn {
  margin-left: auto;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 700;
}

/* Custom Playlist Builder Modal */
.custom-playlist-modal {
  z-index: 100050 !important;
}

.custom-playlist-card {
  max-height: 88vh;
  overflow-y: auto;
}

.custom-playlist-body {
  padding: 16px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.custom-pl-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-pl-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
}

.custom-pl-field input[type="text"],
.custom-pl-dropdown-row select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
}

.custom-pl-field input[type="text"]:focus,
.custom-pl-dropdown-row select:focus {
  border-color: var(--gold-primary);
}

.custom-pl-dropdown-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 8px;
  align-items: center;
}

@media (max-width: 640px) {
  .custom-pl-dropdown-row {
    grid-template-columns: 1fr;
  }
  .comfort-sticky-header {
    top: 40px;
  }
}

.custom-chapter-search-results {
  max-height: 170px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}

.custom-search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.custom-selected-tracks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 210px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.custom-selected-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid rgba(212, 175, 55, 0.25);
  font-size: 13px;
}

.custom-pl-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}




