/* ============================================================
   La Verdad Histórica (LVDE) — Sistema visual en CSS puro.
   Paleta unificada con la pestaña Tienda (VERITAS):
   obsidiana / marfil / oro / grises cálidos.
   Playfair Display + Manrope, textura papel.
   ============================================================ */

:root {
  /* Paleta de marca (misma que la Tienda / VERITAS) */
  --obsidian: #0B0B0D;
  --charcoal: #151518;
  --charcoal-2: #1B1B1F;
  --ivory: #F2EDE1;
  --paper: #CDBB98;
  --gold-hex: #D4AF37;
  --gold-dark-hex: #9C7A24;

  /* Modo claro — marfil y blanco, negro obsidiana, acento dorado */
  --background: 42 33% 96%;
  --foreground: 240 8% 4%;
  --card: 0 0% 100%;
  --card-foreground: 240 8% 4%;
  --primary: 240 8% 4%;
  --primary-foreground: 42 39% 92%;
  --secondary: 42 25% 91%;
  --muted: 42 14% 90%;
  --muted-foreground: 40 6% 33%;
  --accent: 43 45% 88%;
  --border: 42 18% 82%;
  --ring: 43 62% 45%;
  --gold: 42 66% 34%;
  --gold-soft: 46 65% 52%;
  --radius: 0.75rem;

  --hero-top: hsla(42, 33%, 96%, 0.84);
  --hero-bottom: hsla(42, 33%, 96%, 0.96);
  --shadow-color: 0 0% 0%;

  --green-bg: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  --green-border: #86efac;
  --green-text: #166534;
  --red-bg: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  --red-border: #fca5a5;
  --red-text: #991b1b;
  --amber-bg: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  --amber-border: #fcd34d;
  --amber-text: #92400e;
}

[data-theme="dark"] {
  /* Modo oscuro — negro obsidiana, marfil, oro (idéntico a la Tienda) */
  --background: 240 8% 4%;
  --foreground: 42 39% 92%;
  --card: 240 7% 8%;
  --card-foreground: 42 39% 92%;
  --primary: 46 65% 52%;
  --primary-foreground: 240 8% 4%;
  --secondary: 240 7% 11%;
  --muted: 240 7% 11%;
  --muted-foreground: 40 8% 68%;
  --accent: 43 26% 15%;
  --border: 43 14% 20%;
  --ring: 46 65% 52%;
  --gold: 46 65% 52%;
  --gold-soft: 44 74% 65%;

  --hero-top: hsla(240, 8%, 4%, 0.80);
  --hero-bottom: hsla(240, 8%, 4%, 0.95);
  --shadow-color: 0 0% 0%;

  --green-bg: linear-gradient(135deg, #14331f 0%, #16432a 100%);
  --green-border: #2f6b45;
  --green-text: #bbf7d0;
  --red-bg: linear-gradient(135deg, #3a1414 0%, #4a1717 100%);
  --red-border: #7f2a2a;
  --red-text: #fecaca;
  --amber-bg: linear-gradient(135deg, #3a2c0d 0%, #4a3910 100%);
  --amber-border: #7a5e18;
  --amber-text: #fde68a;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', -apple-system, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: hsl(var(--foreground));
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }
::selection { background: hsl(var(--primary) / 0.15); color: hsl(var(--primary)); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: hsl(var(--muted)); }
::-webkit-scrollbar-thumb { background: hsl(var(--primary) / 0.4); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--primary) / 0.6); }

/* ===================== HEADER / NAV ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid hsl(var(--border));
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: hsl(var(--primary));
  white-space: nowrap;
}
.brand i { font-size: 1.05rem; color: hsl(var(--gold)); }

.main-nav { display: flex; align-items: center; gap: 0.9rem; }
.nav-link {
  position: relative;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-link:hover { color: hsl(var(--primary)); background: hsl(var(--accent)); }
.nav-link.active { color: hsl(var(--primary-foreground)); background: hsl(var(--primary)); }

/* Navegación en iconos con tooltip al pasar el ratón o enfocar con teclado */
.main-nav .nav-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; padding: 0; font-size: 1.05rem;
}
.main-nav .nav-link::after {
  content: attr(data-tooltip);
  position: absolute; top: calc(100% + 0.5rem); left: 50%;
  transform: translate(-50%, -4px);
  padding: 0.3rem 0.65rem; border-radius: 0.5rem;
  background: hsl(var(--foreground)); color: hsl(var(--background));
  font-size: 0.78rem; font-weight: 500; line-height: 1.2; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease; z-index: 60;
}
.main-nav .nav-link:hover::after,
.main-nav .nav-link:focus-visible::after {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card) / 0.8);
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.icon-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); background: hsl(var(--accent)); }
.icon-btn:active { transform: scale(0.94); }

.mobile-menu-toggle { display: none; }

/* ===================== MOBILE NAV ===================== */
.mobile-overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(0,0,0,0.4);
  opacity: 0; visibility: hidden; transition: opacity 0.25s ease;
}
.mobile-overlay.open { opacity: 1; visibility: visible; }

.mobile-nav {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 56;
  width: 300px; max-width: 85vw;
  background: hsl(var(--background));
  border-left: 1px solid hsl(var(--border));
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.35rem;
  box-shadow: -20px 0 40px rgba(0,0,0,0.12);
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
}
.mobile-nav-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.75rem 0.85rem; border-radius: var(--radius);
  font-weight: 500; color: hsl(var(--foreground));
  transition: background-color 0.2s ease, color 0.2s ease;
}
.mobile-nav-link:hover, .mobile-nav-link.active {
  background: hsl(var(--accent)); color: hsl(var(--primary));
}
.mobile-nav-link i { width: 20px; text-align: center; color: hsl(var(--gold)); }
.mobile-nav-divider { height: 1px; background: hsl(var(--border)); margin: 0.5rem 0; }

/* ===================== LAYOUT ===================== */
.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section-pad { padding: 3.5rem 0; }

/* ===================== FONDO ILUSTRADO — PÁGINAS CON EL ESTILO "MAPA ANTIGUO" ===================== */
/* Mapa antiguo + columnata clásica + libros: fondo fijo de toda la página
   (cabecera de la sección, banners de publicidad y contenido), no solo un
   recuadro. Ahora se aplica a todas las páginas del sitio (antes solo a
   Verificador/inicio, Comunidad, Planes y Aviso legal). */
body {
  background-image:
    linear-gradient(to bottom, hsla(42, 45%, 97%, 0.35) 0%, hsla(42, 45%, 97%, 0.55) 55%, hsl(var(--background)) 100%),
    url('assets/img/hero-bg.webp');
  background-size: 100% auto, cover;
  background-position: top center, top center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: scroll, scroll;
}
[data-theme="dark"] body {
  background-image:
    linear-gradient(to bottom, hsla(240, 8%, 4%, 0.55) 0%, hsla(240, 8%, 4%, 0.72) 55%, hsl(var(--background)) 100%),
    url('assets/img/hero-bg.webp');
}

/* ===================== HERO / VERIFICADOR ===================== */
.hero {
  position: relative;
  min-height: 62vh;
  display: flex; align-items: center; justify-content: center;
  padding: 4rem 1.5rem;
  background: transparent;
}
.hero-inner { max-width: 720px; text-align: center; }

/* ---------- Tarjeta blanca del verificador (selección + análisis IA) ---------- */
.verifier-card {
  background: transparent;
  border: 1px solid hsl(var(--border));
  border-radius: 1.5rem;
  padding: 1.75rem 1.75rem 1.5rem;
}
.verifier-card .verifier-tabs { margin-top: 0; }
.verifier-card .search-wrap { max-width: 100%; }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.hero p.lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: hsl(var(--muted-foreground));
  max-width: 560px; margin: 0 auto 2.25rem;
}

.search-wrap { position: relative; max-width: 640px; margin: 0 auto; }
textarea.query, input.query {
  width: 100%; min-height: 140px; resize: none;
  padding: 1rem 1.1rem;
  font-family: inherit; font-size: 1rem;
  background: hsl(var(--card) / 0.92); backdrop-filter: blur(6px);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  color: hsl(var(--foreground));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input.query { min-height: unset; }
textarea.query:focus, input.query:focus { outline: none; border-color: hsl(var(--primary) / 0.4); box-shadow: 0 0 0 4px hsl(var(--primary) / 0.1); }

/* ---------- Pestañas Verificador (afirmaciones / personajes) ---------- */
.verifier-tabs { display: inline-flex; gap: 0.35rem; background: hsl(var(--card) / 0.85); border: 1px solid hsl(var(--border)); border-radius: 999px; padding: 0.3rem; margin: 0 auto 1.5rem; }
.verifier-tab { display: inline-flex; align-items: center; gap: 0.5rem; border: none; background: transparent; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 0.9rem; padding: 0.55rem 1.1rem; border-radius: 999px; color: hsl(var(--muted-foreground)); transition: background-color 0.2s ease, color 0.2s ease; }
.verifier-tab.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel-lead { color: hsl(var(--muted-foreground)); font-size: 0.95rem; max-width: 560px; margin: 0 auto 1.25rem; }

/* ---------- Franja de confianza (hero del verificador) ---------- */
.trust-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.4rem;
  margin: 0 auto 1.75rem; font-size: 0.82rem; color: hsl(var(--muted-foreground)); font-weight: 500;
}
.trust-strip span { display: inline-flex; align-items: center; gap: 0.4rem; }
.trust-strip i { color: hsl(var(--gold)); }

/* ---------- Guía de 3 pasos ---------- */
.verifier-steps {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 0.5rem 0; max-width: 620px; margin: 0 auto 1.25rem;
  font-size: 0.82rem; color: hsl(var(--muted-foreground));
}
.v-step { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0 0.9rem; }
.v-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.4rem; border-radius: 50%; flex-shrink: 0;
  background: hsl(var(--primary) / 0.12); color: hsl(var(--primary));
  font-weight: 700; font-size: 0.75rem;
}
.v-step:not(:last-child)::after {
  content: "\f105"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  margin-left: 0.9rem; color: hsl(var(--border));
}
@media (max-width: 640px) {
  .verifier-steps { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .v-step:not(:last-child)::after { display: none; }
}

/* ---------- Chips de ejemplo ---------- */
.example-chips {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.5rem; max-width: 640px; margin: 0 auto 1rem;
}
.example-chips-label { font-size: 0.8rem; color: hsl(var(--muted-foreground)); margin-right: 0.15rem; }
.example-chip {
  font-family: inherit; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  padding: 0.4rem 0.85rem; border-radius: 999px;
  background: hsl(var(--card) / 0.85); border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground)); transition: border-color 0.15s ease, transform 0.15s ease;
}
.example-chip:hover { border-color: hsl(var(--primary) / 0.5); transform: translateY(-1px); }

/* ---------- Contador de caracteres ---------- */
.query-counter {
  display: block; text-align: right; margin-top: 0.4rem;
  font-size: 0.75rem; color: hsl(var(--muted-foreground));
}
.query-counter.ok { color: hsl(var(--gold)); }

/* ---------- Estado vacío del verificador ---------- */
.verifier-empty-state {
  text-align: center; max-width: 420px; margin: 2rem auto; padding: 1.5rem 1rem;
  color: hsl(var(--muted-foreground));
}
.verifier-empty-state i { font-size: 1.8rem; color: hsl(var(--border)); margin-bottom: 0.75rem; display: block; }
.verifier-empty-state p { font-size: 0.9rem; line-height: 1.6; }

.verifier-auth-gate {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.6rem 0.9rem;
  max-width: 640px; margin: 0 auto 1.5rem;
  padding: 0.75rem 1.1rem;
  background: hsl(var(--accent) / 0.6);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: hsl(var(--foreground));
}
.verifier-auth-gate i.fa-lock { color: hsl(var(--gold)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: none; cursor: pointer; font-family: inherit; font-weight: 600;
  border-radius: var(--radius);
  transition: transform 0.12s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  padding: 0.9rem 2rem; font-size: 1.05rem; margin-top: 1.25rem;
  box-shadow: 0 8px 22px hsl(var(--primary) / 0.25);
}
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===================== RESULTS ===================== */
.results { max-width: 1000px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.results > * + * { margin-top: 2.5rem; }

.verdict-card {
  border: 2px solid; border-radius: var(--radius);
  padding: 1.5rem; display: flex; gap: 1rem; align-items: flex-start;
}
.verdict-card i.big { font-size: 2rem; flex-shrink: 0; margin-top: 0.15rem; }
.verdict-desmentido { background: var(--green-bg); border-color: var(--green-border); color: var(--green-text); }
.verdict-confirmado { background: var(--red-bg); border-color: var(--red-border); color: var(--red-text); }
.verdict-parcialmente_cierto { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-text); }
.verdict-no_concluyente { background: var(--muted-bg, #f3f4f6); border-color: var(--border, #d1d5db); color: var(--foreground, #374151); }

.badge {
  display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; border: 1px solid;
}
.badge-desmentido { background: #dcfce7; color: #166534; border-color: #86efac; }
.badge-confirmado { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.badge-parcialmente_cierto { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.verdict-card p { margin-top: 0.75rem; font-size: 0.95rem; opacity: 0.92; }

.section-title { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.section-title i { color: hsl(var(--gold)); font-size: 1.3rem; }
.section-title h2 { font-size: 1.6rem; font-weight: 600; }
.section-sub { color: hsl(var(--muted-foreground)); margin-bottom: 1.5rem; }

.sources-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.source-card {
  background: hsl(var(--card) / 0.75); backdrop-filter: blur(6px);
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.source-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,0.08); }
.source-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.source-type { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; padding: 0.15rem 0.55rem; border: 1px solid hsl(var(--border)); border-radius: 999px; color: hsl(var(--muted-foreground)); }
.source-type i { color: hsl(var(--gold)); }
.source-year { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.source-card h4 { font-family: 'Playfair Display', serif; font-size: 1.05rem; margin-bottom: 0.2rem; }
.source-author { font-size: 0.85rem; font-weight: 600; color: hsl(var(--primary) / 0.85); margin-bottom: 0.5rem; }
.source-desc { font-size: 0.85rem; color: hsl(var(--muted-foreground)); }
.source-link { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.75rem; font-size: 0.75rem; color: hsl(var(--primary)); }
.source-link:hover { text-decoration: underline; }

.bento-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
.empire-card {
  background: hsl(var(--card) / 0.65); backdrop-filter: blur(6px);
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: 1.1rem;
}
.empire-card .head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.empire-card .head .flag { font-size: 1.5rem; }
.empire-card .head h3 { font-size: 1.2rem; }
.empire-source { padding: 0.75rem; border-radius: 0.5rem; background: hsl(var(--muted) / 0.6); border: 1px solid hsl(var(--border)); }
.empire-source + .empire-source { margin-top: 0.6rem; }
.empire-source h5 { font-family: 'Manrope', sans-serif; font-size: 0.9rem; font-weight: 600; }
.empire-source small { color: hsl(var(--muted-foreground)); }
.empire-source p { font-size: 0.8rem; color: hsl(var(--muted-foreground)); margin-top: 0.35rem; }

/* Loading */
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, hsl(var(--muted)) 0%, hsl(var(--background)) 50%, hsl(var(--muted)) 100%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ===================== STATIC / PLACEHOLDER PAGES ===================== */
.page-hero { text-align: center; padding: 3.5rem 1.5rem 1.5rem; }
.page-hero .eyebrow, .hero .eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: hsl(var(--gold)); background: hsl(var(--gold) / 0.12); border: 1px solid hsl(var(--gold) / 0.35); padding: 0.35rem 0.9rem; border-radius: 999px; margin-bottom: 1rem; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.75rem; }
.page-hero p { color: hsl(var(--muted-foreground)); max-width: 600px; margin: 0 auto; }

.card {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.card + .card { margin-top: 1.25rem; }
.card h2 { font-size: 1.2rem; margin-bottom: 0.6rem; color: hsl(var(--foreground)); }
.card p { color: hsl(var(--muted-foreground)); margin-bottom: 1rem; }
.card p:last-child { margin-bottom: 0; }
.narrow { max-width: 820px; }

.placeholder-note {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: hsl(var(--accent)); border: 1px dashed hsl(var(--primary) / 0.35);
  border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1.5rem;
  color: hsl(var(--primary));
}
.placeholder-note i { margin-top: 0.15rem; }
.placeholder-note span { color: hsl(var(--foreground)); font-size: 0.9rem; }

.feature-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 1.5rem; }
.feature { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 1.25rem; }
.feature .ficon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: hsl(var(--accent)); color: hsl(var(--gold)); font-size: 1.15rem; margin-bottom: 0.75rem; }
.feature h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.feature p { font-size: 0.87rem; color: hsl(var(--muted-foreground)); }

/* Aviso de acceso por plan para el Motor de Batallas */
.battle-access-lock { margin: 1rem 0 1.5rem; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: linear-gradient(135deg, hsl(var(--card)), hsl(var(--muted) / .55)); text-align: center; }
.battle-access-lock .battle-lock-icon { width: 54px; height: 54px; margin: 0 auto 1rem; border-radius: 16px; display: grid; place-items: center; background: hsl(var(--gold) / .16); color: hsl(var(--gold)); font-size: 1.4rem; }
.battle-access-lock h2 { margin: 0 0 .6rem; font-family: 'Playfair Display', serif; }
.battle-access-lock p { max-width: 620px; margin: 0 auto 1rem; color: hsl(var(--muted-foreground)); }
.battle-access-lock .battle-lock-plan { display: inline-block; margin: .25rem 0 1rem; font-weight: 700; }
.battle-access-lock .battle-lock-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .65rem; }
.battle-access-lock[hidden] { display: none !important; }

/* ---------- Motor de Batallas (módulo embebido en iframe) ---------- */
.battle-engine-wrap {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); overflow: hidden; margin-bottom: 1.75rem;
  box-shadow: 0 12px 30px rgba(20, 15, 5, 0.08);
}
.battle-engine-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1.1rem; border-bottom: 1px solid hsl(var(--border));
  font-family: 'Playfair Display', serif; font-size: 0.95rem; color: hsl(var(--foreground));
}
.battle-engine-toolbar i { color: hsl(var(--gold)); margin-right: 0.4rem; }
.battle-engine-frame { position: relative; width: 100%; height: 78vh; min-height: 560px; max-height: 820px; background: #0a0e17; }
.battle-engine-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 720px) {
  .battle-engine-frame { height: 68vh; min-height: 460px; }
  .battle-engine-toolbar { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
}

/* ---------- Tienda: presentación de la marca "VERITAS" ---------- */
.veritas-teaser {
  background: var(--obsidian);
  color: var(--ivory);
  padding: 4.5rem 1.5rem;
  text-align: center;
}
.veritas-teaser-inner { max-width: 640px; margin: 0 auto; }
.veritas-eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-hex); background: rgba(212, 175, 55, 0.1); border: 1px solid rgba(212, 175, 55, 0.35); padding: 0.35rem 0.9rem; border-radius: 999px; margin-bottom: 1.25rem; }
.veritas-wordmark { font-family: "Playfair Display", serif; font-size: clamp(2.6rem, 7vw, 4.2rem); letter-spacing: 0.14em; margin: 0; color: var(--ivory); }
.veritas-tagline { font-family: "Playfair Display", serif; font-style: italic; color: var(--gold-hex); letter-spacing: 0.05em; margin: 0.25rem 0 1.75rem; font-size: 1.05rem; }
.veritas-desc { color: rgba(242, 237, 225, 0.75); line-height: 1.7; margin-bottom: 2rem; }
.veritas-pillars { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem 2rem; margin-bottom: 2.25rem; }
.veritas-pillars > div { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: rgba(242, 237, 225, 0.85); }
.veritas-pillars i { color: var(--gold-hex); }
.veritas-cta { background: var(--gold-hex); color: var(--obsidian); box-shadow: 0 8px 22px rgba(212, 175, 55, 0.25); }
.veritas-cta:hover { background: #c9a52f; }

/* ---------- Verificador de Personajes: cronología ---------- */
.char-timeline { position: relative; margin-top: 1.25rem; padding-left: 1.75rem; }
.char-timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: hsl(var(--border)); }
.char-event { position: relative; padding-bottom: 1.5rem; }
.char-event:last-child { padding-bottom: 0; }
.char-event::before { content: ""; position: absolute; left: -1.75rem; top: 3px; width: 13px; height: 13px; border-radius: 50%; background: hsl(var(--primary)); border: 3px solid hsl(var(--background)); box-shadow: 0 0 0 2px hsl(var(--border)); }
.char-event .cyear { font-weight: 700; color: hsl(var(--primary)); font-size: 0.85rem; margin-right: 0.5rem; }
.char-event .ctype { display: inline-block; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.1rem 0.55rem; border-radius: 999px; background: hsl(var(--accent)); color: hsl(var(--primary)); }
.char-event h4 { margin: 0.3rem 0 0.3rem; font-size: 1.02rem; }
.char-event p { color: hsl(var(--muted-foreground)); font-size: 0.9rem; margin: 0; }

/* ===================== LIBROS (catálogo conectado a books.db) ===================== */
.books-toolbar { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.books-search { position: relative; flex: 1; min-width: 220px; }
.books-search i { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); font-size: 0.85rem; }
.books-search input { width: 100%; padding: 0.65rem 1rem 0.65rem 2.35rem; border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); font-family: inherit; font-size: 0.9rem; }
.books-search input:focus { outline: none; border-color: hsl(var(--primary) / 0.4); box-shadow: 0 0 0 4px hsl(var(--primary) / 0.1); }
.books-search-help { margin: -.85rem 0 1.1rem; color: hsl(var(--muted-foreground)); font-size: .78rem; line-height: 1.45; }
#books-sort-select,
#books-category-select { max-width: 100%; padding: 0.65rem 2.1rem 0.65rem 0.9rem; border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); font-family: inherit; font-size: 0.85rem; }
.books-category-filter-label { display: inline-flex; align-items: center; gap: .45rem; color: hsl(var(--muted-foreground)); }
.books-category-filter-label i { margin-left: .15rem; }
.books-category-filter-label select { min-width: min(260px, 100%); }
.books-category-error { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .9rem 1rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); color: hsl(var(--muted-foreground)); }
.books-category-error strong { color: hsl(var(--foreground)); }
.books-category-error .btn { margin-left: auto; }
.btn-sm { padding: .45rem .75rem; font-size: .78rem; }
@media (max-width: 640px) {
  .books-toolbar { align-items: stretch; }
  .books-category-filter-label { width: 100%; }
  .books-category-filter-label select { width: 100%; min-width: 0; }
  #books-sort-select { width: 100%; }
  .books-category-error .btn { margin-left: 0; }
}


/* Búsqueda semántica de libros — función del Plan Avanzado */
.books-smart-search { margin: .4rem 0 1.5rem; padding: 1.2rem; border: 1px solid hsl(var(--gold) / .42); background: linear-gradient(135deg, hsl(var(--card)), hsl(var(--gold) / .055)); box-shadow: 0 8px 26px hsl(var(--foreground) / .035); }
.books-smart-search [hidden] { display: none !important; }
.books-smart-search-head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1rem; }
.books-smart-search-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: hsl(var(--gold)); background: hsl(var(--gold) / .13); font-size: 1.05rem; }
.books-smart-search-copy { flex: 1; min-width: 0; }
.books-smart-search-eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .25rem; }
.books-smart-search-eyebrow .eyebrow { margin: 0; }
.books-smart-plan-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border: 1px solid hsl(var(--gold) / .42); border-radius: 999px; color: hsl(var(--gold)); font-size: .68rem; font-weight: 750; letter-spacing: .02em; }
.books-smart-search-copy h2 { margin: 0 0 .3rem; font-size: clamp(1.05rem, 1.5vw, 1.28rem); line-height: 1.3; }
.books-smart-search-copy p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .87rem; line-height: 1.5; }
.books-smart-search-locked { padding: .85rem 1rem; border-radius: 12px; border: 1px solid hsl(var(--border)); background: hsl(var(--background) / .64); }
.books-smart-search-locked p { margin: 0 0 .7rem; color: hsl(var(--muted-foreground)); font-size: .88rem; line-height: 1.55; }
.books-smart-search-lock-actions { display: flex; gap: .55rem; flex-wrap: wrap; }
.books-smart-search-form { display: grid; gap: .6rem; }
.books-smart-search-form label { font-size: .86rem; font-weight: 700; }
.books-smart-search-form textarea { width: 100%; resize: vertical; min-height: 82px; padding: .8rem .9rem; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .91rem; line-height: 1.55; }
.books-smart-search-form textarea:focus { outline: none; border-color: hsl(var(--gold) / .8); box-shadow: 0 0 0 3px hsl(var(--gold) / .16); }
.books-smart-search-form-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.books-smart-search-hint, .books-smart-search-char-count { color: hsl(var(--muted-foreground)); font-size: .75rem; }
.books-smart-search-submit-wrap { display: inline-flex; align-items: center; gap: .75rem; }
.books-smart-search-submit-wrap .btn { white-space: nowrap; }
.books-smart-search-privacy { margin: .15rem 0 0; color: hsl(var(--muted-foreground)); font-size: .72rem; line-height: 1.5; }
.books-smart-search-privacy i { margin-right: .25rem; color: hsl(var(--gold)); }
.books-smart-search-status { margin: .55rem 0 0; color: hsl(var(--muted-foreground)); font-size: .8rem; line-height: 1.5; }
.books-smart-search-results { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid hsl(var(--border)); }
.books-smart-search-interpretation { margin: 0 0 .8rem; font-size: .85rem; line-height: 1.55; color: hsl(var(--muted-foreground)); }
.books-smart-search-grid { display: grid; gap: .7rem; }
.books-smart-result { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: .9rem; align-items: start; padding: .75rem; border: 1px solid hsl(var(--border)); border-radius: 13px; background: hsl(var(--card)); }
.books-smart-result-cover { display: block; width: 78px; }
.books-smart-result-cover .book-cover { aspect-ratio: 2 / 3; height: auto; border-radius: 6px; overflow: hidden; background: hsl(var(--muted) / .12); }
.books-smart-result-cover .book-cover img { width: 100%; height: 100%; object-fit: cover; }
.books-smart-result-body { min-width: 0; }
.books-smart-result-match { display: inline-block; margin: 0 0 .25rem; color: hsl(var(--gold)); font-size: .67rem; font-weight: 750; text-transform: uppercase; letter-spacing: .045em; }
.books-smart-result-body .book-card-category { display: block; margin-bottom: .2rem; }
.books-smart-result-body h3 { margin: 0 0 .22rem; font-size: .97rem; line-height: 1.4; }
.books-smart-result-body h3 a { color: hsl(var(--foreground)); text-decoration: none; }
.books-smart-result-body h3 a:hover { color: hsl(var(--gold)); }
.books-smart-result-body .book-author { margin: 0 0 .45rem; font-size: .78rem; }
.books-smart-result-reason { margin: 0 0 .35rem; font-size: .82rem; line-height: 1.52; }
.books-smart-result-synopsis { margin: 0 0 .5rem; color: hsl(var(--muted-foreground)); font-size: .76rem; line-height: 1.5; }
.books-smart-result-link { display: inline-flex; gap: .35rem; align-items: center; color: hsl(var(--gold)); font-size: .78rem; font-weight: 700; text-decoration: none; }
.books-smart-result-link:hover { text-decoration: underline; }
.books-smart-no-results { display: grid; gap: .4rem; justify-items: start; padding: 1.1rem; border-radius: 10px; background: hsl(var(--muted) / .13); }
.books-smart-no-results i { color: hsl(var(--gold)); font-size: 1.1rem; }
.books-smart-no-results span { color: hsl(var(--muted-foreground)); font-size: .82rem; line-height: 1.5; }
@media (max-width: 560px) {
  .books-smart-search { padding: .9rem; }
  .books-smart-search-head { gap: .65rem; }
  .books-smart-search-icon { flex-basis: 38px; width: 38px; height: 38px; border-radius: 10px; }
  .books-smart-search-form-actions { align-items: stretch; }
  .books-smart-search-submit-wrap { justify-content: space-between; width: 100%; }
  .books-smart-search-submit-wrap .btn { flex: 1; }
  .books-smart-result { grid-template-columns: 65px minmax(0, 1fr); gap: .65rem; padding: .6rem; }
  .books-smart-result-cover { width: 65px; }
}

.books-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 1rem; }
.book-card-skeleton { height: 320px; border-radius: var(--radius); }
.books-empty { text-align: center; color: hsl(var(--muted-foreground)); padding: 2.5rem 1rem; }

.book-card {
  position: relative; display: flex; flex-direction: column;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.book-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,0.08); border-color: hsl(var(--gold) / 0.4); }
.book-cover { aspect-ratio: 2 / 3; background: hsl(var(--muted)); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover-fallback { color: hsl(var(--muted-foreground)); font-size: 2rem; }
.book-card-body { padding: 0.85rem 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.book-title { font-size: 0.92rem; line-height: 1.3; font-weight: 600; color: hsl(var(--foreground)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { font-size: 0.78rem; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-price { margin-top: auto; padding-top: 0.4rem; font-family: 'Playfair Display', serif; }
.price-now { font-size: 1.05rem; color: hsl(var(--primary)); font-weight: 600; }
.price-old { font-size: 0.8rem; color: hsl(var(--muted-foreground)); text-decoration: line-through; margin-right: 0.4rem; font-family: 'Manrope', sans-serif; }
.book-badge { position: absolute; top: 0.6rem; left: 0.6rem; z-index: 1; font-size: 0.68rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.book-badge-discount { background: hsl(var(--gold)); color: hsl(var(--primary-foreground)); }
.book-badge-out { background: hsl(0 0% 40%); color: #fff; }
.book-badge-order { background: hsl(210 15% 88%); color: hsl(210 15% 25%); }

/* Ficha de producto (detalle de libro) */
.back-link { display: inline-flex; align-items: center; gap: 0.5rem; color: hsl(var(--muted-foreground)); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
.back-link:hover { color: hsl(var(--primary)); }
.book-detail { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 2rem; margin: 1.5rem 0 2rem; }
.book-detail-cover { border-radius: var(--radius); overflow: hidden; background: hsl(var(--muted)); aspect-ratio: 2/3; box-shadow: 0 12px 30px rgba(0,0,0,0.1); }
.book-detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-detail-info h1 { font-size: 1.7rem; margin-bottom: 0.3rem; }
.book-detail-subtitle { color: hsl(var(--muted-foreground)); font-style: italic; margin-bottom: 0.5rem; }
.book-detail-author { color: hsl(var(--muted-foreground)); margin-bottom: 0.9rem; }
.book-detail-price { display: flex; align-items: baseline; gap: 0.6rem; font-family: 'Playfair Display', serif; font-size: 1.6rem; margin-bottom: 0.75rem; }
.book-detail-price .book-badge { position: static; }
.book-availability { font-size: 0.85rem; font-weight: 600; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.4rem; }
.book-availability.is-in { color: #1f8b4c; }
.book-availability.is-out { color: hsl(0 60% 45%); }
.book-availability.is-external { color: hsl(var(--muted-foreground)); }
.book-synopsis, .book-meta { margin-top: 1.25rem; }
.book-meta-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid hsl(var(--border)); font-size: 0.88rem; }
.book-meta-row:last-child { border-bottom: none; }
.book-meta-label { color: hsl(var(--muted-foreground)); }
.book-meta-value { font-weight: 600; text-align: right; }
@media (max-width: 640px) {
  .book-detail { grid-template-columns: 1fr; }
  .book-detail-cover { max-width: 220px; margin: 0 auto; }
}

/* Planes cards */
.plans-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 2rem; }
.plan { position: relative; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 1.75rem; display: flex; flex-direction: column; }
.plan.featured { border-color: hsl(var(--gold)); box-shadow: 0 12px 30px hsl(var(--gold) / 0.18); }
.plan .tag { position: absolute; top: -0.7rem; left: 50%; transform: translateX(-50%); background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 0.7rem; font-weight: 600; padding: 0.25rem 0.8rem; border-radius: 999px; }
.plan h3 { font-size: 1.3rem; margin-bottom: 0.35rem; }
.plan .price { font-family: 'Playfair Display', serif; font-size: 2.2rem; color: hsl(var(--primary)); margin: 0.5rem 0 0.25rem; }
.plan .price small { font-size: 0.85rem; color: hsl(var(--muted-foreground)); font-family: 'Manrope', sans-serif; }
.plan ul { list-style: none; margin: 1.25rem 0; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.plan li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.9rem; color: hsl(var(--foreground)); }
.plan li i { color: hsl(var(--gold)); margin-top: 0.2rem; }
.btn-outline { background: transparent; border: 1px solid hsl(var(--primary)); color: hsl(var(--primary)); padding: 0.7rem 1.25rem; }
.btn-outline:hover { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-block { width: 100%; }

/* ===================== HISTORY PANEL ===================== */
.history-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: 460px; max-width: 92vw;
  background: hsl(var(--background));
  border-left: 1px solid hsl(var(--border));
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 40px rgba(0,0,0,0.12);
}
.history-panel.open { transform: translateX(0); }
.history-head { padding: 1.5rem; border-bottom: 1px solid hsl(var(--border)); }
.history-head h2 { font-size: 1.35rem; }
.history-head p { color: hsl(var(--muted-foreground)); font-size: 0.9rem; margin-top: 0.25rem; }
.history-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.history-item { border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; cursor: pointer; transition: background-color 0.2s ease; }
.history-item:hover { background: hsl(var(--accent)); }
.history-item .q { font-size: 0.9rem; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-item .row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.history-item .date { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.link-btn { background: none; border: none; cursor: pointer; font-family: inherit; font-size: 0.8rem; color: hsl(var(--muted-foreground)); display: inline-flex; align-items: center; gap: 0.3rem; }
.link-btn:hover { color: hsl(var(--primary)); }
.link-btn.danger:hover { color: #dc2626; }
.history-empty { text-align: center; padding: 3rem 1rem; color: hsl(var(--muted-foreground)); }
.history-empty i { font-size: 2.5rem; opacity: 0.4; margin-bottom: 0.75rem; display: block; }

/* ===================== FOOTER FLOATING BAR ===================== */
.footer-bar {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  z-index: 45;
  display: flex; align-items: center; gap: 0.5rem;
  background: hsl(var(--card) / 0.9); backdrop-filter: blur(14px);
  border: 1px solid hsl(var(--border)); border-radius: 999px;
  padding: 0.4rem 0.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.footer-bar.collapsed { transform: translateX(-50%) translateY(150%); }
.footer-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500;
  color: hsl(var(--foreground)); background: transparent;
  border: none; cursor: pointer; font-family: inherit;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.footer-chip:hover { background: hsl(var(--accent)); color: hsl(var(--primary)); }
.footer-chip i { color: hsl(var(--gold)); }
.footer-toggle {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  z-index: 44; opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease;
}
.footer-toggle.show { opacity: 1; visibility: visible; }

/* ===================== COOKIE CONSENT — modal flotante ===================== */
body.cookie-dialog-open { overflow: hidden; }
/* El modal debe flotar por encima de cualquier página; no formar parte del flujo del documento. */
#cookie-modal.cookie-overlay {
  position: fixed; inset: 0; z-index: 12000;
  display: none; align-items: center; justify-content: center;
  overflow-y: auto; overscroll-behavior: contain;
  background: rgba(10, 16, 20, .72); backdrop-filter: blur(7px);
  padding: clamp(.65rem, 3vw, 1.5rem);
}
#cookie-modal.cookie-overlay.open { display: flex; }
#cookie-modal .cookie-consent-card { flex: 0 1 720px; margin: auto; }
.cookie-consent-card { max-width: 720px; width: 100%; max-height: min(92vh, 900px); overflow-y: auto; padding: 0; border: 1px solid hsl(var(--border)); border-radius: 24px; background: hsl(var(--card)); box-shadow: 0 28px 90px rgba(0,0,0,.34); }
.cookie-hero { padding: clamp(1.25rem, 4vw, 2rem) clamp(1.1rem, 4vw, 2rem) 1.35rem; background: linear-gradient(135deg, hsl(var(--primary) / .11), hsl(var(--gold) / .12)); border-bottom: 1px solid hsl(var(--border)); }
.cookie-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: hsl(var(--primary)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); box-shadow: 0 5px 18px rgba(0,0,0,.06); font-size: 1.2rem; margin-bottom: .9rem; }
.cookie-eyebrow { color: hsl(var(--primary)); font-size: .68rem; font-weight: 800; letter-spacing: .16em; margin-bottom: .35rem; }
.cookie-hero h2 { display: block; font-family: 'Playfair Display', Georgia, serif; font-size: clamp(1.55rem, 4vw, 2.05rem); line-height: 1.15; letter-spacing: -.025em; margin: 0; }
.cookie-hero p { color: hsl(var(--muted-foreground)); max-width: 58ch; font-size: .91rem; line-height: 1.65; margin: .65rem 0 0; }
.cookie-consent-body { padding: .25rem clamp(1rem, 3vw, 1.6rem) 0; }
.cookie-category { padding: 1rem 0; border-bottom: 1px solid hsl(var(--border)); }
.cookie-category-head { display: flex; align-items: center; gap: .85rem; }
.cookie-category-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 12px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.cookie-category-icon.analytics-icon { color: #367a68; background: rgba(54,122,104,.12); }
.cookie-category-icon.marketing-icon { color: #9a7331; background: rgba(201,164,92,.18); }
.cookie-category-copy { flex: 1; min-width: 0; }
.cookie-category-copy h3 { font-family: 'Manrope', sans-serif; font-size: .98rem; margin: 0 0 .18rem; font-weight: 800; }
.cookie-category-copy p { font-size: .79rem; color: hsl(var(--muted-foreground)); line-height: 1.5; margin: 0; }
.required-badge { font-size: .66rem; font-weight: 750; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); padding: .35rem .55rem; border-radius: 999px; white-space: nowrap; }
.cookie-main-switch { margin-left: .25rem; }
.cookie-details { margin: .8rem 0 0 3.25rem; }
.cookie-details summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; color: hsl(var(--primary)); font-size: .78rem; font-weight: 800; width: fit-content; }
.cookie-details summary::-webkit-details-marker { display: none; }
.cookie-details summary::before { content: '+'; display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 6px; background: hsl(var(--muted)); font-size: 1rem; line-height: 1; }
.cookie-details[open] summary::before { content: '−'; }
.cookie-detail-count { color: hsl(var(--muted-foreground)); font-weight: 600; font-size: .68rem; }
.cookie-vendor-list { margin-top: .65rem; border: 1px solid hsl(var(--border)); border-radius: 13px; overflow: hidden; }
.cookie-vendor { display: flex; align-items: center; gap: .75rem; padding: .85rem; background: hsl(var(--background) / .45); }
.cookie-vendor + .cookie-vendor { border-top: 1px solid hsl(var(--border)); }
.cookie-vendor > div { flex: 1; min-width: 0; }
.cookie-vendor strong { font-size: .8rem; }
.cookie-vendor p { color: hsl(var(--muted-foreground)); font-size: .73rem; line-height: 1.5; margin: .2rem 0 0; }
.cookie-privacy-note { display: flex; gap: .6rem; align-items: flex-start; margin: .95rem clamp(1rem, 3vw, 1.6rem) 0; padding: .75rem .85rem; border-radius: 12px; background: hsl(var(--muted) / .65); color: hsl(var(--muted-foreground)); font-size: .74rem; line-height: 1.5; }
.cookie-privacy-note i { color: hsl(var(--primary)); margin-top: .12rem; }
.cookie-actions { padding: 1rem clamp(1rem, 3vw, 1.6rem) 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .55rem; }
.cookie-actions .btn { min-width: 0; min-height: 44px; padding: .7rem .65rem; font-size: .79rem; font-weight: 800; border-radius: 11px; }
.cookie-legal-foot { color: hsl(var(--muted-foreground)); text-align: center; font-size: .67rem; padding: .75rem 1rem 1rem; margin: 0; }
/* toggles */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slider { position: absolute; inset: 0; background: hsl(var(--border)); border-radius: 999px; transition: background .2s ease; cursor: pointer; }
.slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.switch input:checked + .slider { background: hsl(var(--primary)); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 3px solid hsl(var(--gold)); outline-offset: 3px; }
.switch input:disabled + .slider { opacity: .6; cursor: not-allowed; }
.btn-ghost { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--border)); }
@media (max-width: 560px) {
  #cookie-modal.cookie-overlay { align-items: center; padding: .65rem; }
  #cookie-modal .cookie-consent-card { max-height: 94dvh; max-height: 94svh; border-radius: 21px; }
  .cookie-hero { padding: 1.1rem 1rem 1rem; }
  .cookie-mark { width: 38px; height: 38px; border-radius: 12px; margin-bottom: .65rem; }
  .cookie-category { padding: .8rem 0; }
  .cookie-category-head { gap: .6rem; }
  .cookie-category-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
  .cookie-category-copy p { font-size: .73rem; }
  .required-badge { white-space: normal; text-align: center; max-width: 88px; }
  .cookie-details { margin-left: 2.6rem; }
  .cookie-vendor { padding: .7rem; }
  .cookie-actions { grid-template-columns: 1fr 1fr; }
  .cookie-actions #cookie-accept { grid-column: 1 / -1; grid-row: 1; }
  .cookie-actions #cookie-decline { grid-column: 1; grid-row: 2; }
  .cookie-actions #cookie-save { grid-column: 2; grid-row: 2; }
}

/* ===================== PROFILE (header) ===================== */
.profile-area { display: flex; align-items: center; }
.btn-enter {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 0.88rem; border: 1px solid hsl(var(--primary));
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  transition: background-color 0.2s ease, transform 0.12s ease;
}
.btn-enter:hover { background: hsl(var(--primary) / 0.9); }
.btn-enter:active { transform: scale(0.96); }
.profile-trigger {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.6rem 0.3rem 0.35rem; border-radius: 999px; cursor: pointer;
  border: 1px solid hsl(var(--border)); background: hsl(var(--card) / 0.8); font-family: inherit;
  transition: background-color 0.2s ease;
}
.profile-trigger:hover { background: hsl(var(--accent)); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
}
.profile-name { font-size: 0.85rem; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-wrap { position: relative; }
.profile-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
  min-width: 220px; background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,0.14);
  padding: 0.5rem; display: none;
}
.profile-menu.open { display: block; animation: fadeIn 0.15s ease; }
.profile-menu .pm-head { padding: 0.6rem 0.7rem; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 0.35rem; }
.profile-menu .pm-head .nm { font-weight: 600; font-size: 0.9rem; }
.profile-menu .pm-head .em { font-size: 0.78rem; color: hsl(var(--muted-foreground)); }
.profile-menu .pm-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.6rem 0.7rem; border-radius: 0.5rem; border: none; background: none;
  font-family: inherit; font-size: 0.88rem; color: hsl(var(--foreground)); cursor: pointer; text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.profile-menu .pm-item:hover { background: hsl(var(--accent)); color: hsl(var(--primary)); }
.profile-menu .pm-item i { width: 18px; text-align: center; color: hsl(var(--gold)); }
.profile-menu .pm-item.danger:hover { color: #dc2626; }
.profile-menu .pm-item.danger:hover i { color: #dc2626; }

/* Auth modal fields + tabs */
.auth-tabs { display: flex; gap: 0.25rem; background: hsl(var(--muted)); padding: 0.25rem; border-radius: 999px; margin-bottom: 1.25rem; }
.auth-tab { flex: 1; padding: 0.5rem; border: none; background: none; border-radius: 999px; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 0.85rem; color: hsl(var(--muted-foreground)); transition: background-color 0.2s ease, color 0.2s ease; }
.auth-tab.active { background: hsl(var(--card)); color: hsl(var(--primary)); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.35rem; }
.field input { width: 100%; padding: 0.7rem 0.85rem; font-family: inherit; font-size: 0.95rem; border: 1px solid hsl(var(--border)); border-radius: 0.5rem; background: hsl(var(--background)); color: hsl(var(--foreground)); }
.field input:focus { outline: none; border-color: hsl(var(--primary) / 0.5); box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1); }
.err-msg { color: #dc2626; font-size: 0.85rem; margin: 0 0 0.75rem; min-height: 1rem; }

/* ===================== TOAST ===================== */
.toast-wrap { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.toast { padding: 0.75rem 1.25rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,0.15); animation: fadeIn 0.25s ease; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); }
.toast.success { border-left: 4px solid #16a34a; }
.toast.error { border-left: 4px solid #dc2626; }

/* ===================== PAGE FOOTER ===================== */
.site-footer { border-top: 1px solid hsl(var(--border)); padding: 2.5rem 1.5rem 6rem; margin-top: 3rem; background: hsl(var(--secondary) / 0.5); }
.site-footer .fcols { max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.site-footer .fbrand { max-width: 300px; }
.site-footer .fbrand p { color: hsl(var(--muted-foreground)); font-size: 0.88rem; margin-top: 0.5rem; }
.site-footer .fcol h4 { font-family: 'Manrope', sans-serif; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: hsl(var(--gold)); margin-bottom: 0.75rem; }
.site-footer .fcol a, .site-footer .fcol button { display: block; font-size: 0.9rem; color: hsl(var(--foreground)); margin-bottom: 0.5rem; background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; text-align: left; transition: color 0.2s ease; }
.site-footer .fcol a:hover, .site-footer .fcol button:hover { color: hsl(var(--primary)); }
.site-footer .copyright { max-width: 1100px; margin: 2rem auto 0; padding-top: 1.5rem; border-top: 1px solid hsl(var(--border)); font-size: 0.8rem; color: hsl(var(--muted-foreground)); }

/* ===================== PUBLICIDAD ===================== */
/* Espacios reservados con altura fija (sin saltos de layout).
   Banners:  728×90 (≥900px) → 468×60 (tablet) → 320×50 (móvil).
   Raíles laterales: 160×600 (≥1620px) / 120×600 (≥1500px) y alto ≥800px; en pantallas
   más estrechas o bajas se ocultan y nunca invaden el contenido (que llega a 1200px).
   No se muestran en Comunidad, páginas privadas, pagos, tienda, planes ni páginas legales. */
:root { --rail-w: 160px; --rail-gap: 24px; }

.ad-slot {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  margin: 1.75rem auto; padding: 0 1rem; max-width: 100%;
}
.ad-label {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); opacity: 0.8;
}
body[data-route="inicio"] .ad-label,
body[data-route="comunidad"] .ad-label {
  background: hsl(var(--card) / 0.85); padding: 0.15rem 0.6rem; border-radius: 999px;
}
.ad-box {
  display: flex; align-items: center; justify-content: center; text-align: center;
  max-width: 100%; overflow: hidden;
  border: 1px dashed hsl(var(--gold) / 0.5); border-radius: 0.5rem;
  background: hsl(var(--card) / 0.88);
  backdrop-filter: blur(4px);
  color: hsl(var(--muted-foreground)); font-size: 0.75rem; letter-spacing: 0.04em;
}
.ad-box:empty::after { content: "Espacio publicitario"; }
.ad-box.is-filled { border: 0; background: transparent; }
.ad-off { display: none !important; }
/* AdSense sin anuncio disponible: colapsar el espacio entero */
.ad-slot:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

.ad-banner .ad-box { width: 728px; height: 90px; }
.results > .ad-slot { margin: 2.5rem auto 0; padding: 0; }

/* Raíles laterales: ver bloque «RAÍLES LATERALES» al final del archivo. */

/* Pantallas medianas: banner compacto */
@media (max-width: 899px) {
  .ad-banner .ad-box { width: 468px; height: 60px; }
  .ad-slot { margin: 1.25rem auto; }
  .results > .ad-slot { margin: 1.75rem auto 0; }
}
/* Pantallas pequeñas: banner mínimo */
@media (max-width: 520px) {
  .ad-banner .ad-box { width: 320px; height: 50px; }
  .ad-slot { margin: 1rem auto; padding: 0 0.75rem; }
  .ad-label { font-size: 0.56rem; }
  .results > .ad-slot { margin: 1.5rem auto 0; }
}


/* Sin publicidad en Comunidad, páginas privadas/transaccionales y páginas legales. */
body[data-route="comunidad"] .ad-slot,
body[data-route="acceso"] .ad-slot,
body[data-route="cuenta"] .ad-slot,
body[data-route="notificaciones"] .ad-slot,
body[data-route="biblioteca"] .ad-slot,
body[data-route="pago"] .ad-slot,
body[data-route="tienda"] .ad-slot,
body[data-route="planes"] .ad-slot,
body[data-route="aviso-legal"] .ad-slot,
body[data-route="politica-privacidad"] .ad-slot { display: none !important; }
@media print { .ad-slot { display: none !important; } }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .mobile-menu-toggle { display: inline-flex; }
  .bento-grid { grid-template-columns: 1fr; }
  .footer-chip span { display: none; }
  .footer-chip { padding: 0.5rem 0.7rem; }
}
@media (max-width: 520px) {
  .site-header { padding: 0.75rem 1rem; }
  .brand span { display: none; }
}

/* ===================== POTENCIAS ANTE LA AFIRMACIÓN ===================== */
.powers-box { border: 2px solid hsl(var(--border)); border-radius: var(--radius); padding: 1.5rem; background: hsl(var(--card) / 0.7); }
.powers-grid, .powers-loading { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
.power-item { padding: 1rem; border-radius: 0.5rem; background: hsl(var(--muted) / 0.6); border: 1px solid hsl(var(--border)); }
.power-item .head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.power-item .head .flag { font-size: 1.4rem; }
.power-item .head h3 { font-size: 1.1rem; }
.power-item p { font-size: 0.88rem; color: hsl(var(--foreground) / 0.85); }
.power-src { display: block; margin-top: 0.6rem; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.power-src i { color: hsl(var(--gold)); margin-right: 0.3rem; }
.powers-error { color: hsl(var(--muted-foreground)); margin-bottom: 0.5rem; }
@media (max-width: 720px) { .powers-grid, .powers-loading { grid-template-columns: 1fr; } }

/* ===================== CURSOR PERSONALIZADO ===================== */
/* Cursor por defecto: pequeño rosetón/diana en dorado, acorde a la
   estética "mapa antiguo" del sitio. */
html, body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8.5' fill='none' stroke='%23c9a227' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='2' fill='%23c9a227'/%3E%3Cpath d='M12 1v4M12 19v4M1 12h4M19 12h4' stroke='%23c9a227' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 12 12, auto;
}

/* Cursor sobre elementos interactivos: lupa dorada, en línea con el
   icono del Verificador. */
a,
button,
.btn,
.nav-link,
.mobile-nav-link,
.icon-btn,
.verifier-tab,
.example-chip,
.auth-tab,
.history-item,
.link-btn,
.switch,
.slider,
.footer-chip,
label[for],
select,
input[type="checkbox"],
input[type="radio"],
input[type="submit"],
[role="button"],
[onclick],
[data-route] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%23c9a227' stroke-width='2.5'/%3E%3Cline x1='16.2' y1='16.2' x2='23' y2='23' stroke='%23c9a227' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") 11 11, pointer;
}

.btn-primary:disabled,
button:disabled,
input:disabled {
  cursor: not-allowed;
}

/* ===================== PÁGINA DE PAGO (Stripe) ===================== */
.payment-summary {
  padding: 1.25rem;
}
.payment-summary-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.payment-summary-cover {
  flex: 0 0 84px;
  width: 84px;
  aspect-ratio: 2 / 3;
  border-radius: 0.5rem;
  overflow: hidden;
  background: hsl(var(--muted));
  box-shadow: 0 6px 16px rgba(20, 15, 5, 0.18);
}
.payment-summary-cover img,
.payment-summary-cover .book-cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}
.payment-summary-info h2 {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
  line-height: 1.3;
}
.payment-summary-info .book-author {
  margin: 0 0 0.5rem;
}
.payment-summary-price {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: hsl(var(--gold));
}
.payment-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 20px 45px rgba(20, 15, 5, 0.14), 0 2px 8px rgba(20, 15, 5, 0.06);
}
.payment-card h2 {
  font-size: 1.15rem;
}
#payment-message {
  min-height: 1.25rem;
  margin: 0.85rem 0;
}
#payment-message.success {
  color: hsl(142 60% 32%);
}
#payment-submit-btn {
  margin-top: 0.25rem;
}
.payment-success-card {
  text-align: center;
  padding: 2.25rem 1.5rem;
}
.payment-success-card > i {
  font-size: 3rem;
  color: hsl(142 60% 38%);
  margin-bottom: 0.75rem;
}
.payment-success-card h2 {
  margin-bottom: 0.5rem;
}
.payment-success-card p {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.25rem;
}
@media (max-width: 520px) {
  .payment-summary-row { gap: 0.9rem; }
  .payment-summary-cover { flex-basis: 68px; width: 68px; }
  .payment-card { padding: 1.25rem; }
}

/* ---------- Biblioteca de ebooks ---------- */
.library-list { display: grid; gap: 0.9rem; }
.library-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; }
.library-cover { flex: 0 0 56px; width: 56px; aspect-ratio: 2 / 3; border-radius: 0.4rem; overflow: hidden; background: hsl(var(--muted)); }
.library-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.library-cover .book-cover-fallback { width: 100%; height: 100%; }
.library-info { flex: 1; min-width: 0; }
.library-info h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.library-info .book-author { margin: 0; }
.library-note { font-size: 0.85rem; color: hsl(var(--muted-foreground)); }
.library-empty { text-align: center; padding: 2.5rem 1.5rem; }
.library-empty > i { font-size: 2.2rem; color: hsl(var(--gold)); display: block; margin-bottom: 0.75rem; }
.library-empty p { color: hsl(var(--muted-foreground)); margin-bottom: 1.25rem; }
@media (max-width: 520px) {
  .library-item { flex-wrap: wrap; }
  .library-action { width: 100%; }
  .library-action .btn { width: 100%; }
}

/* Versión extensa del verificador */
.extended-actions { margin-top: 1rem; }
.extended-btn { font-size: 0.9rem; padding: 0.55rem 1rem; display: inline-flex; align-items: center; gap: 0.5rem; }
.extended-box { border: 2px solid hsl(var(--border)); border-radius: var(--radius); padding: 1.5rem; background: hsl(var(--card) / 0.7); margin-top: 1.5rem; }
.extended-section { margin-top: 1.25rem; }
.extended-section h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.extended-section p { font-size: 0.95rem; line-height: 1.7; color: hsl(var(--foreground) / 0.88); margin-bottom: 0.75rem; }

/* ============================================================
   COMUNIDAD — experiencia tipo chat / Discord, integrada con VERITAS
   ============================================================ */
.community-page { padding: 0 !important; }
.community-app { height: calc(100vh - 82px); min-height: 620px; display:grid; grid-template-columns: 260px minmax(0,1fr) 270px; background: hsl(var(--card)); border-top:1px solid hsl(var(--border)); overflow:hidden; }
.community-sidebar { background: linear-gradient(180deg, hsl(var(--primary)) 0%, hsl(240 8% 9%) 100%); color:#f4eee1; display:flex; flex-direction:column; min-width:0; }
.community-server { height:72px; display:flex; align-items:center; gap:.75rem; padding:.8rem 1rem; border-bottom:1px solid rgba(255,255,255,.09); box-shadow:0 1px 8px rgba(0,0,0,.18); }
.community-server-mark { width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,#d4af37,#9c7a24);color:#0b0b0d;flex:none; }
.community-server-copy { display:flex; flex-direction:column; min-width:0; }
.community-server-copy strong { font-family:'Playfair Display',serif; letter-spacing:.08em; font-size:.95rem; }
.community-server-copy span { font-size:.66rem; color:#bdb7ac; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.community-icon-btn { border:0; background:transparent; color:inherit; width:32px;height:32px;border-radius:8px;display:grid;place-items:center;cursor:pointer;transition:.2s; }
.community-icon-btn:hover { background:rgba(255,255,255,.1); }
.community-server .community-icon-btn { display:none; margin-left:auto; }
.community-sidebar-scroll { flex:1; overflow:auto; padding:.85rem .65rem; }
.community-sidebar-title { display:flex; justify-content:space-between; align-items:center; padding:.35rem .55rem .5rem; color:#8f8a81; font-size:.64rem; font-weight:800; letter-spacing:.1em; }
.community-sidebar-title i { font-size:.72rem; }
.community-online-title { margin-top:1.4rem; }
.community-channel-list { display:flex; flex-direction:column; gap:.15rem; }
.community-channel { width:100%; border:0; background:transparent; color:#bdb7ac; display:flex; align-items:center; gap:.6rem; text-align:left; padding:.62rem .55rem; border-radius:8px; cursor:pointer; transition:.18s; }
.community-channel:hover { background:rgba(255,255,255,.07); color:#f5f0e6; }
.community-channel.active { background:rgba(212,175,55,.14); color:#f7e9b6; }
.community-channel-icon { width:25px; text-align:center; color:#858078; font-size:.9rem; flex:none; }
.community-channel.active .community-channel-icon { color:#d4af37; }
.community-channel-text { min-width:0; display:flex; flex-direction:column; flex:1; }
.community-channel-text strong { font-size:.83rem; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.community-channel-text small { font-size:.63rem; color:#77736d; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.community-channel.active .community-channel-text small { color:#a99a70; }
.community-channel-arrow { font-size:.6rem; opacity:.7; }
.community-side-note { display:flex; gap:.55rem; color:#8e8980; font-size:.7rem; line-height:1.5; padding:.5rem .55rem; }
.community-side-note i { color:#b79a3e; margin-top:2px; }
.community-userbar { min-height:60px; padding:.65rem .7rem; display:flex; align-items:center; gap:.6rem; background:rgba(0,0,0,.18); border-top:1px solid rgba(255,255,255,.07); }
.community-avatar,.community-message-avatar { width:34px;height:34px;border-radius:50%;display:grid;place-items:center;position:relative;background:linear-gradient(135deg,#d4af37,#8e7024);color:#111;font-weight:800;font-size:.78rem;flex:none; }
.community-avatar.guest { background:#2a2a2e;color:#bdb7ac; }
.community-status-dot { position:absolute; right:-1px; bottom:0; width:9px;height:9px;border:2px solid #151518;border-radius:50%;background:#48b36a; }
.community-user-copy { min-width:0; flex:1; display:flex; flex-direction:column; }
.community-user-copy strong { font-size:.75rem; white-space:nowrap; overflow:hidden;text-overflow:ellipsis; }
.community-user-copy small { color:#77736d; font-size:.62rem; }
.community-login-mini { border:0;background:#d4af37;color:#111;border-radius:6px;padding:.35rem .55rem;font-size:.65rem;font-weight:800;cursor:pointer; }
.community-main { min-width:0; display:flex; flex-direction:column; background:hsl(var(--background)); }
.community-chat-header { min-height:72px; display:flex;align-items:center;gap:.8rem;padding:.75rem 1.1rem;border-bottom:1px solid hsl(var(--border));background:hsl(var(--card)); }
.community-mobile-channels { display:none; border:0;background:hsl(var(--muted));color:hsl(var(--foreground));width:36px;height:36px;border-radius:9px; }
.community-channel-heading { display:flex;align-items:center;gap:.7rem;min-width:0;flex:1; }
.community-channel-symbol { width:38px;height:38px;border-radius:10px;background:hsl(var(--accent));color:hsl(var(--gold));display:grid;place-items:center;flex:none; }
.community-channel-heading h2 { font-family:'Manrope',sans-serif;font-size:1rem;font-weight:800;margin:0; }
.community-channel-heading p { margin:2px 0 0;color:hsl(var(--muted-foreground));font-size:.7rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.community-chat-actions { display:flex;align-items:center;gap:.25rem; }
.community-live { color:hsl(var(--muted-foreground));font-size:.67rem;display:flex;align-items:center;gap:.35rem;padding:.35rem .55rem; }
.community-live i { font-size:.42rem;color:#45b36b; }
.community-messages { flex:1;overflow:auto;padding:1rem 1.25rem 1.4rem;scroll-behavior:smooth; }
.community-message { display:flex;gap:.75rem;padding:.5rem .65rem;border-radius:9px;margin-bottom:.15rem;transition:background .15s; }
.community-message:hover { background:hsl(var(--muted) / .55); }
.community-message.pinned { background:hsl(var(--accent) / .45); border-left:2px solid hsl(var(--gold)); }
.community-message-avatar { width:36px;height:36px; }
.community-message-body { min-width:0;flex:1; }
.community-message-meta { display:flex;align-items:center;gap:.55rem;min-height:18px; }
.community-message-meta strong { font-family:'Manrope',sans-serif;font-size:.8rem; }
.community-message-meta time { color:hsl(var(--muted-foreground));font-size:.61rem; }
.community-pin { font-size:.59rem;color:hsl(var(--gold));display:inline-flex;gap:.25rem;align-items:center; }
.community-message-text { color:hsl(var(--foreground));font-size:.82rem;line-height:1.6;word-break:break-word;margin-top:.08rem; }
.community-empty,.community-loading { height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:hsl(var(--muted-foreground)); }
.community-empty h3 { font-family:'Manrope',sans-serif;font-size:1rem;margin:.65rem 0 .2rem;color:hsl(var(--foreground)); }
.community-empty p { font-size:.75rem;max-width:360px; }
.community-empty > i { font-size:1.5rem;color:hsl(var(--gold)); }
.community-empty-icon { width:54px;height:54px;border-radius:16px;background:hsl(var(--accent));display:grid;place-items:center;color:hsl(var(--gold));font-size:1.15rem; }
.community-loading { flex-direction:row;gap:.6rem;font-size:.75rem; }
.community-composer-wrap { padding:.65rem 1.15rem .8rem;border-top:1px solid hsl(var(--border));background:hsl(var(--card)); }
.community-compose-box { display:flex;align-items:flex-end;gap:.5rem;background:hsl(var(--muted));border:1px solid hsl(var(--border));border-radius:12px;padding:.45rem .5rem .45rem .55rem;transition:border-color .2s,box-shadow .2s; }
.community-compose-box:focus-within { border-color:hsl(var(--gold) / .6);box-shadow:0 0 0 3px hsl(var(--gold) / .08); }
.community-compose-plus,.community-send { width:32px;height:32px;border:0;border-radius:8px;display:grid;place-items:center;cursor:pointer;flex:none; }
.community-compose-plus { background:hsl(var(--card));color:hsl(var(--muted-foreground)); }
.community-send { background:hsl(var(--primary));color:hsl(var(--primary-foreground)); }
[data-theme="dark"] .community-send { background:hsl(var(--gold));color:#111; }
.community-compose-box textarea { flex:1;resize:none;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:.78rem;line-height:1.5;padding:.38rem .15rem;max-height:140px; }
.community-compose-box textarea::placeholder { color:hsl(var(--muted-foreground)); }
.community-compose-box.locked { align-items:center;color:hsl(var(--muted-foreground));font-size:.72rem;padding:.7rem .8rem; }
.community-compose-box.locked i { color:hsl(var(--gold)); }
.community-compose-box.locked a { margin-left:auto;color:hsl(var(--gold));font-weight:800; }
.community-compose-hint { color:hsl(var(--muted-foreground));font-size:.58rem;padding:.3rem .25rem 0; }
kbd { border:1px solid hsl(var(--border));border-bottom-width:2px;border-radius:4px;padding:0 .22rem;font-size:.56rem; }
.community-info { border-left:1px solid hsl(var(--border));background:hsl(var(--card));padding:1.25rem 1rem;overflow:auto; }
.community-info-head { display:flex;align-items:center;gap:.45rem;font-size:.68rem;font-weight:800;color:hsl(var(--muted-foreground));text-transform:uppercase;letter-spacing:.08em;margin-bottom:1.3rem; }
.community-info-icon { width:54px;height:54px;border-radius:16px;background:hsl(var(--accent));display:grid;place-items:center;color:hsl(var(--gold));font-size:1.25rem;margin-bottom:.8rem; }
.community-info h3 { font-family:'Manrope',sans-serif;font-size:1rem;margin-bottom:.35rem; }
.community-info > p { color:hsl(var(--muted-foreground));font-size:.7rem;line-height:1.6; }
.community-info-divider { height:1px;background:hsl(var(--border));margin:1rem 0; }
.community-info-rule { display:flex;gap:.65rem;margin-bottom:.95rem; }
.community-info-rule > i { width:28px;height:28px;border-radius:8px;background:hsl(var(--accent));color:hsl(var(--gold));display:grid;place-items:center;font-size:.7rem;flex:none; }
.community-info-rule div { display:flex;flex-direction:column;gap:1px; }
.community-info-rule strong { font-size:.68rem; }
.community-info-rule span { color:hsl(var(--muted-foreground));font-size:.62rem;line-height:1.45; }
.community-auth-inline { display:none; }

@media (max-width: 1100px) {
  .community-app { grid-template-columns:230px minmax(0,1fr); }
  .community-info { display:none; }
}
@media (max-width: 760px) {
  .community-app { height:calc(100vh - 68px);min-height:560px;grid-template-columns:1fr;position:relative; }
  .community-sidebar { position:absolute;z-index:20;inset:0 auto 0 0;width:min(82vw,300px);transform:translateX(-102%);transition:transform .22s ease;box-shadow:10px 0 35px rgba(0,0,0,.25); }
  .community-app.sidebar-open .community-sidebar { transform:translateX(0); }
  .community-server .community-icon-btn { display:grid; }
  .community-mobile-channels { display:grid;place-items:center; }
  .community-messages { padding-left:.55rem;padding-right:.55rem; }
  .community-composer-wrap { padding-left:.65rem;padding-right:.65rem; }
}
@media (max-width: 480px) {
  .community-chat-header { padding:.6rem .65rem;min-height:64px; }
  .community-live { display:none; }
  .community-channel-symbol { width:34px;height:34px; }
  .community-channel-heading h2 { font-size:.9rem; }
  .community-message { gap:.55rem;padding:.45rem .35rem; }
  .community-message-avatar { width:32px;height:32px; }
  .community-message-text { font-size:.76rem; }
  .community-compose-hint { display:none; }
}

/* ============================================================
   ASISTENTE VERITAS — visita guiada adaptativa
   ============================================================ */
.veritas-guide { position:fixed; inset:0; z-index:120; display:none; pointer-events:none; }
.veritas-guide.open { display:block; }
.veritas-guide-backdrop { position:absolute; inset:0; background:rgba(5,5,7,.32); opacity:0; transition:opacity .2s ease; pointer-events:auto; }
.veritas-guide.open .veritas-guide-backdrop { opacity:1; }
.veritas-guide-card { position:fixed; width:min(390px,calc(100vw - 28px)); max-height:min(310px,calc(100vh - 28px)); overflow:auto; display:flex; gap:.8rem; padding:1rem; border:1px solid hsl(var(--border)); border-radius:18px; background:hsl(var(--card)); color:hsl(var(--foreground)); box-shadow:0 24px 70px rgba(0,0,0,.3); pointer-events:auto; opacity:0; transform:translateY(8px) scale(.98); transition:opacity .18s ease,transform .18s ease; }
.veritas-guide-card.visible { opacity:1; transform:translateY(0) scale(1); }
.veritas-guide-avatar { width:42px;height:42px;min-width:42px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(135deg,#d4af37,#9c7a24);color:#111;font-size:1rem;position:relative; }
.veritas-guide-avatar span { position:absolute; width:9px;height:9px;border:2px solid hsl(var(--card));background:#43b36b;border-radius:50%;right:-2px;bottom:-1px; }
.veritas-guide-content { min-width:0; flex:1; }
.veritas-guide-kicker { font-size:.57rem;font-weight:900;letter-spacing:.12em;color:hsl(var(--gold));margin-bottom:.18rem; }
.veritas-guide-card h3 { font-family:'Manrope',sans-serif;font-size:1rem;line-height:1.25;margin-bottom:.35rem; }
.veritas-guide-card p { color:hsl(var(--muted-foreground));font-size:.72rem;line-height:1.55;overflow-wrap:anywhere; }
.veritas-guide-progress { height:3px;background:hsl(var(--muted));border-radius:99px;overflow:hidden;margin:.8rem 0 .7rem; }
.veritas-guide-progress span { display:block;height:100%;width:0;background:hsl(var(--gold));transition:width .2s ease; }
.veritas-guide-actions { display:flex;align-items:center;justify-content:flex-end;gap:.35rem;flex-wrap:wrap; }
.veritas-guide-actions button { border:0;border-radius:8px;padding:.5rem .65rem;font:inherit;font-size:.66rem;font-weight:800;cursor:pointer;white-space:nowrap; }
.veritas-guide-skip,.veritas-guide-prev { background:transparent;color:hsl(var(--muted-foreground)); }
.veritas-guide-next { background:hsl(var(--primary));color:hsl(var(--primary-foreground)); }
[data-theme="dark"] .veritas-guide-next { background:hsl(var(--gold));color:#111; }
.veritas-guide-launcher { position:fixed; right:20px;bottom:22px;z-index:115;display:flex;align-items:center;gap:.55rem;border:1px solid hsl(var(--border));background:hsl(var(--card));color:hsl(var(--foreground));padding:.45rem .7rem .45rem .45rem;border-radius:999px;box-shadow:0 10px 30px rgba(0,0,0,.16);cursor:pointer;font:inherit;font-size:.68rem;font-weight:800;transition:transform .18s ease,box-shadow .18s ease; }
.veritas-guide-launcher:hover { transform:translateY(-2px);box-shadow:0 14px 35px rgba(0,0,0,.22); }
.veritas-guide-launcher-icon { width:31px;height:31px;border-radius:50%;display:grid;place-items:center;background:hsl(var(--accent));color:hsl(var(--gold)); }
.veritas-guide-pulse { width:7px;height:7px;border-radius:50%;background:#43b36b;box-shadow:0 0 0 4px rgba(67,179,107,.12); }
.veritas-tour-target { position:relative !important; z-index:121 !important; box-shadow:0 0 0 4px hsl(var(--gold) / .92),0 0 0 8px hsl(var(--gold) / .18),0 16px 45px rgba(0,0,0,.28) !important; border-radius:10px !important; transition:box-shadow .18s ease !important; }

/* Guardas globales para evitar desbordamientos en responsive. */
html,body { max-width:100%; overflow-x:hidden; }
img,svg,video,canvas,iframe { max-width:100%; }
input,textarea,select,button { max-width:100%; }
pre,code { max-width:100%; overflow-x:auto; }
.page { min-width:0; overflow-x:clip; }
.community-page { min-width:0; width:100%; }
.community-app,.community-sidebar,.community-main,.community-info { min-width:0; max-width:100%; }
.community-message-text,.community-info-rule span,.community-side-note,.community-channel-text { overflow-wrap:anywhere; word-break:break-word; }
.community-chat-header,.community-composer-wrap,.community-info { min-width:0; }
.community-compose-box { min-width:0; max-width:100%; }
.community-compose-box textarea { min-width:0; width:100%; }
.ad-slot,.ad-box { min-width:0; max-width:100%; overflow:hidden; }

@media (max-width: 760px) {
  .veritas-guide-launcher { right:12px;bottom:12px; }
  .veritas-guide-launcher-label { display:none; }
  .veritas-guide-card { padding:.85rem; border-radius:15px; }
  .veritas-guide-card h3 { font-size:.92rem; }
  .veritas-guide-card p { font-size:.69rem; }
  .veritas-guide-actions { justify-content:space-between; }
  .community-app { width:100%; max-width:100vw; }
  .community-main { width:100%; overflow:hidden; }
  .community-chat-header { max-width:100%; }
  .community-chat-actions { min-width:0; }
  .community-channel-heading { min-width:0; }
  .community-channel-heading > div:last-child { min-width:0; }
  .community-messages { min-width:0; max-width:100%; overflow-x:hidden; }
  .community-message-body { min-width:0; max-width:100%; }
}
@media (max-width: 420px) {
  .veritas-guide-card { width:calc(100vw - 20px); max-height:calc(100vh - 20px); }
  .veritas-guide-avatar { width:36px;height:36px;min-width:36px;font-size:.85rem; }
  .veritas-guide-actions button { padding:.45rem .55rem; }
  .community-chat-header { gap:.45rem;padding-left:.5rem;padding-right:.5rem; }
  .community-channel-symbol { flex:none; }
  .community-chat-actions .community-icon-btn { width:30px;height:30px; }
  .community-composer-wrap { padding-left:.45rem;padding-right:.45rem; }
  .community-compose-box { gap:.25rem;padding-left:.4rem;padding-right:.4rem; }
  .community-compose-plus,.community-send { width:30px;height:30px; }
}

/* ============================================================
   ACCESO RÁPIDO MÓVIL — VERIFICADOR
   ============================================================ */
.mobile-verifier-fab {
  display:none;
  position:fixed;
  left:max(12px, env(safe-area-inset-left));
  bottom:max(14px, env(safe-area-inset-bottom));
  z-index:114;
  align-items:center;
  gap:.42rem;
  min-height:42px;
  padding:.34rem .72rem .34rem .38rem;
  border:1px solid hsl(var(--border));
  border-radius:999px;
  background:hsl(var(--card) / .97);
  color:hsl(var(--foreground));
  box-shadow:0 9px 28px rgba(0,0,0,.18);
  text-decoration:none;
  font:inherit;
  font-size:.67rem;
  font-weight:900;
  white-space:nowrap;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  transition:transform .16s ease, box-shadow .16s ease;
  touch-action:manipulation;
}
.mobile-verifier-fab:active { transform:scale(.95); }
.mobile-verifier-fab-icon {
  width:32px; height:32px; flex:0 0 32px;
  display:grid; place-items:center;
  border-radius:50%;
  background:hsl(var(--primary));
  color:hsl(var(--primary-foreground));
}
[data-theme="dark"] .mobile-verifier-fab-icon {
  background:hsl(var(--gold)); color:#111;
}
@media (max-width:760px) {
  .mobile-verifier-fab { display:flex; }
  /* Deja espacio entre el botón del verificador y el asistente de visita. */
  .veritas-guide-launcher { right:12px; bottom:max(12px, env(safe-area-inset-bottom)); }
}
@media (max-width:420px) {
  .mobile-verifier-fab {
    left:max(9px, env(safe-area-inset-left));
    bottom:max(10px, env(safe-area-inset-bottom));
    min-height:38px; padding:.28rem .58rem .28rem .3rem; font-size:.61rem;
  }
  .mobile-verifier-fab-icon { width:29px; height:29px; flex-basis:29px; }
}
@media (max-width:340px) {
  .mobile-verifier-fab-label { display:none; }
  .mobile-verifier-fab { width:42px; height:42px; min-height:42px; padding:.28rem; justify-content:center; }
  .mobile-verifier-fab-icon { width:34px; height:34px; flex-basis:34px; }
}
@media (prefers-reduced-motion:reduce) {
  .mobile-verifier-fab { transition:none; }
}

/* AdSense safety: never allow ads to escape existing containers. */
.ad-slot,.ad-box{min-width:0;max-width:100%;overflow:hidden}.ad-box>ins.adsbygoogle{box-sizing:border-box;max-width:100%!important;width:100%!important}.ad-box iframe{max-width:100%!important}

/* Área de usuario */
.account-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:18px;margin-bottom:22px}.account-grid .card{min-width:0}.account-grid input{max-width:100%;padding:10px}.account-table{overflow-x:auto}.account-table table{width:100%;border-collapse:collapse;text-align:left}.account-table th,.account-table td{padding:12px;border-bottom:1px solid var(--border,#bbb)}#affiliate-url{width:100%;max-width:100%;padding:10px}

/* ================= NOTIFICACIONES ================= */
.notification-wrap{position:relative;display:flex;align-items:center}.notification-trigger{position:relative}.notification-badge{position:absolute;top:-3px;right:-3px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:hsl(var(--gold));color:#111;font-size:10px;font-weight:800;border:2px solid hsl(var(--background));}.notification-dropdown{display:none;position:absolute;right:0;top:calc(100% + 10px);width:min(390px,calc(100vw - 24px));max-height:560px;overflow:auto;background:hsl(var(--card));border:1px solid hsl(var(--border));border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,.18);z-index:1000}.notification-dropdown.open{display:block}.notification-head,.notification-foot{padding:12px 15px;border-bottom:1px solid hsl(var(--border));display:flex;justify-content:space-between;align-items:center;gap:12px}.notification-foot{border-top:1px solid hsl(var(--border));border-bottom:0}.notification-head a,.notification-foot button{background:none;border:0;color:hsl(var(--gold));cursor:pointer;font:inherit}.notification-item{display:flex;gap:11px;padding:13px 15px;border-bottom:1px solid hsl(var(--border));cursor:pointer;position:relative}.notification-item:hover{background:hsl(var(--muted)/.35)}.notification-item.unread{background:hsl(var(--gold)/.07)}.notification-icon{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:0 0 36px;background:hsl(var(--muted));}.notification-icon.success{color:#16834b}.notification-icon.error{color:#c93636}.notification-icon.warning{color:#b77900}.notification-body{min-width:0;flex:1}.notification-title{font-weight:700;font-size:.9rem}.notification-message{font-size:.82rem;color:hsl(var(--muted-foreground));margin-top:3px;line-height:1.4}.notification-date{font-size:.72rem;color:hsl(var(--muted-foreground));margin-top:5px}.notification-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:hsl(var(--gold));vertical-align:middle}.notification-delete{background:none;border:0;color:hsl(var(--muted-foreground));cursor:pointer}.notification-empty{text-align:center;padding:30px 18px;color:hsl(var(--muted-foreground))}.notification-empty i{font-size:2rem;margin-bottom:8px}.notification-toolbar{display:flex;justify-content:flex-end;margin-bottom:12px}.notification-dropdown .notification-item{padding:11px 13px}.notification-dropdown .notification-delete{display:none}


/* Notificaciones en móvil: el desplegable se ancla a la cabecera (no a la campana) para no salirse de la pantalla */
@media (max-width: 860px) {
  .notification-wrap { position: static; }
  .notification-dropdown { position: fixed; left: 12px; right: 12px; top: calc(100% + 8px); width: auto; max-height: min(70vh, 520px); }
}

[hidden] { display: none !important; }


/* ============================================================
   APP INSTALABLE (PWA) — EXPERIENCIA MÓVIL Y TABLET
   ============================================================ */
:root { --bottom-nav-h: 4rem; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
a, button, [role="button"], input, select, textarea, label { touch-action: manipulation; }
.bottom-nav { display: none; }

/* Pantallas táctiles: objetivos de toque de al menos 44 px */
@media (pointer: coarse) {
  .icon-btn { min-width: 44px; min-height: 44px; }
  .main-nav .nav-link { width: 2.9rem; height: 2.9rem; }
  .btn, .mobile-nav-link { min-height: 44px; }
}
/* Tablet horizontal / táctil sin ratón: no existe "pasar el ratón", así que se muestra el nombre bajo el icono */
@media (hover: none) and (min-width: 861px) {
  .main-nav { gap: 1.1rem; }
  .main-nav .nav-link { width: auto; height: auto; min-width: 3.4rem; padding: 0.4rem 0.7rem; flex-direction: column; gap: 0.15rem; border-radius: 0.9rem; }
  .main-nav .nav-link::after {
    position: static; transform: none; opacity: 1; visibility: visible;
    background: none; color: inherit; padding: 0; font-size: 0.68rem; font-weight: 600;
  }
}

/* Móvil y tablet vertical: barra de pestañas inferior estilo app */
@media (max-width: 860px) {
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    padding: 0 max(0.6rem, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(0.6rem, env(safe-area-inset-right));
    gap: 0.6rem;
    background: hsl(var(--background) / 0.92);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid hsl(var(--border));
  }
  .bottom-nav-link {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
    min-width: 0; color: hsl(var(--muted-foreground)); font-size: 0.68rem; font-weight: 600; text-decoration: none;
    border-top: 2px solid transparent; transition: color 0.15s ease;
  }
  .bottom-nav-link i { font-size: 1.2rem; }
  .bottom-nav-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav-link:active { background: hsl(var(--accent)); }
  .bottom-nav-link.active { color: hsl(var(--primary)); border-top-color: hsl(var(--gold)); }
  /* El Verificador ya es una pestaña: el botón flotante sobra */
  .mobile-verifier-fab { display: none !important; }
  /* Elementos flotantes por encima de la barra inferior */
  .footer-bar, .footer-toggle { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 0.75rem); }
  .veritas-guide-launcher { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 0.75rem) !important; }
  .site-footer { padding-bottom: 3rem; }
  /* 16 px evita el zoom automático de iOS al escribir */
  input, select, textarea { font-size: 16px; }
}

/* Ya instalada como app: sin rebote al hacer scroll y con el contenido a salvo de muescas */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
  .site-header { padding-top: calc(0.9rem + env(safe-area-inset-top)); }
}

/* Hoja de ayuda para instalar en iPhone/iPad */
.pwa-sheet-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.55); padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
.pwa-sheet { width: 100%; max-width: 26rem; background: hsl(var(--card)); color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); border-radius: 1.25rem; padding: 1.4rem; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.pwa-sheet h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.pwa-sheet ol { margin: 0 0 1.1rem; padding-left: 1.2rem; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.pwa-sheet li strong { color: hsl(var(--foreground)); }
@media (min-width: 700px) { .pwa-sheet-backdrop { align-items: center; } }

/* ============================================================
   MI CUENTA — DASHBOARD COMPACTO Y RESPONSIVE
   ============================================================ */
#page-cuenta .page-hero{padding:2.25rem 1.25rem 1.15rem;text-align:left;max-width:1080px;margin:0 auto}
#page-cuenta .page-hero h1{font-size:clamp(1.8rem,4vw,2.45rem);margin-bottom:.35rem}
#page-cuenta .page-hero p{margin:0;max-width:720px}
#page-cuenta .container.narrow{max-width:1040px}
.account-shell{display:flex;flex-direction:column;gap:1.35rem;padding-bottom:2.5rem}
.account-welcome{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.15rem 1.3rem;border:1px solid hsl(var(--border));border-radius:18px;background:linear-gradient(135deg,hsl(var(--card)),hsl(var(--muted)/.42));box-shadow:0 10px 30px rgba(0,0,0,.06)}
.account-welcome h2{margin:.2rem 0 .25rem;font-size:1.35rem}
.account-welcome p{margin:0;color:hsl(var(--muted-foreground));font-size:.88rem}
.account-kicker,.account-label{display:block;color:hsl(var(--gold));font-size:.7rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
.account-grid.account-overview{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px;margin:0}
.account-card{position:relative;min-width:0;margin:0!important;padding:1.15rem!important;border-radius:17px!important;overflow:hidden;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.account-card:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(0,0,0,.08);border-color:hsl(var(--gold)/.4)}
.account-profile-card{grid-column:span 6}.account-subscription-card{grid-column:span 6}.account-library-card{grid-column:span 4}.account-affiliate-card{grid-column:span 8}
.account-card-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:hsl(var(--gold)/.12);color:hsl(var(--gold));margin-bottom:.85rem}
.account-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:.8rem;margin-bottom:.65rem}
.account-card h3{font-size:1.05rem;margin:.18rem 0 0;color:hsl(var(--foreground))}
.account-card p{margin:.45rem 0 .9rem}
.account-card-muted{font-size:.82rem;color:hsl(var(--muted-foreground));line-height:1.5}
.account-status{display:inline-flex;align-items:center;border-radius:999px;padding:.25rem .55rem;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:.67rem;font-weight:800;text-transform:uppercase;white-space:nowrap}
.account-status.is-active{background:rgba(22,131,75,.11);color:#16834b}
.account-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.8rem}
.account-profile-form label{display:block;font-size:.76rem;font-weight:700;margin-bottom:.35rem}
.account-profile-form input{display:block;width:100%;box-sizing:border-box;margin:.25rem 0 .65rem;padding:.65rem .75rem;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:.88rem}
.account-profile-form input:focus{outline:none;border-color:hsl(var(--gold)/.65);box-shadow:0 0 0 3px hsl(var(--gold)/.1)}
.account-email{display:flex;align-items:center;gap:.5rem;color:hsl(var(--muted-foreground));font-size:.78rem;margin-bottom:.8rem;min-width:0}.account-email span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-link{display:inline-flex;align-items:center;gap:.45rem;color:hsl(var(--primary));font-weight:700;font-size:.82rem;text-decoration:none;margin-top:.25rem}.account-link:hover{color:hsl(var(--gold))}
.account-section{display:flex;flex-direction:column;gap:.65rem}
.account-section-head{display:flex;align-items:end;justify-content:space-between;gap:1rem;padding:0 .15rem}.account-section-head h3{margin:.18rem 0 0;font-size:1.05rem}.account-section-count{font-size:.72rem;color:hsl(var(--muted-foreground));padding:.25rem .55rem;border:1px solid hsl(var(--border));border-radius:999px}
.account-table-card{margin:0!important;padding:.35rem!important;overflow:hidden}
.account-table{overflow:auto;border-radius:12px}.account-table table{min-width:600px}.account-table th{font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;color:hsl(var(--muted-foreground));background:hsl(var(--muted)/.35);white-space:nowrap}.account-table td{font-size:.82rem;color:hsl(var(--foreground));background:hsl(var(--card))}.account-table tr:last-child td{border-bottom:0}
#affiliate-details{margin-top:.35rem}#affiliate-details p{font-size:.78rem;margin:.4rem 0;color:hsl(var(--muted-foreground))}#affiliate-url{font-size:.75rem;border-radius:9px!important}
@media (max-width:800px){#page-cuenta .page-hero{padding:1.8rem 1rem 1rem}.account-welcome{align-items:flex-start;flex-direction:column}.account-welcome .btn{width:100%}.account-grid.account-overview{grid-template-columns:1fr}.account-profile-card,.account-subscription-card,.account-library-card,.account-affiliate-card{grid-column:span 1}.account-card:hover{transform:none}}
@media (max-width:520px){.account-shell{gap:1rem}.account-welcome{padding:1rem;border-radius:15px}.account-card{padding:1rem!important}.account-actions .btn{flex:1;min-width:130px}.account-section-head{align-items:flex-start}.account-section-count{display:none}.account-table-card{padding:.2rem!important}.account-table table{min-width:560px}}

/* En pantallas móviles se evita el desenfoque del fondo, costoso para la GPU en algunos dispositivos. */
@media (max-width: 860px) {
  .site-header,
  .bottom-nav {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: hsl(var(--background));
  }
}
/* ===================== LIBRERÍA POR CATEGORÍAS ===================== */
.books-category-section { margin: 1.4rem 0 2rem; }
.books-section-heading, .books-results-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.books-section-heading h2, .books-results-heading h2 { margin: .25rem 0 .35rem; font-size: clamp(1.25rem, 2vw, 1.7rem); line-height: 1.2; }
.books-section-heading p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .92rem; }
.books-view-all { display: inline-flex; align-items: center; gap: .45rem; flex-shrink: 0; color: hsl(var(--primary)); font-size: .84rem; font-weight: 700; text-decoration: none; }
.books-view-all:hover { text-decoration: underline; }
.books-categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.book-category-tile { min-width: 0; min-height: 108px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: .75rem; align-items: start; padding: 1rem; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); background: hsl(var(--card)); color: hsl(var(--foreground)); text-decoration: none; box-shadow: 0 2px 8px rgba(20,24,30,.025); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease; }
.book-category-tile:hover { transform: translateY(-2px); border-color: hsl(var(--gold) / .72); box-shadow: 0 8px 22px rgba(20,24,30,.07); }
.book-category-tile.is-active { border-color: hsl(var(--gold)); background: hsl(var(--gold) / .08); box-shadow: inset 0 0 0 1px hsl(var(--gold) / .22); }
.book-category-icon { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: hsl(var(--gold) / .14); color: hsl(var(--primary)); font-size: 1rem; }
.book-category-copy { min-width: 0; display: flex; flex-direction: column; gap: .32rem; }
.book-category-copy strong { font-size: .9rem; line-height: 1.3; }
.book-category-copy span { color: hsl(var(--muted-foreground)); font-size: .76rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-category-count { align-self: start; min-width: 27px; height: 25px; display: inline-flex; justify-content: center; align-items: center; padding: 0 .42rem; border-radius: 999px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.books-results-heading { align-items: center; margin: 1.6rem 0 1rem; padding-top: 1.35rem; border-top: 1px solid hsl(var(--border)); }
.books-results-heading h2 { margin-bottom: 0; }
.books-results-heading > p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .85rem; white-space: nowrap; }
.book-category-skeleton { height: 108px; border-radius: calc(var(--radius) + 2px); }
.books-category-error { padding: .8rem 1rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); color: hsl(var(--muted-foreground)); }
.book-card-category { display: inline-flex; align-self: flex-start; max-width: 100%; color: hsl(var(--primary)); font-size: .68rem; font-weight: 700; line-height: 1.3; margin-bottom: .1rem; }
.book-detail-taxonomy { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: .85rem 0 1rem; }
.book-category-pill, .book-subcategory-pill, .book-tag { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .65rem; border-radius: 999px; font-size: .73rem; line-height: 1.25; }
.book-category-pill { background: hsl(var(--gold) / .16); color: hsl(var(--primary)); font-weight: 700; text-decoration: none; }
.book-category-pill:hover { text-decoration: underline; }
.book-subcategory-pill { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.book-detail-tags { display: flex; flex-wrap: wrap; gap: .35rem; width: 100%; margin-top: .2rem; }
.book-tag { padding: .28rem .55rem; border: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); }
@media (max-width: 900px) { .books-categories { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 580px) {
  .books-categories { grid-template-columns: 1fr; gap: .6rem; }
  .book-category-tile { min-height: 88px; padding: .85rem; }
  .books-section-heading { align-items: start; flex-direction: column; }
  .books-results-heading { align-items: start; }
  .books-results-heading > p { padding-top: .5rem; }
}
@media (prefers-reduced-motion: reduce) { .book-category-tile { transition: none; } .book-category-tile:hover { transform: none; } }

.books-category-description { margin: .45rem 0 0; max-width: 680px; color: hsl(var(--muted-foreground)); font-size: .85rem; line-height: 1.55; }
.books-taxonomy-notice { margin: .8rem 0 0; padding: .7rem .85rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); color: hsl(var(--muted-foreground)); font-size: .8rem; }

/* ===================== LIBROS: NAVEGACIÓN LATERAL POR CATEGORÍAS ===================== */
#page-libros .books-layout {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 2.6vw, 2rem);
  margin-top: 1.35rem;
}
#page-libros .books-sidebar { min-width: 0; align-self: stretch; }
#page-libros .books-category-section {
  position: sticky;
  top: 5.25rem;
  margin: 0;
  padding: 1rem .8rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  background: hsl(var(--card) / .96);
  box-shadow: 0 8px 24px rgba(20, 24, 30, .045);
}
#page-libros .books-sidebar-heading {
  display: block;
  margin: 0 0 .8rem;
  padding: 0 .35rem .85rem;
  border-bottom: 1px solid hsl(var(--border));
}
#page-libros .books-sidebar-heading .eyebrow { font-size: .67rem; }
#page-libros .books-sidebar-heading h2 { margin: .3rem 0 .25rem; font-size: 1.28rem; }
#page-libros .books-sidebar-heading p { margin: 0 0 .65rem; font-size: .8rem; line-height: 1.45; }
#page-libros .books-sidebar-heading .books-view-all { font-size: .78rem; }
#page-libros .books-categories {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
#page-libros .book-category-tile {
  min-height: 0;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  padding: .58rem .55rem;
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
#page-libros .book-category-tile:hover {
  transform: none;
  border-color: hsl(var(--gold) / .35);
  background: hsl(var(--gold) / .07);
  box-shadow: none;
}
#page-libros .book-category-tile.is-active {
  border-color: hsl(var(--gold) / .55);
  background: hsl(var(--gold) / .13);
  box-shadow: inset 3px 0 0 hsl(var(--gold));
}
#page-libros .book-category-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: .82rem;
}
#page-libros .book-category-copy { gap: 0; }
#page-libros .book-category-copy strong { font-size: .79rem; line-height: 1.35; font-weight: 650; }
#page-libros .book-category-copy span { display: none; }
#page-libros .book-category-count {
  min-width: 24px;
  height: 22px;
  padding: 0 .35rem;
  font-size: .68rem;
}
#page-libros .books-category-skeleton,
#page-libros .book-category-skeleton { height: 43px; border-radius: 9px; }
#page-libros .books-main { min-width: 0; }
#page-libros .books-main .books-results-heading {
  margin: .1rem 0 1rem;
  padding: .1rem 0 .9rem;
  border-top: 0;
  border-bottom: 1px solid hsl(var(--border));
}
#page-libros .books-main .books-toolbar { margin-bottom: 1.1rem; }
#page-libros .books-main .books-search { min-width: min(220px, 100%); }
#page-libros .books-main #books-sort-select { flex: 0 0 auto; }
#page-libros .books-main .books-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
#page-libros .books-taxonomy-notice { font-size: .73rem; margin: .75rem .15rem 0; padding: .6rem; }
@media (max-width: 960px) {
  #page-libros .books-layout { grid-template-columns: 225px minmax(0, 1fr); gap: 1.1rem; }
  #page-libros .books-main .books-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .9rem; }
  #page-libros .books-sidebar-heading h2 { font-size: 1.15rem; }
  #page-libros .book-category-tile { gap: .45rem; padding: .55rem .4rem; }
}
@media (max-width: 760px) {
  #page-libros .books-layout { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  #page-libros .books-category-section { position: static; padding: .85rem; }
  #page-libros .books-sidebar-heading { padding-bottom: .65rem; margin-bottom: .65rem; }
  #page-libros .books-sidebar-heading h2 { font-size: 1.1rem; }
  #page-libros .books-sidebar-heading p { margin-bottom: .45rem; }
  #page-libros .books-categories {
    flex-direction: row;
    align-items: stretch;
    gap: .5rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: .15rem .1rem .5rem;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }
  #page-libros .book-category-tile {
    flex: 0 0 205px;
    min-width: 205px;
    max-width: 235px;
    grid-template-columns: 29px minmax(0, 1fr) auto;
    padding: .62rem .55rem;
    border-color: hsl(var(--border));
    background: hsl(var(--card));
    scroll-snap-align: start;
  }
  #page-libros .book-category-tile.is-active { border-color: hsl(var(--gold)); }
  #page-libros .books-main .books-results-heading { padding-bottom: .75rem; }
  #page-libros .books-main .books-toolbar { align-items: stretch; }
  #page-libros .books-main .books-search { flex-basis: 100%; }
  #page-libros .books-main #books-sort-select { width: 100%; }
  #page-libros .books-main .books-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: .75rem; }
}
@media (max-width: 420px) {
  #page-libros .books-main .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  #page-libros .books-main .book-card { min-width: 0; }
  #page-libros .books-results-heading { flex-direction: column; align-items: flex-start; }
  #page-libros .books-results-heading > p { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #page-libros .book-category-tile { transition: none; }
}

/* Preferencias visuales de la cuenta */
.account-theme-preferences { margin: 1rem 0; }
.account-theme-controls { display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; margin-top:.75rem; }
.account-theme-controls label { font-weight:600; }
.account-theme-controls select { min-width:min(100%, 240px); padding:.65rem .8rem; border:1px solid var(--border, #d7d7d7); border-radius:.65rem; background:var(--card, #fff); color:var(--foreground, #222); }
.account-accent-swatches { display:flex; flex-wrap:wrap; gap:.6rem; margin-top:.9rem; }
.account-accent-swatch { width:2rem; height:2rem; border-radius:50%; border:2px solid hsl(var(--card)); background:var(--swatch-color); box-shadow:0 0 0 1px hsl(var(--border)); cursor:pointer; transition:transform .15s ease, box-shadow .15s ease; }
.account-accent-swatch:hover, .account-accent-swatch:focus-visible { transform:scale(1.12); box-shadow:0 0 0 3px hsl(var(--ring) / .35); outline:none; }
.account-theme-controls select:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:2px; }
@media (max-width:600px) { .account-theme-controls { align-items:stretch; flex-direction:column; } .account-theme-controls select, .account-theme-controls button { width:100%; min-width:0; } }
#account-theme-status { font-size:.88rem; }

/* Exportación de informes del Verificador */
.pdf-export-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 1rem;
}
.pdf-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 44px;
  border-color: hsl(var(--gold) / .65);
  color: hsl(var(--gold));
  font-weight: 700;
}
.pdf-export-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px hsl(var(--gold) / .13);
}
.pdf-export-btn:disabled { opacity: .7; cursor: progress; }
@media (max-width: 640px) {
  .pdf-export-actions { justify-content: stretch; }
  .pdf-export-btn { width: 100%; white-space: normal; line-height: 1.25; padding: .8rem 1rem; }
}


/* =====================================================================
   SISTEMA VISUAL EDITORIAL 2026 — La Verdad Histórica
   Capa de diseño unificada: marfil, verde tinta y latón suave.
   Mantiene los hooks y selectores de comportamiento existentes.
   ===================================================================== */
:root {
  --background: 42 32% 97%;
  --foreground: 215 27% 16%;
  --card: 0 0% 100%;
  --card-foreground: 215 27% 16%;
  --primary: 162 28% 23%;
  --primary-foreground: 42 40% 97%;
  --secondary: 155 15% 92%;
  --muted: 40 18% 92%;
  --muted-foreground: 215 12% 39%;
  --accent: 151 18% 91%;
  --border: 38 17% 84%;
  --ring: 36 41% 43%;
  --gold: 36 43% 40%;
  --gold-soft: 37 48% 56%;
  --radius: 1rem;
  --shadow-soft: 0 8px 28px rgba(27, 40, 36, .07);
  --shadow-lift: 0 18px 48px rgba(27, 40, 36, .12);
  --hero-top: rgba(248, 247, 241, .94);
  --hero-bottom: rgba(248, 247, 241, .97);
}
[data-theme="dark"] {
  --background: 216 24% 9%;
  --foreground: 42 30% 93%;
  --card: 216 22% 12%;
  --card-foreground: 42 30% 93%;
  --primary: 38 43% 60%;
  --primary-foreground: 216 25% 10%;
  --secondary: 216 16% 16%;
  --muted: 216 16% 16%;
  --muted-foreground: 216 11% 70%;
  --accent: 158 17% 18%;
  --border: 216 13% 24%;
  --ring: 38 45% 60%;
  --gold: 38 48% 61%;
  --gold-soft: 39 53% 69%;
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, .18);
  --shadow-lift: 0 18px 48px rgba(0, 0, 0, .28);
  --hero-top: rgba(18, 29, 31, .93);
  --hero-bottom: rgba(18, 29, 31, .98);
}
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  background-color: hsl(var(--background));
  background-image: radial-gradient(ellipse at 50% -15%, hsl(var(--accent) / .50), transparent 54%);
  color: hsl(var(--foreground));
  line-height: 1.68;
  font-size: 16px;
  cursor: auto;
  transition: background-color .25s ease, color .25s ease;
}
body, html { max-width: 100%; }
body::selection { background: hsl(var(--gold) / .22); }
a, button, .btn, .nav-link, .mobile-nav-link, .icon-btn, .verifier-tab,
.example-chip, .history-item, .link-btn, [role="button"], [data-route] { cursor: pointer; }
:focus-visible { outline: 3px solid hsl(var(--ring)); outline-offset: 3px; }
.skip-link {
  position: fixed; top: .7rem; left: .7rem; z-index: 2000;
  transform: translateY(-180%); padding: .75rem 1rem; border-radius: .7rem;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-weight: 800;
  box-shadow: var(--shadow-lift);
}
.skip-link:focus { transform: translateY(0); }

/* Header y navegación */
.site-header {
  min-height: 76px; padding: .7rem clamp(1rem, 3vw, 2.75rem); gap: 1rem;
  background: hsl(var(--background) / .92); border-bottom: 1px solid hsl(var(--border));
  box-shadow: 0 5px 22px rgba(20, 40, 34, .035);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.brand { color: hsl(var(--foreground)); font-size: 1.03rem; gap: .65rem; letter-spacing: -.025em; }
.brand i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 1rem; }
.main-nav { gap: .2rem; }
.main-nav .nav-link { width: 42px; height: 44px; border-radius: 13px; font-size: 1rem; }
.main-nav .nav-link.active { box-shadow: inset 0 -2px 0 hsl(var(--gold)); }
.main-nav .nav-link::after { border: 1px solid hsl(var(--border)); box-shadow: var(--shadow-soft); }
.header-actions { gap: .35rem; }
.icon-btn { border-color: transparent; background: transparent; transition: background .18s ease, color .18s ease, transform .18s ease; }
.icon-btn:hover { box-shadow: none; background: hsl(var(--accent)); color: hsl(var(--primary)); }
@media (min-width: 1240px) {
  .main-nav .nav-link { width: auto; min-width: 0; height: 42px; padding: .55rem .62rem; gap: .42rem; font-size: .78rem; font-weight: 750; }
  .main-nav .nav-link span { display: inline; }
  .main-nav .nav-link::after { display: none; }
}
@media (min-width: 861px) and (max-width: 1239px) {
  .main-nav { gap: .05rem; }
  .main-nav .nav-link { width: 38px; }
  .site-header { gap: .55rem; padding-inline: 1rem; }
  .brand { font-size: .95rem; }
}
.mobile-nav { background: hsl(var(--background)); border-color: hsl(var(--border)); }
.mobile-nav-link { min-height: 48px; border-radius: 13px; font-size: .92rem; }
.mobile-overlay { background: rgba(14, 25, 22, .48); backdrop-filter: blur(3px); }

/* Portada y verificador: hero editorial con imagen patrimonial muy sutil */
.hero {
  min-height: auto; padding: clamp(3rem, 6.2vw, 5.8rem) clamp(1rem, 4vw, 3.5rem) 3.25rem;
  background-image: linear-gradient(90deg, rgba(248,247,241,.96) 0%, rgba(248,247,241,.94) 47%, rgba(248,247,241,.83) 100%), url('/assets/img/hero-bg.webp');
  background-size: cover; background-position: center 43%;
  border-bottom: 1px solid hsl(var(--border));
}
[data-theme="dark"] .hero {
  background-image: linear-gradient(90deg, rgba(17,28,29,.97) 0%, rgba(17,28,29,.94) 51%, rgba(17,28,29,.84) 100%), url('/assets/img/hero-bg.webp');
}
.hero-inner {
  width: 100%; max-width: 1160px; display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  grid-template-rows: auto auto auto auto; column-gap: clamp(2rem, 5vw, 5rem); row-gap: .85rem;
  align-items: center; text-align: left;
}
.hero-inner > .eyebrow { grid-column: 1; grid-row: 1; justify-self: start; margin: 0 0 .3rem; }
.hero h1 { grid-column: 1; grid-row: 2; max-width: 560px; font-size: clamp(2.7rem, 4.2vw, 4.55rem); letter-spacing: -.045em; line-height: 1.04; margin: .15rem 0 .25rem; }
.hero p.lead { grid-column: 1; grid-row: 3; max-width: 500px; margin: 0; font-size: clamp(1.02rem, 1.45vw, 1.16rem); line-height: 1.75; color: hsl(var(--muted-foreground)); }
.eyebrow, .page-hero .eyebrow, .hero .eyebrow {
  font-size: .72rem; letter-spacing: .095em; font-weight: 800; text-transform: uppercase;
  color: hsl(var(--primary)); background: hsl(var(--accent) / .85); border: 1px solid hsl(var(--border));
  padding: .48rem .8rem; border-radius: 999px;
}
[data-theme="dark"] .eyebrow, [data-theme="dark"] .page-hero .eyebrow, [data-theme="dark"] .hero .eyebrow { color: hsl(var(--gold)); }
.trust-strip {
  grid-column: 1; grid-row: 4; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  gap: .72rem; margin: 1.1rem 0 0; color: hsl(var(--muted-foreground)); font-size: .84rem;
}
.trust-strip span { gap: .65rem; }
.trust-strip i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; background: hsl(var(--accent)); color: hsl(var(--primary)); }
.verifier-card {
  grid-column: 2; grid-row: 1 / 5; width: 100%; padding: clamp(1rem, 2vw, 1.6rem);
  background: hsl(var(--card) / .96); border: 1px solid hsl(var(--border)); border-radius: 24px;
  box-shadow: 0 24px 70px rgba(32, 48, 41, .13); backdrop-filter: blur(8px);
}
.verifier-tabs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); width: 100%; gap: .35rem; padding: .35rem; margin: 0 0 1.2rem; border-radius: 15px; background: hsl(var(--muted) / .75); border-color: transparent; }
.verifier-tab { justify-content: center; min-width: 0; min-height: 46px; padding: .55rem .65rem; border-radius: 11px; font-size: .83rem; line-height: 1.25; }
.verifier-tab.active { color: hsl(var(--primary-foreground)); background: hsl(var(--primary)); box-shadow: 0 3px 9px rgba(22, 51, 42, .16); }
[data-theme="dark"] .verifier-tab.active { color: hsl(var(--primary-foreground)); background: hsl(var(--primary)); }
.verifier-steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); max-width: none; gap: .55rem; margin: 0 0 1.05rem; }
.v-step { align-items: flex-start; gap: .48rem; min-width: 0; padding: .72rem .68rem; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--background)); font-size: .72rem; line-height: 1.45; }
.v-step:not(:last-child)::after { display: none; }
.v-step-num { width: 27px; height: 27px; font-size: .75rem; background: hsl(var(--accent)); color: hsl(var(--primary)); }
textarea.query, input.query {
  min-height: 148px; padding: 1rem; border-radius: 15px; background: hsl(var(--background));
  border: 1px solid hsl(var(--border)); box-shadow: none; font-size: 1rem; line-height: 1.65;
}
input.query { min-height: 52px; }
textarea.query:focus, input.query:focus, input:focus, select:focus, textarea:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 4px hsl(var(--ring) / .14); outline: none; }
.query-counter { padding-right: .1rem; font-variant-numeric: tabular-nums; }
.search-wrap .btn-primary { width: 100%; min-height: 50px; }
.example-chip { padding: .48rem .75rem; background: hsl(var(--background)); border-radius: 999px; }
.example-chip:hover { transform: translateY(-1px); border-color: hsl(var(--gold)); background: hsl(var(--accent)); }
.verifier-auth-gate { background: hsl(var(--accent) / .6); border-radius: 14px; }

/* Botones, enlaces y estados */
.btn { min-height: 44px; padding: .7rem 1.1rem; font-size: .9rem; font-weight: 750; border-radius: 12px; line-height: 1.25; transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease, border-color .18s ease; }
.btn:active { transform: scale(.985); }
.btn-primary { margin-top: .65rem; color: hsl(var(--primary-foreground)); background: hsl(var(--primary)); padding: .86rem 1.2rem; font-size: .95rem; box-shadow: 0 5px 16px hsl(var(--primary) / .16); }
.btn-primary:hover { background: hsl(var(--primary) / .91); box-shadow: 0 9px 24px hsl(var(--primary) / .2); }
.btn-outline { min-height: 44px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); padding: .7rem 1.05rem; }
.btn-outline:hover { background: hsl(var(--accent)); border-color: hsl(var(--gold) / .55); color: hsl(var(--primary)); }
.btn-sm { min-height: 38px; padding: .52rem .8rem; font-size: .82rem; }
button:disabled, .btn:disabled { opacity: .55; }

/* Páginas interiores, contenedores y tarjetas coherentes */
.container { max-width: 1200px; padding-inline: clamp(1rem, 3vw, 2rem); }
.container.narrow { max-width: 900px; }
.page-hero { padding: clamp(2.5rem, 5vw, 4.25rem) 1rem 1.75rem; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.035em; line-height: 1.1; }
.page-hero p { max-width: 660px; font-size: 1.02rem; line-height: 1.7; }
.section-pad { padding: clamp(2.25rem, 4vw, 4rem) 0; }
.card, .source-card, .empire-card, .powers-box, .plan, .book-card, .books-smart-search {
  border: 1px solid hsl(var(--border)); border-radius: 18px; box-shadow: var(--shadow-soft); background-color: hsl(var(--card));
}
.card { padding: clamp(1.15rem, 2.6vw, 1.8rem); }
.card h2 { font-size: clamp(1.12rem, 1.7vw, 1.35rem); letter-spacing: -.02em; line-height: 1.3; }
.section-title h2 { font-size: clamp(1.25rem, 2.4vw, 1.7rem); letter-spacing: -.025em; }
.results { max-width: 1160px; padding: 2.3rem clamp(1rem, 3vw, 2rem) 4.5rem; }
.results > * + * { margin-top: 1.8rem; }
.verifier-empty-state { max-width: 560px; padding: 2rem 1.25rem; border: 1px dashed hsl(var(--border)); border-radius: 20px; background: hsl(var(--card) / .62); }
.verifier-empty-state i { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; margin: 0 auto .8rem; color: hsl(var(--primary)); background: hsl(var(--accent)); font-size: 1.25rem; }
.source-card, .empire-card { padding: 1.15rem; }
.source-card:hover, .book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: hsl(var(--gold) / .52); }
.source-card h4 { font-size: 1.05rem; line-height: 1.4; }
.verdict-card { border-width: 1px; border-radius: 18px; padding: clamp(1.15rem, 2.3vw, 1.65rem); box-shadow: var(--shadow-soft); }
.section-sub { line-height: 1.65; }

/* Catálogo, categorías, producto y planes */
.books-layout { gap: 1.4rem; }
.books-toolbar { align-items: stretch; gap: .65rem; margin-bottom: 1.1rem; }
.books-search input, .books-category-filter-label select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(.query), select, textarea:not(.query) {
  border-radius: 12px; border-color: hsl(var(--border)); background-color: hsl(var(--card)); color: hsl(var(--foreground));
}
.books-search input { min-height: 48px; padding-inline: 2.55rem 1rem; }
.books-grid { grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 1rem; }
.book-card { border-radius: 16px; box-shadow: 0 4px 15px rgba(23, 42, 35, .04); }
.book-cover { background: hsl(var(--muted)); }
.book-card-body { padding: .9rem .9rem 1rem; gap: .38rem; }
.book-title { font-size: .93rem; line-height: 1.38; }
.book-price { font-family: 'Manrope', sans-serif; }
.price-now { color: hsl(var(--primary)); font-weight: 800; }
.book-badge { top: .7rem; left: .7rem; border-radius: 8px; letter-spacing: .015em; }
.books-smart-search { background: linear-gradient(135deg, hsl(var(--card)), hsl(var(--accent) / .68)); border-color: hsl(var(--gold) / .32); padding: clamp(1rem, 2.5vw, 1.5rem); }
.books-smart-search-icon { border-radius: 13px; color: hsl(var(--primary)); background: hsl(var(--accent)); }
.books-smart-plan-badge { color: hsl(var(--gold)); }
.book-detail { gap: clamp(1.2rem, 3.5vw, 2.8rem); }
.book-detail-cover { border: 1px solid hsl(var(--border)); border-radius: 18px; box-shadow: var(--shadow-lift); }
.book-detail-info h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.15; }
.plans-grid { gap: 1rem; align-items: stretch; }
.plan { padding: clamp(1.2rem, 2.4vw, 1.8rem); border-radius: 20px; }
.plan.featured { border: 1.5px solid hsl(var(--gold)); box-shadow: 0 16px 38px hsl(var(--gold) / .12); }
.plan .tag { top: .8rem; left: auto; right: .8rem; transform: none; color: hsl(var(--primary-foreground)); background: hsl(var(--primary)); border-radius: 999px; }
.plan h3 { font-size: 1.4rem; }
.plan .price { font-size: 2.35rem; color: hsl(var(--primary)); letter-spacing: -.04em; }

/* Bloques de marca, anuncios y pie de página */
.veritas-teaser { margin: clamp(1rem, 3vw, 2.25rem) auto; max-width: 1200px; border: 1px solid rgba(194, 163, 111, .3); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lift); background: radial-gradient(ellipse at 80% 0%, rgba(196,165,111,.18), transparent 48%), linear-gradient(135deg, #183832 0%, #132823 100%); }
.veritas-teaser-inner { max-width: 800px; padding: clamp(2rem, 5vw, 4rem) 1.5rem; }
.veritas-teaser, .veritas-teaser h1, .veritas-teaser h2, .veritas-teaser p, .veritas-teaser a { color: #f7f3e8; }
.veritas-wordmark { letter-spacing: .16em; }
.site-footer { margin-top: 3.5rem; padding: 3rem clamp(1rem, 3vw, 2rem) 1.5rem; border-top: 1px solid hsl(var(--border)); background: hsl(var(--card) / .8); }
.site-footer .fcols { max-width: 1200px; gap: clamp(1.3rem, 4vw, 3.5rem); }
.site-footer .fcol a, .site-footer .fcol button { min-height: 36px; display: inline-flex; align-items: center; }
.site-footer .copyright { max-width: 1200px; }
.ad-slot { color: hsl(var(--muted-foreground)); }
.ad-box { border-radius: 12px; }

/* Cuenta, formularios, notificaciones y modales */
.field { margin-bottom: 1.05rem; }
.field label, form label { display: block; margin-bottom: .4rem; color: hsl(var(--foreground)); font-weight: 700; font-size: .88rem; }
input, select, textarea { font: inherit; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(.query), select, textarea:not(.query) { min-height: 44px; padding: .7rem .85rem; }
.profile-area { min-width: 0; }
.notification-dropdown { border-radius: 18px; border-color: hsl(var(--border)); box-shadow: var(--shadow-lift); }
.notification-item { min-height: 66px; }
.history-panel { box-shadow: -22px 0 70px rgba(0,0,0,.18); }
.auth-modal, .modal, .cookie-modal { border-radius: 22px; }

/* Comunidad dentro del sitio: mantener su personalidad, compartir paleta y radios */
.community-app { border-color: hsl(var(--border)); border-radius: 18px; box-shadow: var(--shadow-soft); }
.community-channel.active { background: hsl(var(--accent)); color: hsl(var(--primary)); }
.community-channel.active .community-channel-icon { color: hsl(var(--gold)); }
.community-compose-box:focus-within { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / .13); }

/* Responsive: móvil primero, controles cómodos y sin scroll horizontal */
@media (max-width: 980px) {
  .hero { padding: 2.8rem 1rem 2.3rem; }
  .hero-inner { display: flex; flex-direction: column; align-items: stretch; text-align: center; gap: 1rem; max-width: 790px; }
  .hero-inner > .eyebrow { align-self: center; }
  .hero h1 { max-width: 760px; margin: .2rem auto 0; font-size: clamp(2.45rem, 6vw, 3.55rem); }
  .hero p.lead { max-width: 680px; margin: 0 auto; }
  .trust-strip { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: .65rem 1rem; margin: .35rem 0 .4rem; }
  .trust-strip span { font-size: .78rem; }
  .verifier-card { max-width: 760px; align-self: center; }
}
@media (max-width: 760px) {
  .site-header { min-height: 64px; padding: .45rem .75rem; gap: .4rem; }
  .brand { font-size: .9rem; gap: .45rem; }
  .brand i { width: 34px; height: 34px; border-radius: 11px; }
  .header-actions { gap: .12rem; }
  .header-actions .icon-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  .site-header #history-trigger { display: none; }
  .hero { padding: 2.1rem .85rem 1.7rem; }
  .hero h1 { font-size: clamp(2.15rem, 8.5vw, 3rem); max-width: 540px; line-height: 1.08; }
  .hero p.lead { font-size: .98rem; line-height: 1.65; }
  .verifier-card { padding: .8rem; border-radius: 20px; }
  .verifier-tabs { gap: .25rem; padding: .25rem; margin-bottom: .9rem; }
  .verifier-tab { min-height: 48px; padding: .52rem .45rem; gap: .35rem; font-size: .77rem; }
  .verifier-steps { gap: .4rem; margin-bottom: .8rem; }
  .v-step { padding: .58rem; font-size: .69rem; }
  .v-step-num { width: 24px; height: 24px; }
  textarea.query, input.query { min-height: 148px; font-size: 16px; padding: .9rem; }
  input.query { min-height: 48px; }
  .query-counter { margin-top: .3rem; }
  .search-wrap .btn-primary { min-height: 50px; width: 100%; }
  .trust-strip { gap: .5rem; }
  .trust-strip span { font-size: .73rem; }
  .trust-strip i { width: 23px; height: 23px; }
  .page-hero { padding: 2.35rem .9rem 1.25rem; }
  .page-hero h1 { font-size: clamp(1.85rem, 7.2vw, 2.55rem); }
  .page-hero p { font-size: .95rem; }
  .container { padding-inline: .9rem; }
  .results { padding: 1.5rem .8rem 3rem; }
  .results > * + * { margin-top: 1.25rem; }
  .section-title { align-items: flex-start; }
  .section-title h2 { font-size: 1.25rem; }
  .sources-grid { grid-template-columns: 1fr; gap: .75rem; }
  .bento-grid { grid-template-columns: 1fr; }
  .verdict-card { gap: .75rem; padding: 1rem; }
  .verdict-card i.big { font-size: 1.5rem; }
  .books-layout { display: block; }
  .books-toolbar { flex-direction: column; }
  .books-search { width: 100%; min-width: 0; }
  .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .book-card-body { padding: .7rem; }
  .book-title { font-size: .83rem; }
  .book-author { font-size: .72rem; }
  .book-price { font-size: .9rem; }
  .book-detail { grid-template-columns: minmax(0, 1fr); }
  .book-detail-cover { width: min(200px, 60%); }
  .plans-grid { grid-template-columns: 1fr; gap: .85rem; margin-top: 1.35rem; }
  .plan { padding: 1.25rem; }
  .plan .tag { position: static; display: inline-flex; align-self: flex-start; transform: none; margin-bottom: .7rem; }
  .veritas-teaser { margin: .9rem; border-radius: 22px; }
  .veritas-teaser-inner { padding: 2rem 1rem; }
  .site-footer { padding: 2.25rem 1rem 1.2rem; }
  .site-footer .fcols { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .site-footer .copyright { font-size: .74rem; }
  .bottom-nav { gap: .1rem; padding-inline: max(.25rem, env(safe-area-inset-left)) max(.25rem, env(safe-area-inset-right)); }
  .bottom-nav-link { min-width: 0; gap: .18rem; font-size: .62rem; letter-spacing: -.01em; }
  .bottom-nav-link i { font-size: 1.08rem; }
}
@media (max-width: 420px) {
  .brand span { display: none; }
  .site-header .header-actions .notification-trigger, .site-header .header-actions #theme-toggle { width: 36px; min-width: 36px; }
  .verifier-tabs { grid-template-columns: 1fr 1fr; }
  .verifier-tab { flex-direction: column; font-size: .7rem; min-height: 54px; }
  .verifier-steps { grid-template-columns: 1fr; }
  .v-step { flex-direction: row; align-items: center; padding: .55rem .65rem; font-size: .76rem; }
  .trust-strip { display: grid; grid-template-columns: 1fr; justify-content: start; text-align: left; width: fit-content; max-width: 100%; margin: .25rem auto .35rem; }
  .books-grid { gap: .55rem; }
  .book-badge { font-size: .57rem; padding: .18rem .4rem; }
  .site-footer .fcols { grid-template-columns: 1fr; }
  .notification-dropdown { left: 8px; right: 8px; width: auto; }
}
@media (hover: hover) and (pointer: fine) {
  .card, .plan, .book-card, .source-card { transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
  .plan:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* Acceso por suscripción: comparativa entre imperios */
.empire-plan-lock{display:flex;align-items:center;gap:18px;margin:18px 0 8px;padding:22px 24px;border:1px solid rgba(201,164,92,.38);border-radius:16px;background:linear-gradient(135deg,rgba(201,164,92,.09),rgba(16,31,48,.72));}
.empire-plan-lock-icon{flex:0 0 auto;font-size:1.55rem;color:#c9a45c;}
.empire-plan-lock-copy{min-width:0;flex:1;display:flex;align-items:center;justify-content:space-between;gap:18px;}
.empire-plan-lock-message{min-width:0;flex:1;}
.empire-plan-lock-copy h3{margin:0 0 7px;font-size:1.08rem;color:var(--text-primary,#f4f1e8);}
.empire-plan-lock-copy p{margin:0 0 14px;color:var(--text-secondary,#b8c0ca);line-height:1.55;}
.empire-plan-cta{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;white-space:normal;flex:0 0 auto;}
@media(max-width:600px){.empire-plan-lock{align-items:flex-start;gap:12px;padding:18px 16px}.empire-plan-lock-icon{font-size:1.25rem}.empire-plan-lock-copy{align-items:stretch;flex-direction:column;gap:8px}.empire-plan-cta{width:100%}}

/* ===================== FIX GLOBAL DE MODALES Y BANNERS ===================== */
/* Todos los diálogos se sacan del flujo normal: nunca deben aparecer al final
   del documento como si fueran contenido de la página. */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 11000;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding: clamp(.75rem, 3vw, 1.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(10, 12, 16, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.open {
  display: flex !important;
}
#auth-modal {
  z-index: 11900;
}
#auth-modal .modal {
  position: relative;
  box-sizing: border-box;
  width: min(420px, 100%);
  max-width: 420px;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1.1rem, 4vw, 1.6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid hsl(var(--border));
  border-radius: 22px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}
#auth-modal .modal-header { margin-bottom: 1rem; }
#auth-modal .modal-header h2 { margin: 0 0 .45rem; font-size: 1.35rem; }
#auth-modal .modal-header p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .88rem; line-height: 1.5; }
#auth-modal .auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: 1rem 0; }
#auth-modal .auth-tab { padding: .65rem .8rem; border: 1px solid hsl(var(--border)); border-radius: 10px; background: transparent; color: hsl(var(--foreground)); cursor: pointer; }
#auth-modal .auth-tab.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
#auth-modal #auth-form .field { margin-bottom: .85rem; }
#auth-modal #auth-form label { display: block; margin-bottom: .35rem; font-size: .82rem; font-weight: 700; }
#auth-modal #auth-forgot-link { display: inline-block; margin: -.15rem 0 .8rem; padding: 0; border: 0; background: transparent; color: hsl(var(--primary)); font: inherit; font-size: .84rem; text-decoration: underline; cursor: pointer; }
#auth-modal #auth-error { line-height: 1.45; overflow-wrap: anywhere; }
#auth-modal #auth-form input { box-sizing: border-box; width: 100%; max-width: 100%; }
#auth-modal #auth-error:empty { display: none; }
#cookie-modal.cookie-overlay { z-index: 12000; }
@media (max-width: 560px) {
  #auth-modal { padding: .65rem; }
  #auth-modal .modal { max-height: calc(100dvh - 1.3rem); border-radius: 18px; }
}

/* Preferencias personales de lectura */
:root { --lvh-reading-font-size: 100%; --lvh-reading-line-height: 1.7; }
.article-content, .article-body, .reader-content, .ebook-reader-content, .reader-page, .historical-article-body {
  font-size: var(--lvh-reading-font-size);
  line-height: var(--lvh-reading-line-height);
}
.account-extra-features { display: grid; gap: 1rem; margin-top: 1rem; }
.account-extra-card { min-width: 0; }
.account-extra-form { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); gap: .75rem; align-items: end; margin: .8rem 0 1rem; }
.account-extra-form label, .account-pref-frequency { display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; }
.account-extra-form input, .account-extra-form select, .account-pref-frequency select { width: 100%; min-width: 0; border: 1px solid var(--border, #d5d5d5); border-radius: .6rem; padding: .65rem .75rem; background: var(--card, #fff); color: var(--foreground, inherit); }
.account-preference-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: .65rem; margin: 1rem 0; }
.account-pref-check { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--border, #ddd); border-radius: .65rem; padding: .7rem; font-size: .92rem; }
.account-pref-check input { accent-color: hsl(var(--primary, 142 62% 30%)); }
.account-pref-frequency { max-width: 320px; }
.saved-items-list, .account-sessions-list { display: grid; gap: .6rem; margin-top: .8rem; }
.saved-item-row, .account-session-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem; border: 1px solid var(--border, #ddd); border-radius: .7rem; min-width: 0; }
.saved-item-row > div, .account-session-row > div { display: grid; gap: .25rem; min-width: 0; overflow-wrap: anywhere; }
.saved-item-row small, .account-session-row small { display: block; color: var(--muted-foreground, #666); font-size: .82rem; }
.saved-item-row a { font-size: .88rem; }
.account-session-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.account-session-head h4 { margin: 0; }
.account-session-current { white-space: nowrap; color: var(--muted-foreground, #666); font-size: .85rem; }
@media (max-width: 560px) {
  .saved-item-row, .account-session-row { align-items: flex-start; }
  .account-session-head { align-items: flex-start; flex-direction: column; }
}


/* CMP Google pendiente: conservar el espacio reservado sin cargar anuncios. */
.ad-slot.ad-consent-pending {
  display: flex;
  visibility: visible;
  min-height: 90px;
  align-items: flex-start;
  justify-content: center;
}
.ad-slot.ad-consent-pending .ad-box {
  min-height: 64px;
}
.ad-slot.ad-consent-pending .ad-label {
  display: inline-block;
}
.ad-rail.ad-consent-pending {
  min-height: 250px;
}


/* ============================================================
   FIX RESPONSIVE DEFINITIVO DE PUBLICIDAD (2026-10)
   - Los raíles laterales fixed invadían el contenido central.
   - Los tamaños fijos de 728/468/320px desbordaban sus contenedores.
   - Los anuncios reservan espacio en el flujo normal y nunca se superponen.
============================================================ */
/* Los raíles laterales se definen al final del archivo (RAÍLES LATERALES). */
.ad-slot.ad-banner,
.ad-slot:not(.ad-rail) {
  box-sizing: border-box;
  position: relative;
  inset: auto;
  float: none;
  clear: both;
  width: calc(100% - 2rem);
  max-width: 760px;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: clamp(1rem, 3vw, 2rem) auto;
  padding: 0;
  overflow: visible;
  flex: 0 1 auto;
  align-self: center;
  z-index: auto;
}
.ad-slot .ad-label {
  display: block;
  position: static;
  max-width: 100%;
  line-height: 1.4;
  text-align: center;
}
.ad-slot .ad-box,
.ad-banner .ad-box,
.ad-slot.ad-consent-pending .ad-box {
  box-sizing: border-box;
  display: flex;
  position: relative;
  inset: auto;
  float: none;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: clamp(50px, 8vw, 90px);
  margin: 0 auto;
  padding: .5rem;
  overflow: hidden;
  aspect-ratio: auto;
}
.ad-slot .ad-box > ins.adsbygoogle,
.ad-slot .ad-box iframe,
.ad-slot .ad-box > div {
  box-sizing: border-box;
  max-width: 100% !important;
}
.ad-slot .ad-box > ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
}
.ad-slot.ad-consent-pending {
  display: flex;
  visibility: visible;
  min-height: 0;
}
.ad-slot.ad-consent-pending .ad-box { min-height: clamp(50px, 8vw, 90px); }
.results > .ad-slot { width: calc(100% - 2rem); max-width: 760px; margin: 1.5rem auto 0; padding: 0; }
@media (max-width: 760px) {
  .ad-slot.ad-banner,
  .ad-slot:not(.ad-rail),
  .results > .ad-slot {
    width: calc(100% - 1.5rem);
    max-width: 100%;
    margin: 1rem auto;
  }
  .ad-slot .ad-box,
  .ad-slot.ad-consent-pending .ad-box {
    min-height: 60px;
    padding: .35rem;
  }
}
@media (max-width: 420px) {
  .ad-slot.ad-banner,
  .ad-slot:not(.ad-rail),
  .results > .ad-slot {
    width: calc(100% - 1rem);
    margin: .75rem auto;
  }
  .ad-slot .ad-box,
  .ad-slot.ad-consent-pending .ad-box {
    min-height: 50px;
    border-radius: .4rem;
    padding: .25rem;
  }
  .ad-slot .ad-label { font-size: .55rem; letter-spacing: .12em; }
}

/* ============================================================
   Biblioteca de afirmaciones (sección «Batallas»)
   ============================================================ */
.lib-search { display: flex; align-items: center; gap: .6rem; max-width: 640px; margin: 1.25rem auto 1rem; padding: .35rem .4rem .35rem 1rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 999px; box-shadow: var(--shadow-soft, 0 4px 16px rgba(0,0,0,.05)); }
.lib-search > i { color: hsl(var(--gold)); }
.lib-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: hsl(var(--foreground)); padding: .55rem 0; }
.lib-search:focus-within { border-color: hsl(var(--gold) / .7); box-shadow: 0 0 0 3px hsl(var(--gold) / .15); }
.lib-search[hidden], .lib-verdicts[hidden] { display: none !important; }
.lib-verdicts { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: 1.75rem; }
.lib-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); font-size: .88rem; font-weight: 650; text-decoration: none; transition: background-color .18s, border-color .18s; }
.lib-chip b { font-weight: 700; padding: .05rem .5rem; border-radius: 999px; background: hsl(var(--muted)); font-size: .78rem; }
.lib-chip:hover { border-color: hsl(var(--gold) / .6); background: hsl(var(--accent)); }
.lib-chip.active { background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.lib-chip.active b { background: hsl(var(--primary-foreground) / .2); }
.lib-view { margin-bottom: 2.5rem; min-height: 220px; }
.lib-view .section-title { margin-top: 1.5rem; }
.lib-loading { text-align: center; color: hsl(var(--muted-foreground)); padding: 3rem 0; }
.lib-cats { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.lib-cat { display: flex; flex-direction: column; gap: .3rem; padding: 1.15rem; border-radius: 16px; border: 1px solid hsl(var(--border)); background: linear-gradient(145deg, hsl(var(--card)), hsl(var(--accent) / .55)); color: inherit; text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s; }
.lib-cat:hover { transform: translateY(-3px); border-color: hsl(var(--gold) / .6); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.lib-cat-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: hsl(var(--gold) / .16); color: hsl(var(--gold)); font-size: 1.1rem; margin-bottom: .4rem; }
.lib-cat-name { font-family: 'Playfair Display', serif; font-size: 1.12rem; font-weight: 600; }
.lib-cat-meta { font-size: .85rem; color: hsl(var(--muted-foreground)); }
.lib-dots { display: flex; gap: .35rem; margin-top: .4rem; }
.lib-dot { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--muted-foreground)); }
.lib-dot-desmentido { background: #22c55e; } .lib-dot-confirmado { background: #ef4444; } .lib-dot-parcialmente_cierto { background: #f59e0b; }
.lib-list { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.lib-entry { display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem 1.15rem; border-radius: 16px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: inherit; text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s; }
.lib-entry:hover { transform: translateY(-3px); border-color: hsl(var(--gold) / .6); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.lib-entry-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.lib-entry-cat { font-size: .78rem; color: hsl(var(--muted-foreground)); }
.lib-entry-cat i { color: hsl(var(--gold)); margin-right: .25rem; }
.lib-entry h3 { font-family: 'Playfair Display', serif; font-size: 1.08rem; line-height: 1.3; margin: 0; }
.lib-entry p { margin: 0; font-size: .9rem; color: hsl(var(--muted-foreground)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lib-entry-more { margin-top: auto; font-size: .85rem; font-weight: 700; color: hsl(var(--gold)); }
.lib-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .88rem; color: hsl(var(--muted-foreground)); margin-bottom: .5rem; }
.lib-crumbs a { color: hsl(var(--gold)); font-weight: 650; text-decoration: none; }
.lib-crumbs i { font-size: .65rem; }
.lib-article { max-width: 860px; margin: 0 auto; }
.lib-claim { font-family: 'Playfair Display', serif; font-size: clamp(1.3rem, 3.2vw, 1.8rem); line-height: 1.3; margin: .75rem 0 0; }
.lib-body { margin: 1.25rem 0 1rem; font-size: 1.02rem; line-height: 1.75; }
.lib-body p + p { margin-top: 1rem; }
.lib-sources { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.lib-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; padding: 1.1rem 1.25rem; border-radius: 16px; border: 1px solid hsl(var(--gold) / .35); background: hsl(var(--gold) / .08); font-weight: 650; }
.lib-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; color: hsl(var(--muted-foreground)); font-size: .9rem; }
.lib-empty { text-align: center; padding: 3rem 1rem; color: hsl(var(--muted-foreground)); }
.lib-empty i { font-size: 2rem; color: hsl(var(--gold)); margin-bottom: .75rem; display: block; }
.lib-empty p { margin-bottom: 1rem; }
.lib-engine { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 3rem; padding: 1rem 1.25rem; border-radius: 16px; border: 1px dashed hsl(var(--border)); background: hsl(var(--card)); }
.lib-engine[hidden] { display: none !important; }
.lib-engine-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: hsl(var(--gold) / .16); color: hsl(var(--gold)); }
.lib-engine-copy { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: .15rem; }
.lib-engine-copy span { font-size: .88rem; color: hsl(var(--muted-foreground)); }
@media (max-width: 600px) {
  .lib-search { border-radius: 18px; }
  .lib-verdicts { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; }
  .lib-chip { white-space: nowrap; }
  .lib-list { grid-template-columns: 1fr; }
}

.source-verified { display: inline-flex; align-items: center; gap: .35rem; align-self: flex-start; margin: .1rem 0 .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; color: #15803d; background: rgba(34,197,94,.13); border: 1px solid rgba(34,197,94,.35); }

.ai-usage-note { margin: .6rem 0 0; font-size: .85rem; color: hsl(var(--muted-foreground)); }
.ai-usage-note[hidden] { display: none; }
.ai-usage-note i { color: hsl(var(--gold)); margin-right: .3rem; }
.ai-usage-note a { color: hsl(var(--gold)); font-weight: 700; }
.ai-usage-empty { color: #b45309; }
.plan .plan-ai-line { font-weight: 600; }
.plan .plan-ai-line i { color: hsl(var(--gold)); }

/* ---------- Biblioteca: artículo comparativo (afirmación + 5 imperios) ---------- */
.lib-article { max-width: 1120px; }
.lib-claim-sub { margin-top: .6rem; font-size: .95rem; opacity: .85; }
.lib-entry-cmp { display: inline-flex; align-items: center; gap: .4rem; align-self: flex-start; font-size: .76rem; font-weight: 700; letter-spacing: .02em; padding: .25rem .65rem; border-radius: 999px; background: hsl(var(--gold) / .14); color: hsl(var(--gold-dark, var(--gold))); border: 1px solid hsl(var(--gold) / .35); }
.lib-article-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem; margin-top: 2rem; align-items: start; }
.lib-toc { position: sticky; top: 6rem; display: flex; flex-direction: column; gap: .15rem; padding: 1rem; border-radius: 16px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.lib-toc-title { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: hsl(var(--muted-foreground)); margin-bottom: .5rem; }
.lib-toc a { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; border-radius: 10px; color: hsl(var(--foreground)); text-decoration: none; font-size: .9rem; font-weight: 600; transition: background-color .18s, color .18s; }
.lib-toc a span { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; font-size: .72rem; background: hsl(var(--gold) / .16); color: hsl(var(--gold)); }
.lib-toc a:hover { background: hsl(var(--accent)); color: hsl(var(--gold)); }
.lib-article-main { min-width: 0; }
.lib-sec { scroll-margin-top: 6rem; padding: 0 0 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid hsl(var(--border)); }
.lib-sec:last-child { border-bottom: 0; }
.lib-sec-head { display: flex; gap: 1rem; align-items: flex-start; }
.lib-sec-num { font-family: 'Playfair Display', serif; font-size: 2.4rem; line-height: 1; font-weight: 700; color: hsl(var(--gold)); min-width: 2.2rem; }
.lib-sec-kicker { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: hsl(var(--muted-foreground)); margin-bottom: .25rem; }
.lib-sec-title { font-family: 'Playfair Display', serif; font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.25; margin: 0; }
.lib-sec-notice { margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 12px; font-size: .88rem; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.lib-sec-notice i { color: hsl(var(--gold)); margin-right: .3rem; }
.lib-sec .lib-body { max-width: 72ch; }
.lib-sec-sources { margin-top: 1.25rem; padding: 1rem; border-radius: 14px; background: hsl(var(--accent) / .45); border: 1px dashed hsl(var(--border)); }
.lib-sec-sources-title { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--muted-foreground)); margin-bottom: .75rem; }
.lib-sec-sources-title i { color: hsl(var(--gold)); margin-right: .3rem; }
@media (max-width: 900px) {
  .lib-article-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .lib-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: .35rem; }
  .lib-toc-title { width: 100%; }
  .lib-toc a { border: 1px solid hsl(var(--border)); font-size: .82rem; }
}
/* overflow-x: hidden en body lo convierte en contenedor de scroll y rompe el índice fijo */
body[data-route="batallas"] { overflow-x: clip; overflow-y: visible; }


/* ===== Publicidad v2: huecos en listados, artículos y verificador ===== */
/* Dentro de la rejilla de la biblioteca el anuncio ocupa toda la fila. */
.lib-list > .ad-in-list { grid-column: 1 / -1; margin: .25rem auto; padding: 0; width: 100%; }
/* Entre secciones de un artículo: respiro suficiente para no confundirlo con el texto. */
.lib-article-main > .ad-in-article,
.lib-article > .ad-in-article { margin: 2rem auto; width: 100%; }
/* Hueco inferior del verificador: solo cuando ya hay un resultado (nunca junto a los botones ni con el estado vacío). */
.ad-slot[data-ad="inicio-bottom"] { display: none; }
#results-container:not(:has(.verifier-empty-state)) ~ .ad-slot[data-ad="inicio-bottom"],
#character-results:not(:has(.verifier-empty-state)) ~ .ad-slot[data-ad="inicio-bottom"] { display: flex; }
@media (max-width: 520px) {
  .lib-article-main > .ad-in-article,
  .lib-article > .ad-in-article { margin: 1.5rem auto; }
}

/* ============================================================
   RAÍLES LATERALES (restaurados 2026-10-22)
   El contenido central llega a 1200px (half = 600px). Los raíles son fixed y quedan SIEMPRE
   fuera de esa columna: 120px desde 1500px de ancho, 160px desde 1620px. Con menos ancho
   se ocultan. Alto mínimo 800px: así no tapan el botón flotante de la guía (abajo a la derecha)
   ni el pie de ventana. Los banners del flujo normal no cambian.
============================================================ */
:root { --content-half: 600px; --rail-w: 120px; --rail-gap: 12px; }
.ad-rail,
.ad-rail.ad-consent-pending {
  display: none;
  position: fixed;
  top: 96px;
  right: auto;
  bottom: auto;
  width: var(--rail-w);
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  transform: none;
  z-index: 20;
}
.ad-rail-left  { left: calc(50% - var(--content-half) - var(--rail-gap) - var(--rail-w)); }
.ad-rail-right { left: calc(50% + var(--content-half) + var(--rail-gap)); }
.ad-slot.ad-rail .ad-box,
.ad-slot.ad-rail.ad-consent-pending .ad-box {
  width: var(--rail-w) !important;
  min-width: 0 !important;
  height: 600px !important;
  min-height: 600px;
  padding: .5rem;
}
@media (min-width: 1500px) and (min-height: 800px) {
  .ad-rail,
  .ad-rail.ad-consent-pending { display: flex; }
}
@media (min-width: 1620px) and (min-height: 800px) {
  :root { --rail-w: 160px; --rail-gap: 16px; }
}
@media print { .ad-rail { display: none !important; } }


/* Patrocinadores: logos administrables, responsive y con dimensiones normalizadas */
.hero { padding-top: clamp(1.8rem, 3.5vw, 3.25rem); padding-bottom: clamp(2rem, 3vw, 2.8rem); }
.sponsors-strip { width: min(1160px, calc(100% - 2rem)); margin: 1.2rem auto 1.6rem; padding: 1.1rem 1.25rem 1.3rem; text-align: center; border: 1px solid hsl(var(--border)); border-radius: 18px; background: hsl(var(--card) / .72); }
.sponsors-strip[hidden] { display: none !important; }
.sponsors-strip h2 { margin: 0 0 1rem; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: hsl(var(--muted-foreground)); }
.sponsors-logos { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: clamp(1rem, 3vw, 2.5rem); }
.sponsor-logo { display: flex; flex: 0 1 150px; min-width: 90px; max-width: 180px; min-height: 72px; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; color: hsl(var(--foreground)); text-decoration: none; font-size: .78rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.sponsor-logo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 52px; object-fit: contain; }
.sponsor-logo span { max-width: 100%; }
@media (max-width: 600px) { .hero { padding-top: 1.5rem; padding-bottom: 1.5rem; } .sponsors-strip { width: calc(100% - 1rem); padding: 1rem .65rem; margin: .75rem auto 1rem; } .sponsors-logos { gap: .85rem; } .sponsor-logo { flex-basis: 100px; max-width: 125px; min-height: 62px; font-size: .72rem; } .sponsor-logo img { max-height: 42px; } }

/* LVH shared navigation: consistent on every public section */
.site-header .main-nav{gap:clamp(.12rem,.35vw,.4rem);flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.site-header .main-nav::-webkit-scrollbar{display:none}.site-header .main-nav .nav-link{white-space:nowrap}.site-header .main-nav .nav-link span{display:inline}.site-header .header-actions{flex-shrink:0}@media(max-width:1100px){.site-header .main-nav{justify-content:flex-start}.site-header .main-nav .nav-link{padding:.45rem .5rem;font-size:.76rem;gap:.3rem}}@media(max-width:760px){.site-header .main-nav{display:none;position:absolute;top:100%;left:.5rem;right:.5rem;z-index:1000;padding:.65rem;background:hsl(var(--background));border:1px solid hsl(var(--border));border-radius:1rem;box-shadow:0 12px 32px #0002;white-space:normal;flex-wrap:wrap}.site-header .main-nav.is-open{display:flex}.site-header .main-nav .nav-link{flex:1 1 30%;justify-content:center}.site-header .brand{min-width:0}.site-header .brand span{font-size:.9rem}}

/* Footer editorial reorganizado: grupos claros y lectura rápida */
.site-footer{background:linear-gradient(145deg,hsl(var(--secondary)/.78),hsl(var(--background)));padding-top:2.8rem}.site-footer .fcols{display:grid;grid-template-columns:minmax(220px,1.5fr) repeat(4,minmax(130px,1fr));gap:clamp(1rem,2.5vw,2.25rem);align-items:start}.site-footer .fcol{min-width:0}.site-footer .fcol h4{margin-bottom:.9rem}.site-footer .fcol a,.site-footer .fcol button{line-height:1.55}.site-footer .fbrand .brand{font-weight:800;display:inline-flex;gap:.55rem;align-items:center}.site-footer .copyright{line-height:1.6}@media(max-width:900px){.site-footer .fcols{grid-template-columns:repeat(2,minmax(0,1fr))}.site-footer .fbrand{grid-column:1/-1}}@media(max-width:520px){.site-footer .fcols{gap:1.25rem}.site-footer .fcol a,.site-footer .fcol button{font-size:.84rem}.site-footer{padding:1.7rem 1rem 5rem}}

/* Portadas externas: fallback cuando el proveedor no dispone de imagen o bloquea la carga. */
.book-cover.cover-missing, .book-detail-cover.cover-missing, .library-cover.cover-missing {
  position: relative; background: var(--surface, #f2f2f2); display: flex; align-items: center; justify-content: center;
}
.book-cover.cover-missing::after, .book-detail-cover.cover-missing::after, .library-cover.cover-missing::after {
  content: "\\f02d"; font-family: "Font Awesome 5 Free", "Font Awesome 6 Free"; font-weight: 900; color: #888; font-size: 2rem;
}
