/* ============================================================
   Web pública — Walter Altare Devocionales
   Sistema visual: Playfair + Lora + DM Sans, paleta terracota
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Columna de lectura centrada */
.app-wrap {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

/* ============================================================
   HEADER
   ============================================================ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px 12px;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.app-header.hide-on-scroll {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: url('/assets/img/logo-walteraltare-yeah.png') center / cover no-repeat;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.header-actions {
  display: flex;
  gap: 2px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
}

.icon-btn:hover { background: var(--line-soft); }

.header-avatar-btn { padding: 0; overflow: hidden; }

.header-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.header-avatar-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--terra-soft);
  color: var(--terra-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}

/* ============================================================
   SCROLL AREA (contenido desplazable)
   ============================================================ */

.scroll-area {
  padding: 8px 22px 100px;
}

/* ============================================================
   HOME — SALUDO
   ============================================================ */

.greeting {
  margin: 4px 0 24px;
}

.greeting .small-label {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--terra);
  font-weight: 500;
  margin-bottom: 10px;
}

.greeting .big {
  font-family: var(--display);
  font-size: 27px;
  line-height: 1.15;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.6px;
}

.greeting .big em {
  font-style: italic;
  color: var(--terra-deep);
}

/* ============================================================
   TARJETA 1 — HERO (devocional del día)
   ============================================================ */

.card-hero {
  background: var(--ink);
  border-radius: var(--r-lg);
  padding: 22px 22px 20px;
  color: #fff;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.card-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(184, 86, 56, 0.18);
  pointer-events: none;
}

.card-hero .h-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--terra-soft);
  margin-bottom: 14px;
  font-weight: 500;
  position: relative;
}

.card-hero .h-title {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
  color: #fff;
  position: relative;
}

.card-hero .h-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  position: relative;
}

.card-hero .read-btn {
  margin-left: auto;
  background: #fff;
  color: var(--ink);
  border: none;
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

/* ============================================================
   TARJETA 2 — NAVEGADOR SEMANAL
   ============================================================ */

.card-week {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-head .label {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-mute);
  font-weight: 500;
}

.card-head .count,
.card-head .link {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: var(--terra);
  text-decoration: none;
}

.week-grid {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.day-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 6px;
  border-radius: 10px;
  text-decoration: none;
  transition: background var(--transition);
}

a.day-cell:hover { background: var(--line-soft); }

.day-cell .dow {
  font-size: 9px;
  font-weight: 500;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.day-cell .num {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.day-cell.read .dow,
.day-cell.read .num { color: var(--ink-mute); }

.day-cell.read::after {
  content: '';
  display: block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--terra);
  margin-top: 3px;
}

.day-cell.today { background: var(--ink); }
.day-cell.today .dow { color: rgba(255,255,255,0.65); }
.day-cell.today .num { color: #fff; }

.day-cell.locked { opacity: 0.35; pointer-events: none; }

/* ============================================================
   TARJETA 3 — SERIE EN CURSO
   ============================================================ */

.card-series {
  background: var(--bg-warm);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  transition: opacity var(--transition);
}

.card-series:hover { opacity: 0.88; }

.series-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--terra);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-style: italic;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
}

.series-info { flex: 1; min-width: 0; }

.series-info .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--terra-deep);
  font-weight: 500;
  margin-bottom: 3px;
}

.series-info .title {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 3px;
}

.series-info .sub {
  font-size: 12px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
}

.series-arrow { color: var(--ink-soft); flex-shrink: 0; }

/* ============================================================
   TARJETA 4 — CITA DESTACADA (pull quote rotativo)
   ============================================================ */

.card-quote {
  padding: 24px 4px;
  margin-bottom: 14px;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.card-quote .deco {
  font-family: var(--display);
  color: var(--terra);
  font-size: 13px;
  letter-spacing: 8px;
  margin-bottom: 14px;
}

.card-quote .quote-text {
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.35;
  color: var(--ink);
  font-weight: 500;
  padding: 0 8px;
}

.card-quote .quote-author {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-mute);
  margin-top: 14px;
  font-weight: 500;
}

/* ============================================================
   TARJETA 5 — ARCHIVO / "VOLVÉ A LEER"
   ============================================================ */

.card-archive {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px 6px;
  margin-bottom: 20px;
}

.archive-list { list-style: none; }

.archive-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  transition: opacity var(--transition);
}

.archive-item:last-child { border-bottom: none; }
.archive-item:hover { opacity: 0.75; }

.archive-num {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  color: var(--terra);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 24px;
  margin-top: -1px;
}

.archive-content { flex: 1; min-width: 0; }

.archive-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-date {
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.archive-arrow { color: var(--ink-mute); flex-shrink: 0; margin-top: 2px; }

/* ============================================================
   ESTADO VACÍO (home sin devocional del día)
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state .deco {
  font-family: var(--display);
  color: var(--terra);
  font-size: 14px;
  letter-spacing: 12px;
  padding-left: 12px;
  margin-bottom: 28px;
}

.empty-state h1 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.4px;
  margin-bottom: 12px;
}

.empty-state p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--terra-deep);
  line-height: 1.55;
}

/* ============================================================
   PÁGINA DEVOCIONAL
   ============================================================ */

/* Barra de progreso */
.reading-progress-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 2px;
  background: var(--line);
}

.reading-progress-bar {
  height: 100%;
  background: var(--terra);
  width: 0%;
  transition: width 80ms linear;
}

/* Header del devocional (con back arrow) */
.dev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  position: sticky;
  top: 2px; /* debajo de la barra de progreso */
  z-index: 30;
  background: var(--bg);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.dev-header.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.dev-header .title-center {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.1px;
  flex: 1;
  text-align: center;
  padding: 0 8px;
}

/* Meta (día X de 7 + fecha) */
.dev-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dev-meta .tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--terra-deep);
  font-weight: 500;
  background: var(--terra-bg);
  padding: 4px 10px;
  border-radius: 100px;
}

.dev-meta .date {
  font-size: 12px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
}

/* Título */
.dev-title {
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.1;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.8px;
  margin-bottom: 18px;
}

@media (min-width: 480px) { .dev-title { font-size: 34px; } }

/* Epígrafe */
.epigraph {
  margin: 18px 0 22px;
  padding: 0 16px;
  border-left: 2px solid var(--terra);
}

.epigraph .text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.epigraph .author {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
}

.epigraph .author::before { content: '— '; }

/* Gancho / hook */
.dev-hook {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 22px;
  font-weight: 500;
}

/* Cuerpo */
.dev-body {
  font-family: var(--sans);
  font-size: var(--body-size);
  line-height: 1.8;
  color: var(--ink);
}

.dev-body p { margin-bottom: 16px; }

/* Drop cap — capitular en el primer párrafo */
.dev-body .drop-cap::first-letter {
  font-family: var(--display);
  font-size: 56px;
  float: left;
  line-height: 0.85;
  margin: 6px 8px 0 0;
  color: var(--terra);
  font-weight: 600;
}

/* Separador de sección (II · Versículo) */
.section-roman {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 28px 0 14px;
}

.section-roman .roman {
  font-family: var(--display);
  font-style: italic;
  font-size: 22px;
  color: var(--terra);
  font-weight: 500;
  line-height: 1;
}

.section-roman .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink-mute);
  font-weight: 500;
}

.section-roman::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Pull quote */
.pull-quote {
  margin: 28px -4px;
  padding: 8px 0;
  text-align: center;
}

.pull-quote .text {
  font-family: var(--display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.3px;
}

.pull-quote .text::before,
.pull-quote .text::after {
  content: '';
  display: block;
  width: 30px; height: 1px;
  background: var(--terra);
  margin: 0 auto;
}

.pull-quote .text::before { margin-bottom: 16px; }
.pull-quote .text::after  { margin-top: 16px; }

/* Versículo en bloque */
.verse {
  background: var(--bg-warm);
  border-radius: var(--r-lg);
  padding: 24px 24px 22px;
  margin: 26px 0;
  position: relative;
}

.verse::before {
  content: '"';
  position: absolute;
  top: -10px; left: 18px;
  font-family: var(--display);
  font-size: 80px;
  color: var(--terra);
  line-height: 1;
  font-weight: 600;
}

.verse-text {
  font-family: var(--display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  margin: 14px 0;
  font-weight: 500;
}

.verse-ref {
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--terra-deep);
  font-weight: 500;
}

/* Versículos secundarios (más compactos) */
.verse-secondary {
  border-left: 2px solid var(--terra-soft);
  padding: 8px 0 8px 16px;
  margin: 18px 0;
}

.verse-secondary .verse-text {
  font-size: 15px;
  margin: 0 0 8px;
}

/* Asterism */
.asterism {
  text-align: center;
  margin: 32px 0;
  color: var(--terra);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 12px;
  padding-left: 12px;
}

/* Aplicación */
.application {
  border-left: 2px solid var(--terra);
  padding: 6px 0 6px 18px;
  margin: 24px 0;
}

.application .label {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  color: var(--terra-deep);
  font-weight: 500;
  margin-bottom: 8px;
}

.application .text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
}

/* Cierre + sello */
.closing {
  text-align: center;
  margin: 32px 0 24px;
}

.closing .text {
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 20px;
  font-weight: 500;
}

.seal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--terra);
  border-radius: 100px;
  color: var(--terra);
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  font-weight: 500;
}

.seal-dot {
  width: 5px; height: 5px;
  background: var(--terra);
  border-radius: 50%;
}

/* ============================================================
   BARRA FLOTANTE DE LECTURA
   ============================================================ */

.reader-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  border-radius: 100px;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px -8px rgba(40, 30, 20, 0.38);
  z-index: 20;
  max-width: calc(100vw - 40px);
  transition: opacity 0.3s ease;
}

.toolbar-time {
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  white-space: nowrap;
}

.toolbar-divider {
  width: 1px; height: 16px;
  background: rgba(255,255,255,0.15);
}

.toolbar-icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.toolbar-icon-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ============================================================
   404 / NOT FOUND
   ============================================================ */

.page-404 {
  text-align: center;
  padding: 80px 24px;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-404 .deco {
  font-family: var(--display);
  color: var(--terra);
  font-size: 14px;
  letter-spacing: 12px;
  padding-left: 12px;
  margin-bottom: 28px;
}

.page-404 h1 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.4px;
  margin-bottom: 12px;
  line-height: 1.2;
}

.page-404 p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--terra-deep);
  line-height: 1.55;
  margin-bottom: 28px;
}

.btn-terra {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--terra);
  color: #fff;
  padding: 10px 22px;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--transition);
}

.btn-terra:hover { opacity: 0.88; }

/* ============================================================
   RESPONSIVO — desktop amplía márgenes
   ============================================================ */

@media (min-width: 600px) {
  .scroll-area { padding: 8px 32px 100px; }
  .dev-header { padding: 14px 32px; }
  .app-header { padding: 14px 32px; }
  .greeting .big { font-size: 30px; }
  .dev-title { font-size: 36px; }
  .dev-hook { font-size: 20px; }
}

/* ============================================================
   APLAUSOS (estilo Medium, máx 50 por sesión)
   ============================================================ */

.clap-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 0 20px;
  margin-top: 8px;
}

.clap-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1.5px solid var(--terra);
  background: transparent;
  color: var(--terra);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.12s ease;
  position: relative;
  font-family: var(--display);
}

.clap-btn:hover:not(.maxed) {
  background: var(--terra-bg);
}

.clap-btn:active:not(.maxed) {
  transform: scale(0.92);
}

.clap-btn.maxed {
  border-color: var(--terra-soft);
  color: var(--terra-soft);
  cursor: default;
}

.clap-btn.bump {
  animation: clap-bump 0.22s ease;
}

@keyframes clap-bump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.clap-count {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.clap-label {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-mute);
  font-weight: 500;
}

/* ----------------------------------------------------------------
   REACCIONES — 3 pills inline (👏 N | ❤️ N | ⭐ N)
   ---------------------------------------------------------------- */
.reaccion-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.reaccion-btn:hover:not(.maxed) {
  background: var(--line-soft);
  color: var(--ink-soft);
}

.reaccion-btn.reacted       { color: var(--terra); }
.reaccion-btn.reacted:hover { color: var(--terra); }

.reaccion-btn.maxed {
  opacity: 0.45;
  cursor: default;
}

.reaccion-btn.bump { animation: reaccion-bump 0.2s ease; }

@keyframes reaccion-bump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.reaccion-count { line-height: 1; }

/* Navegador semanal al pie del devocional */
.week-nav-bottom {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 80px;
}

.week-nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-mute);
  font-weight: 500;
}

.week-nav-link {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: var(--terra);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}

.day-cell.current {
  background: var(--terra);
}
.day-cell.current .dow { color: rgba(255,255,255,0.65); }
.day-cell.current .num { color: #fff; }

/* ============================================================
   TOAST DE COPIA
   ============================================================ */

.copy-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  z-index: 50;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   PÁGINA DE SERIE (/serie/{slug})
   ============================================================ */

.serie-page-meta {
  text-align: center;
  padding: 16px 0 24px;
}

.serie-page-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--terra);
  color: #fff;
  font-family: var(--display);
  font-style: italic;
  font-size: 28px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.serie-page-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--terra-deep);
  font-weight: 500;
  margin-bottom: 10px;
}

.serie-page-title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 12px;
}

.serie-page-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--terra-deep);
  line-height: 1.55;
  margin-bottom: 12px;
}

.serie-page-dates {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.serie-page-dates .sep { color: var(--terra); }

.serie-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.serie-progress-bar {
  flex: 1;
  height: 3px;
  background: var(--line);
  border-radius: 100px;
  overflow: hidden;
}

.serie-progress-fill {
  height: 100%;
  background: var(--terra);
  border-radius: 100px;
  transition: width 0.5s ease;
}

.serie-progress-label {
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 500;
  white-space: nowrap;
}

.serie-days-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.serie-day-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  transition: opacity var(--transition);
}

a.serie-day-item:hover { opacity: 0.78; }

.serie-day-item.locked {
  opacity: 0.45;
}

.serie-day-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-warm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--terra);
}

.serie-day-item.read .serie-day-num  { background: var(--terra-bg); }
.serie-day-item.today .serie-day-num { background: var(--terra); color: #fff; }

.num-text {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
}

.dot-today {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
}

.serie-day-info { flex: 1; min-width: 0; }

.serie-day-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: 2px;
}

.serie-day-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.locked-text { color: var(--ink-mute); font-style: italic; }

.serie-day-arrow { color: var(--ink-soft); flex-shrink: 0; }
.serie-day-lock  { color: var(--ink-mute); flex-shrink: 0; }

/* ============================================================
   PÁGINA DE ARCHIVO (/archivo)
   ============================================================ */

.archivo-heading {
  margin: 4px 0 22px;
}

.archivo-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.6px;
  margin-bottom: 4px;
}

.archivo-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--terra-deep);
}

/* Buscador */
.search-form { margin-bottom: 16px; }

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--ink-mute);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 40px 11px 40px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--bg-elevated);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.search-input:focus { border-color: var(--terra); }
.search-input::placeholder { color: var(--ink-mute); }

.search-clear {
  position: absolute;
  right: 14px;
  color: var(--ink-mute);
  text-decoration: none;
  display: flex;
  align-items: center;
}

/* Tags */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tag-chip {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.tag-chip:hover { border-color: var(--terra-soft); color: var(--terra); }

.tag-chip.active {
  background: var(--terra);
  border-color: var(--terra);
  color: #fff;
}

/* Conteo y agrupación */
.archivo-count {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: 20px;
}

.archivo-month { margin-bottom: 24px; }

.archivo-month-label {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: var(--terra-deep);
  font-weight: 500;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.archive-serie {
  font-style: italic;
  color: var(--ink-mute);
}

/* Empty state del archivo */
.archivo-empty {
  text-align: center;
  padding: 60px 0 40px;
}

.archivo-empty .deco {
  font-family: var(--display);
  color: var(--terra);
  font-size: 14px;
  letter-spacing: 8px;
  margin-bottom: 16px;
}

.archivo-empty p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--terra-deep);
  margin-bottom: 18px;
}

/* Paginación */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 0 16px;
}

.page-btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--terra);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--terra-soft);
  border-radius: 100px;
  transition: background var(--transition), color var(--transition);
}

.page-btn:hover { background: var(--terra-bg); }

.page-info {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-mute);
}

/* ============================================================
   PÁGINA SOBRE (/sobre)
   ============================================================ */

.sobre-intro {
  text-align: center;
  padding: 24px 0 28px;
}

.sobre-sello {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--terra);
  border-radius: 100px;
  color: var(--terra);
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.sobre-title {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}

.sobre-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--terra-deep);
}

.sobre-body {
  font-size: var(--body-size);
  line-height: 1.82;
  color: var(--ink);
  margin-bottom: 32px;
}

.sobre-body p {
  font-family: var(--serif);
  margin-bottom: 18px;
}

.sobre-body a {
  color: var(--terra);
  text-decoration: none;
  border-bottom: 1px solid var(--terra-soft);
}

.sobre-body a:hover { border-color: var(--terra); }

.sobre-quote {
  background: var(--bg-warm);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin: 24px 0;
  text-align: center;
}

.sobre-quote p {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}

.sobre-section {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.3px;
  margin: 28px 0 12px;
}

.sobre-foto-wrap {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--terra-soft);
  margin: 0 auto 20px;
}

.sobre-foto {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sobre-iglesia {
  background: var(--bg-warm);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 0 0 18px;
}

.sobre-iglesia-nombre {
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 6px;
}

.sobre-iglesia-dir,
.sobre-iglesia-hrs {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.sobre-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.sobre-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--terra);
  text-decoration: none;
  transition: opacity var(--transition);
}

.sobre-link:hover { opacity: 0.75; }

.sobre-asterism {
  text-align: center;
  color: var(--terra);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 12px;
  padding-left: 12px;
  margin: 28px 0;
}

/* ============================================================
   NAV GENÉRICO DE PÁGINAS INTERIORES
   ============================================================ */

.page-nav-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 60px;
}

.nav-link-soft {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  color: var(--terra);
  text-decoration: none;
  transition: opacity var(--transition);
}

.nav-link-soft:hover { opacity: 0.75; }

/* ============================================================
   NAV BOTTOM DEL HOME (archivo + sobre)
   ============================================================ */

.home-nav-bottom {
  display: flex;
  gap: 8px;
  padding: 4px 0 40px;
}

.home-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: opacity var(--transition);
}

.home-nav-item:hover { opacity: 0.78; }

/* ============================================================
   BOTTOM SHEET PREFERENCIAS
   ============================================================ */

.prefs-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 37, 32, 0.45);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.prefs-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.prefs-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 560px;
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  padding: 12px 24px 40px;
  z-index: 100;
  box-shadow: 0 -8px 32px rgba(42, 37, 32, 0.14);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

.prefs-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.prefs-handle {
  width: 36px; height: 4px;
  background: var(--line);
  border-radius: 100px;
  margin: 0 auto 20px;
}

.prefs-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.3px;
  margin-bottom: 24px;
}

.prefs-group { margin-bottom: 24px; }

.prefs-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: 12px;
}

.prefs-options {
  display: flex;
  gap: 8px;
}

.prefs-opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: transparent;
  cursor: pointer;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color var(--transition), background var(--transition);
}

.prefs-opt small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-mute);
}

.prefs-opt:hover { border-color: var(--terra-soft); }

.prefs-opt.active {
  border-color: var(--terra);
  background: var(--terra-bg);
}

.prefs-opt.active small { color: var(--terra-deep); }

/* Swatches de tema */
.theme-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
}

.theme-swatch.light { background: #FBFAF7; }
.theme-swatch.sepia { background: #F5EFE3; }
.theme-swatch.dark  { background: #1A1714; }

.prefs-close {
  width: 100%;
  padding: 13px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
}

.prefs-close:hover { opacity: 0.88; }

/* ============================================================
   RESPONSIVO — desktop amplía márgenes
   ============================================================ */

@media (min-width: 600px) {
  .scroll-area { padding: 8px 32px 100px; }
  .dev-header { padding: 14px 32px; }
  .app-header { padding: 14px 32px; }
  .greeting .big { font-size: 30px; }
  .dev-title { font-size: 36px; }
  .dev-hook { font-size: 20px; }
}

/* ============================================================
   COMENTARIOS
   ============================================================ */

.comments-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.comments-header { margin-bottom: 20px; }

.comments-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.comments-empty {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-mute);
  margin-bottom: 24px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 28px;
}

.comment {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.comment:last-child { border-bottom: none; }

.avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-initial {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--terra-soft);
  color: var(--terra-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-initial.avatar-pastor { background: var(--terra); color: #fff; }

.avatar-img.avatar-sm,
.avatar-initial.avatar-sm { width: 26px; height: 26px; font-size: 11px; }

.comment-body { min-width: 0; }

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.comment-autor {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.comment-autor-pastor { color: var(--terra); }

.comment-pastor-badge {
  display: inline-block;
  padding: 1px 6px;
  background: var(--terra-bg);
  color: var(--terra-deep);
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-left: 2px;
  vertical-align: middle;
}

.comment-tiempo {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-mute);
}

.comment-text {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 8px;
  word-break: break-word;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-like-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 3px 6px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  transition: background var(--transition), color var(--transition);
}

.comment-like-btn:hover,
.comment-like-btn.liked { background: var(--terra-bg); color: var(--terra); }

.comment-like-btn.liked svg { fill: var(--terra); stroke: var(--terra); }

.comment-reply-btn {
  background: none;
  border: none;
  padding: 3px 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  transition: color var(--transition);
}

.comment-reply-btn:hover { color: var(--ink-soft); }

.comment-report-btn {
  background: none;
  border: none;
  padding: 3px 4px;
  cursor: pointer;
  color: var(--ink-mute);
  opacity: 0.5;
  transition: opacity var(--transition);
  margin-left: auto;
}

.comment-report-btn:hover { opacity: 1; }

.comment-replies {
  margin-top: 8px;
  padding-left: 14px;
  border-left: 2px solid var(--line-soft);
}

.reply-item { padding: 10px 0; border-bottom: none; }
.reply-item:last-child { padding-bottom: 0; }

.reply-form {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-warm);
  border-radius: var(--r-md);
}

.reply-name-input,
.reply-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  resize: vertical;
  margin-bottom: 8px;
  transition: border-color var(--transition);
}

.reply-name-input:focus,
.reply-textarea:focus { border-color: var(--terra-soft); }

.reply-form-actions { display: flex; gap: 8px; justify-content: flex-end; }

.reply-cancel-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mute);
  padding: 6px 12px;
}

.reply-submit-btn {
  background: var(--terra);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 6px 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
}

.reply-submit-btn:hover { opacity: 0.88; }
.reply-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.comment-new-form {
  padding: 20px;
  background: var(--bg-warm);
  border-radius: var(--r-lg);
  margin-top: 8px;
}

.comment-form-header { margin-bottom: 10px; }

.comment-form-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.comment-form-name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.comment-logout-btn {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: background var(--transition);
}

.comment-logout-btn:hover { background: var(--line-soft); }

.comment-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition);
}

.comment-input:focus { border-color: var(--terra-soft); }

.comment-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  resize: vertical;
  line-height: 1.6;
  transition: border-color var(--transition);
  margin-top: 2px;
}

.comment-textarea:focus { border-color: var(--terra-soft); }

.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
  flex-wrap: wrap;
}

.comment-google-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.comment-google-btn:hover { border-color: var(--terra-soft); color: var(--terra); }

.comment-submit-btn {
  background: var(--terra);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 9px 22px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
  margin-left: auto;
}

.comment-submit-btn:hover { opacity: 0.88; }
.comment-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.comment-disclaimer {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 10px;
}

.comment-feedback {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
}

.comment-feedback.ok    { background: #D1FAE5; color: #065F46; }
.comment-feedback.error { background: #FEE2E2; color: #991B1B; }

/* ============================================================
   STATS BAR — reemplaza clap-section
   ============================================================ */

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  margin: 8px 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

/* Item stat genérico (vistas, comentarios) */
.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: transparent;
  cursor: default;
  white-space: nowrap;
}

a.stat-item { cursor: pointer; }
a.stat-item:hover { background: var(--line-soft); color: var(--ink-soft); }


/* Botones de acción (guardar, compartir) */
.stat-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.stat-action-btn:hover { background: var(--line-soft); color: var(--ink-soft); }

.stat-action-btn.active svg {
  stroke: var(--terra);
  fill: var(--terra-bg);
}

/* ============================================================
   BOOKMARK (referencia legacy para toolbar si queda en otro lugar)
   ============================================================ */

.toolbar-icon-btn.active svg {
  stroke: var(--terra);
  fill: var(--terra-bg);
}

/* ============================================================
   PANEL GUARDADOS (bottom sheet)
   ============================================================ */

.saved-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 37, 32, 0.45);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.saved-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.saved-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 560px;
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  padding: 12px 24px 40px;
  z-index: 100;
  box-shadow: 0 -8px 32px rgba(42, 37, 32, 0.14);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.saved-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.saved-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.saved-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--line-soft);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}

.saved-close:hover { background: var(--line); }

.saved-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.saved-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  transition: background var(--transition);
}

.saved-item:hover { background: var(--bg-warm); }

.saved-item-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

.saved-item-meta {
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.saved-empty {
  padding: 40px 0;
  text-align: center;
  flex-shrink: 0;
}

.saved-empty p {
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.saved-empty small {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
}

/* ============================================================
   BANNER PWA INSTALAR
   ============================================================ */

.pwa-banner {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 80;
  box-shadow: 0 -4px 20px rgba(40,30,20,0.22);
}

.pwa-banner[hidden] { display: none; }

.pwa-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.pwa-banner-text strong {
  font-size: 14px;
  font-weight: 600;
}

.pwa-banner-text span {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install-btn {
  background: var(--terra);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 8px 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  white-space: nowrap;
}

.pwa-install-btn:hover { opacity: 0.88; }

.pwa-dismiss-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  line-height: 1;
  transition: color var(--transition);
}

.pwa-dismiss-btn:hover { color: #fff; }

/* ============================================================
   CONTADOR DE LECTORES HOY
   ============================================================ */

.readers-today {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.2px;
}

.readers-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--terra);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--terra-bg);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px var(--terra-bg); }
  50%       { box-shadow: 0 0 0 5px var(--terra-bg); }
}

/* ============================================================
   HOME — CTA LOGIN
   ============================================================ */

.greeting-login-cta {
  margin-top: 14px;
}

.google-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 5px 10px 5px 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.google-chip:hover {
  border-color: var(--terra-soft);
  color: var(--terra);
}

/* ============================================================
   AVATARES DE LECTORES (tarjeta hero en home)
   ============================================================ */
.card-readers {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.reader-avatars {
  display: flex;
  align-items: center;
}

.reader-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--crema, #f5f0e8);
  object-fit: cover;
  margin-left: -6px;
  background: var(--bg-elevated);
}

.reader-avatars .reader-avatar:first-child {
  margin-left: 0;
}

.reader-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--terra);
}

.readers-count {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
}

/* ============================================================
   DESTACADOS — colores de resaltado
   ============================================================ */
.hl-amarillo {
  background: linear-gradient(
    104deg,
    transparent 0.9%,
    rgba(255, 214, 0, 0.5) 2.4%,
    rgba(255, 214, 0, 0.42) 97.8%,
    transparent 99%
  );
  border-radius: 2px;
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hl-verde {
  background: linear-gradient(
    104deg,
    transparent 0.9%,
    rgba(100, 190, 110, 0.45) 2.4%,
    rgba(100, 190, 110, 0.38) 97.8%,
    transparent 99%
  );
  border-radius: 2px;
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hl-rosa {
  background: linear-gradient(
    104deg,
    transparent 0.9%,
    rgba(255, 130, 150, 0.45) 2.4%,
    rgba(255, 130, 150, 0.38) 97.8%,
    transparent 99%
  );
  border-radius: 2px;
  padding: 0 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ============================================================
   TOOLBAR DE DESTACADOS (integrado en reader-toolbar)
   ============================================================ */
.toolbar-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-panel--highlight {
  display: none;
  gap: 8px;
}

.toolbar-hl-cancel {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.toolbar-hl-cancel:hover { background: rgba(255,255,255,0.22); }

.hl-color-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.15s, border-color 0.15s;
}

.hl-color-btn:hover,
.hl-color-btn.active {
  transform: scale(1.2);
  border-color: rgba(255,255,255,0.7);
}

.hl-color-btn[data-color="amarillo"] { background: rgba(255, 214, 0, 0.9); }
.hl-color-btn[data-color="verde"]    { background: rgba(100, 190, 110, 0.9); }
.hl-color-btn[data-color="rosa"]     { background: rgba(255, 130, 150, 0.9); }

.hl-save-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.hl-save-btn:hover { opacity: 0.85; }

/* ============================================================
   TABS DEL DRAWER (Mi biblioteca)
   ============================================================ */
.saved-tabs {
  display: flex;
  border-bottom: 1px solid var(--line, #e0d8d0);
  margin: 0 -20px 0;
  padding: 0 20px;
}

.saved-tab {
  flex: 1;
  padding: 10px 0;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
  margin-bottom: -1px;
}

.saved-tab.active {
  color: var(--terra, #8b4513);
  border-bottom-color: var(--terra, #8b4513);
}

.saved-panel {
  padding-top: 8px;
}

/* Ítem de destacado en el drawer */
.destacado-group {
  margin-bottom: 16px;
}

.destacado-group-title {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.destacado-item {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-family: var(--serif-body, Georgia, serif);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
  color: var(--ink);
  transition: opacity 0.15s;
}

.destacado-item:hover { opacity: 0.75; }
.destacado-item.hl-amarillo { border-left: 3px solid rgba(255,214,0,0.8); }
.destacado-item.hl-verde    { border-left: 3px solid rgba(100,190,110,0.8); }
.destacado-item.hl-rosa     { border-left: 3px solid rgba(255,130,150,0.8); }

/* ============================================================
   DARK MODE — ELEMENTOS INVERTIDOS
   (fondo var(--ink) pasa a crema: invertir colores de texto)
   ============================================================ */

/* Hero card */
[data-theme="dark"] .card-hero          { color: rgba(0,0,0,0.85); }
[data-theme="dark"] .card-hero .h-title { color: rgba(0,0,0,0.85); }
[data-theme="dark"] .card-hero .h-meta  { color: rgba(0,0,0,0.55); }
[data-theme="dark"] .card-hero .read-btn { color: #2A2520; }

/* Calendario — día de hoy */
[data-theme="dark"] .day-cell.today .dow { color: rgba(0,0,0,0.55); }
[data-theme="dark"] .day-cell.today .num { color: rgba(0,0,0,0.85); }

/* Copy toast */
[data-theme="dark"] .copy-toast { color: rgba(0,0,0,0.85); }

/* Barra lectora */
[data-theme="dark"] .toolbar-time { color: rgba(0,0,0,0.65); }
[data-theme="dark"] .toolbar-divider { background: rgba(0,0,0,0.15); }
[data-theme="dark"] .toolbar-icon-btn { color: rgba(0,0,0,0.6); }
[data-theme="dark"] .toolbar-icon-btn:hover { background: rgba(0,0,0,0.08); color: rgba(0,0,0,0.85); }

/* Panel de destacados */
[data-theme="dark"] .toolbar-hl-cancel { background: rgba(0,0,0,0.1); color: rgba(0,0,0,0.6); }
[data-theme="dark"] .toolbar-hl-cancel:hover { background: rgba(0,0,0,0.18); }
[data-theme="dark"] .hl-color-btn:hover,
[data-theme="dark"] .hl-color-btn.active { border-color: rgba(0,0,0,0.5); }
[data-theme="dark"] .hl-save-btn { color: #2A2520; }

/* Banner PWA */
[data-theme="dark"] .pwa-banner { color: rgba(0,0,0,0.85); }
[data-theme="dark"] .pwa-banner-text span { color: rgba(0,0,0,0.6); }
[data-theme="dark"] .pwa-dismiss-btn { color: rgba(0,0,0,0.55); }
[data-theme="dark"] .pwa-dismiss-btn:hover { color: rgba(0,0,0,0.85); }
