/* ===== Variables (Glorify-inspired) ===== */
:root {
  --bg: #f8f6f3;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --accent: #e07c3c;
  --accent-hover: #c96a32;
  --accent-light: rgba(224, 124, 60, 0.12);
  --segment-active-bg: #2d2d2d;
  --segment-active-text: #fff;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 56px;
  --bottom-nav-h: 72px;
  --font-sans: 'DM Sans', -apple-system, sans-serif;
  --font-serif: 'Literata', Georgia, serif;
}

/* Modo oscuro */
[data-theme="dark"] {
  --bg: #1a1a1c;
  --bg-card: #252528;
  --text: #e8e8ea;
  --text-muted: #9a9aa0;
  --accent: #e07c3c;
  --accent-hover: #ef9460;
  --accent-light: rgba(224, 124, 60, 0.2);
  --segment-active-bg: #e07c3c;
  --segment-active-text: #fff;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.25);
}
[data-theme="dark"] body {
  background: var(--bg);
}
@media (min-width: 768px) {
  [data-theme="dark"] body { background: #121214; }
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: var(--bottom-nav-h);
}
@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* NavegaciÃ³n escritorio: Biblia | Buscar | Marcadores */
.header-nav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
@media (min-width: 768px) {
  .header-nav { display: flex; }
}
.header-nav-item {
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.header-nav-item:hover {
  color: var(--text);
  background: var(--accent-light);
}
.header-nav-item--active,
.header-nav-item[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}
.logo { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%); color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-weight: 800; font-size: 1.3rem; box-shadow: 0 4px 12px rgba(224, 124, 60, 0.25); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); cursor: pointer; } .logo:hover { transform: scale(1.1) rotate(3deg); box-shadow: 0 6px 20px rgba(224, 124, 60, 0.4); } .app-title { margin: 0; font-size: 1.45rem; font-weight: 800; color: var(--text); letter-spacing: -0.04em; display: flex; align-items: center; } .app-title span { color: var(--accent); margin-right: 6px; font-weight: 900; }
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-trigger:hover { background: var(--accent-light); color: var(--accent); }
.version-trigger--desktop { display: none; }
@media (min-width: 768px) {
  .version-trigger--desktop { display: flex; }
}
.version-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.version-trigger:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.version-trigger-icon {
  display: flex;
  opacity: 0.8;
}
.version-trigger:hover .version-trigger-icon { opacity: 1; }

/* ===== Modal versiÃ³n (mÃ³vil: bottom sheet / escritorio: centrado) ===== */
.version-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.version-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}
.version-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.version-modal.is-open .version-modal-backdrop {
  opacity: 1;
}
.version-modal-panel {
  position: relative;
  width: 100%;
  max-height: 70vh;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.version-modal.is-open .version-modal-panel {
  transform: translateY(0);
}
.version-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.version-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.version-modal-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.version-modal-close:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.version-modal-list {
  padding: 12px 16px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.version-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.version-option:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.version-option:active {
  transform: scale(0.98);
}
.version-option.version-option--active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.version-option-name {
  font-size: 1rem;
  font-weight: 600;
}
.version-option-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.version-option.version-option--active .version-option-desc {
  color: var(--accent);
  opacity: 0.9;
}
@media (min-width: 768px) {
  .version-modal {
    align-items: center;
    padding: 24px;
  }
  .version-modal-panel {
    max-width: 400px;
    max-height: 85vh;
    border-radius: var(--radius);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .version-modal.is-open .version-modal-panel {
    transform: scale(1);
  }
  .version-modal-header {
    padding: 24px 24px 20px;
  }
  .version-modal-title { font-size: 1.35rem; }
  .version-modal-list {
    padding: 16px 24px 28px;
    gap: 10px;
  }
  .version-option { padding: 18px 20px; }
}

/* ===== Modal Acerca de (serif tÃ­tulo, sans cuerpo, fondo gradiente radial) ===== */
.about-modal {
  position: fixed;
  inset: 0;
  z-index: 105;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.about-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}
.about-modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, rgba(28, 28, 32, 0.97) 0%, rgba(18, 18, 22, 0.98) 50%, rgba(12, 12, 16, 0.99) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.about-modal-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.35s ease;
}
.about-modal.is-open .about-modal-panel {
  transform: scale(1);
  opacity: 1;
}
.about-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
}
.about-modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.about-modal-content {
  padding: 48px 32px 40px;
  text-align: center;
}
.about-modal-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.98);
  margin: 0 0 24px;
  letter-spacing: 0.01em;
}
.about-modal-body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
  font-weight: 400;
}
.about-modal-fineprint {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin: 28px 0 0;
  font-weight: 400;
  opacity: 0.7;
}
@media (min-width: 768px) {
  .about-modal-title { font-size: 2rem; }
  .about-modal-body { font-size: 1.05rem; }
  .about-modal-fineprint { font-size: 0.9rem; margin-top: 32px; }
  .about-modal-content { padding: 56px 40px 48px; }
}

/* ===== Panel Configuraciones (desliza desde la derecha) ===== */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  visibility: hidden;
}
.settings-panel.is-open {
  pointer-events: auto;
  visibility: visible;
}
.settings-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.settings-panel.is-open .settings-panel-backdrop {
  opacity: 1;
}
.settings-panel-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  max-width: 100%;
  background: var(--bg-card);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.settings-panel.is-open .settings-panel-drawer {
  transform: translateX(0);
}
.settings-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card);
}
.settings-panel-back {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.settings-panel-back:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.settings-panel-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.settings-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 24px;
}
.settings-section {
  margin-bottom: 24px;
}
.settings-section:last-child { margin-bottom: 0; }
.settings-section-title {
  margin: 0 20px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}
.settings-row:hover:not(:disabled) {
  background: var(--accent-light);
}
.settings-row:disabled {
  cursor: default;
  opacity: 0.85;
}
.settings-row-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.settings-row:hover:not(:disabled) .settings-row-icon,
.settings-row:focus-visible .settings-row-icon { color: var(--accent); }
.settings-row-label { flex: 1; font-weight: 500; }
.settings-row-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-right: 4px;
}
.settings-row-arrow {
  flex-shrink: 0;
  display: flex;
  color: var(--text-muted);
}
.settings-row:hover:not(:disabled) .settings-row-arrow { color: var(--accent); }
/* Modo oscuro: solo valor, sin flecha */
#settingsDarkMode .settings-row-arrow { display: none; }

/* ===== Main content ===== */
.main {
  flex: 1;
  padding: 20px;
  max-width: 100%;
}
.main.hidden { display: none !important; }
.main--books { display: flex; flex-direction: column; gap: 16px; }
.main--chapters,
.main--reader,
.main--search { display: flex; flex-direction: column; }
.main--inicio { display: flex; flex-direction: column; gap: 20px; }

/* ===== Vista Inicio (estilo imagen) ===== */
.inicio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.inicio-greeting {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}
.inicio-header-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inicio-icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.inicio-icon-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.inicio-icon-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
}

/* Hero: versÃ­culo del dÃ­a */
.inicio-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}
.inicio-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #8b5a3c 0%, #5c3d2e 40%, #3d2a1f 100%);
  background-image: url('../Image/montaÃ±a.png');
  background-size: cover;
  background-position: center;
}
.inicio-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 40%, transparent 70%);
}
.inicio-hero-content {
  position: relative;
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inicio-hero-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.03em;
}
.inicio-hero-ref {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 1);
  letter-spacing: 0.02em;
}
.inicio-hero-text {
  margin: 8px 0 0;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
}
.inicio-hero-footer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.inicio-hero-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
}
.inicio-hero-action:hover {
  color: #fff;
}
.inicio-hero-action svg {
  flex-shrink: 0;
}
.inicio-hero-action--liked svg {
  fill: #e74c3c;
  stroke: #e74c3c;
}
.inicio-hero-action--liked {
  color: #e74c3c;
}
.inicio-hero-more {
  margin-left: auto;
}

/* Tarjeta Comparte la palabra */
.inicio-share-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.inicio-share-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  background-color: #f0ebe6;
  background-image: url('../Image/compartir.png');
  background-size: cover;
  background-position: center;
}
.inicio-share-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.inicio-share-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}
[data-theme="dark"] .inicio-share-image {
  background-image: url('../Image/compartir.png');
  background-color: rgba(0, 0, 0, 0.2);
}

/* Barra fija: pestaÃ±as + bÃºsqueda (vista libros) */
.books-toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: -20px -20px 0 -20px;
  padding: 0 20px 16px 20px;
  background: var(--bg);
}
@media (min-width: 768px) {
  .books-toolbar {
    margin: -32px -40px 0 -40px;
    padding: 0 40px 20px 40px;
  }
}

/* ===== Segment control (Antiguo / Nuevo Testamento) ===== */
.segment-control {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow);
}
.segment {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.segment:first-of-type { border-radius: 10px 0 0 10px; }
.segment:last-of-type { border-radius: 0 10px 10px 0; }
.segment--active {
  background: var(--segment-active-bg);
  color: var(--segment-active-text);
}

/* ===== Search row ===== */
.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.btn-icon {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.btn-icon:hover { background: var(--accent-light); color: var(--accent); }

/* ===== Books list ===== */
.books-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-bottom: 20px;
}
.book-card {
  display: block;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
}
.book-card:hover {
  box-shadow: var(--shadow-card);
  border-color: rgba(0,0,0,0.12);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumb-back {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}
.breadcrumb-back:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-muted); font-size: 0.9rem; }
.breadcrumb-current { color: var(--text); font-size: 0.9rem; }

.screen-title {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 600;
}

/* ===== Chapters grid ===== */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 10px;
}
.chapter-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.chapter-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Reader ===== */
/* Barra top: Breadcrumb + Controles TipogrÃ¡ficos */
.reader-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.reader-topbar .breadcrumb {
  margin-bottom: 0;
}

/* Toolbar de controles tipogrÃ¡ficos */
.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 6px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.reader-tool-group {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.reader-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.reader-tool-group .reader-tool-btn {
  padding: 6px 12px;
  border-right: 1px solid var(--border);
}
.reader-tool-group .reader-tool-btn:last-child {
  border-right: none;
}
.reader-tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.reader-tool-btn--active {
  background: var(--accent-light) !important;
  color: var(--accent) !important;
}

.tool-label {
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.8;
}

.reader-tool-font-toggle {
  min-width: 60px;
}

/* Barra de progreso de lectura (sticky top) */
.reader-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  z-index: 1000;
}
.reader-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Modificadores de la vista de Lector */
.reader {
  max-width: 720px;
  margin: 0 auto;
  /* Valores por defecto */
  --reader-font-size: 1.1rem;
  --reader-line-height: 1.7;
  --reader-font-family: var(--font-serif);
}

.reader[data-font-size="sm"] { --reader-font-size: 0.95rem; }
.reader[data-font-size="md"] { --reader-font-size: 1.1rem; }
.reader[data-font-size="lg"] { --reader-font-size: 1.35rem; }
.reader[data-font-size="xl"] { --reader-font-size: 1.6rem; }

.reader[data-font-family="sans"] { --reader-font-family: var(--font-sans); }
.reader[data-font-family="serif"] { --reader-font-family: var(--font-serif); }

.reader[data-line-spacing="tight"] { --reader-line-height: 1.4; }
.reader[data-line-spacing="normal"] { --reader-line-height: 1.7; }
.reader[data-line-spacing="loose"] { --reader-line-height: 2.1; }

.verse {
  line-height: var(--reader-line-height);
}
.verse-text {
  font-family: var(--reader-font-family);
  font-size: var(--reader-font-size);
  transition: font-size 0.3s ease, line-height 0.3s ease;
}

/* Modo Pantalla Completa Inmersiva */
.app.is-fullscreen .main--reader {
  border-radius: 0;
  margin: 0;
  max-width: none;
}
.app.is-fullscreen .header,
.app.is-fullscreen .bottom-nav {
  display: none !important;
}
.app.is-fullscreen .reader-progress-bar {
  top: 0;
}

/* === Narrador BÃ­blico (TTS) === */
.reader-tts-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 40px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.tts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.tts-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}
.tts-btn--play, .tts-btn--pause {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.tts-btn--play:hover, .tts-btn--pause:hover {
  background: var(--text-muted);
  border-color: var(--text-muted);
  transform: scale(1.05);
}
.tts-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.tts-btn--speed {
  padding: 0 12px;
}

/* Karaoke Highlight */
.tts-highlight {
  background-color: var(--accent-light, rgba(224,124,60,0.15));
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--accent-light, rgba(224,124,60,0.15));
  transition: background-color 0.2s, box-shadow 0.2s;
}

/* NavegaciÃ³n entre capÃ­tulos (Bottom) */
.reader-chapter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.reader-chapter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 40px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.reader-chapter-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.reader-chapter-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.reader-chapter-indicator {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.reader-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 24px;
  color: var(--text);
}
.verses {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.verse {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.verse-num {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 1.8em;
}

/* Acciones por versÃ­culo (Marcador, Compartir) */
.verse-actions-group {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-left: auto; /* Empujar a la derecha */
  padding-left: 8px;
}
.verse-action-btn,
.verse-bookmark-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.verse-action-btn:hover,
.verse-bookmark-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.verse-bookmark-btn--active {
  color: var(--accent) !important;
}
.verse-bookmark-btn--pop {
  animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== Search results ===== */
/* Barra de bÃºsqueda fija en vista Buscar / Marcadores */
.search-results-header {
  position: sticky;
  top: var(--header-h);
  z-index: 8;
  margin: -20px -20px 0 -20px;
  padding: 20px 20px 16px;
  background: var(--bg);
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .main--search .search-results-header {
    margin: -32px -40px 0 -40px;
    padding: 32px 40px 20px 40px;
  }
}
.search-input--full { width: 100%; }
.search-results-info {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-result-item {
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.search-result-item:hover { box-shadow: var(--shadow); }
.search-result-ref { font-weight: 600; font-size: 0.9rem; color: var(--accent); margin-bottom: 4px; }
.search-result-text { font-size: 0.95rem; color: var(--text); }

/* ===== Bottom navigation (mobile) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 20;
  padding: 8px 0;
}
@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.bottom-nav-item:hover { color: var(--text); }
.bottom-nav-item--active,
.bottom-nav-item[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}
.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav-item--active .bottom-nav-icon,
.bottom-nav-item[aria-current="page"] .bottom-nav-icon {
  color: var(--accent);
}

/* ===== Desktop layout ===== */
@media (min-width: 768px) {
  .app {
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 0 48px rgba(0,0,0,0.08);
    min-height: 100vh;
    border-radius: 0;
  }
  body { background: #e8e6e2; }
  .header { border-radius: 0; }
  .main {
    padding: 32px 40px 48px;
  }
  .main--books { max-width: 100%; }
  .books-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
  .book-card {
    padding: 20px;
    font-size: 1.05rem;
  }
  .chapters-grid {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 12px;
  }
  .chapter-btn { font-size: 1.05rem; }
  .reader { padding-bottom: 2rem; }
  .reader-title { font-size: 2rem; }
  .verse-text { font-size: 1.15rem; }
  .search-results { max-width: 640px; }
}

/* ===== Utilidades ===== */
.hidden { display: none !important; }

/* ===== Vista: Marcadores ===== */
.main--bookmarks { display: flex; flex-direction: column; gap: 16px; }
.bookmarks-header { padding-bottom: 4px; }
.bookmarks-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Lista de marcadores */
.bookmarks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bookmark-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.bookmark-item--removing {
  transform: translateX(120%);
  opacity: 0;
}

.bookmark-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.bookmark-ref {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bookmark-book {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
}
.bookmark-chapter-verse {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.bookmark-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.bookmark-text {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

/* Acciones de una tarjeta de marcador */
.bookmark-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bookmark-goto,
.bookmark-note-btn,
.bookmark-delete {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.bookmark-goto:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.bookmark-note-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.bookmark-delete {
  margin-left: auto;
  padding: 6px 10px;
}
.bookmark-delete:hover {
  background: rgba(231, 76, 60, 0.1);
  border-color: #e74c3c;
  color: #e74c3c;
}

/* Ãrea de nota */
.bookmark-note-area {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.32, 0.72, 0, 1), margin-top 0.3s ease;
  margin-top: 0;
}
.bookmark-note-area--open {
  max-height: 120px;
  margin-top: 12px;
}
.bookmark-note-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  resize: none;
  transition: border-color 0.2s;
}
.bookmark-note-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Estado vacÃ­o */
.bookmarks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}
.bookmarks-empty-icon {
  font-size: 3.5rem;
  line-height: 1;
  opacity: 0.6;
}
.bookmarks-empty-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.bookmarks-empty-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
}

/* ===== BotÃ³n de marcador por versÃ­culo ===== */
.verse {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.verse-bookmark-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-left: 6px;
  margin-top: 2px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s, opacity 0.2s, transform 0.15s;
}
.verse:hover .verse-bookmark-btn,
.verse-bookmark-btn--active {
  opacity: 1;
}
.verse-bookmark-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.verse-bookmark-btn--active {
  color: var(--accent);
}
/* AnimaciÃ³n pop al marcar */
@keyframes bookmark-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.verse-bookmark-btn--pop {
  animation: bookmark-pop 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ===== Asistente IA (Gemini / Offline) ===== */
.ai-fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 20px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s;
}
@media (min-width: 768px) {
  .ai-fab {
    bottom: 32px;
    right: 32px;
  }
}
.ai-fab:hover {
  transform: scale(1.1);
  background: var(--accent-light);
  color: var(--accent);
}

.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.ai-modal.is-open {
  pointer-events: auto;
}
.ai-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.3s;
}
.ai-modal.is-open .ai-modal-backdrop {
  opacity: 1;
}
.ai-modal-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--bg);
  height: 100%;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
}
.ai-modal.is-open .ai-modal-panel {
  transform: translateX(0);
}

.ai-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}
.ai-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.ai-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.ai-modal-close:hover { color: var(--text); }

.ai-chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
}
.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
}
.ai-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.ai-msg--assistant {
  align-self: flex-start;
}
.ai-avatar {
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ai-msg--user .ai-avatar { display: none; }
.ai-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  word-wrap: break-word;
}
.ai-msg--user .ai-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg--assistant .ai-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.ai-welcome {
  text-align: center;
  padding: 20px 0;
}
.ai-welcome h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--text);
}
.ai-welcome p {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-suggestion-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.ai-suggestion-btn:hover {
  background: var(--accent);
  color: #fff;
}

.ai-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  gap: 10px;
}
.ai-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s;
}
.ai-input:focus {
  outline: none;
  border-color: var(--accent);
}
.ai-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.ai-send-btn:hover {
  transform: scale(1.05);
}
.ai-dots { animation: blink 1.4s infinite both; }
@keyframes blink { 0% { opacity:.2; } 20% { opacity:1; } 100% { opacity:.2; } }

/* ===== AutenticaciÃ³n / Login CSS ===== */
.settings-auth-section {
  padding: 16px 20px;
  background: var(--bg-hover);
  border-bottom: 2px solid var(--border);
}
.settings-guest-card {
  text-align: center;
}
.settings-guest-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:active, .btn-primary:hover {
  opacity: 0.9;
}
.settings-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-user-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.settings-user-info {
  flex: 1;
  min-width: 0; /* Permite que el flex se reduzca */
}
.settings-user-info h4 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-user-info p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-auth-logout {
  padding: 8px 16px;
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s;
}
.btn-auth-logout:hover {
  background: #e74c3c;
  color: #fff;
}

/* Auth Modal Window */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}
.auth-modal.is-open {
  pointer-events: auto;
}
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.auth-modal.is-open .auth-modal-backdrop {
  opacity: 1;
}
.auth-modal-panel {
  position: relative;
  background: var(--bg-card);
  width: 90%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}
.auth-modal.is-open .auth-modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}
.auth-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.auth-modal-header {
  padding: 30px 24px 20px;
  text-align: center;
}
.auth-modal-header h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: var(--text);
}
.auth-modal-header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.auth-tab:hover {
  color: var(--text);
}
.auth-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.auth-forms {
  padding: 24px;
}
.auth-input-group {
  margin-bottom: 16px;
}
.auth-input-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.auth-input-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.auth-input-group input:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-error-msg {
  color: #e74c3c;
  font-size: 0.85rem;
  margin: 0 0 16px;
  text-align: center;
  min-height: 20px;
}
.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Gamificación CSS ===== */
.inicio-gamification {
  padding: 0 20px 24px;
}
.streak-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.streak-icon {
  font-size: 2.2rem;
  background: rgba(255, 152, 0, 0.1);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.streak-info {
  display: flex;
  flex-direction: column;
}
.streak-count {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.streak-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.inicio-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
}
.plans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.plan-info h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--text);
}
.plan-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.plan-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0, 102, 255, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}
.plans-empty {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 20px;
  background: var(--bg-hover);
  border-radius: var(--radius);
}


/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}
.toast-msg {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-msg.is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-theme="dark"] .toast-msg {
  background: var(--accent);
  color: #fff;
}

/* ===== Busqueda Avanzada (item 8) ===== */
.search-filters-bar {
  padding: 8px 0 4px;
}
.search-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.search-filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.search-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.search-filter-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}
mark.search-highlight {
  background: rgba(255, 200, 0, 0.35);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  font-weight: 700;
}
[data-theme="dark"] mark.search-highlight {
  background: rgba(255, 200, 0, 0.25);
}
.search-result-item--direct {
  border-left: 4px solid var(--accent);
}
.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}
.search-empty-icon {
  font-size: 3rem;
  opacity: 0.6;
}
.search-empty-state p {
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 280px;
}
.search-example {
  display: inline-block;
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--accent);
}

/* ===== Comunidad: Lo que nosotros comentamos (Nuevo Pilar) ===== */
.inicio-comunidad {
  margin-top: 12px;
  padding: 0 20px 80px;
}
.community-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}
.community-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeIn 0.4s ease forwards;
}
.community-card:active { transform: scale(0.99); }

.community-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.community-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.community-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.community-meta {
  display: flex;
  flex-direction: column;
}
.community-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.community-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.community-bible-quote {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 0 8px 8px 0;
}
.quote-ref {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}
.quote-text {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 4px 0 0;
}

.community-thought {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.community-card-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 16px;
}
.community-btn-like {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.community-btn-like:hover {
  color: var(--accent);
}

/* Checkbox de compartir */
.devocional-share-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}
.devocional-share-option input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}


