:root {
  --parchment: #FFFFFF;
  --parchment-panel: #FFFFFF;
  --parchment-dark: #F5F5F5;
  --parchment-card: #FFFFFF;
  --ink: #2c1f0e;
  --ink-muted: #5a4020;
  --ink-faint: #8a6840;
  --gold: #7a5c0a;
  --gold-bright: #9a7418;
  --gold-accent: #b8922a;
  --border: #c8b078;
  --border-light: #ddd0a0;
  --red-letter: #8b1a1a;
  --success: #3a6030;
}

/* DARK MODE */
body.dark-mode {
  --parchment: #1a1612;
  --parchment-panel: #211d18;
  --parchment-dark: #2a2520;
  --parchment-card: #252018;
  --ink: #e8dfc8;
  --ink-muted: #b8a880;
  --ink-faint: #8a7a5a;
  --gold: #c8a040;
  --gold-bright: #d4b050;
  --gold-accent: #c8a040;
  --border: #5a4e30;
  --border-light: #3a3020;
  --red-letter: #d07070;
  --success: #4a8040;
}
/* LOGO ICON */
.logo-bg { fill: #2c1f0e; }
body.dark-mode .logo-bg { fill: #e8dfc8; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Crimson Pro', Georgia, serif;
  background: var(--parchment);
  color: var(--ink);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* HEADER */
.app-header {
  background: var(--parchment);
  border-bottom: none;
  padding: 0 16px;
  height: 52px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}
.app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--border-light);
}
.header-left { display: flex; align-items: center; }
.header-right { display: flex; align-items: center; justify-content: flex-end; }
.logo-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, transform 0.15s;
}
.logo-btn:hover { opacity: 0.8; transform: scale(1.08); }
.logo-btn:active { transform: scale(0.95); }
.dark-mode-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  margin-right: 8px;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.dark-mode-btn:hover { background: var(--parchment-dark); border-color: var(--gold); }
.app-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  text-align: center;
  line-height: 1;
}
.app-title .title-the {
  font-weight: 800;
  font-style: normal;
  font-size: 22px;
  letter-spacing: 0.03em;
  display: inline;
  margin-right: 6px;
}
.app-title .title-main {
  font-weight: 800;
  font-style: normal;
  font-size: 22px;
  letter-spacing: 0.03em;
  display: inline;
}
.nav-select {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: lining-nums;
  background: var(--parchment);
  color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  padding: 0 8px;
  height: 32px;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.nav-select:focus { outline: none; border-color: var(--gold); }
.nav-btn {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 600;
  background: var(--parchment);
  color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  padding: 0 12px;
  height: 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.nav-btn:hover { background: var(--parchment-dark); border-color: var(--gold); }
.esv-badge {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--border);
  background: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 0 10px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.06em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  text-align-last: center;
  transition: opacity 0.15s;
}
.esv-badge:hover { opacity: 0.85; }
.esv-badge:focus { outline: none; }

/* ACCESSIBILITY BAR */
.a11y-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 0 12px;
  margin-bottom: 14px;
  flex-wrap: nowrap;
}
.a11y-group { display: flex; align-items: center; gap: 4px; }
.a11y-sep { width: 1px; height: 20px; background: var(--border-light); margin: 0 2px; }
.a11y-btn {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--parchment);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  padding: 0 8px;
  height: 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.a11y-btn:hover { background: var(--parchment-dark); border-color: var(--gold); }
.a11y-btn.active { background: var(--ink); color: var(--border); border-color: var(--ink); }
.a11y-icon { min-width: 26px; padding: 0 5px; justify-content: center; }

/* HIGH CONTRAST MODE — bible text and all widget content cards */

/* BIBLE HEADER (version + nav combined) */
.bible-version-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px 0;
  background: var(--parchment);
  flex-shrink: 0;
}
.bible-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: var(--parchment);
  flex-shrink: 0;
}
.bible-card-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  background: var(--parchment);
  flex-shrink: 0;
  position: relative;
}
.bible-card-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--border-light);
}
.bible-nav-label {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink);
  flex: 1;
  text-align: center;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LAYOUT SELECT */
.layout-select {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--border);
  background: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 0 10px;
  height: 32px;
  letter-spacing: 0.06em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  text-align-last: center;
  transition: opacity 0.15s;
}
.layout-select:hover { opacity: 0.85; }
.layout-select:focus { outline: none; }

.app-body { display: flex; flex: 1; min-height: 0; overflow: hidden; transition: none; }

/* Split (default) */
.app-body.layout-split .bible-panel  { display: flex; }
.app-body.layout-split .resizer      { display: flex; }
.app-body.layout-split .study-panel  { flex: 1; display: flex; }

/* Bible full width */
.app-body.layout-bible .bible-panel  { width: 100% !important; display: flex; }
.app-body.layout-bible .resizer      { display: none; }
.app-body.layout-bible .study-panel  { display: none; }

/* Widgets full width */
.app-body.layout-study .bible-panel  { display: none; }
.app-body.layout-study .resizer      { display: none; }
.app-body.layout-study .study-panel  { flex: 1; display: flex; }

/* Full screen — bible as first carousel slot in study panel */
.app-body.layout-fullscreen .bible-panel  { display: none; }
.app-body.layout-fullscreen .resizer      { display: none; }
.app-body.layout-fullscreen .study-panel  { flex: 1; display: flex; }

/* RESIZER */
.resizer {
  width: 6px;
  flex-shrink: 0;
  background: var(--parchment-dark);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  cursor: col-resize;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  position: relative;
  z-index: 10;
}
.resizer:hover, .resizer.dragging { background: var(--gold-accent); border-color: var(--gold); }
.resizer::after {
  content: '';
  display: block;
  width: 2px;
  height: 32px;
  background: var(--border);
  border-radius: 2px;
}

/* TTS PLAYER BAR */
.tts-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 3px 16px;
  background: var(--parchment);
  flex-shrink: 0;
}
.tts-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s;
}
.tts-play-btn:hover { color: var(--gold); }
.tts-play-btn.playing { color: var(--gold); }
.tts-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex: 1;
}

body.dark-mode .tts-play-btn { color: #e8dfc8; }

/* BIBLE PANEL */
.bible-panel {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--parchment-panel);
  min-height: 0;
}
.bible-text-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  min-height: 0;
  background: var(--parchment-panel);
}
.bible-text-scroll::-webkit-scrollbar { width: 6px; }
.bible-text-scroll::-webkit-scrollbar-track { background: var(--parchment-dark); }
.bible-text-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.bible-card {
  background: var(--parchment-card);
  border-radius: 4px;
  padding: 0 24px 28px;
}
.bible-card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.03em;
  font-variant-numeric: lining-nums;
  line-height: 1.2;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
#bibleText {
  line-height: 1.8;
  font-size: 16px;
  color: var(--ink);
}
.bible-citation {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.6;
  text-align: center;
}
.card-source {
  margin-top: 8px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 11px;
  font-style: italic;
  color: var(--ink-faint);
  opacity: 0.85;
}
.widget-source-note {
  margin-top: 14px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 11px;
  font-style: italic;
  color: var(--ink-faint);
  text-align: center;
  padding: 8px 0 2px;
  border-top: 1px solid var(--border-light);
  opacity: 0.85;
}
.verse {
  display: inline;
  padding: 1px 3px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s;
}
.verse:hover { }
.verse.highlighted {
  background: #FFE818;
  border-radius: 2px;
}
.verse-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  vertical-align: super;
  margin-right: 3px;
}
.red-letter { color: var(--red-letter); }
.verse-flow { line-height: 1.9; }

/* STUDY PANEL */
.study-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--parchment-panel);
  min-height: 0;
  min-width: 0;
}
/* TWO-ROW TAB BAR */
/* CAROUSEL NAV */
.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 2px;
  background: var(--parchment);
  flex-shrink: 0;
}
.carousel-label {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink);
  flex: 1;
  text-align: center;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0 0 4px;
  background: var(--parchment);
  flex-shrink: 0;
  position: relative;
}
.carousel-dots::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--border-light);
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-light);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  border: none;
  padding: 0;
}
.carousel-dot.active {
  background: var(--gold);
  transform: scale(1.3);
}
.carousel-dot:hover { background: var(--gold-bright); }
body.dark-mode .carousel-dot { background: #4a4030; }
body.dark-mode .carousel-dot.active { background: #e8dfc8; }
.widget-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.widget-sections-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 0;
}
.widget-sections-wrap::-webkit-scrollbar { width: 6px; }
.widget-sections-wrap::-webkit-scrollbar-track { background: var(--parchment-dark); }
.widget-sections-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.widget-section { display: none; }
.widget-section.active { display: block; }
.widget-card {
  background: var(--parchment-card);
  border-radius: 4px;
  overflow: hidden;
}
.content-card {
  padding: 14px 16px;
  border-top: 1px solid var(--border-light);
}
.content-card:first-child { border-top: none; }
.card-label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.card-sublabel {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.card-text {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  font-style: normal;
}

/* MAP LINK BUTTON */
.map-link-btn {
  display: inline-block;
  margin-top: 10px;
  margin-bottom: 10px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  padding: 4px 10px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.map-link-btn:hover {
  background: var(--parchment-dark);
  border-color: var(--gold);
  color: var(--gold-accent);
}

.map-embed {
  width: 100%;
  aspect-ratio: 2 / 1;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  margin: 10px 0 6px;
  display: block;
  object-fit: cover;
  z-index: 0;
}

/* NOTES */
.oia-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.oia-btn {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--parchment-dark);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.oia-btn.active { background: var(--gold); color: var(--parchment); border-color: var(--gold); }
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  background: var(--parchment);
  border-bottom: 1px solid var(--border-light);
  position: relative;
}
.rte-btn {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  background: var(--parchment);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 3px;
  width: 26px;
  height: 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}
.rte-btn:hover { background: var(--parchment-dark); border-color: var(--gold); }
.rte-btn.active { background: var(--gold); color: var(--parchment); border-color: var(--gold); }
.rte-separator { width: 1px; height: 24px; background: var(--border); margin: 0 2px; align-self: center; }
.highlight-picker {
  display: none;
  position: absolute;
  top: 34px;
  left: 110px;
  background: var(--parchment-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px;
  gap: 4px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(44,31,14,0.15);
}
.highlight-picker.open { display: flex; }
.highlight-swatch {
  width: 20px; height: 20px; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--border);
}
.rte-editor {
  min-height: 680px;
  max-height: 999px;
  overflow-y: auto;
  padding: 12px 14px;
  background: var(--parchment-card);
  border: none;
  border-radius: 0;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  outline: none;
}
.rte-editor::-webkit-scrollbar { width: 6px; }
.rte-editor::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.rte-editor h3 { font-family: 'Playfair Display', Georgia, serif; color: var(--gold); font-size: 14px; margin-bottom: 6px; }
.rte-editor.placeholder-active { color: var(--ink-faint); }
.study-prompts { margin-top: 12px; }
.study-prompts p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.study-prompts ul { list-style: none; padding: 0; }
.study-prompts li {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 14px;
  color: var(--ink-muted);
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.5;
}
.study-prompts li::before { content: '›'; color: var(--gold-accent); margin-right: 6px; }

/* ADMIN PANEL */

/* MODAL */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,31,14,0.45);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--parchment-panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 28px 32px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(44,31,14,0.25);
}
.modal h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 18px; color: var(--gold); margin-bottom: 16px; }
.modal label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.modal input {
  width: 100%;
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  background: var(--parchment-card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 14px;
}
.modal input:focus { outline: none; border-color: var(--gold); }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.modal-btn {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 4px;
  padding: 0 18px;
  height: 34px;
  cursor: pointer;
}
.modal-btn.primary { background: var(--gold); color: var(--parchment); }
.modal-btn.primary:hover { background: var(--gold-accent); }
.modal-btn.secondary { background: var(--parchment-dark); color: var(--ink); border: 1px solid var(--border); }

/* AUTH MODAL */
.auth-modal { max-width: 360px; width: 360px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.auth-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  white-space: nowrap;
}
.auth-title .title-the {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: none;
  color: inherit;
  display: inline;
}
.auth-title .title-main { display: inline; }
.auth-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 10px 0 18px;
}
.auth-subtitle {
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: 8px;
}
.auth-field { margin-bottom: 0px; }
.auth-field label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.auth-field input {
  width: 100%;
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  background: var(--parchment-card);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 0;
}
.auth-field input:focus { outline: none; border-color: var(--gold); }
.auth-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.auth-btns .modal-btn { width: 100%; height: 38px; font-size: 11px; letter-spacing: 0.06em; }
.auth-guest-btn {
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0 0;
  text-align: center;
  width: 100%;
}
.auth-links .auth-guest-btn { width: auto; padding: 4px 0; }
.auth-guest-btn:hover { color: var(--ink-muted); }
.auth-links {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 24px;
  margin-top: 0;
}
.auth-link {
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.auth-link:hover { color: var(--gold-accent); text-decoration: underline; }
.auth-error {
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  color: #8b1a1a;
  margin: 2px 0 0;
  text-align: center;
}
.auth-success {
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  color: var(--success);
  margin: 2px 0 0;
  text-align: center;
}

/* ACCOUNT DROPDOWN */
.account-dropdown {
  position: fixed;
  top: 58px;
  right: 16px;
  background: var(--parchment);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0;
  min-width: 260px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(44,31,14,0.18);
  z-index: 300;
}
.account-email {
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
  padding: 6px 14px 8px;
  word-break: break-all;
}
.account-divider { height: 1px; background: var(--border-light); margin: 0 0 4px; }
.account-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: 'Playfair Display', serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: none;
  border: none;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.account-item:hover { background: var(--parchment-dark); }

/* DARK MODE — #e8dfc8 for buttons, toggles, sliders */
body.dark-mode .menu-btn,
body.dark-mode .nav-btn,
body.dark-mode .a11y-btn,
body.dark-mode .tab-btn,
body.dark-mode .rte-btn,
body.dark-mode .oia-btn,
body.dark-mode .menu-select,
body.dark-mode .nav-select {
  background: #e8dfc8; color: #2c1f0e; border-color: #c8b078;
}
body.dark-mode .menu-btn:hover,
body.dark-mode .nav-btn:hover,
body.dark-mode .tab-btn:hover,
body.dark-mode .rte-btn:hover { background: #d4cbb4; border-color: #a08040; }
body.dark-mode .menu-btn.active,
body.dark-mode .tab-btn.active { background: #2c1f0e; color: #e8dfc8; border-color: #2c1f0e; }
body.dark-mode .toggle-track { background: #4a4030; border-color: #5a4e30; }
body.dark-mode input[type="checkbox"]:checked + .toggle-track { background: #e8dfc8; border-color: #e8dfc8; }
body.dark-mode .toggle-thumb { background: #e8dfc8; }
body.dark-mode input[type="checkbox"]:checked + .toggle-track .toggle-thumb { background: #2c1f0e; }
body.dark-mode input[type="range"],
body.dark-mode .menu-spacing-slider { accent-color: #e8dfc8; }
.menu-spacing-slider { accent-color: var(--gold); }
body.dark-mode .menu-tts-btn { background: #e8dfc8; color: #2c1f0e; border-color: #e8dfc8; }
body.dark-mode .menu-tts-btn:hover { background: #d4cbb4; border-color: #d4cbb4; }
body.dark-mode .menu-tts-btn.active { background: #2c1f0e; color: #e8dfc8; border-color: #2c1f0e; }
body.dark-mode .modal-btn.primary { background: #e8dfc8; color: #2c1f0e; border-color: #e8dfc8; }
body.dark-mode .modal-btn.primary:hover { background: #d4cbb4; }
.chevron-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.chevron-btn:hover { color: var(--gold); }
body.dark-mode .chevron-btn { color: #e8dfc8; }
body.dark-mode .chevron-btn:hover { color: #e8dfc8; background: var(--parchment-dark); }

/* BOOK/CHAPTER PICKER */
.picker-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.picker-modal {
  background: var(--parchment);
  border-radius: 8px;
  width: 560px;
  max-width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.picker-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  text-align: center;
}
.picker-close {
  background: none; border: none; cursor: pointer;
  color: var(--ink-faint); font-size: 16px; padding: 2px 6px;
  border-radius: 4px; transition: color 0.15s;
}
.picker-close:hover { color: var(--ink); }
.picker-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.picker-books {
  width: 200px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border-light);
  padding: 10px 0;
}
.picker-books::-webkit-scrollbar { width: 6px; }
.picker-books::-webkit-scrollbar-track { background: var(--parchment-dark); }
.picker-books::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.picker-chapters::-webkit-scrollbar { width: 6px; }
.picker-chapters::-webkit-scrollbar-track { background: var(--parchment-dark); }
.picker-chapters::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.picker-testament-label {
  font-family: 'Playfair Display', serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 6px 14px 4px;
}
.picker-book-grid { display: flex; flex-direction: column; }
.picker-book-btn {
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  color: var(--ink);
  background: none;
  border: none;
  text-align: left;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.picker-book-btn:hover { background: var(--parchment-dark); }
.picker-book-btn.active { background: var(--ink); color: var(--parchment); font-weight: 600; }
.picker-chapters { flex: 1; overflow-y: auto; padding: 10px 14px; }
.picker-chapters-label {
  font-family: 'Playfair Display', serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.picker-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 6px;
}
.picker-chap-btn {
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--parchment-dark);
  border: none;
  border-radius: 4px;
  padding: 6px 4px;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s;
}
.picker-chap-btn:hover { background: var(--border-light); }
.picker-chap-btn.active { background: var(--ink); color: var(--parchment); }
body.dark-mode .picker-book-btn.active,
body.dark-mode .picker-chap-btn.active { background: #e8dfc8; color: #2c1f0e; }

/* TOGGLE SWITCH */
.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  width: 36px; height: 20px; background: var(--border-light);
  border-radius: 10px; position: relative; transition: background 0.2s; border: 1px solid var(--border);
}
.toggle-switch input:checked + .toggle-track { background: var(--gold); border-color: var(--gold); }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  background: #fff; border-radius: 50%; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb { left: 18px; }

/* SETTINGS MENU */
.menu-header {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}
.menu-section { padding: 10px 16px 8px; border-bottom: 1px solid var(--border-light); }
.menu-section:last-child { border-bottom: none; }
.menu-section-title {
  font-family: 'Playfair Display', serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px;
}
.menu-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.menu-row:last-child { margin-bottom: 0; }
.menu-label { font-family: 'Crimson Pro', serif; font-size: 13px; color: var(--ink); }
.menu-control { display: flex; align-items: center; gap: 4px; }
.menu-btn {
  font-family: 'Playfair Display', serif; font-size: 11px; font-weight: 700; color: var(--ink);
  background: var(--parchment); border: 1.5px solid var(--border); border-radius: 4px;
  padding: 0 8px; height: 26px; cursor: pointer; display: inline-flex; align-items: center;
  transition: background 0.12s, border-color 0.12s; white-space: nowrap;
}
.menu-btn:hover { background: var(--parchment-dark); border-color: var(--gold); }
.menu-btn.active { background: var(--ink); color: var(--border); border-color: var(--ink); }
.menu-select {
  font-family: 'Crimson Pro', serif; font-size: 13px; color: var(--ink);
  background: var(--parchment); border: 1.5px solid var(--border); border-radius: 4px;
  padding: 0 6px; height: 26px; cursor: pointer;
}
.menu-select:focus { outline: none; border-color: var(--gold); }
.menu-tts-btn {
  font-family: 'Playfair Display', serif; font-size: 11px; font-weight: 700;
  color: var(--parchment); background: var(--gold); border: 1.5px solid var(--gold);
  border-radius: 4px; padding: 0 10px; height: 26px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; transition: background 0.12s;
}
.menu-tts-btn:hover { background: var(--gold-accent); border-color: var(--gold-accent); }
.menu-tts-btn.active { background: var(--ink); border-color: var(--ink); }
.account-email {
  font-family: 'Crimson Pro', serif; font-size: 13px; color: var(--ink-muted);
  font-style: italic; padding: 10px 16px 8px; word-break: break-all;
}
.account-divider { height: 1px; background: var(--border-light); margin: 0; }
.account-item {
  display: block; width: 100%; text-align: left; font-family: 'Playfair Display', serif;
  font-size: 12px; font-weight: 700; color: var(--ink); background: none; border: none;
  padding: 8px 16px; cursor: pointer; transition: background 0.12s;
}
.account-item:hover { background: var(--parchment-dark); }
