/* ==========================================================================
   LCG BIBLE STUDY HUB - NKJV BIBLE NAVIGATION & READER STYLES
   Prefix: lcg-bible- (Isolated scope to prevent style collisions)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties / Tokens
   -------------------------------------------------------------------------- */
:root {
  --lcg-bible-bg-overlay: rgba(8, 9, 12, 0.94);
  --lcg-bible-modal-bg: #18191d;
  --lcg-bible-card-bg: #202226;
  --lcg-bible-card-hover: #2a2c31;
  --lcg-bible-border: rgba(255, 255, 255, 0.12);
  --lcg-bible-border-focus: #8ab4f8;
  --lcg-bible-text-main: #f1f3f5;
  --lcg-bible-text-muted: #9aa0a6;
  --lcg-bible-text-dim: #6e7681;
  --lcg-bible-accent-gold: #fbbf24;
  --lcg-bible-accent-blue: #8ab4f8;
  --lcg-bible-accent-purple: #c58af9;
  --lcg-bible-accent-green: #34d399;
  --lcg-bible-red-letter: #f87171;
  
  /* Highlight swatch colors (with dark background contrast) */
  --lcg-bible-hl-yellow: rgba(251, 191, 36, 0.35);
  --lcg-bible-hl-green: rgba(52, 211, 153, 0.35);
  --lcg-bible-hl-blue: rgba(138, 180, 248, 0.35);
  --lcg-bible-hl-purple: rgba(197, 138, 249, 0.35);
  --lcg-bible-hl-pink: rgba(244, 114, 182, 0.35);
  --lcg-bible-hl-orange: rgba(251, 146, 60, 0.35);

  --lcg-bible-radius-lg: 16px;
  --lcg-bible-radius-md: 10px;
  --lcg-bible-radius-sm: 6px;
  --lcg-bible-shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --lcg-bible-shadow-floating: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15);
  --lcg-bible-verse-font-size: calc(1.05 * var(--global-reading-size, 1.0rem));
}

:root.light-theme {
  --lcg-bible-bg-overlay: rgba(240, 244, 248, 0.94);
  --lcg-bible-modal-bg: #ffffff;
  --lcg-bible-card-bg: #ffffff;
  --lcg-bible-card-hover: #f1f5f9;
  --lcg-bible-border: rgba(0, 0, 0, 0.12);
  --lcg-bible-border-focus: #2563eb;
  --lcg-bible-text-main: #0f172a;
  --lcg-bible-text-muted: #475569;
  --lcg-bible-text-dim: #64748b;
  --lcg-bible-accent-gold: #d97706;
  --lcg-bible-accent-blue: #2563eb;
  --lcg-bible-accent-purple: #9333ea;
  --lcg-bible-accent-green: #059669;
  --lcg-bible-red-letter: #dc2626;
  --lcg-bible-shadow-modal: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08);
  --lcg-bible-shadow-floating: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.1);
  --lcg-bible-hl-yellow: rgba(251, 191, 36, 0.4);
  --lcg-bible-hl-green: rgba(52, 211, 153, 0.4);
  --lcg-bible-hl-blue: rgba(138, 180, 248, 0.4);
  --lcg-bible-hl-purple: rgba(197, 138, 249, 0.4);
  --lcg-bible-hl-pink: rgba(244, 114, 182, 0.4);
  --lcg-bible-hl-orange: rgba(251, 146, 60, 0.4);
}

/* --------------------------------------------------------------------------
   Z-Index Hierarchy Layering (Explicit high z-index & strict isolation)
   -------------------------------------------------------------------------- */
#lcgBibleReaderRoot {
  z-index: 10000 !important;
}

#lcgBibleNavModal {
  z-index: 50000 !important;
}

#lcgBibleBottomNav {
  z-index: 60000 !important;
}

#lcgBibleExplainDrawer {
  z-index: 35000 !important;
}

#lcgBibleSearchDrawer {
  z-index: 10005 !important;
}

#lcgBibleToast {
  z-index: 10020 !important;
}

/* --------------------------------------------------------------------------
   Dark Theme Scrollbar Styling
   -------------------------------------------------------------------------- */
#lcgBibleReaderRoot,
.lcg-bible-modal,
.lcg-bible-modal-body,
#lcgBookGridContainer,
#lcgChapterGrid,
#lcgVerseGrid,
.lcg-bible-chapter-card,
#lcgDrawerSearchResults {
  scrollbar-width: thin;
  scrollbar-color: #555555 #2d2d2d;
}

#lcgBibleReaderRoot::-webkit-scrollbar,
.lcg-bible-modal::-webkit-scrollbar,
.lcg-bible-modal-body::-webkit-scrollbar,
#lcgBookGridContainer::-webkit-scrollbar,
#lcgChapterGrid::-webkit-scrollbar,
#lcgVerseGrid::-webkit-scrollbar,
.lcg-bible-chapter-card::-webkit-scrollbar,
.lcg-bible-modal-backdrop ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#lcgBibleReaderRoot::-webkit-scrollbar-track,
.lcg-bible-modal::-webkit-scrollbar-track,
.lcg-bible-modal-body::-webkit-scrollbar-track,
#lcgBookGridContainer::-webkit-scrollbar-track,
#lcgChapterGrid::-webkit-scrollbar-track,
#lcgVerseGrid::-webkit-scrollbar-track,
.lcg-bible-chapter-card::-webkit-scrollbar-track,
.lcg-bible-modal-backdrop ::-webkit-scrollbar-track {
  background: #2d2d2d;
  border-radius: 4px;
}

#lcgBibleReaderRoot::-webkit-scrollbar-thumb,
.lcg-bible-modal::-webkit-scrollbar-thumb,
.lcg-bible-modal-body::-webkit-scrollbar-thumb,
#lcgBookGridContainer::-webkit-scrollbar-thumb,
#lcgChapterGrid::-webkit-scrollbar-thumb,
#lcgVerseGrid::-webkit-scrollbar-thumb,
.lcg-bible-chapter-card::-webkit-scrollbar-thumb,
.lcg-bible-modal-backdrop ::-webkit-scrollbar-thumb {
  background: #555555;
  border-radius: 4px;
  border: 2px solid #2d2d2d;
}

#lcgBibleReaderRoot::-webkit-scrollbar-thumb:hover,
.lcg-bible-modal::-webkit-scrollbar-thumb:hover,
.lcg-bible-modal-body::-webkit-scrollbar-thumb:hover,
.lcg-bible-modal-backdrop ::-webkit-scrollbar-thumb:hover {
  background: #777777;
}

/* --------------------------------------------------------------------------
   2. Modal Backdrop & Container
   -------------------------------------------------------------------------- */
.lcg-bible-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #0c0d11 !important;
  background: #0c0d11 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, left 0.32s cubic-bezier(0.16, 1, 0.3, 1), right 0.32s cubic-bezier(0.16, 1, 0.3, 1), width 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px;
  box-sizing: border-box;
  isolation: isolate;
  z-index: 10000;
}

.lcg-bible-modal-backdrop.active {
  opacity: 1 !important;
  visibility: visible !important;
}

.lcg-bible-modal {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  background-color: #0e1217 !important;
  background: #0e1217 !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--lcg-bible-radius-lg);
  box-shadow: var(--lcg-bible-shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1 !important;
  padding-top: env(safe-area-inset-top) !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
}

.lcg-bible-modal-backdrop.active .lcg-bible-modal {
  transform: scale(1) translateY(0);
}

/* --------------------------------------------------------------------------
   3. Modal Header & 3-Tab Navigation (BOOK, CHAPTER, VERSE)
   -------------------------------------------------------------------------- */
.lcg-bible-modal-header {
  position: sticky;
  top: 0;
  z-index: 10002 !important;
  padding: 6px 14px 0;
  background-color: #0e1217 !important;
  background: #0e1217 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Top Row: Navigation Title Bar with Close, Title & View Toggle */
.lcg-bible-modal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative;
  height: 32px;
}

.lcg-bible-modal-title {
  font-size: 1.12rem;
  font-weight: 500;
  color: #f1f5f9;
  margin: 0;
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  letter-spacing: -0.01em;
  pointer-events: none;
}

.lcg-bible-quick-jump-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background: #181d24;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0 0 0 10px;
  height: 36px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 20;
}

.lcg-bible-quick-jump-wrap:focus-within {
  border-color: #0284c7;
  background: #1b212a;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

/* Quick Jump Auto-Predict Dropdown */
.lcg-bible-quick-jump-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 10020;
  background: #1e2025;
  border: 1px solid var(--lcg-bible-border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
  margin: 0;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.lcg-bible-quick-jump-dropdown::-webkit-scrollbar {
  width: 6px;
}

.lcg-bible-quick-jump-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.lcg-bible-quick-jump-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.lcg-bible-quick-jump-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.lcg-bible-quick-jump-item {
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--lcg-bible-text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.lcg-bible-quick-jump-item:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.lcg-bible-quick-jump-item:hover,
.lcg-bible-quick-jump-item:active,
.lcg-bible-quick-jump-item.selected {
  background: rgba(138, 180, 248, 0.14);
  color: var(--lcg-bible-accent-blue);
}

.lcg-bible-quick-jump-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lcg-bible-quick-jump-item-hint {
  font-size: 0.72rem;
  color: var(--lcg-bible-text-dim);
  margin-left: 8px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.lcg-bible-quick-jump-item:hover .lcg-bible-quick-jump-item-hint,
.lcg-bible-quick-jump-item.selected .lcg-bible-quick-jump-item-hint {
  color: var(--lcg-bible-accent-blue);
  opacity: 0.8;
}

.lcg-bible-quick-jump-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.lcg-bible-quick-jump-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 6px 0;
  font-family: inherit;
}

.lcg-bible-quick-jump-input::placeholder {
  color: #64748b;
  font-size: 0.85rem;
}

.lcg-bible-quick-jump-btn {
  background: #007799;
  color: #ffffff;
  border: none;
  border-radius: 0 4px 4px 0;
  padding: 0 16px;
  height: 36px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lcg-bible-quick-jump-btn:hover {
  background: #0284c7;
}

.lcg-bible-close-btn,
#lcgBibleCloseBtn {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  width: 32px !important;
  height: 32px !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  color: #cbd5e1 !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
}

.lcg-bible-close-btn:hover,
#lcgBibleCloseBtn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.lcg-bible-view-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.lcg-bible-view-toggle-btn:hover,
.lcg-bible-view-toggle-btn.active {
  color: #ffffff;
}

/* Bottom Row: 3 Text Tabs with Centered Rounded Indicator */
.lcg-bible-nav-tabs {
  display: flex;
  width: 100%;
  background: transparent;
  padding: 2px 0 0;
  border: none;
  gap: 0;
}

.lcg-bible-nav-tab {
  flex: 1;
  background: transparent;
  border: none !important;
  padding: 6px 4px 8px;
  border-radius: 0;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 0;
}

.lcg-bible-nav-tab:hover:not(:disabled) {
  color: #f1f5f9;
}

.lcg-bible-nav-tab.active {
  background: transparent;
  color: #ffffff !important;
  box-shadow: none;
}

.lcg-bible-nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 3px;
  border-radius: 9999px;
  background: #38bdf8;
}

.lcg-bible-nav-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   4. Tab Views & Scrollable Content
   -------------------------------------------------------------------------- */
.lcg-bible-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px max(6px, env(safe-area-inset-bottom)) !important;
  position: relative;
  max-height: none;
}

/* Custom Sleek Scrollbar */
.lcg-bible-modal-body::-webkit-scrollbar,
.lcg-bible-reader-container::-webkit-scrollbar {
  width: 6px;
}

.lcg-bible-modal-body::-webkit-scrollbar-track,
.lcg-bible-reader-container::-webkit-scrollbar-track {
  background: transparent;
}

.lcg-bible-modal-body::-webkit-scrollbar-thumb,
.lcg-bible-reader-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.lcg-bible-modal-body::-webkit-scrollbar-thumb:hover,
.lcg-bible-reader-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lcg-bible-tab-pane {
  display: none;
  animation: lcgBibleFadeIn 0.2s ease forwards;
}

.lcg-bible-tab-pane.active {
  display: block;
}

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

/* --------------------------------------------------------------------------
   5. Filter Pills (Hidden for Clean Screenshot 2 Layout)
   -------------------------------------------------------------------------- */
.lcg-bible-filter-bar {
  display: none !important;
}

/* --------------------------------------------------------------------------
   6. Book Selection Grid (GEN, EX, LEV, ...)
   -------------------------------------------------------------------------- */
.lcg-bible-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--lcg-bible-text-dim);
  letter-spacing: 0.08em;
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lcg-bible-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.lcg-bible-book-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(3px, 0.6vh, 6px) clamp(2px, 1vw, 5px);
  margin-bottom: 0;
  justify-items: center;
}

.lcg-bible-book-btn {
  background: #181d24;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  width: 100%;
  max-width: clamp(36px, 5.0vh, 46px);
  height: clamp(36px, 5.0vh, 46px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.lcg-bible-book-btn:hover {
  background: #222933;
  border-color: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

.lcg-bible-book-btn.selected {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1.5px #38bdf8;
}

.lcg-bible-book-abbr {
  font-size: clamp(1.05rem, 2.35vh, 1.28rem);
  font-weight: 700;
  color: var(--lcg-bible-text-main);
  letter-spacing: -0.025em;
  line-height: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lcg-bible-testament-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: clamp(4px, 0.8vh, 8px) 2px;
  border: none;
  width: calc(100% - 4px);
}

/* --------------------------------------------------------------------------
   Categorical Text Color Classes for Bible Navigation (Screenshot 2 Match)
   -------------------------------------------------------------------------- */
.cat-pink,
.lcg-bible-book-btn.cat-pink .lcg-bible-book-abbr,
.lcg-bible-book-abbr.cat-pink {
  color: #f87171 !important;
}

.cat-blue,
.lcg-bible-book-btn.cat-blue .lcg-bible-book-abbr,
.lcg-bible-book-abbr.cat-blue {
  color: #60a5fa !important;
}

.cat-orange,
.lcg-bible-book-btn.cat-orange .lcg-bible-book-abbr,
.lcg-bible-book-abbr.cat-orange {
  color: #fb923c !important;
}

.cat-purple,
.lcg-bible-book-btn.cat-purple .lcg-bible-book-abbr,
.lcg-bible-book-abbr.cat-purple {
  color: #c084fc !important;
}

.cat-green,
.lcg-bible-book-btn.cat-green .lcg-bible-book-abbr,
.lcg-bible-book-abbr.cat-green {
  color: #34d399 !important;
}

.lcg-bible-book-btn.cat-pink:hover   { border-color: rgba(248, 113, 113, 0.5); }
.lcg-bible-book-btn.cat-blue:hover   { border-color: rgba(96, 165, 250, 0.5); }
.lcg-bible-book-btn.cat-orange:hover { border-color: rgba(251, 146, 60, 0.5); }
.lcg-bible-book-btn.cat-purple:hover { border-color: rgba(192, 132, 252, 0.5); }
.lcg-bible-book-btn.cat-green:hover  { border-color: rgba(52, 211, 153, 0.5); }

.lcg-bible-book-name-hint {
  display: none;
}

/* Optional List View Mode */
.lcg-bible-book-list-view {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.lcg-bible-book-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #181d24;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--lcg-bible-text-main);
  text-align: left;
  transition: all 0.15s ease;
}

.lcg-bible-book-list-item:hover {
  background: #222933;
  border-color: rgba(255, 255, 255, 0.15);
}

.lcg-bible-book-list-item.selected {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px #38bdf8;
}

.lcg-bible-book-list-name {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   7. Chapter & Verse Grid Layouts
   -------------------------------------------------------------------------- */
.lcg-bible-active-book-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: var(--lcg-bible-radius-sm);
  border: 1px solid var(--lcg-bible-border);
  margin-bottom: 14px;
}

.lcg-bible-active-ref-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--lcg-bible-text-main);
}

.lcg-bible-back-link {
  background: transparent;
  border: none;
  color: var(--lcg-bible-accent-blue);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.lcg-bible-chapter-grid,
.lcg-bible-verse-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(3px, 0.6vh, 6px) clamp(2px, 1vw, 5px);
  justify-items: center;
}

.lcg-bible-num-btn {
  background: #181d24;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  max-width: clamp(36px, 5.0vh, 46px);
  height: clamp(36px, 5.0vh, 46px);
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.05rem, 2.4vh, 1.3rem);
  font-weight: 700;
  line-height: 1;
  color: var(--lcg-bible-text-main);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  box-sizing: border-box;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

.lcg-bible-num-btn:hover {
  background: #222933;
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: scale(1.05);
}

.lcg-bible-num-btn.selected {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 0 0 1.5px #38bdf8;
}

/* --------------------------------------------------------------------------
   8. Continuous Chapter Reader View
   -------------------------------------------------------------------------- */
#lcgBibleReaderRoot.lcg-bible-reader-root,
#lcgBibleReaderRoot {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100% !important;
  background-color: #0f1115;
  color: var(--lcg-bible-text-main, #f1f3f5);
  z-index: 10000 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box;
  transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1), right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.lcg-bible-reader-view,
.lcg-bible-reader-container,
.reader-container,
.bible-content {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1;
  box-sizing: border-box;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden !important;
}

/* Reader Toolbar Header */
.bible-top-panel,
.lcg-bible-reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  padding-top: max(10px, env(safe-area-inset-top)) !important;
  min-height: 60px;
  height: auto;
  background: rgba(24, 25, 29, 0.85) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--lcg-bible-border);
  position: relative !important;
  flex-shrink: 0;
  z-index: 100 !important;
  width: 100% !important;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1), right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

:root.light-theme .bible-top-panel,
:root.light-theme .lcg-bible-reader-toolbar {
  background: rgba(255, 255, 255, 0.85) !important;
  border-bottom: 1px solid var(--lcg-bible-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Back Chevron Button */
.lcg-bible-back-chevron-btn {
  background: transparent;
  border: 1px solid var(--lcg-bible-border);
  color: var(--lcg-bible-text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--lcg-bible-radius-sm, 8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.lcg-bible-back-chevron-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--lcg-bible-accent-blue);
  color: var(--lcg-bible-accent-blue);
  transform: translateX(-2px);
}

:root.light-theme .lcg-bible-back-chevron-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Recall Explainer Drawer Button */
.lcg-bible-recall-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--lcg-bible-radius-sm, 8px);
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.lcg-bible-recall-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: scale(1.1);
}

:root.light-theme .lcg-bible-recall-btn:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

.lcg-bible-nav-trigger-btn {
  background: rgba(102, 178, 255, 0.15);
  border: 1px solid rgba(102, 178, 255, 0.3);
  border-radius: 20px;
  padding: 6px 18px;
  color: var(--lcg-bible-text-main);
  font-size: 1.1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.lcg-bible-nav-trigger-btn strong {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
}

.lcg-bible-nav-trigger-btn:hover {
  background: rgba(102, 178, 255, 0.25);
  border-color: rgba(102, 178, 255, 0.5);
  color: var(--lcg-bible-text-main);
  transform: scale(1.02);
}

:root.light-theme .lcg-bible-nav-trigger-btn {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
}

:root.light-theme .lcg-bible-nav-trigger-btn:hover {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.45);
}

.lcg-bible-reader-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lcg-bible-font-btn {
  background: transparent;
  border: 1px solid var(--lcg-bible-border);
  color: var(--lcg-bible-text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--lcg-bible-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.lcg-bible-font-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--lcg-bible-text-main);
}

/* Reader View Centering Wrapper */
.lcg-bible-reader-view {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

/* Reader Content Body (Holding chapters and Previous/Next buttons) */
.lcg-bible-reader-body {
  transition: transform 0.3s ease-in-out;
  flex-grow: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 24px 24px !important;
  width: 100%;
  max-width: 840px;
  margin: 0 auto !important;
  box-sizing: border-box;
}

/* Chapter Card Container */
.lcg-bible-chapter-card {
  background-color: var(--lcg-bible-card-bg, #202226) !important;
  background: var(--lcg-bible-card-bg, #202226) !important;
  border: 1px solid var(--lcg-bible-border);
  border-radius: var(--lcg-bible-radius-lg);
  padding: 32px 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

:root.light-theme .lcg-bible-chapter-card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.lcg-bible-chapter-title-banner {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lcg-bible-chapter-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--lcg-bible-text-main);
  letter-spacing: -0.02em;
}

.lcg-bible-chapter-sub {
  font-size: 0.82rem;
  color: var(--lcg-bible-text-muted);
  margin-top: 4px;
}

/* Verses Layout & Typography */
.lcg-bible-verses-stream {
  font-family: 'Plus Jakarta Sans', Georgia, serif;
  font-size: var(--lcg-bible-verse-font-size, 1.05rem);
  line-height: 1.6;
  color: var(--lcg-bible-text-main);
  transition: font-size 0.1s ease;
  padding: 8px 4px;
}

/* Passage Headings (Pericopes) */
.passage-title,
.lcg-bible-heading,
h3.lcg-bible-heading,
.lcg-bible-verses-stream .passage-title,
.lcg-bible-verses-stream .lcg-bible-heading {
  font-size: 1.15rem;
  font-style: italic !important;
  font-weight: 600;
  color: #fbbf24 !important;
  margin-top: 32px !important;
  margin-bottom: 12px !important;
  display: block;
  clear: both;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.passage-title:first-child,
.lcg-bible-heading:first-child,
h3.lcg-bible-heading:first-child {
  margin-top: 4px !important;
}

/* Passage Paragraph Block (Backward-compatibility fallback) */
.lcg-bible-passage-block {
  display: block;
  margin-top: 0 !important;
  margin-bottom: 4px !important;
}

/* Verse Item (Tightened list-like block layout) */
.lcg-bible-verse-item,
.lcg-bible-verses-stream .lcg-bible-verse-item,
.lcg-bible-verses-stream .verse-block,
.lcg-bible-verses-stream .verse-container,
.lcg-bible-verses-stream p {
  display: block !important;
  margin-top: 0 !important;
  margin-bottom: 4px !important;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: text;
  font-size: inherit;
  line-height: 1.6 !important;
}

.lcg-bible-verse-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Enhanced Selection State (Crisp, noticeable highlight with left accent bar) */
.lcg-bible-verse-item.selected {
  background: rgba(59, 130, 246, 0.22) !important;
  box-shadow: inset 3.5px 0 0 #3b82f6, 0 0 0 1px rgba(59, 130, 246, 0.35) !important;
  border-radius: 6px;
}

:root.light-theme .lcg-bible-verse-item.selected {
  background: rgba(37, 99, 235, 0.14) !important;
  box-shadow: inset 3.5px 0 0 #2563eb, 0 0 0 1px rgba(37, 99, 235, 0.3) !important;
}

/* Swatch-specific selection borders when a highlighted verse is selected */
.lcg-bible-verse-item.selected.hl-yellow {
  background: rgba(251, 191, 36, 0.42) !important;
  box-shadow: inset 3.5px 0 0 #fbbf24, 0 0 0 1px rgba(251, 191, 36, 0.5) !important;
}
.lcg-bible-verse-item.selected.hl-green {
  background: rgba(52, 211, 153, 0.42) !important;
  box-shadow: inset 3.5px 0 0 #34d399, 0 0 0 1px rgba(52, 211, 153, 0.5) !important;
}
.lcg-bible-verse-item.selected.hl-blue {
  background: rgba(138, 180, 248, 0.42) !important;
  box-shadow: inset 3.5px 0 0 #8ab4f8, 0 0 0 1px rgba(138, 180, 248, 0.5) !important;
}
.lcg-bible-verse-item.selected.hl-purple {
  background: rgba(197, 138, 249, 0.42) !important;
  box-shadow: inset 3.5px 0 0 #c58af9, 0 0 0 1px rgba(197, 138, 249, 0.5) !important;
}
.lcg-bible-verse-item.selected.hl-pink {
  background: rgba(244, 114, 182, 0.42) !important;
  box-shadow: inset 3.5px 0 0 #f472b6, 0 0 0 1px rgba(244, 114, 182, 0.5) !important;
}
.lcg-bible-verse-item.selected.hl-orange {
  background: rgba(251, 146, 60, 0.42) !important;
  box-shadow: inset 3.5px 0 0 #fb923c, 0 0 0 1px rgba(251, 146, 60, 0.5) !important;
}

/* Verse Numbers (Subtle muted superscript, removing bright yellow) */
.lcg-bible-verse-num {
  font-size: 0.72em !important;
  vertical-align: super !important;
  color: #a0a0a0 !important;
  font-weight: 600;
  margin-right: 6px;
  user-select: none;
  line-height: 0;
}

.lcg-bible-verse-item:first-child .lcg-bible-verse-num,
.lcg-bible-passage-block > .lcg-bible-verse-item:first-child .lcg-bible-verse-num {
  margin-left: 0;
}

/* Chapter Drop Cap */
.chapter-drop-cap,
.lcg-bible-chapter-drop-cap {
  float: left !important;
  font-size: 3.5em !important;
  line-height: 0.8 !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-right: 12px !important;
  margin-top: 4px !important;
  margin-bottom: -2px !important;
  font-family: 'Plus Jakarta Sans', Georgia, serif;
  user-select: none;
}

/* Red-Letter Formatting */
.red-letter,
.lcg-bible-red-letter {
  color: #ff6b6b !important;
}

/* --------------------------------------------------------------------------
   9. Multi-Color Highlight Swatches
   -------------------------------------------------------------------------- */
.lcg-bible-verse-item.hl-yellow { background: var(--lcg-bible-hl-yellow); }
.lcg-bible-verse-item.hl-green  { background: var(--lcg-bible-hl-green); }
.lcg-bible-verse-item.hl-blue   { background: var(--lcg-bible-hl-blue); }
.lcg-bible-verse-item.hl-purple { background: var(--lcg-bible-hl-purple); }
.lcg-bible-verse-item.hl-pink   { background: var(--lcg-bible-hl-pink); }
.lcg-bible-verse-item.hl-orange { background: var(--lcg-bible-hl-orange); }

.lcg-bible-swatch-palette {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: auto;
  min-height: auto;
  max-height: none;
  padding: 0;
  background: transparent;
  border: none;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  box-sizing: border-box;
  white-space: nowrap !important;
}

.lcg-bible-swatch-dot {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  flex: 0 0 26px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
  -webkit-tap-highlight-color: transparent;
}

.lcg-bible-swatch-dot:hover,
.lcg-bible-swatch-dot:focus-visible {
  transform: scale(1.15);
  border-color: #ffffff;
  outline: none;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.lcg-bible-swatch-dot.swatch-yellow { background: #fbbf24 !important; }
.lcg-bible-swatch-dot.swatch-green  { background: #34d399 !important; }
.lcg-bible-swatch-dot.swatch-blue   { background: #8ab4f8 !important; }
.lcg-bible-swatch-dot.swatch-purple { background: #c58af9 !important; }
.lcg-bible-swatch-dot.swatch-pink   { background: #f472b6 !important; }
.lcg-bible-swatch-dot.swatch-orange { background: #fb923c !important; }
.lcg-bible-swatch-dot.swatch-clear  {
  background: transparent !important;
  position: relative !important;
}
.lcg-bible-swatch-dot.swatch-clear::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 2px !important;
  right: 2px !important;
  height: 2px !important;
  background: #f87171 !important;
  transform: rotate(45deg) !important;
}

/* --------------------------------------------------------------------------
   10. Persistent Two-State Bottom Navigation Bar
   -------------------------------------------------------------------------- */
#lcgBibleBottomNav,
.lcg-bible-bottom-nav {
  position: fixed !important;
  bottom: 24px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  max-width: 95vw !important;
  margin: 0 !important;
  flex-shrink: 0;
  z-index: 60000 !important;
  overflow: hidden;
  background: rgba(30, 30, 32, 0.85) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 40px !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
  padding: 10px 20px !important;
  padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto !important;
}

:root.light-theme .lcg-bible-bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--lcg-bible-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* Strict visibility isolation classes */
.hidden,
.lcg-bible-bottom-nav .hidden,
.lcg-bible-nav-group.hidden,
#lcgBibleNavDefault.hidden,
#lcgBibleNavActive.hidden {
  display: none !important;
}

.lcg-bible-nav-group {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex-wrap: nowrap !important;
  max-width: 100% !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  justify-content: flex-start !important;
  display: flex;
  align-items: center;
  white-space: nowrap;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.lcg-bible-nav-group::-webkit-scrollbar {
  display: none !important;
}

.lcg-bible-nav-item-btn,
.lcg-bible-action-btn,
.lcg-bible-swatch-dot {
  flex-shrink: 0 !important;
}

/* Active Pillbox Menu: Hamburger button is Desktop-only */
#lcgActionMenuBtn,
.lcg-desktop-menu-btn {
  display: none !important;
}

@media (min-width: 1025px) {
  #lcgActionMenuBtn,
  .lcg-desktop-menu-btn {
    display: inline-flex !important;
  }
}

/* On desktop, hide the left sidebar when Bible reader or navigation modal is active, unless explicitly opened via hamburger */
@media (min-width: 1025px) {
  body.bible-reader-active #sidebar:not(.desktop-open),
  body.bible-nav-modal-open #sidebar:not(.desktop-open) {
    display: none !important;
    width: 0 !important;
    transform: translateX(-100%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Pull out left sidebar in front of Bible reader when active */
#sidebar.desktop-open {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 290px !important;
  max-width: 85vw !important;
  height: 100vh !important;
  background: #18191d !important;
  background-color: var(--bg-sidebar, #18191d) !important;
  border-right: 1px solid var(--border-color, rgba(255,255,255,0.12)) !important;
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.85) !important;
  z-index: 65000 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#sidebar.desktop-open #closeSidebarBtn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#sidebar.desktop-open .brand-logo-text,
#sidebar.desktop-open #closeSidebarBtn,
#sidebar.desktop-open .new-chat-wrapper,
#sidebar.desktop-open .threads-nav,
#sidebar.desktop-open .sidebar-tools-nav,
#sidebar.desktop-open .sidebar-footer,
#sidebar.desktop-open .tool-text,
#sidebar.desktop-open .user-meta {
  display: flex !important;
}
#sidebar.desktop-open .threads-nav {
  display: block !important;
}
#sidebar.desktop-open .new-chat-wrapper {
  display: block !important;
}

@media (max-width: 1024px) {
  #sidebarBackdrop.active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 24000 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    display: block !important;
  }
  #sidebar.mobile-open,
  .sidebar.mobile-open {
    z-index: 65000 !important;
  }
}

/* Portrait Smartphones ONLY: Pull out main sidebar panel on top of the note panel */
@media (max-width: 1023px) and (orientation: portrait) {
  #sidebar.mobile-open {
    z-index: 70000 !important;
  }
  #sidebarBackdrop.active {
    z-index: 69000 !important;
  }
}

@media (min-width: 1025px) {
  body.bible-reader-active #sidebarBackdrop,
  body:has(#sidebar.desktop-open) #sidebarBackdrop,
  #sidebarBackdrop {
    display: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: transparent !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
}

/* Wide Viewport Footer Centering */
@media (min-width: 768px) {
  #lcgBibleBottomNav,
  .lcg-bible-bottom-nav {
    /* display intentionally NOT forced here — JS (toggleSidebar) controls it */
    justify-content: center !important;
    align-items: center !important;
  }

  .lcg-bible-nav-group {
    justify-content: center !important;
    overflow-x: visible !important;
  }

  .lcg-bible-nav-group:not(.hidden),
  .lcg-bible-nav-default:not(.hidden),
  .lcg-bible-nav-active:not(.hidden) {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
  }
}

/* Default State (No Verse Selected): Centered Home and Search */
.lcg-bible-nav-default {
  justify-content: center;
  gap: 36px;
  padding: 0 16px;
}

.lcg-bible-nav-item-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--lcg-bible-border);
  color: var(--lcg-bible-text-main);
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.lcg-bible-nav-item-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--lcg-bible-accent-blue);
  color: #ffffff;
  transform: translateY(-1px);
}

.lcg-bible-nav-item-btn:active {
  transform: translateY(0);
}

.lcg-bible-nav-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lcg-bible-nav-label {
  letter-spacing: 0.01em;
}

/* Active State (Verse Selected): Horizontal Scrolling Toolbar with Hidden Scrollbar */
.lcg-bible-nav-active {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;
  padding: 4px 16px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .lcg-bible-nav-active {
    justify-content: center !important;
    overflow-x: visible !important;
  }
}

.lcg-bible-nav-active::-webkit-scrollbar {
  display: none;
}

/* Minimal, Clickable Text/Icon Links with Transparent Background */
.lcg-bible-action-btn {
  background: transparent !important;
  border: none !important;
  color: var(--lcg-bible-text-main) !important;
  padding: 6px 10px !important;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  width: auto !important;
  max-width: fit-content !important;
  margin: 0 !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  box-shadow: none !important;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.lcg-bible-action-btn:hover {
  color: var(--lcg-bible-accent-blue) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  transform: translateY(-1px);
}

.lcg-bible-action-btn:active {
  transform: translateY(0);
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   10b. Chapter Navigation Footer (Previous / Next Buttons - Unified 50/50 Split)
   -------------------------------------------------------------------------- */
.lcg-bible-chapter-nav-footer {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.lcg-bible-chapter-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  height: 48px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--lcg-bible-border);
  border-radius: var(--lcg-bible-radius-md, 10px);
  color: var(--lcg-bible-text-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.lcg-bible-chapter-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--lcg-bible-accent-blue);
  color: #ffffff;
  transform: translateY(-1px);
}

.lcg-bible-chapter-btn:active:not(:disabled) {
  transform: translateY(0);
}

.lcg-bible-chapter-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   11. Toast Notifications
   -------------------------------------------------------------------------- */
.lcg-bible-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid rgba(138, 180, 248, 0.3);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 10005;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lcg-bible-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   12. Responsive Mobile Optimizations
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .lcg-bible-modal-backdrop {
    padding: 0;
    align-items: stretch;
    justify-content: center;
  }

  .lcg-bible-modal,
  .bible-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    transform: none !important;
  }

  .lcg-bible-modal-backdrop.active .lcg-bible-modal,
  .lcg-bible-modal-backdrop.active .bible-modal {
    transform: none !important;
  }

  .lcg-bible-modal-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 10005 !important;
    background: #0e1217 !important;
    background-color: #0e1217 !important;
    padding: max(8px, env(safe-area-inset-top)) 14px 0 !important;
    gap: 6px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .lcg-bible-modal-top-bar {
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important;
    width: 100% !important;
  }

  .lcg-bible-modal-title {
    font-size: 1.22rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    text-align: center !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    white-space: nowrap !important;
    pointer-events: none !important;
  }

  .lcg-bible-close-btn,
  #lcgBibleCloseBtn {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    width: 32px !important;
    height: 32px !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #cbd5e1 !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  .lcg-bible-close-btn:hover,
  #lcgBibleCloseBtn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
  }

  .lcg-bible-view-toggle-btn {
    display: flex !important;
    width: 32px !important;
    height: 32px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    color: #cbd5e1 !important;
    flex-shrink: 0 !important;
  }

  .lcg-bible-quick-jump-wrap {
    height: 38px !important;
    background: #181d24 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 6px !important;
    padding: 0 0 0 10px !important;
  }

  .lcg-bible-quick-jump-input {
    font-size: 0.95rem !important;
    color: #f8fafc !important;
    padding: 6px 0 !important;
  }

  .lcg-bible-quick-jump-btn {
    padding: 0 16px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    height: 38px !important;
    background: #0284c7 !important;
    color: #ffffff !important;
  }

  .lcg-bible-nav-tabs {
    padding: 2px 0 0 !important;
    gap: 0 !important;
  }

  .lcg-bible-nav-tab {
    padding: 6px 8px 8px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
  }

  .lcg-bible-modal-body {
    max-height: none !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: 8px 12px calc(95px + env(safe-area-inset-bottom)) !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .lcg-bible-book-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: clamp(5px, 0.8vh, 8px) clamp(2px, 1.2vw, 6px) !important;
    justify-items: center !important;
  }

  .lcg-bible-book-btn {
    min-height: clamp(38px, 5.2vh, 48px) !important;
    height: clamp(38px, 5.2vh, 48px) !important;
    max-width: clamp(38px, 5.2vh, 48px) !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    background: #181d24 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .lcg-bible-book-abbr {
    font-size: clamp(1.08rem, 2.35vh, 1.28rem) !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: -0.025em !important;
  }

  .lcg-bible-testament-divider {
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    margin: 8px 4px !important;
  }

  .lcg-bible-chapter-grid,
  .lcg-bible-verse-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: clamp(5px, 0.8vh, 8px) clamp(2px, 1.2vw, 6px) !important;
    justify-items: center !important;
  }

  .lcg-bible-num-btn {
    min-height: clamp(38px, 5.2vh, 48px) !important;
    height: clamp(38px, 5.2vh, 48px) !important;
    max-width: clamp(38px, 5.2vh, 48px) !important;
    aspect-ratio: 1 / 1 !important;
    font-size: clamp(1.08rem, 2.4vh, 1.3rem) !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    border-radius: 50% !important;
    background: #181d24 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #lcgBibleBottomNav,
  .lcg-bible-bottom-nav {
    position: fixed !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 60000 !important;
    display: flex !important;
    pointer-events: auto !important;
    width: auto !important;
    max-width: 95vw !important;
    padding: 10px 20px !important;
    border-radius: 40px !important;
    background: rgba(30, 30, 32, 0.88) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
  }

  .lcg-bible-reader-view {
    padding: 0 !important;
  }

  .lcg-bible-reader-body {
    padding: 16px 12px !important;
    flex-grow: 1 !important;
    overflow-y: auto !important;
  }

  .lcg-bible-chapter-card {
    padding: 20px 14px;
  }

  .lcg-bible-verses-stream {
    font-size: 1rem;
    line-height: 1.6 !important;
  }

  .lcg-bible-verse-item,
  .lcg-bible-verses-stream .lcg-bible-verse-item {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    line-height: 1.6 !important;
  }

  #lcgBibleBottomNav,
  .lcg-bible-bottom-nav {
    padding: 12px 0 !important;
  }

  .lcg-bible-nav-default {
    gap: 20px;
    padding: 0 16px;
  }

  .lcg-bible-nav-item-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
    min-height: 38px;
  }

  .lcg-bible-nav-icon {
    font-size: 1.05rem;
  }

  .lcg-bible-nav-active {
    gap: 12px;
    padding: 0 16px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100vw;
    white-space: nowrap;
  }

  .lcg-bible-action-btn {
    padding: 6px 8px !important;
    font-size: 0.9rem;
    flex-shrink: 0 !important;
  }

  .lcg-bible-swatch-palette {
    flex-shrink: 0 !important;
    display: flex !important;
    gap: 16px !important;
    align-items: center !important;
    padding: 0;
  }

  .lcg-bible-swatch-dot {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    flex: 0 0 26px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }

  .lcg-bible-chapter-btn {
    min-height: 44px;
    height: 44px;
    padding: 8px 10px;
    font-size: 0.84rem;
  }
}

/* --------------------------------------------------------------------------
   13. Responsive Landscape Orientation Support (Mobile & Tablet)
   -------------------------------------------------------------------------- */
@media screen and (max-height: 600px) and (orientation: landscape) {
  .lcg-bible-modal-backdrop {
    padding: 0;
    align-items: stretch;
    justify-content: center;
  }

  .lcg-bible-modal,
  .bible-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    transform: none !important;
  }

  .lcg-bible-modal-backdrop.active .lcg-bible-modal,
  .lcg-bible-modal-backdrop.active .bible-modal {
    transform: none !important;
  }

  /* Compact Sticky Modal Header */
  .lcg-bible-modal-header {
    padding: 6px max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)) !important;
    gap: 6px !important;
  }

  .lcg-bible-header-top {
    gap: 8px;
  }

  .lcg-bible-quick-jump-wrap {
    padding: 1px 4px 1px 10px;
  }

  .lcg-bible-quick-jump-input {
    padding: 4px 0;
    font-size: 0.82rem;
  }

  .lcg-bible-quick-jump-btn {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  .lcg-bible-close-btn {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
  }

  /* Compact Tabs */
  .lcg-bible-nav-tabs {
    gap: 0;
    padding: 0;
  }

  .lcg-bible-nav-tab {
    padding: 6px 4px 8px;
    font-size: 0.74rem;
  }

  /* Compact Filter Bar */
  .lcg-bible-filter-bar {
    padding-bottom: 6px;
    margin-bottom: 8px;
    gap: 6px;
  }

  .lcg-bible-filter-pill {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  /* Modal Body Full-Height Scrolling */
  .lcg-bible-modal-body {
    flex: 1 1 auto;
    height: calc(100% - 85px);
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 8px max(14px, env(safe-area-inset-right)) max(24px, calc(12px + env(safe-area-inset-bottom))) max(14px, env(safe-area-inset-left));
  }

  /* Highly Flexible Landscape Grid Adaptations */
  .lcg-bible-book-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 6px 4px;
    margin-bottom: 12px;
  }

  .lcg-bible-book-btn {
    min-height: 40px;
    height: 40px;
    border-radius: 20px;
    padding: 0;
  }

  .lcg-bible-book-abbr {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
  }

  .lcg-bible-book-name {
    display: none;
  }

  .lcg-bible-chapter-grid,
  .lcg-bible-verse-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 6px 4px;
  }

  .lcg-bible-num-btn {
    min-height: 40px;
    height: 40px;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    border-radius: 20px;
    padding: 0;
  }

  /* Compact Reader Toolbar Header */
  .lcg-bible-reader-toolbar {
    padding: 6px max(14px, env(safe-area-inset-right)) 6px max(14px, env(safe-area-inset-left)) !important;
    gap: 8px !important;
  }

  .lcg-bible-nav-trigger-btn {
    padding: 4px 10px;
    font-size: 0.82rem;
  }

  .lcg-bible-font-btn {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
  }

  /* Scrollable Reader Body in Landscape */
  #lcgBibleReaderRoot {
    height: 100% !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .lcg-bible-reader-view {
    padding: 0 !important;
  }

  .lcg-bible-reader-body {
    padding: 12px 10px !important;
    flex-grow: 1 !important;
    overflow-y: auto !important;
    max-width: 95%;
  }

  .lcg-bible-chapter-card {
    padding: 14px 16px !important;
  }

  .lcg-bible-chapter-title-banner {
    margin-bottom: 14px !important;
    padding-bottom: 8px !important;
  }

  .lcg-bible-chapter-heading {
    font-size: 1.25rem;
  }

  .lcg-bible-bottom-nav {
    padding: 6px 0;
    padding-bottom: max(6px, calc(6px + env(safe-area-inset-bottom, 0px)));
  }

  .lcg-bible-nav-default {
    gap: 24px;
    padding: 0 16px;
  }

  .lcg-bible-nav-item-btn {
    padding: 6px 16px;
    min-height: 36px;
    font-size: 0.85rem;
  }

  .lcg-bible-nav-active {
    gap: 12px;
    padding: 0 16px;
    justify-content: center;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }

  .lcg-bible-action-btn {
    padding: 4px 6px !important;
    font-size: 0.82rem;
    flex-shrink: 0 !important;
  }

  .lcg-bible-swatch-palette {
    gap: 6px;
    padding: 0;
    flex-shrink: 0 !important;
  }

  .lcg-bible-swatch-dot {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    flex: 0 0 24px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }
}

/* --------------------------------------------------------------------------
   13b. Tablet Landscape & Compact Height Adaptive Scaling (Height <= 880px)
   Prevents book chips from overlapping with floating pillbox dock
   -------------------------------------------------------------------------- */
@media (max-height: 880px) {
  .lcg-bible-modal-header {
    padding: 6px 12px 0 !important;
    gap: 4px !important;
  }

  .lcg-bible-modal-top-bar {
    margin-bottom: 4px !important;
    height: 28px !important;
  }

  .lcg-bible-modal-title {
    font-size: 1rem !important;
  }

  .lcg-bible-close-btn,
  .lcg-bible-view-toggle-btn {
    width: 28px !important;
    height: 28px !important;
  }

  .lcg-bible-quick-jump-wrap {
    margin-bottom: 4px !important;
    padding: 2px 6px 2px 10px !important;
  }

  .lcg-bible-quick-jump-input {
    height: 32px !important;
    font-size: 0.85rem !important;
  }

  .lcg-bible-quick-jump-btn {
    padding: 3px 12px !important;
    font-size: 0.76rem !important;
    height: 26px !important;
  }

  .lcg-bible-nav-tabs {
    margin-top: 4px !important;
    padding: 0 4px !important;
  }

  .lcg-bible-nav-tab {
    padding: 4px 10px !important;
    font-size: 0.82rem !important;
  }

  .lcg-bible-section-label {
    margin: 6px 0 4px !important;
    font-size: 0.72rem !important;
  }

  .lcg-bible-testament-divider {
    margin: 4px 2px !important;
  }

  /* Adaptive Circle Chips for Tablet Heights */
  .lcg-bible-book-btn {
    max-width: clamp(32px, 4.4vh, 38px) !important;
    height: clamp(32px, 4.4vh, 38px) !important;
    min-height: 32px !important;
  }

  .lcg-bible-book-abbr {
    font-size: clamp(0.92rem, 2.1vh, 1.15rem) !important;
    font-weight: 700 !important;
  }

  .lcg-bible-book-grid {
    gap: clamp(2px, 0.45vh, 4px) clamp(2px, 0.8vw, 4px) !important;
  }

  .lcg-bible-chapter-grid,
  .lcg-bible-verse-grid {
    gap: clamp(2px, 0.45vh, 4px) clamp(2px, 0.8vw, 4px) !important;
  }

  .lcg-bible-num-btn {
    max-width: clamp(32px, 4.4vh, 38px) !important;
    height: clamp(32px, 4.4vh, 38px) !important;
    min-height: 32px !important;
    font-size: clamp(0.95rem, 2.1vh, 1.15rem) !important;
  }

  /* Guaranteed Scroll Clearance Buffer: content scrolls well above floating dock */
  #lcgBibleNavModal .lcg-bible-modal-body,
  #lcgBibleNavModal #lcgBookGridContainer,
  #lcgChapterGrid,
  #lcgVerseGrid {
    padding-bottom: calc(95px + env(safe-area-inset-bottom)) !important;
  }

  #lcgBibleBottomNav,
  .lcg-bible-bottom-nav {
    bottom: max(14px, env(safe-area-inset-bottom)) !important;
  }
}

/* --------------------------------------------------------------------------
   14. Horizontal Slide Animations for Chapter Transitions
   -------------------------------------------------------------------------- */
#lcgBibleReaderModal,
#lcgBibleReaderModal .lcg-bible-modal,
#lcgBibleReaderRoot,
.lcg-bible-reader-view {
  overflow-x: hidden !important;
}

@keyframes lcgSlideOutLeft {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  to {
    transform: translate3d(-100%, 0, 0);
    opacity: 0;
  }
}

@keyframes lcgSlideInRight {
  from {
    transform: translate3d(100%, 0, 0);
    opacity: 0;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes lcgSlideOutRight {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  to {
    transform: translate3d(100%, 0, 0);
    opacity: 0;
  }
}

@keyframes lcgSlideInLeft {
  from {
    transform: translate3d(-100%, 0, 0);
    opacity: 0;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

.slide-out-left,
.lcg-slide-out-left {
  animation: lcgSlideOutLeft 200ms ease-out forwards;
  will-change: transform, opacity;
  pointer-events: none;
}

.slide-in-right,
.lcg-slide-in-right {
  animation: lcgSlideInRight 200ms ease-in forwards;
  will-change: transform, opacity;
}

.slide-out-right,
.lcg-slide-out-right {
  animation: lcgSlideOutRight 200ms ease-out forwards;
  will-change: transform, opacity;
  pointer-events: none;
}

.slide-in-left,
.lcg-slide-in-left {
  animation: lcgSlideInLeft 200ms ease-in forwards;
  will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   15. Continuous Sliding Explain Drawer (AI Scripture Insights)
   -------------------------------------------------------------------------- */
#lcgBibleExplainDrawer,
.lcg-bible-explain-drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 400px !important;
  height: 100% !important;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 35000 !important;
  background: #252525 !important;
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.7) !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  pointer-events: auto !important;
}

#lcgBibleExplainDrawer.active,
.lcg-bible-explain-drawer.active {
  transform: translateX(0) !important;
}

.lcg-explain-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  padding-top: max(16px, env(safe-area-inset-top)) !important;
  background: #18191d;
  border-bottom: 1px solid var(--lcg-bible-border);
  flex-shrink: 0;
}

.lcg-explain-drawer-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lcg-explain-drawer-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.lcg-explain-drawer-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lcg-explain-drawer-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--lcg-bible-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lcg-explain-drawer-subtitle {
  font-size: 0.72rem;
  color: var(--lcg-bible-text-muted);
  font-weight: 500;
}

.lcg-explain-drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.lcg-explain-font-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--lcg-bible-border);
  color: var(--lcg-bible-text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--lcg-bible-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.2;
}

.lcg-explain-font-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--lcg-bible-text-main);
  border-color: var(--lcg-bible-accent-blue);
}

.lcg-explain-drawer-close {
  background: transparent;
  border: none;
  color: var(--lcg-bible-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.lcg-explain-drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--lcg-bible-text-main);
}

#lcgExplainDrawerMessages,
.lcg-explain-drawer-messages {
  --chat-font-size: calc(var(--global-reading-size, 1.1rem) - 0.15rem);
  font-size: calc(var(--global-reading-size, 1.1rem) - 0.15rem);
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: 120px !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: #555555 transparent;
  box-sizing: border-box;
}

#lcgExplainDrawerMessages .lcg-explain-bubble,
#lcgExplainDrawerMessages .lcg-explain-bubble p,
.lcg-explain-drawer-messages .lcg-explain-bubble,
.lcg-explain-drawer-messages .lcg-explain-bubble p {
  font-size: calc(var(--global-reading-size, 1.1rem) - 0.15rem);
}

.lcg-explain-drawer-messages::-webkit-scrollbar {
  width: 6px;
}

.lcg-explain-drawer-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.lcg-explain-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 200px;
  color: var(--lcg-bible-text-muted);
  padding: 2rem 1rem;
  gap: 12px;
}

.lcg-explain-empty-icon {
  font-size: 2rem;
  opacity: 0.7;
}

.lcg-explain-empty-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lcg-bible-text-main);
  margin: 0;
}

.lcg-explain-empty-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  max-width: 280px;
  margin: 0;
}

/* Chat Message Bubbles */
.lcg-explain-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.lcg-explain-msg-user {
  align-self: flex-end;
  max-width: 90%;
}

.lcg-explain-msg-user .lcg-explain-bubble {
  background: #232d3f;
  border: 1px solid rgba(138, 180, 248, 0.35);
  border-radius: 14px 14px 2px 14px;
  padding: 10px 14px;
  color: #e8eaed;
  font-size: var(--chat-font-size, 0.88rem);
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  word-break: break-word;
}

.lcg-explain-msg-user .lcg-explain-citation-tag {
  display: block;
  font-weight: 700;
  color: var(--lcg-bible-accent-blue);
  margin-bottom: 3px;
  font-size: 0.82rem;
}

.lcg-explain-msg-assistant {
  align-self: flex-start;
  max-width: 98%;
  width: 100%;
}

.lcg-explain-msg-assistant .lcg-explain-bubble {
  background: #18191d;
  border: 1px solid var(--lcg-bible-border);
  border-radius: 14px 14px 14px 2px;
  padding: 14px 16px;
  color: #f1f3f5;
  font-size: var(--chat-font-size, 0.88rem);
  line-height: 1.55;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  word-break: break-word;
}

.lcg-explain-msg-assistant .lcg-explain-bubble h3 {
  margin: 14px 0 6px 0;
  font-size: calc(var(--chat-font-size, 0.88rem) * 1.12);
  line-height: 1.35;
  color: var(--lcg-bible-accent-gold);
}

.lcg-explain-msg-assistant .lcg-explain-bubble h4,
.lcg-explain-msg-assistant .lcg-explain-bubble h5,
.lcg-explain-msg-assistant .lcg-explain-bubble .bold-title {
  margin: 12px 0 4px 0;
  font-size: calc(var(--chat-font-size, 0.88rem) * 1.05);
  font-weight: 700;
  line-height: 1.35;
  color: var(--lcg-bible-accent-gold);
  display: block;
}

.lcg-explain-msg-assistant .lcg-explain-bubble h3:first-child,
.lcg-explain-msg-assistant .lcg-explain-bubble h4:first-child,
.lcg-explain-msg-assistant .lcg-explain-bubble .bold-title:first-child {
  margin-top: 0;
}

.lcg-explain-msg-assistant .lcg-explain-bubble strong {
  color: #f3f4f6;
  font-weight: 700;
}

.lcg-explain-msg-assistant .lcg-explain-bubble blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--lcg-bible-accent-gold);
  background: rgba(251, 191, 36, 0.08);
  border-radius: 0 6px 6px 0;
  color: #fef08a;
  font-style: normal;
}

.lcg-explain-msg-assistant .lcg-explain-bubble hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 10px 0;
}

.lcg-explain-msg-assistant .lcg-explain-bubble p {
  margin: 6px 0;
}

.lcg-explain-msg-assistant .lcg-explain-bubble ul,
.lcg-explain-msg-assistant .lcg-explain-bubble ol {
  margin: 6px 0;
  padding-left: 20px;
}

/* Reference Citations Details/Summary Dropdown */
.lcg-explain-sources-details {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lcg-explain-sources-summary {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--lcg-bible-text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
  outline: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.lcg-explain-sources-summary::-webkit-details-marker {
  display: none;
}

.lcg-explain-sources-summary::before {
  content: '▶';
  font-size: 0.62rem;
  transition: transform 0.2s ease;
  display: inline-block;
  color: var(--lcg-bible-accent-blue);
}

.lcg-explain-sources-details[open] > .lcg-explain-sources-summary::before {
  transform: rotate(90deg);
}

.lcg-explain-sources-summary:hover {
  color: var(--lcg-bible-accent-blue);
}

.lcg-explain-sources-details[open] > .lcg-explain-sources-summary {
  margin-bottom: 8px;
  color: var(--lcg-bible-accent-blue);
}

.lcg-explain-sources-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lcg-explain-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--lcg-bible-text-muted);
}

/* Typing indicator */
.lcg-explain-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #18191d;
  border: 1px solid var(--lcg-bible-border);
  border-radius: 14px 14px 14px 2px;
  color: var(--lcg-bible-text-muted);
  font-size: 0.82rem;
  width: fit-content;
  min-width: 260px; /* prevents layout jump when phrases change length */
}

.lcg-explain-typing-phrase {
  transition: opacity 0.4s ease;
}

.lcg-explain-typing-dots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.lcg-explain-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--lcg-bible-accent-blue);
  border-radius: 50%;
  animation: lcgTypingAnim 1.4s infinite ease-in-out;
}

.lcg-explain-typing-dot:nth-child(1) { animation-delay: 0s; }
.lcg-explain-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.lcg-explain-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes lcgTypingAnim {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Drawer Footer Form */
.lcg-explain-drawer-footer {
  padding: 12px 14px !important;
  background: #16171a;
  border-top: 1px solid var(--lcg-bible-border);
  flex-shrink: 0;
}

.lcg-explain-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--lcg-bible-border);
  border-radius: 22px;
  padding: 4px 6px 4px 14px;
  transition: all 0.2s ease;
}

.lcg-explain-input-wrap:focus-within {
  border-color: var(--lcg-bible-accent-blue);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.2);
}

.lcg-explain-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--lcg-bible-text-main);
  font-size: 0.88rem;
  padding: 6px 0;
  font-family: inherit;
}

.lcg-explain-input::placeholder {
  color: var(--lcg-bible-text-dim);
  font-size: 0.82rem;
}

.lcg-explain-send-btn {
  background: var(--lcg-bible-accent-blue);
  color: #121316;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.lcg-explain-send-btn:hover {
  background: #a8c7fa;
  transform: scale(1.05);
}

.lcg-explain-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.explain-inline-copy {
  margin-top: 10px;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--theme-bg-hover, rgba(255, 255, 255, 0.08));
  color: var(--theme-text, #e8eaed);
  border: 1px solid var(--lcg-bible-border, rgba(255, 255, 255, 0.1));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.explain-inline-copy:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: var(--lcg-bible-accent-blue);
}

/* Main Hub Navbar - NKJV Bible Action Pill */
#bibleNavBtn,
.btn-bible-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  height: 30px;
  box-sizing: border-box;
  text-decoration: none;
}

#bibleNavBtn:hover,
#bibleNavBtn:active,
.btn-bible-nav:hover,
.btn-bible-nav:active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

:root.light-theme #bibleNavBtn,
:root.light-theme .btn-bible-nav {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1a1a;
}

:root.light-theme #bibleNavBtn:hover,
:root.light-theme .btn-bible-nav:hover {
  background: rgba(0, 0, 0, 0.09);
  border-color: rgba(0, 0, 0, 0.22);
}

/* Full-Text Scripture Keyword Search & Highlighting */
.highlight-gold {
  color: #FFD700;
  font-weight: 700;
}

.bible-search-summary {
  color: var(--theme-text, var(--lcg-bible-text-main, #e8eaed));
  font-size: 0.9rem;
  padding: 10px;
  text-align: center;
  font-style: italic;
  border-bottom: 1px solid var(--theme-border, var(--lcg-bible-border, #3c4043));
}

.bible-search-result-item {
  padding: 12px;
  border-bottom: 1px solid var(--theme-border, var(--lcg-bible-border, #3c4043));
  cursor: pointer;
  transition: background 0.2s;
}

.bible-search-result-item:hover {
  background: var(--theme-bg-hover, rgba(255, 255, 255, 0.08));
}

.bible-search-result-ref {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--theme-accent, #66b2ff);
  margin-bottom: 4px;
}

.bible-search-result-text {
  font-size: 1rem;
  color: var(--theme-text, var(--lcg-bible-text-main, #e8eaed));
  line-height: 1.4;
}

@media (min-width: 768px) {
  #lcgBibleNavDefault,
  #lcgBibleNavActive {
    justify-content: center !important;
    overflow-x: visible !important;
  }
}

@media (min-width: 1024px) {
  .lcg-bible-reader-body.drawer-open,
  .lcg-bible-reader-body.search-drawer-open {
    transform: none !important;
  }
}

/* --------------------------------------------------------------------------
   Left-Hand Search & Jump Drawer
   -------------------------------------------------------------------------- */
.lcg-bible-search-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 10005;
  background: var(--theme-bg, #1e1e1e);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

#lcgBibleSearchDrawer.active {
  transform: translateX(0) !important;
}

.search-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #18191d;
  border-bottom: 1px solid var(--theme-border, var(--lcg-bible-border, rgba(255, 255, 255, 0.1)));
  flex-shrink: 0;
}

.search-drawer-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-drawer-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--lcg-bible-text-main, #f1f3f5);
}

.search-drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--lcg-bible-text-muted, #9aa0a6);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--lcg-bible-text-main, #fff);
}

.search-drawer-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid var(--theme-border, var(--lcg-bible-border, rgba(255, 255, 255, 0.12)));
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .search-drawer-inputs {
    flex-direction: column;
  }
}

.search-drawer-input-group {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.search-drawer-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.search-drawer-input-group input,
.search-drawer-smart-input {
  width: 100%;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important; /* Clearly visible outline all the time */
  border-radius: 6px;
  color: var(--lcg-bible-text-main, #f1f3f5) !important;
  padding: 8px 30px 8px 12px !important;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-drawer-input-group input::placeholder,
.search-drawer-smart-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.search-drawer-input-group input:hover,
.search-drawer-smart-input:hover {
  border-color: rgba(255, 255, 255, 0.48) !important;
  background: rgba(255, 255, 255, 0.09) !important;
}

.search-drawer-input-group input:focus,
.search-drawer-smart-input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.search-drawer-input-group .search-drawer-input-clear-btn,
.search-drawer-input-clear-btn {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.22) !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.9) !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease !important;
  z-index: 10 !important;
  box-sizing: border-box !important;
}

.search-drawer-smart-input:not(:placeholder-shown) + .search-drawer-input-clear-btn,
.search-drawer-input-group input:not(:placeholder-shown) + .search-drawer-input-clear-btn {
  display: flex !important;
}

.search-drawer-input-group .search-drawer-input-clear-btn:hover,
.search-drawer-input-clear-btn:hover {
  background: rgba(255, 255, 255, 0.45) !important;
  color: #ffffff !important;
}

.search-drawer-input-group .search-drawer-input-clear-btn:active,
.search-drawer-input-clear-btn:active {
  transform: translateY(-50%) scale(0.88) !important;
}

.search-drawer-input-group > button:not(.search-drawer-input-clear-btn),
#lcgDrawerSmartBtn,
.search-drawer-smart-btn {
  background: #0284c7 !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  color: #ffffff !important;
  padding: 8px 16px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background 0.15s, filter 0.15s !important;
  flex-shrink: 0 !important;
}

.search-drawer-input-group > button:not(.search-drawer-input-clear-btn):hover,
#lcgDrawerSmartBtn:hover,
.search-drawer-smart-btn:hover {
  background: #0369a1 !important;
  filter: brightness(1.1) !important;
}

.search-drawer-clear-results-btn {
  margin-top: 10px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--lcg-bible-text-main, #f1f3f5);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s, border-color 0.15s;
}

.search-drawer-clear-results-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

#lcgLoadMoreSearchBtn {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.15));
  border-radius: 6px;
  color: var(--theme-text, var(--lcg-bible-text-main, #f1f3f5));
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

#lcgLoadMoreSearchBtn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--lcg-bible-accent-blue, #8ab4f8);
  color: #ffffff;
}

/* -------------------------------------------------------------
   One-Click Clip to Study Notes Actions
------------------------------------------------------------- */
.lcg-bible-verse-item {
  position: relative;
}

.lcg-verse-note-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  float: right;
  opacity: 0;
  margin-top: 2px;
  margin-left: 8px;
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 500;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  color: #94a3b8;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  user-select: none;
  vertical-align: middle;
}

.lcg-verse-note-btn svg {
  display: block;
  flex-shrink: 0;
}

.lcg-bible-verse-item:hover .lcg-verse-note-btn,
.lcg-verse-note-btn:focus,
.lcg-bible-verse-item.selected .lcg-verse-note-btn {
  opacity: 1;
}

.lcg-verse-note-btn:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
}

.lcg-verse-note-btn:active {
  transform: translateY(0);
}

@media (hover: none), (max-width: 768px) {
  .lcg-verse-note-btn {
    display: none;
    opacity: 0;
  }
  .lcg-bible-verse-item.selected .lcg-verse-note-btn,
  .lcg-bible-verse-item.active .lcg-verse-note-btn {
    display: inline-flex;
    opacity: 1;
  }
}

.explain-inline-note {
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
}

.explain-inline-note:hover {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}

blockquote.scripture-clip,
.ql-editor blockquote.scripture-clip,
.ql-editor blockquote:has(a[href^="#bible:"]),
.ql-editor blockquote:has(.scripture-link) {
  border-left: 4px solid #3b82f6 !important;
  padding: 8px 14px !important;
  margin: 12px 0 !important;
  background: rgba(59, 130, 246, 0.08) !important;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: #93c5fd !important; /* Original blue scripture body text */
}

/* Scripture book reference ONLY (e.g. Luke 21:23 [NKJV]) is GOLD */
blockquote.scripture-clip strong,
blockquote.scripture-clip .scripture-citation,
blockquote.scripture-clip a.scripture-link,
blockquote.scripture-clip .scripture-link,
.ql-editor blockquote strong,
.ql-editor blockquote .scripture-citation,
.ql-editor blockquote.scripture-clip .scripture-citation,
.ql-editor blockquote a[href^="#bible:"],
.ql-editor blockquote .scripture-link {
  color: #fbbf24 !important; /* Gold font for book reference */
  font-weight: 700 !important;
  text-decoration-color: rgba(251, 191, 36, 0.6) !important;
}

blockquote.scripture-clip a.scripture-link:hover,
.ql-editor blockquote a[href^="#bible:"]:hover,
.ql-editor blockquote .scripture-link:hover {
  color: #fef08a !important;
  text-decoration-color: #fef08a !important;
  background-color: rgba(251, 191, 36, 0.15) !important;
}

/* Scripture body text verse numbers maintain original blue */
blockquote.scripture-clip sup,
.ql-editor blockquote sup,
.ql-editor blockquote.scripture-clip sup {
  font-size: 0.72em;
  font-weight: 700;
  vertical-align: super;
  color: #93c5fd !important; /* Original blue */
  margin-right: 3px;
  line-height: 0;
}

:root.light-theme blockquote.scripture-clip,
:root.light-theme .ql-editor blockquote.scripture-clip,
:root.light-theme .ql-editor blockquote:has(a[href^="#bible:"]),
:root.light-theme .ql-editor blockquote:has(.scripture-link) {
  background: #eff6ff !important;
  border-left-color: #2563eb !important;
  color: #1e40af !important;
}

:root.light-theme blockquote.scripture-clip strong,
:root.light-theme blockquote.scripture-clip .scripture-citation,
:root.light-theme blockquote.scripture-clip a.scripture-link,
:root.light-theme blockquote.scripture-clip .scripture-link,
:root.light-theme .ql-editor blockquote strong,
:root.light-theme .ql-editor blockquote .scripture-citation,
:root.light-theme .ql-editor blockquote.scripture-clip .scripture-citation,
:root.light-theme .ql-editor blockquote a[href^="#bible:"],
:root.light-theme .ql-editor blockquote .scripture-link {
  color: #b45309 !important; /* Deep gold/amber in light theme */
  text-decoration-color: rgba(180, 83, 9, 0.6) !important;
}

:root.light-theme blockquote.scripture-clip sup,
:root.light-theme .ql-editor blockquote sup,
:root.light-theme .ql-editor blockquote.scripture-clip sup {
  color: #2563eb !important;
}

/* Completely suppress Quill's link URL tooltip popup ("Visit URL: ... Edit | Remove") */
.ql-snow .ql-tooltip,
.ql-tooltip,
#editor-container .ql-tooltip,
.global-notes-drawer .ql-tooltip,
.ql-editing,
.ql-tooltip.ql-editing,
.ql-tooltip:not(.ql-hidden) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  top: -99999px !important;
  left: -99999px !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  transform: scale(0) !important;
}

/* --------------------------------------------------------------------------
   Dynamic Flex-Pane Resizing for Study Notes Dockable Panel
   -------------------------------------------------------------------------- */
@media (min-width: 901px) {
  #lcgBibleModuleRoot {
    transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1), left 0.32s cubic-bezier(0.16, 1, 0.3, 1), right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.notes-drawer-open .bible-top-panel,
  body.notes-drawer-open .lcg-bible-reader-toolbar {
    width: 100% !important;
    right: auto !important;
  }

  body.notes-drawer-open #lcgBibleBottomNav,
  body.notes-drawer-open .lcg-bible-bottom-nav {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: auto !important;
  }

  /* Accommodate Left-Hand Scripture Search Drawer if open */
  body.notes-drawer-open #lcgBibleSearchDrawer,
  body.notes-drawer-open .lcg-bible-search-drawer {
    max-width: min(400px, calc(100vw - var(--notes-drawer-width, 500px))) !important;
  }

  /* Accommodate Right-Hand Explain Drawer if open in standard non-split mode */
  body.notes-drawer-open:not(.bible-split-active) #lcgBibleExplainDrawer,
  body.notes-drawer-open:not(.bible-split-active) .lcg-bible-explain-drawer {
    right: var(--notes-drawer-width, 500px) !important;
  }

  body.notes-drawer-open #lcgBibleReaderRoot.lcg-bible-reader-root,
  body.notes-drawer-open #lcgBibleReaderRoot {
    width: calc(100vw - var(--notes-drawer-width, 500px)) !important;
    right: var(--notes-drawer-width, 500px) !important;
  }
}

/* --------------------------------------------------------------------------
   Unified Landscape & Desktop Panel Spacing Matrix
   Dynamically centers Bible navigation modal and reader between panels
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (orientation: landscape), (min-width: 1024px) {
  :root {
    --bible-space-left: 0px;
    --bible-space-right: 0px;
  }

  /* Left Panel detection */
  body:has(#sidebar.desktop-open),
  body:has(#sidebar.mobile-open),
  body:not(.bible-reader-active):not(.bible-nav-modal-open):has(#sidebar:not(.desktop-collapsed)) {
    --bible-space-left: var(--sidebar-width, 290px);
  }

  body:has(#lcgBibleSearchDrawer.active) {
    --bible-space-left: 400px;
  }

  body:has(#sidebar.desktop-open):has(#lcgBibleSearchDrawer.active) {
    --bible-space-left: max(var(--sidebar-width, 290px), 400px);
  }

  /* Right Panel detection */
  body.notes-drawer-open,
  body:has(#globalNotesDrawer.open) {
    --bible-space-right: var(--notes-drawer-width, 50vw);
  }

  body.explain-drawer-open,
  body:has(#lcgBibleExplainDrawer.active) {
    --bible-space-right: 400px;
  }

  body.bible-split-active:not(.notes-drawer-open):not(:has(#globalNotesDrawer.open)) {
    --bible-space-right: 50vw;
  }

  /* Bounded fluid container in clear workspace between panels */
  #lcgBibleNavModal,
  .lcg-bible-modal-backdrop,
  #lcgBibleReaderRoot,
  div#lcgBibleReaderRoot.lcg-bible-reader-root {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: var(--bible-space-left, 0px) !important;
    right: var(--bible-space-right, 0px) !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1), right 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .lcg-bible-modal-backdrop {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }

  .lcg-bible-modal {
    width: 100% !important;
    max-width: min(680px, calc(100% - 24px)) !important;
    margin: 0 auto !important;
  }

  .lcg-bible-reader-body {
    width: 100% !important;
    max-width: min(840px, calc(100% - 32px)) !important;
    margin: 0 auto !important;
  }

  /* Centered dock within available clear space between panels */
  #lcgBibleBottomNav,
  .lcg-bible-bottom-nav {
    left: calc(var(--bible-space-left, 0px) + (100vw - var(--bible-space-left, 0px) - var(--bible-space-right, 0px)) / 2) !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
}


/* Reader Toolbar Notes Button Styling */
.lcg-bible-notes-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--lcg-bible-border, rgba(255, 255, 255, 0.15));
  border-radius: 16px;
  color: var(--lcg-bible-text-main, #f1f3f5);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  height: 32px;
}

.lcg-bible-notes-btn:hover,
.lcg-bible-notes-btn.active,
body.notes-drawer-open .lcg-bible-notes-btn {
  background: rgba(138, 180, 248, 0.18);
  border-color: var(--lcg-bible-accent-blue, #8ab4f8);
  color: var(--lcg-bible-accent-blue, #8ab4f8);
  box-shadow: 0 0 12px rgba(138, 180, 248, 0.25);
}

:root.light-theme .lcg-bible-notes-btn {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #1e293b;
}

:root.light-theme .lcg-bible-notes-btn:hover,
:root.light-theme .lcg-bible-notes-btn.active,
:root.light-theme body.notes-drawer-open .lcg-bible-notes-btn {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  color: #2563eb;
}

@media (max-width: 600px) {
  .lcg-bible-notes-btn .btn-nav-action-label {
    display: none;
  }
  .lcg-bible-notes-btn {
    padding: 6px 8px;
    border-radius: 50%;
  }
}

/* Lock Bible into the Chat Workspace */
.chat-main #lcgBibleModuleRoot {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
    z-index: 50 !important;
}
.chat-main #lcgBibleModuleRoot > * {
    pointer-events: auto;
}

#lcgBibleReaderRoot.lcg-bible-reader-root,
#lcgBibleReaderRoot {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100% !important;
    z-index: 50 !important; /* Sit above chat, below modals */
}

/* Nuke the top header background and float it */
.bible-top-panel,
.lcg-bible-reader-toolbar {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    position: absolute !important;
    top: 0; left: 0; right: 0;
    justify-content: center !important;
    pointer-events: none !important; /* Allow clicking text beneath */
    padding-top: max(16px, env(safe-area-inset-top)) !important;
}

/* Re-enable clicking on the pill itself */
.bible-top-panel > * {
    pointer-events: auto !important;
}

/* Hide the old corners */
#lcgReaderBackBtn, 
.lcg-bible-header-actions {
    display: none !important;
}

/* Style the floating Chapter Pill */
.lcg-bible-nav-trigger-btn {
    background: rgba(30, 31, 34, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1)) !important;
    border-radius: 30px !important;
    padding: 8px 20px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    font-size: 1rem !important;
}

/* Add top padding so scrolling text doesn't hit the absolute top */
.lcg-bible-reader-view {
    padding-top: max(70px, env(safe-area-inset-top)) !important;
}

/* Glassmorphism Selection Footer */
.lcg-bible-bottom-nav {
    background: rgba(20, 21, 24, 0.65) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

/* Remove Redundant Home Button */
#lcgNavHomeBtn { display: none !important; }

/* Center Bible and Blend Background */
.lcg-bible-chapter-card {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}
.lcg-bible-reader-body {
    max-width: 840px !important;
    margin: 0 auto !important;
}

/* Desktop-Only Full Page Quick-Jump Expansion */
@media (min-width: 901px) {
    .lcg-bible-modal {
        max-width: 100% !important;
        max-height: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background-color: #0f1115 !important;
    }
    .lcg-bible-modal-backdrop {
        background-color: #0f1115 !important;
        padding: 0 !important; 
    }
}

/* Enforce Dead-Center Layout for Bible Text */
.lcg-bible-reader-body {
    width: 100% !important;
    max-width: 840px !important;
    margin: 0 auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

/* Mobile Hamburger Icon inside Bible Header */
.mobile-bible-hamburger {
    display: none !important;
    position: absolute !important;
    left: 16px !important;
    right: auto !important;
    /* Align vertically with the pill */
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 1000 !important;
    padding: 8px !important;
}
@media (max-width: 1024px) {
    .mobile-bible-hamburger {
        display: block !important;
    }
}

/* ==========================================================================
   50/50 Horizontal Layout Split for Landscape Screens
   ========================================================================== */
@media (min-width: 768px) and (orientation: landscape) {
  :root body.notes-drawer-open {
    --notes-drawer-width: 50vw !important;
  }

  /* 1. Global Notes Drawer active state */
  body.notes-drawer-open #globalNotesDrawer,
  #globalNotesDrawer.open {
    width: 50vw !important;
    right: 0 !important;
  }

  /* 2. Main Application Container active state (overriding calc(100vw - 500px)) */
  html body.notes-drawer-open #appMainContainer,
  body.notes-drawer-open #appMainContainer,
  body.notes-drawer-open .app-container,
  #appMainContainer.notes-drawer-open,
  .app-container.notes-drawer-open {
    width: 50vw !important;
    flex-shrink: 0 !important;
  }

  /* 3. Constrain fixed inner modals to available clear space between panels */
  body.notes-drawer-open #lcgBibleNavModal,
  body.notes-drawer-open .lcg-bible-modal-backdrop {
    width: auto !important;
    max-width: none !important;
    left: var(--bible-space-left, 0px) !important;
    right: var(--bible-space-right, 50vw) !important;
    box-sizing: border-box !important;
  }

  body.notes-drawer-open #lcgBibleSearchDrawer,
  body.notes-drawer-open .lcg-bible-search-drawer {
    max-width: min(400px, calc(100vw - var(--bible-space-left, 0px) - var(--bible-space-right, 50vw))) !important;
    left: var(--bible-space-left, 0px) !important;
    box-sizing: border-box !important;
  }

  /* Reset search drawer translation so it bounds properly */
  body.notes-drawer-open #lcgBibleSearchDrawer.active,
  body.notes-drawer-open .lcg-bible-search-drawer.active {
    transform: translateX(0) !important;
  }

  /* Constrain inner modal card inside backdrop and center */
  body.notes-drawer-open .lcg-bible-modal {
    max-width: min(680px, calc(100% - 24px)) !important;
    margin: 0 auto !important;
    height: auto !important;
    max-height: 96vh !important;
  }

  /* 4. Book Grid & Filter Bar Overflow Prevention */
  body.notes-drawer-open #lcgBibleModuleRoot .lcg-bible-book-grid,
  #lcgBibleModuleRoot .lcg-bible-book-grid,
  body.notes-drawer-open .lcg-bible-book-grid {
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)) !important;
  }

  body.notes-drawer-open .lcg-bible-filter-bar {
    flex-wrap: wrap !important;
  }

  /* 5. Shatter Vertical Ceiling for Modal Body */
  body.notes-drawer-open #lcgBibleModuleRoot .lcg-bible-modal-body,
  #lcgBibleModuleRoot .lcg-bible-modal-body {
    max-height: none !important;
    height: 100% !important;
    flex: 1 1 auto !important;
  }
}

/* --------------------------------------------------------------------------
   MOBILE OVERRIDE BLOCK — Note Title + Explain Footer (≤ 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {

  /* Note Title: H3 size */
  #noteTitleInput,
  .note-title-input {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
    padding: 14px 20px 4px 20px !important;
  }

  /* Explain Chat Footer: float above the global glass dock */
  .lcg-explain-drawer-footer {
    margin-bottom: 90px !important;
    border-radius: 12px !important;
    width: calc(100% - 16px) !important;
    margin-left: 8px !important;
    margin-right: 8px !important;
  }
}

/* --------------------------------------------------------------------------
   BULLETPROOF: Color Swatch Palette Force-Render
   Prevents flexbox from crushing dots to 0px by strictly enforcing
   physical dimensions on both the palette wrapper and each dot.
   -------------------------------------------------------------------------- */
#lcgSwatchPalette, .lcg-bible-swatch-palette {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  width: auto !important;
}
.lcg-bible-swatch-dot {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  flex: 0 0 26px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
  flex-shrink: 0 !important;
  position: relative !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
}

/* --------------------------------------------------------------------------
   TUNED: Notes Editor Scroll Space
   Provides crisp 15-20px clearance right above the floating dock bar
   without wasting dead space.
   -------------------------------------------------------------------------- */
#editor-container {
  padding-bottom: 85px !important;
  box-sizing: border-box !important;
}
.ql-editor {
  margin-bottom: 0 !important;
  padding-bottom: 16px !important;
}

/* --------------------------------------------------------------------------
   Cross-Surface Scripture Reference Hyperlinks (.scripture-link)
   -------------------------------------------------------------------------- */
.scripture-link,
a.scripture-link,
.ql-editor a[href^="#bible:"] {
  color: var(--lcg-bible-accent-blue, #8ab4f8) !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(138, 180, 248, 0.5) !important;
  text-underline-offset: 3px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  display: inline !important;
  transition: all 0.15s ease !important;
  border-radius: 2px !important;
  padding: 0 1px !important;
}

.scripture-link:hover,
a.scripture-link:hover,
.ql-editor a[href^="#bible:"]:hover {
  color: #bfdbfe !important;
  text-decoration-color: #bfdbfe !important;
  background-color: rgba(59, 130, 246, 0.15) !important;
}

.scripture-link:active,
a.scripture-link:active,
.ql-editor a[href^="#bible:"]:active {
  color: #93c5fd !important;
  transform: scale(0.98) !important;
}

/* --------------------------------------------------------------------------
   50/50 Split Screen Mode: NKJV Bible Reader (Left) & Originating Page (Right)
   On Desktop and Mobile Landscape Viewports
   -------------------------------------------------------------------------- */
@keyframes bibleSlideInLeft {
  0% {
    transform: translateX(-100%);
    opacity: 0.8;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes bibleSlideOutLeft {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-100%);
    opacity: 0.8;
  }
}

.lcg-bible-split-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--lcg-bible-border, rgba(255, 255, 255, 0.15));
  border-radius: 16px;
  color: var(--lcg-bible-text-main, #f1f3f5);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  height: 32px;
}

.lcg-bible-split-btn:hover {
  background: rgba(138, 180, 248, 0.18);
  border-color: var(--lcg-bible-accent-blue, #8ab4f8);
  color: var(--lcg-bible-accent-blue, #8ab4f8);
  box-shadow: 0 0 12px rgba(138, 180, 248, 0.25);
}

:root.light-theme .lcg-bible-split-btn {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #1e293b;
}

:root.light-theme .lcg-bible-split-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  color: #2563eb;
}

@media (min-width: 1024px), (orientation: landscape) {
  /* Maintain app-container full screen width in split mode */
  body.bible-split-active .app-container,
  body.bible-split-active #appMainContainer {
    display: flex !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow: hidden !important;
  }

  /* Left 50% Pane: Bible Module Root */
  body.bible-split-active #lcgBibleModuleRoot {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 50vw !important;
    max-width: 50vw !important;
    height: 100dvh !important;
    z-index: 20000 !important;
    pointer-events: none !important;
  }

  /* Left 50% Pane: Bible Reader Root */
  body.bible-split-active #lcgBibleReaderRoot.lcg-bible-reader-root,
  body.bible-split-active #lcgBibleReaderRoot {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    width: 50vw !important;
    max-width: 50vw !important;
    height: 100dvh !important;
    z-index: 20000 !important;
    pointer-events: auto !important;
    background-color: #0f1115 !important;
    border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.12)) !important;
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.5) !important;
    animation: bibleSlideInLeft 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), width 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  /* Left 50% Pane: Bible Navigation Modal in Split Mode */
  body.bible-split-active #lcgBibleNavModal,
  body.bible-split-active .lcg-bible-modal-backdrop {
    pointer-events: auto !important;
    z-index: 25000 !important;
  }

  :root.light-theme body.bible-split-active #lcgBibleReaderRoot {
    border-right-color: #e2e8f0 !important;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.08) !important;
  }

  /* Sticky blurred toolbar inside Left 50% reader pane */
  body.bible-split-active .bible-top-panel,
  body.bible-split-active .lcg-bible-reader-toolbar {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 14px !important;
    padding-top: max(10px, env(safe-area-inset-top)) !important;
    background: rgba(19, 19, 20, 0.92) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    gap: 8px !important;
    z-index: 100 !important;
    pointer-events: auto !important;
    overflow: visible !important;
  }

  :root.light-theme body.bible-split-active .bible-top-panel,
  :root.light-theme body.bible-split-active .lcg-bible-reader-toolbar {
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom-color: #e2e8f0 !important;
  }

  /* Make close button visible and nicely styled in split mode */
  body.bible-split-active #lcgReaderBackBtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--lcg-bible-border, rgba(255, 255, 255, 0.15)) !important;
    color: var(--lcg-bible-text-main, #f1f3f5) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    pointer-events: auto !important;
  }

  body.bible-split-active #lcgReaderBackBtn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    transform: scale(1.05) !important;
  }

  /* Center pill in split mode: dynamically/automatically center in available space */
  body.bible-split-active .lcg-bible-nav-trigger-btn {
    position: relative !important;
    margin: 0 auto !important;
    flex-shrink: 1 !important;
    max-width: 60% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding: 6px 14px !important;
    font-size: 0.95rem !important;
  }

  /* Actions group on right of reader toolbar */
  body.bible-split-active .lcg-bible-header-actions {
    position: absolute !important;
    right: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    pointer-events: auto !important;
    z-index: 2 !important;
  }

  body.bible-split-active .lcg-bible-split-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 6px 10px !important;
    height: 32px !important;
    width: auto !important;
    min-width: 32px !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15)) !important;
    color: var(--text-primary, #f1f3f5) !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    pointer-events: auto !important;
  }

  body.bible-split-active .lcg-bible-split-btn:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    transform: scale(1.03) !important;
  }

  body.bible-split-active .lcg-bible-notes-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 6px 10px !important;
    height: 32px !important;
    width: auto !important;
    min-width: 32px !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15)) !important;
    color: var(--text-primary, #f1f3f5) !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    pointer-events: auto !important;
  }

  body.bible-split-active .lcg-bible-notes-btn.active {
    background: rgba(37, 99, 235, 0.25) !important;
    border-color: #3b82f6 !important;
    color: #60a5fa !important;
  }

  @media (max-width: 1350px) {
    body.bible-split-active .lcg-bible-split-btn .btn-nav-action-label,
    body.bible-split-active .lcg-bible-notes-btn .btn-nav-action-label {
      display: none !important;
    }
    body.bible-split-active .lcg-bible-split-btn,
    body.bible-split-active .lcg-bible-notes-btn {
      padding: 0 !important;
      width: 32px !important;
      height: 32px !important;
      border-radius: 50% !important;
      justify-content: center !important;
    }
  }

  /* Right 50% Pane: Chat Workspace (Messages & Prompt Box) */
  body.bible-split-active .chat-main {
    margin-left: 50vw !important;
    width: 50vw !important;
    max-width: 50vw !important;
    flex: none !important;
    height: 100dvh !important;
    transition: margin-left 0.35s cubic-bezier(0.16, 1, 0.3, 1), width 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  /* Bottom pillbox menu: Base split mode styling */
  body.bible-split-active #lcgBibleBottomNav,
  body.bible-split-active .lcg-bible-bottom-nav {
    position: fixed !important;
    bottom: 24px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    max-width: 95vw !important;
    z-index: 60000 !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 40px !important;
    animation: none !important;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  /* Specifically for Bible split view: center pillbox within the left 50% Bible pane (25vw) */
  body.bible-split-active:not(.notes-drawer-open) #lcgBibleBottomNav,
  body.bible-split-active:not(.notes-drawer-open) .lcg-bible-bottom-nav {
    left: 25vw !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-width: 48vw !important;
  }

  /* In all other screen conditions, dock centers dynamically within the available workspace */
  body:not(.bible-split-active).bible-nav-modal-open #lcgBibleBottomNav,
  body:not(.bible-split-active).bible-nav-modal-open .lcg-bible-bottom-nav,
  body:not(.bible-split-active):has(#lcgBibleNavModal.active) #lcgBibleBottomNav,
  body:not(.bible-split-active):has(#lcgBibleNavModal.active) .lcg-bible-bottom-nav,
  body.bible-split-active.notes-drawer-open #lcgBibleBottomNav,
  body.bible-split-active.notes-drawer-open .lcg-bible-bottom-nav {
    left: calc(var(--bible-space-left, 0px) + (100vw - var(--bible-space-left, 0px) - var(--bible-space-right, 0px)) / 2) !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-width: 95vw !important;
  }

  /* Right 50% Pane: Study Notes Drawer ONLY when actively open */
  body.bible-split-active.notes-drawer-open #globalNotesDrawer.open,
  body.bible-split-active.notes-drawer-open .global-notes-drawer.open {
    width: 50vw !important;
    max-width: 50vw !important;
    right: 0 !important;
    z-index: 21000 !important;
    border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.12)) !important;
  }

  /* Right 50% Pane: Scripture Explain Drawer in Split Mode (overlaying right side over notes) */
  body.bible-split-active #lcgBibleExplainDrawer,
  body.bible-split-active .lcg-bible-explain-drawer,
  body.bible-split-active.notes-drawer-open #lcgBibleExplainDrawer,
  body.bible-split-active.notes-drawer-open .lcg-bible-explain-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    height: 100% !important;
    right: 0 !important;
    z-index: 35000 !important;
    width: 100% !important;
    max-width: min(420px, 50vw) !important;
    transform: translateX(100%);
    pointer-events: auto !important;
  }

  body.bible-split-active #lcgBibleExplainDrawer.active,
  body.bible-split-active .lcg-bible-explain-drawer.active,
  body.bible-split-active.notes-drawer-open #lcgBibleExplainDrawer.active,
  body.bible-split-active.notes-drawer-open .lcg-bible-explain-drawer.active {
    transform: translateX(0) !important;
  }

  /* When notes drawer is closed or closing, keep it strictly off-screen and hidden */
  #globalNotesDrawer:not(.open),
  .global-notes-drawer:not(.open),
  body:not(.bible-split-active) #globalNotesDrawer:not(.open),
  body.bible-split-active:not(.notes-drawer-open) #globalNotesDrawer,
  body.bible-split-active #globalNotesDrawer:not(.open) {
    right: -110vw !important;
    transform: translateX(110%) !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1), transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s !important;
  }

  #globalNotesDrawer.open,
  .global-notes-drawer.open {
    transform: none !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }

  /* Ensure close button on notes drawer is always interactive */
  #closeNotesDrawerBtn {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 22000 !important;
  }

  /* Modals in split mode: centered within the right 50% workspace */
  body.bible-split-active .modal-overlay {
    left: 50vw !important;
    width: 50vw !important;
  }

  /* Closing smooth slide-out animation to the left */
  body.bible-split-active.bible-split-closing #lcgBibleReaderRoot {
    animation: bibleSlideOutLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }

  body.bible-split-active.bible-split-closing .chat-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile Portrait Mode: Study Notes Drawer Docked Pillbox Menu
   Ensures bottom pillbox menu is visible and dynamically centered in portrait mode
   when Study Notes drawer is opened from left panel or elsewhere
   -------------------------------------------------------------------------- */
@media (max-width: 899px), (orientation: portrait) {
  body.notes-drawer-open #lcgBibleBottomNav,
  body.notes-drawer-open .lcg-bible-bottom-nav {
    display: flex !important;
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    max-width: calc(100vw - 32px) !important;
    z-index: 60000 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body.notes-drawer-open #lcgBibleBottomNav #lcgBibleNavDefault {
    display: flex !important;
    visibility: visible !important;
  }

  /* Remove redundant 'x' close button on mobile portrait mode since bottom pillbox menu is present */
  #closeNotesDrawerBtn,
  .notes-drawer-header-right {
    display: none !important;
  }
}

/* Digital Library Shelf Styles */
#reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #25282c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#btn-close-reader {
  background: #374151;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

#btn-close-reader:hover {
  background: #4b5563;
  border-color: rgba(255, 255, 255, 0.3);
}

#library-shelf-view {
  gap: 20px;
  align-content: flex-start;
}

.book-card {
  background: #25282c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  width: 240px;
  min-height: 150px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
}

.book-card .book-title {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.4;
  word-break: break-word;
}

.book-card button {
  align-self: flex-start;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.book-card button:hover {
  background: #1d4ed8;
}

.book-card button:active {
  transform: scale(0.97);
}

#book-render-view {
  position: relative;
  overflow: hidden;
}

#flipbook-container {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}

.page {
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.page canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* --------------------------------------------------------------------------
   Focused Glow Wrapper - Midnight Teal Halo Effect
   -------------------------------------------------------------------------- */
.focused-glow-wrapper {
  position: relative;
  z-index: 1; /* Ensure text remains on top */
  width: 100%;
  max-width: 800px; /* Optional, match existing layout constraint */
  margin: 0 auto; /* Ensure horizontal centering */
}

.focused-glow-wrapper::before {
  content: "";
  position: absolute;
  top: 50%; /* Position behind the chatbox */
  left: 50%;
  transform: translate(-50%, -50%); /* Core center positioning */
  width: 250%; /* Make glow wide, centered on input */
  height: 250%;
  border-radius: 50%;
  
  /* Layered Teal Aurora Glow: Concentrated and Wide */
  background-image: 
    none /* Neutralized for Gemini gradient */;
  
  filter: blur(100px); /* Heavy blur for soft-focus aurora effect */
  z-index: -1; /* Push behind text and input box */
  opacity: 0.9; /* Final intensity control */
  pointer-events: none; /* Do not block interaction with input */
}


/* OVERRIDE Z-INDEX TO FLOAT OVER QA MODAL */





/* QA YIELD TO EXPLAIN: Allow Explain Drawer to float over Q&A */
body.explain-drawer-open #qa-module,
body.explain-drawer-open .chat-main {
    z-index: 34000 !important; /* Drop below Explain Drawer's 35000 */
}
#lcgBibleExplainDrawer {
    z-index: 35000 !important; 
    box-shadow: -15px 0 45px rgba(0,0,0,0.85) !important;
}

/* Gemini Home Page Gradient - Zero State Only */
.chat-main:has(#zeroState:not([style*="none"])) {
    background: var(--bg-main-gradient, radial-gradient(ellipse at 50% 20%, #1e2840 0%, #0f1115 75%)) !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}
