/* ============================================================
   theBible.net — main.css
   Ported from bible-net-v2/apps/web/src/styles/index.css
   ============================================================ */

/* ------------------------------------------------------------
   Google Fonts import
   ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=Merriweather:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@400;500;600&display=swap');

/* ------------------------------------------------------------
   CSS custom properties — light theme (default)
   ------------------------------------------------------------ */
:root {
  color-scheme: light;
  --bg: 246 247 249;
  --fg: 51 51 51;
  --surface-1: 255 255 255;
  --surface-2: 238 241 244;
  --surface-3: 229 231 235;
  --muted: 107 114 128;
  --accent: 25 98 134;
  --reading-pane-font-size: 16px;
  --reading-pane-font-family: 'Merriweather', 'Source Serif 4', Georgia, serif;

  /* Reading comfort */
  --font-verse: 'Merriweather', 'Source Serif 4', Georgia, serif;
  --font-ui: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --reading-line-height: 1.75;
  --reading-measure: 820px;
  --reading-verse-gap: 16px;
}

/* ------------------------------------------------------------
   Dark theme
   ------------------------------------------------------------ */
html.dark {
  color-scheme: dark;
  --bg: 18 18 18;
  --fg: 226 232 240;
  --surface-1: 30 30 30;
  --surface-2: 31 41 55;
  --surface-3: 55 65 81;
  --muted: 156 163 175;
  --accent: 96 165 250;
}

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

body {
  margin: 0;
  font-family: Inter, 'Segoe UI', sans-serif;
  color: rgb(var(--fg));
  background: rgb(var(--bg));
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Typography utility classes
   ------------------------------------------------------------ */
.font-headline {
  font-family: var(--font-verse);
}

.scripture-text {
  font-family: var(--font-verse);
}

.font-serif-verse {
  font-family: var(--font-verse);
}

/* ------------------------------------------------------------
   Safe-area utility
   ------------------------------------------------------------ */
.safe-bottom {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------
   App shell layout (grid defined in reader.html inline styles)
   ------------------------------------------------------------ */
.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: rgb(var(--bg));
  color: rgb(var(--fg));
}

/* ------------------------------------------------------------
   Pane shell components
   ------------------------------------------------------------ */
.pane-shell {
  height: 100%;
  overflow: hidden;
  background: rgb(var(--surface-1));
}

.pane-header {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgb(var(--muted));
  background: color-mix(in srgb, rgb(var(--surface-2)) 82%, transparent);
}

/* Simple card — flat white bg, subtle shadow */
.tonal-card {
  border-radius: 0.5rem;
  background: rgb(var(--surface-1));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

html.dark .tonal-card {
  background: rgb(var(--surface-2));
}

/* ------------------------------------------------------------
   Search highlight
   ------------------------------------------------------------ */
.search-highlight {
  border-radius: 0.35rem;
  background: rgba(245, 222, 129, 0.72);
  padding: 0 0.125rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

html.dark .search-highlight {
  background: rgba(125, 211, 252, 0.38);
}

/* (search-mode-pill removed — replaced by simple toggle buttons in template) */

/* Search mode content fade-in */
.search-mode-content {
  animation: searchModeFadeIn 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ------------------------------------------------------------
   AI search shell — conic-gradient border animation
   ------------------------------------------------------------ */
.ai-search-shell .white,
.ai-search-shell .border,
.ai-search-shell .darkBorderBg,
.ai-search-shell .glow {
  max-height: none;
  max-width: var(--ai-shell-width, 314px);
  height: calc(var(--ai-input-height, 56px) + 14px);
  width: var(--ai-shell-width, 314px);
  position: absolute;
  overflow: hidden;
  z-index: -1;
  border-radius: 12px;
  filter: blur(3px);
}

.ai-search-shell .input {
  background-color: #050b14;
  border: none;
  width: var(--ai-input-width, 301px);
  min-height: 56px;
  height: var(--ai-input-height, 56px);
  border-radius: 10px;
  color: #eef4ff;
  padding-inline: 64px;
  padding-right: 56px;
  padding-top: 1.02rem;
  padding-bottom: 0.9rem;
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  white-space: pre-wrap;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(147, 197, 253, 0.42) rgba(0, 0, 0, 0);
  transition: height 180ms ease;
}

.ai-search-shell .input::-webkit-scrollbar {
  width: 6px;
}

.ai-search-shell .input::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.44);
}

.ai-search-shell #poda {
  --ai-input-width: 301px;
  --ai-shell-width: 314px;
  --ai-input-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: var(--ai-shell-width, 314px);
  min-height: calc(var(--ai-input-height, 56px) + 14px);
  margin: 0 auto;
}

.ai-search-shell .input::placeholder {
  color: transparent;
}

.ai-search-shell .input:focus {
  outline: none;
}

.ai-search-shell .white {
  height: calc(var(--ai-input-height, 56px) + 7px);
  max-width: calc(var(--ai-input-width, 301px) + 6px);
  border-radius: 10px;
  filter: blur(2px);
}

.ai-search-shell .white::before {
  content: '';
  z-index: -2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(83deg);
  position: absolute;
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: brightness(1.4);
  background-image: conic-gradient(
    rgba(0, 0, 0, 0) 0%,
    #a6c2e6,
    rgba(0, 0, 0, 0) 8%,
    rgba(0, 0, 0, 0) 50%,
    #dbcfb9,
    rgba(0, 0, 0, 0) 58%
  );
  transition: all 2s;
}

.ai-search-shell .border {
  height: calc(var(--ai-input-height, 56px) + 3px);
  max-width: calc(var(--ai-input-width, 301px) + 2px);
  border-radius: 11px;
  filter: blur(0.5px);
}

.ai-search-shell .border::before {
  content: '';
  z-index: -2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(70deg);
  position: absolute;
  width: 600px;
  height: 600px;
  filter: brightness(1.3);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    #0f1624,
    #5f88bc 5%,
    #0f1624 14%,
    #0f1624 50%,
    #cbbd9f 60%,
    #0f1624 64%
  );
  transition: all 2s;
}

.ai-search-shell .darkBorderBg {
  height: calc(var(--ai-input-height, 56px) + 11px);
  max-width: calc(var(--ai-input-width, 301px) + 11px);
}

.ai-search-shell .darkBorderBg::before {
  content: '';
  z-index: -2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(82deg);
  position: absolute;
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    rgba(0, 0, 0, 0),
    #243f67,
    rgba(0, 0, 0, 0) 10%,
    rgba(0, 0, 0, 0) 50%,
    #bcae93,
    rgba(0, 0, 0, 0) 60%
  );
  transition: all 2s;
}

/* Hover rotation state */
.ai-search-shell #poda:hover > .darkBorderBg::before {
  transform: translate(-50%, -50%) rotate(-98deg);
}

.ai-search-shell #poda:hover > .glow::before {
  transform: translate(-50%, -50%) rotate(-120deg);
}

.ai-search-shell #poda:hover > .white::before {
  transform: translate(-50%, -50%) rotate(-97deg);
}

.ai-search-shell #poda:hover > .border::before {
  transform: translate(-50%, -50%) rotate(-110deg);
}

/* Focus-within rotation state */
.ai-search-shell #poda:focus-within > .darkBorderBg::before {
  transform: translate(-50%, -50%) rotate(442deg);
  transition: all 4s;
}

.ai-search-shell #poda:focus-within > .glow::before {
  transform: translate(-50%, -50%) rotate(420deg);
  transition: all 4s;
}

.ai-search-shell #poda:focus-within > .white::before {
  transform: translate(-50%, -50%) rotate(443deg);
  transition: all 4s;
}

.ai-search-shell #poda:focus-within > .border::before {
  transform: translate(-50%, -50%) rotate(430deg);
  transition: all 4s;
}

.ai-search-shell .glow {
  overflow: hidden;
  filter: blur(22px);
  opacity: 0.33;
  max-height: calc(var(--ai-input-height, 56px) + 74px);
  max-width: calc(var(--ai-shell-width, 314px) + 40px);
}

.ai-search-shell .glow::before {
  content: '';
  z-index: -2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(60deg);
  position: absolute;
  width: 999px;
  height: 999px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    #000,
    #6f99ca 5%,
    #000 38%,
    #000 50%,
    #d5c8b0 60%,
    #000 87%
  );
  transition: all 2s;
}

.ai-search-shell #main {
  position: relative;
  width: var(--ai-input-width, 301px);
  height: var(--ai-input-height, 56px);
}

.ai-search-shell .ai-input-logo {
  position: absolute;
  left: 0.85rem;
  top: 28px;
  z-index: 6;
  display: inline-flex;
  height: 1.75rem;
  width: 1.75rem;
  transform: translateY(-50%);
}

.ai-search-shell .ai-static-placeholder {
  pointer-events: none;
  position: absolute;
  top: 28px;
  left: 50%;
  z-index: 4;
  width: calc(var(--ai-input-width, 301px) - 126px);
  transform: translate(-50%, -50%);
  color: #a4b6d4;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  transition: opacity 140ms ease;
}

.ai-search-shell .ai-search-submit {
  position: absolute;
  right: 0.5rem;
  top: 28px;
  z-index: 5;
  display: inline-flex;
  height: 2.1rem;
  width: 2.1rem;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, rgb(var(--accent)) 26%, rgba(5, 11, 20, 0.66));
  color: #f8fbff;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(147, 197, 253, 0.4),
    0 0 10px rgba(96, 165, 250, 0.28);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease;
}

.ai-search-shell .ai-search-submit:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.05);
  box-shadow:
    0 0 0 1px rgba(186, 230, 253, 0.48),
    0 0 12px rgba(96, 165, 250, 0.36);
}

.ai-search-shell .ai-search-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ------------------------------------------------------------
   Study panel rich content
   ------------------------------------------------------------ */
.study-rich-content {
  line-height: 1.55;
}

.study-rich-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.75rem auto;
  border-radius: 0.75rem;
}

.study-rich-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.85rem;
}

.study-rich-content th,
.study-rich-content td {
  border: 1px solid rgba(var(--fg), 0.2);
  padding: 0.45rem 0.55rem;
  vertical-align: top;
}

.study-rich-content th {
  background: rgb(var(--surface-3));
  text-align: left;
}

.study-rich-content a {
  color: rgb(var(--accent));
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------
   Settings glass panel + scrollbar
   ------------------------------------------------------------ */
.settings-glass-panel {
  background: rgb(var(--surface-1));
}

html.dark .settings-glass-panel {
  background: rgb(var(--surface-1));
}

.settings-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.settings-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.settings-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(140, 146, 158, 0.48);
  border-radius: 10px;
}

html.dark .settings-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(184, 194, 210, 0.42);
}

/* ------------------------------------------------------------
   Manila tab
   ------------------------------------------------------------ */
.manila-tab {
  background: #e8effb;
  box-shadow:
    0 16px 28px -24px rgba(15, 23, 42, 0.9),
    inset 0 -1px 0 rgba(var(--fg), 0.08);
}

html.dark .manila-tab {
  background: #4c5f83;
}

/* ------------------------------------------------------------
   Brand aura animation (search section branding)
   ------------------------------------------------------------ */
.brand-aura {
  position: absolute;
  inset: -20px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 30% 40%,
    rgba(var(--accent), 0.08) 0%,
    transparent 70%
  );
  filter: blur(20px);
  animation: auraMorph 8s ease-in-out infinite alternate;
}

@keyframes auraMorph {
  0% {
    background: radial-gradient(
      ellipse at 30% 40%,
      rgba(var(--accent), 0.08) 0%,
      transparent 70%
    );
  }
  100% {
    background: radial-gradient(
      ellipse at 70% 60%,
      rgba(var(--accent), 0.12) 0%,
      transparent 70%
    );
  }
}

/* ------------------------------------------------------------
   Study panel (flat sidebar, no glassmorphism)
   ------------------------------------------------------------ */
.study-rich-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

.study-rich-content td,
.study-rich-content th {
  padding: 0.375rem 0.5rem;
  border: 1px solid rgb(var(--surface-3));
  text-align: left;
}

.study-rich-content th {
  background: rgb(var(--surface-2));
  font-weight: 600;
  font-size: 0.75rem;
}

/* Reading header retraction on scroll */
#reading-header {
  transition: transform 200ms ease, opacity 200ms ease;
}

/* ------------------------------------------------------------
   Bible reading pane
   ------------------------------------------------------------ */
.bible-pane {
  position: relative;
  background: rgb(var(--surface-1));
}

html.dark .bible-pane {
  background: #1f2a38;
}

.bible-pane__scroll {
  height: 100%;
  overflow: auto;
  padding: 4rem 1.25rem 1.5rem;
}

@media (min-width: 768px) {
  .bible-pane__scroll {
    padding: 4rem 1.5rem 2rem;
  }
}

.bible-pane__scroll.focus-mode {
  padding-left: 5rem;
  padding-right: 5rem;
}

@media (min-width: 1024px) {
  .bible-pane__scroll.focus-mode {
    padding-left: 6rem;
    padding-right: 6rem;
  }
}

.bible-pane__content {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 44rem;
}

@media (min-width: 768px) {
  .bible-pane__content {
    max-width: var(--reading-pane-max-width, 44rem);
  }
}

/* Verse row */
.verse-row {
  position: relative;
}

.verse-btn {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  transition:
    background-color 200ms ease,
    box-shadow 200ms ease;
}

.verse-btn:hover {
  background: rgba(var(--surface-2), 0.65);
}

.verse-btn.is-selected {
  background: rgba(var(--surface-2), 0.85);
  box-shadow: 0 16px 30px -26px rgba(15, 23, 42, 0.95);
}

/* Continuous flow mode */
/* Continuous verse flow — inline book/paragraph layout */
#reading-center.flow-mode-active .chapter-verse {
  display: inline;
  padding-bottom: 0;
}

#reading-center.flow-mode-active .verse-actions-slot {
  display: none;
}

#reading-center.flow-mode-active .verse-btn {
  display: inline;
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  cursor: default;
}

#reading-center.flow-mode-active .verse-btn:hover {
  background: transparent !important;
}

#reading-center.flow-mode-active .verse-btn.is-selected .verse-text {
  text-decoration: underline;
  text-decoration-color: rgb(var(--accent));
  text-decoration-style: solid;
  text-underline-offset: 0.15em;
}

#reading-center.flow-mode-active .verse-num {
  display: inline !important;
  min-width: auto !important;
  text-align: left !important;
  vertical-align: super;
  font-size: 0.68em;
  margin: 0 0.15em 0 0.35em;
}

#reading-center.flow-mode-active .verse-text {
  display: inline;
}

/* Verse number */
.verse-num {
  margin-right: 0.5rem;
  vertical-align: text-top;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(var(--accent));
}

/* Verse text */
.verse-text {
  line-height: 2;
  color: rgb(var(--fg));
  font-size: var(--reading-pane-font-size, 16px);
  font-family: var(--reading-pane-font-family, 'Merriweather', 'Source Serif 4', Georgia, serif);
  transition:
    font-size 300ms ease,
    font-family 300ms ease,
    background-color 300ms ease,
    text-decoration-color 300ms ease;
}

/* Verse superscript note markers */
.verse-note-marker {
  margin: 0 0.08em;
  vertical-align: super;
  font-size: 0.66em;
  font-weight: 700;
  color: rgb(var(--accent));
}



/* Reading tool: focus view
   JS adds .has-selection to #reading-center and .selected-row to the
   active .chapter-verse; removing both clears the effect on dismiss. */
#reading-center.focus-view-active .chapter-verse {
  transition: opacity 250ms ease;
}

#reading-center.focus-view-active.has-selection .chapter-verse:not(.selected-row) {
  opacity: 0.3;
}

/* Scroll-to-top button */
.scroll-to-top-btn {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 20;
  display: inline-flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 0;
  background: rgb(var(--surface-1));
  color: rgb(var(--accent));
  cursor: pointer;
  box-shadow: 0 12px 26px -20px rgba(15, 23, 42, 0.9);
  transition:
    opacity 300ms ease-out,
    transform 300ms ease-out;
}

@media (min-width: 768px) {
  .scroll-to-top-btn {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

.scroll-to-top-btn.is-hidden {
  pointer-events: none;
  opacity: 0;
  transform: translateY(0.75rem);
}

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

/* ------------------------------------------------------------
   Inline verse actions panel
   ------------------------------------------------------------ */
.inline-verse-actions {
  margin: 1.5rem auto;
  width: 100%;
  max-width: 42rem;
  border-radius: 0.5rem;
  background: rgb(var(--surface-1));
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  animation: inlineActionsIn 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes inlineActionsIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inline-verse-actions__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(var(--surface-3), 0.6);
  position: relative;
}

.inline-verse-actions__action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--fg));
  border: 0;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 200ms ease,
    box-shadow 200ms ease;
}

.inline-verse-actions__action-btn:hover {
  background: rgb(var(--surface-2));
}

.inline-verse-actions__action-btn.is-active {
  background: rgb(var(--surface-2));
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.34);
}

.inline-verse-actions__action-label {
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgb(var(--muted));
}

.inline-verse-actions__sep {
  height: 1rem;
  width: 1px;
  background: rgb(var(--surface-3));
}

.inline-verse-actions__close-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 1rem;
  padding: 0.5rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background-color 200ms ease;
}

.inline-verse-actions__close-btn:hover {
  background: rgb(var(--surface-2));
}

/* Context panel (highlight/note) */
.inline-verse-actions__context-panel {
  overflow: hidden;
  transition:
    max-height 200ms ease-out,
    opacity 200ms ease-out,
    transform 200ms ease-out,
    margin 200ms ease-out;
}

.inline-verse-actions__context-panel.is-open {
  max-height: 34rem;
  opacity: 1;
  transform: translateY(0);
  margin-top: 0.5rem;
  overflow: visible;
}

.inline-verse-actions__context-panel.is-closed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
}

.inline-verse-actions__context-inner {
  border-radius: 0.75rem;
  border: 1px solid rgba(var(--surface-3), 0.55);
  background: rgba(var(--surface-2), 0.45);
  padding: 0.75rem;
}

/* Color swatch */
.color-swatch {
  height: 1.75rem;
  width: 1.75rem;
  border-radius: 9999px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 9px 18px -13px rgba(15, 23, 42, 0.95);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.color-swatch:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 20px -12px rgba(15, 23, 42, 0.88);
}

.color-swatch.is-selected {
  outline: 2px solid rgba(var(--accent), 0.7);
  outline-offset: 2px;
}

/* Color picker popover */
.color-picker-popover {
  position: absolute;
  z-index: 30;
  width: 15.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(var(--surface-3), 0.65);
  background: rgba(var(--surface-1), 0.98);
  padding: 0.75rem;
  box-shadow: 0 24px 44px -26px rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.color-picker-popover__arrow {
  pointer-events: none;
  position: absolute;
  left: 50%;
  height: 0.625rem;
  width: 0.625rem;
  transform: translateX(-50%) rotate(45deg);
  border: 1px solid rgba(var(--surface-3), 0.65);
  background: rgba(var(--surface-1), 0.98);
}

.color-picker-saturation {
  position: relative;
  height: 6rem;
  width: 100%;
  cursor: crosshair;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgba(var(--surface-3), 0.65);
}

.color-picker-saturation__white {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, white, transparent);
}

.color-picker-saturation__black {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, black, transparent);
}

.color-picker-saturation__cursor {
  pointer-events: none;
  position: absolute;
  height: 0.875rem;
  width: 0.875rem;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.55);
}

/* Hue slider */
.hue-slider {
  height: 0.375rem;
  width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 9999px;
  background: linear-gradient(
    to right,
    #ff0000,
    #ffff00,
    #00ff00,
    #00ffff,
    #0000ff,
    #ff00ff,
    #ff0000
  );
}

.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hue-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* (left-rail removed — controls moved to reading header and search section) */

/* (top-header removed — controls moved to reading header in bible_pane.html) */

/* ------------------------------------------------------------
   Settings modal
   ------------------------------------------------------------ */
.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--fg), 0.32);
  padding: 1rem;
}

@media (min-width: 640px) {
  .settings-modal-backdrop {
    padding: 1.5rem;
  }
}

@media (min-width: 768px) {
  .settings-modal-backdrop {
    padding: 2rem 1.5rem;
  }
}

.settings-modal {
  display: flex;
  flex-direction: column;
  height: min(92vh, 54rem);
  width: 100%;
  max-width: 64rem;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgba(var(--fg), 0.12);
  box-shadow: 0 36px 80px -44px rgba(15, 23, 42, 0.95);
  background: rgb(var(--surface-1));
}

.settings-nav__btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 1rem;
  border-radius: 9999px;
  padding: 0.75rem 1rem;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: all 200ms ease;
}

.settings-nav__btn.is-active {
  background: rgb(var(--surface-1));
  color: rgb(var(--accent));
  box-shadow: 0 20px 38px -30px rgba(15, 23, 42, 0.95);
}

.settings-nav__btn:not(.is-active) {
  color: rgba(var(--fg), 0.6);
}

.settings-nav__btn:not(.is-active):hover {
  background: rgb(var(--surface-3));
}

/* Toggle row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0.75rem;
  background: rgb(var(--surface-2));
  padding: 1rem;
  box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.9);
}

.toggle-switch {
  position: relative;
  height: 1.5rem;
  width: 3rem;
  border-radius: 9999px;
  padding: 0.25rem;
  border: 0;
  cursor: pointer;
  transition: background-color 200ms ease;
}

.toggle-switch.is-on {
  background: rgb(var(--accent));
}

.toggle-switch.is-off {
  background: rgb(var(--surface-3));
}

.toggle-switch__thumb {
  position: absolute;
  top: 0.25rem;
  height: 1rem;
  width: 1rem;
  border-radius: 9999px;
  background: white;
  box-shadow: 0 8px 20px -14px rgba(15, 23, 42, 0.95);
  transition: all 200ms ease;
}

.toggle-switch.is-on .toggle-switch__thumb {
  right: 0.25rem;
}

.toggle-switch.is-off .toggle-switch__thumb {
  left: 0.25rem;
}

/* AI depth pill */
.ai-depth-pill {
  display: flex;
  width: 100%;
  max-width: 32rem;
  border-radius: 9999px;
  background: rgb(var(--surface-3));
  padding: 0.25rem;
}

.ai-depth-pill__btn {
  flex: 1;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: rgb(var(--muted));
  transition: all 200ms ease;
}

.ai-depth-pill__btn.is-active {
  background: white;
  color: rgb(var(--accent));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ------------------------------------------------------------
   Loading skeletons
   ------------------------------------------------------------ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.skeleton {
  animation: pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  background: rgb(var(--surface-2));
  border-radius: 0.5rem;
}

/* ------------------------------------------------------------
   Error / alert banners
   ------------------------------------------------------------ */
.alert-warning {
  border-radius: 0.75rem;
  background: rgba(251, 191, 36, 0.15);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #92400e;
  box-shadow: 0 10px 24px -20px rgba(180, 83, 9, 0.65);
}

html.dark .alert-warning {
  background: rgba(180, 83, 9, 0.35);
  color: #fef3c7;
}

/* Commentary badge */
.commentary-badge {
  border-radius: 0.375rem;
  background: rgba(var(--accent), 0.15);
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(var(--accent));
}

/* Pagination buttons */
.pagination-btn {
  min-height: 2.5rem;
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(var(--surface-3), 0.65);
  background: rgb(var(--surface-2));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: rgb(var(--fg));
  cursor: pointer;
  box-shadow: 0 12px 28px -24px rgba(15, 23, 42, 0.9);
  transition:
    background-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgb(var(--surface-3));
  box-shadow:
    0 0 28px rgba(125, 211, 252, 0.24),
    0 16px 30px -22px rgba(15, 23, 42, 0.95);
}

.pagination-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ------------------------------------------------------------
   Typewriter placeholder
   ------------------------------------------------------------ */
.typewriter-container {
  display: inline-flex;
  align-items: center;
  min-width: 1px;
  white-space: pre;
}

.typewriter-cursor {
  display: inline-block;
  width: 1.5px;
  height: 84%;
  margin-left: 2px;
  margin-right: 1px;
  vertical-align: bottom;
  border-radius: 2px;
  transition: opacity 0.14s;
}

/* ------------------------------------------------------------
   Utility classes (replaces Tailwind one-offs)
   ------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Utility classes provided by Tailwind CDN: hidden, flex, grid, relative, absolute, inset-0 */

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .search-mode-content {
    animation: none;
  }

  .inline-verse-actions {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
