/* ==========================================================================
   Landing redesign – PublicLanding (.pl) y Mi Biblioteca (.ml)
   Paleta pensada para una plataforma educativa: azules profundos (confianza),
   neutros limpios y un acento dorado usado con moderación.
   El modo oscuro (body.active) cambia solo las variables.
   ========================================================================== */

.pl,
.ml {
  --lp-primary: #1d4ed8;
  --lp-primary-hover: #1e40af;
  --lp-navy: #0f2a5c;
  --lp-soft: #eaf1ff;
  --lp-accent: #f5b301;
  --lp-success: #15803d;
  --lp-ink: #0f172a;
  --lp-muted: #475569;
  --lp-line: #e2e8f0;
  --lp-surface: #ffffff;
  --lp-bg: #f6f8fc;
  --lp-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
  --lp-shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.06), 0 18px 40px rgba(15, 23, 42, 0.12);
  --lp-radius: 16px;

  color: var(--lp-ink);
  font-family: 'Alegreya Sans', 'Roboto', system-ui, sans-serif;
  background: var(--lp-bg);
}

body.active .pl,
body.active .ml {
  --lp-primary: #60a5fa;
  --lp-primary-hover: #93c5fd;
  --lp-navy: #dbeafe;
  --lp-soft: rgba(96, 165, 250, 0.12);
  --lp-accent: #fbbf24;
  --lp-success: #4ade80;
  --lp-ink: #f1f5f9;
  --lp-muted: #a7b4c8;
  --lp-line: rgba(148, 163, 184, 0.22);
  --lp-surface: #111c33;
  --lp-bg: #0b1220;
  --lp-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --lp-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.4);
}

.pl *,
.ml * {
  box-sizing: border-box;
}

.pl-container,
.ml-container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

:where(.pl, .ml) {
  text-align: left;
}

:where(.pl, .ml) :is(h1, h2, h3, h4, p) {
  letter-spacing: normal;
  text-align: inherit;
}

.pl-section-head,
.pl-demo-box,
.pl-reader-text,
.pl-reader-hint {
  text-align: center;
}

/* ---------- Botones ---------- */
.pl-btn,
.ml-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.pl-btn:focus-visible,
.ml-btn:focus-visible,
.pl-subnav-link:focus-visible,
.ml-chip:focus-visible,
.ml-book:focus-visible,
.pl-book:focus-visible,
.ml-quick-card:focus-visible {
  outline: 3px solid var(--lp-accent);
  outline-offset: 3px;
}

.pl-btn-primary,
.ml-btn-primary {
  background: var(--lp-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.28);
}

body.active .pl-btn-primary,
body.active .ml-btn-primary {
  color: #0b1220;
  box-shadow: 0 6px 16px rgba(96, 165, 250, 0.25);
}

.pl-btn-primary:hover,
.ml-btn-primary:hover {
  background: var(--lp-primary-hover);
  transform: translateY(-2px);
}

.pl-btn-ghost,
.ml-btn-ghost {
  background: transparent;
  color: var(--lp-primary);
  border-color: var(--lp-line);
}

.pl-btn-ghost:hover,
.ml-btn-ghost:hover {
  background: var(--lp-soft);
  border-color: var(--lp-primary);
}

.pl-btn-light {
  background: #fff;
  color: #0f2a5c;
}

.pl-btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.pl-btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.pl-btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

/* ==========================================================================
   PUBLIC LANDING
   ========================================================================== */
.pl-hero {
  padding: calc(var(--pl-header-h, 80px) + 56px) 0 72px;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(29, 78, 216, 0.14), transparent 60%),
    linear-gradient(180deg, #f3f7ff 0%, var(--lp-bg) 100%);
}

body.active .pl-hero {
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(96, 165, 250, 0.16), transparent 60%),
    linear-gradient(180deg, #0e1a33 0%, var(--lp-bg) 100%);
}

.pl-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.pl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-size: 15px;
  font-weight: 700;
}

.pl-title {
  margin: 18px 0 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--lp-navy);
}

.pl-title span {
  color: var(--lp-primary);
}

.pl-lead {
  max-width: 560px;
  margin: 0 0 26px;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--lp-muted);
}

.pl-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pl-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--lp-muted);
  font-size: 16px;
  font-weight: 600;
}

.pl-trust i {
  color: var(--lp-success);
  margin-right: 4px;
}

.pl-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  margin: 30px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--lp-line);
}

.pl-stats div {
  display: flex;
  flex-direction: column;
}

.pl-stats dt {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--lp-navy);
}

.pl-stats dd {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--lp-muted);
}

/* Tarjeta de lectura (hero) */
.pl-reader-card {
  position: relative;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: 20px;
  box-shadow: var(--lp-shadow-lg);
  padding: 0 0 22px;
  overflow: visible;
}

.pl-reader-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--lp-line);
  border-radius: 20px 20px 0 0;
  background: var(--lp-soft);
}

.pl-reader-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lp-line);
}

.pl-reader-bar strong {
  margin-left: 8px;
  font-size: 14px;
  color: var(--lp-muted);
}

.pl-reader-text {
  margin: 0;
  padding: 36px 28px 12px;
  font-size: 1.9rem;
  line-height: 1.7;
  text-align: center;
  color: var(--lp-ink);
}

.pl-reader-hint {
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: var(--lp-muted);
}

.pl-reader-popup {
  margin: 20px 24px 0;
}

.pl-reader-popup .popup-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--lp-soft);
  border: 1px solid var(--lp-line);
  box-shadow: none;
}

.pl-reader-popup .popup-word {
  font-weight: 800;
  color: var(--lp-navy);
}

.pl-reader-popup .popup-translation {
  flex: 1;
  color: var(--lp-primary);
  font-weight: 600;
}

.pl-reader-popup .popup-audio {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--lp-primary);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease;
}

body.active .pl-reader-popup .popup-audio {
  color: #0b1220;
}

.pl-reader-popup .popup-audio:hover {
  transform: scale(1.08);
}

/* Palabras traducibles (hero y demo) */
.pl .translated-word {
  display: inline-block;
  padding: 0 6px;
  border-radius: 8px;
  border-bottom: 2px dashed var(--lp-primary);
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pl .translated-word:hover,
.pl .translated-word:focus-visible {
  background: var(--lp-soft);
  color: var(--lp-primary);
  outline: none;
}

/* ---------- Navegación rápida ---------- */
.pl-subnav {
  position: sticky;
  top: var(--pl-header-h, 80px);
  z-index: 50;
  background: color-mix(in srgb, var(--lp-surface) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--lp-line);
  border-bottom: 1px solid var(--lp-line);
}

.pl-subnav-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding-top: 8px;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.pl-subnav-inner::-webkit-scrollbar {
  display: none;
}

.pl-subnav-link {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--lp-muted);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pl-subnav-link:hover {
  background: var(--lp-soft);
  color: var(--lp-primary);
}

.pl-subnav-link.is-active {
  background: var(--lp-soft);
  color: var(--lp-primary);
  box-shadow: inset 0 0 0 1.5px var(--lp-primary);
}

.pl-subnav-cta {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--lp-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

body.active .pl-subnav-cta {
  color: #0b1220;
}

.pl-subnav-cta:hover {
  background: var(--lp-primary-hover);
}

/* ---------- Secciones ---------- */
.pl-section {
  padding: 80px 0;
  scroll-margin-top: calc(var(--pl-header-h, 80px) + 56px);
}

.pl-section-alt {
  background: var(--lp-surface);
  border-top: 1px solid var(--lp-line);
  border-bottom: 1px solid var(--lp-line);
}

.pl-section-head {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}

.pl-section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--lp-navy);
}

.pl-section-head p {
  margin: 0;
  font-size: 1.15rem;
  color: var(--lp-muted);
}

/* Pasos */
.pl-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
}

.pl-steps li {
  position: relative;
  padding: 26px 24px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow);
}

.pl-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--lp-primary);
  color: #fff;
  font-weight: 800;
}

body.active .pl-step-num {
  color: #0b1220;
}

.pl-steps h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: var(--lp-navy);
}

.pl-steps p {
  margin: 0;
  color: var(--lp-muted);
  line-height: 1.55;
}

/* Demo */
.pl-demo-box {
  padding: 32px 28px;
  text-align: center;
  background: linear-gradient(135deg, var(--lp-navy) 0%, #1d4ed8 100%);
  border-radius: 20px;
  box-shadow: var(--lp-shadow-lg);
  color: #fff;
}

body.active .pl-demo-box {
  background: linear-gradient(135deg, #14264d 0%, #1e3a8a 100%);
}

.pl-demo-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 14px;
  font-weight: 700;
}

.pl-demo-text {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.9;
  color: #fff;
}

.pl-demo-box .translated-word {
  border-bottom-color: #fcd34d;
}

.pl-demo-box .translated-word:hover,
.pl-demo-box .translated-word:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.pl-demo-hint {
  margin: 14px 0 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}

/* Libros */
.pl-books {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.pl-book {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: 20px;
  box-shadow: var(--lp-shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.pl-book:hover {
  transform: translateY(-4px);
  box-shadow: var(--lp-shadow-lg);
  border-color: var(--lp-primary);
}

.pl-book-cover,
.ml-book-cover {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--lp-soft);
  align-self: start;
}

.pl-book-cover img,
.ml-book-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.pl-badges,
.ml-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.pl-badge,
.ml-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lp-bg);
  border: 1px solid var(--lp-line);
  font-size: 13px;
  font-weight: 700;
  color: var(--lp-muted);
}

.pl-badge-level,
.ml-badge-level {
  background: var(--lp-soft);
  border-color: transparent;
  color: var(--lp-primary);
}

.pl-book h3,
.ml-book h3 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--lp-navy);
}

.pl-book-author,
.ml-book-author {
  margin: 4px 0 10px;
  font-size: 1rem;
  font-style: italic;
  color: var(--lp-muted);
}

.pl-book-desc {
  margin: 0 0 12px;
  line-height: 1.55;
  color: var(--lp-muted);
}

.pl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.pl-tags span {
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-size: 13px;
  font-weight: 700;
}

.pl-book-cta,
.ml-book-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--lp-primary);
}

.pl-book-cta i {
  transition: transform 0.2s ease;
}

.pl-book:hover .pl-book-cta i {
  transform: translateX(4px);
}

/* Características */
.pl-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.pl-feature {
  padding: 24px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pl-feature:hover {
  transform: translateY(-3px);
  border-color: var(--lp-primary);
  box-shadow: var(--lp-shadow);
}

.pl-feature i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-size: 1.4rem;
}

.pl-feature h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  color: var(--lp-navy);
}

.pl-feature p {
  margin: 0;
  line-height: 1.55;
  color: var(--lp-muted);
}

/* FAQ */
.pl-faq-wrap {
  max-width: 820px;
}

.pl-faq details {
  margin-bottom: 12px;
  background: var(--lp-bg);
  border: 1px solid var(--lp-line);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pl-faq details[open] {
  border-color: var(--lp-primary);
  box-shadow: var(--lp-shadow);
}

.pl-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--lp-navy);
  cursor: pointer;
  list-style: none;
}

.pl-faq summary::-webkit-details-marker {
  display: none;
}

.pl-faq summary::after {
  content: '+';
  flex: 0 0 auto;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--lp-primary);
  transition: transform 0.2s ease;
}

.pl-faq details[open] summary::after {
  transform: rotate(45deg);
}

.pl-faq summary:focus-visible {
  outline: 3px solid var(--lp-accent);
  outline-offset: 2px;
  border-radius: 14px;
}

.pl-faq p {
  margin: 0;
  padding: 0 20px 20px;
  line-height: 1.6;
  color: var(--lp-muted);
}

/* CTA final */
.pl-cta-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.pl-cta-card {
  padding: 36px 32px;
  border-radius: 20px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  box-shadow: var(--lp-shadow);
}

.pl-cta-card h2 {
  margin: 0 0 10px;
  font-size: 1.8rem;
  color: var(--lp-navy);
}

.pl-cta-card p {
  margin: 0 0 22px;
  line-height: 1.55;
  color: var(--lp-muted);
}

.pl-cta-primary {
  background: linear-gradient(135deg, var(--lp-navy) 0%, #1d4ed8 100%);
  border: none;
}

body.active .pl-cta-primary {
  background: linear-gradient(135deg, #14264d 0%, #1e3a8a 100%);
}

.pl-cta-primary h2,
.pl-cta-primary p {
  color: #fff;
}

.pl-cta-primary p {
  opacity: 0.9;
}

.pl-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-size: 1.6rem;
}

/* ==========================================================================
   MI BIBLIOTECA
   ========================================================================== */
.ml {
  min-height: 100vh;
}

.ml-dashboard {
  padding: 120px 0 72px;
  background:
    radial-gradient(900px 380px at 90% -10%, rgba(29, 78, 216, 0.12), transparent 60%),
    linear-gradient(180deg, #f3f7ff 0%, var(--lp-bg) 360px);
}

body.active .ml-dashboard {
  background:
    radial-gradient(900px 380px at 90% -10%, rgba(96, 165, 250, 0.14), transparent 60%),
    linear-gradient(180deg, #0e1a33 0%, var(--lp-bg) 360px);
}

.ml-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.ml-greeting {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ml-title {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--lp-navy);
}

.ml-title span {
  color: var(--lp-primary);
}

.ml-subtitle {
  margin: 4px 0 0;
  font-size: 1.1rem;
  color: var(--lp-muted);
}

.ml-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ml-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 190px;
  padding: 14px 18px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: 14px;
  box-shadow: var(--lp-shadow);
}

.ml-stat > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-size: 1.3rem;
}

.ml-stat-number {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--lp-navy);
}

.ml-stat-label {
  display: block;
  font-size: 14px;
  color: var(--lp-muted);
}

/* Continuar leyendo */
.ml-continue {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--lp-navy) 0%, #1d4ed8 100%);
  border-radius: 18px;
  box-shadow: var(--lp-shadow-lg);
  color: #fff;
}

body.active .ml-continue {
  background: linear-gradient(135deg, #14264d 0%, #1e3a8a 100%);
}

.ml-continue-thumb {
  flex: 0 0 auto;
  width: 64px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ml-continue-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

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

.ml-continue-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.ml-continue-info h2 {
  margin: 2px 0;
  font-size: 1.4rem;
  color: #fff;
}

.ml-continue-info p {
  margin: 0;
  opacity: 0.9;
}

.ml-continue .ml-btn-primary {
  background: #fff;
  color: #0f2a5c;
  box-shadow: none;
}

.ml-continue .ml-btn-primary:hover {
  background: #eaf1ff;
}

/* Biblioteca */
.ml-library {
  padding: 28px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: 20px;
  box-shadow: var(--lp-shadow);
}

.ml-library-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.ml-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.6rem;
  color: var(--lp-navy);
}

.ml-section-title i {
  color: var(--lp-primary);
}

.ml-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.ml-search {
  position: relative;
  flex: 1 1 260px;
  display: block;
}

.ml-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lp-muted);
  pointer-events: none;
}

.ml-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 40px;
  border-radius: 12px;
  border: 1.5px solid var(--lp-line);
  background: var(--lp-bg);
  color: var(--lp-ink);
  font-family: inherit;
  font-size: 17px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ml-search input:focus {
  outline: none;
  border-color: var(--lp-primary);
  box-shadow: 0 0 0 4px var(--lp-soft);
}

.ml-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ml-chip {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--lp-line);
  background: transparent;
  color: var(--lp-muted);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ml-chip:hover {
  border-color: var(--lp-primary);
  color: var(--lp-primary);
}

.ml-chip.is-active {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  color: #fff;
}

body.active .ml-chip.is-active {
  color: #0b1220;
}

.ml-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.ml-book {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  background: var(--lp-bg);
  border: 1.5px solid var(--lp-line);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ml-book[hidden] {
  display: none;
}

.ml-book:hover {
  transform: translateY(-3px);
  border-color: var(--lp-primary);
  box-shadow: var(--lp-shadow-lg);
}

.ml-book h3 {
  font-size: 1.25rem;
}

.ml-book-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ml-progress {
  height: 8px;
  margin-top: auto;
  border-radius: 999px;
  background: var(--lp-line);
  overflow: hidden;
}

.ml-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lp-primary), #38bdf8);
  transition: width 0.6s ease;
}

.ml-progress-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 8px 0 12px;
  font-size: 14px;
  color: var(--lp-muted);
}

.ml-progress-text {
  font-weight: 700;
}

.ml-book-position i {
  color: var(--lp-accent);
}

.ml-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 0;
  padding: 28px;
  border: 1.5px dashed var(--lp-line);
  border-radius: 14px;
  color: var(--lp-muted);
  font-size: 1.1rem;
}

.ml-empty[hidden] {
  display: none;
}

/* Accesos rápidos */
.ml-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.ml-quick-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  box-shadow: var(--lp-shadow);
  color: inherit;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ml-quick-card:hover {
  transform: translateY(-3px);
  border-color: var(--lp-primary);
  box-shadow: var(--lp-shadow-lg);
}

.ml-quick-card > i {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-size: 1.4rem;
}

.ml-quick-card strong {
  display: block;
  font-size: 1.1rem;
  color: var(--lp-navy);
}

.ml-quick-card span {
  display: block;
  font-size: 14px;
  color: var(--lp-muted);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1120px) {
  .pl-hero {
    padding-top: calc(var(--pl-header-h, 100px) + 36px);
  }
}

@media (max-width: 900px) {
  .pl-hero-grid,
  .pl-cta-grid {
    grid-template-columns: 1fr;
  }

  .pl-hero-grid {
    gap: 36px;
  }

  .pl-steps,
  .pl-features {
    grid-template-columns: 1fr 1fr;
  }

  .pl-books {
    grid-template-columns: 1fr;
  }

  .ml-quick {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pl-container,
  .ml-container {
    padding: 0 16px;
  }

  .pl-section {
    padding: 56px 0;
  }

  .pl-steps,
  .pl-features {
    grid-template-columns: 1fr;
  }

  .pl-book {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .pl-book-desc {
    display: none;
  }

  .pl-cta-row .pl-btn {
    flex: 1 1 100%;
  }

  .pl-reader-text {
    font-size: 1.5rem;
    padding: 28px 16px 8px;
  }

  .pl-cta-card {
    padding: 28px 22px;
  }

  .ml-dashboard {
    padding-top: 100px;
  }

  .ml-library {
    padding: 18px 14px;
  }

  .ml-grid {
    grid-template-columns: 1fr;
  }

  .ml-book {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
  }

  .ml-stat {
    flex: 1 1 100%;
  }

  .ml-continue {
    flex-wrap: wrap;
  }

  .ml-continue .ml-btn {
    width: 100%;
  }

  .ml-library-head .ml-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pl *,
  .ml * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Alineación consistente (algunos estilos globales centran el texto) */
.pl-steps li,
.pl-feature,
.pl-book-body,
.ml-book-body,
.pl-cta-card,
.pl-faq details {
  text-align: left;
}

.pl-book-cover img,
.ml-book-cover img {
  object-position: top center;
}

@media (max-width: 640px) {
  .ml-stats {
    width: 100%;
  }

  .pl-subnav-cta {
    display: none;
  }
}

/* Modo oscuro: los estilos globales de h1–h4 (dorado) no deben pisar la paleta de la landing */
body.active .pl :is(h1, h2, h3, h4),
body.active .ml :is(h1, h2, h3, h4) {
  color: var(--lp-navy);
  text-shadow: none;
}

body.active .pl-title span,
body.active .ml-title span {
  color: var(--lp-primary);
}

body.active .ml-continue :is(h2, p, span),
body.active .pl-cta-primary :is(h2, p) {
  color: #fff;
}

/* Tarjeta "Próximamente: más libros" */
.ml-soon {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 2px dashed var(--lp-line);
  border-radius: 16px;
  background: transparent;
  text-align: left;
}

.ml-soon[hidden] {
  display: none;
}

.ml-soon-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-size: 1.5rem;
}

.ml-soon h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  color: var(--lp-navy);
}

.ml-soon p {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--lp-muted);
}

.ml-soon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--lp-primary);
  text-decoration: none;
}

.ml-soon-link:hover {
  text-decoration: underline;
}

/* Botón "Sugiere un libro" dentro de la tarjeta */
button.ml-soon-link {
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

/* Diálogo de sugerencia */
.ml-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--lp-line);
  border-radius: 20px;
  background: var(--lp-surface);
  color: var(--lp-ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: auto;
}

.ml-dialog::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
}

.ml-form {
  padding: 26px 26px 22px;
}

.ml-form-trap {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.ml-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ml-dialog-head h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--lp-navy);
}

.ml-dialog-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-size: 1.1rem;
  cursor: pointer;
}

.ml-dialog-close:hover {
  background: var(--lp-primary);
  color: #fff;
}

.ml-dialog-intro {
  margin: 8px 0 18px;
  line-height: 1.5;
  color: var(--lp-muted);
}

.ml-field {
  display: block;
  margin-bottom: 14px;
}

.ml-field > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--lp-navy);
}

.ml-field b {
  color: #dc2626;
}

.ml-field input,
.ml-field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--lp-line);
  background: var(--lp-bg);
  color: var(--lp-ink);
  font-family: inherit;
  font-size: 17px;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ml-field input:focus,
.ml-field textarea:focus {
  outline: none;
  border-color: var(--lp-primary);
  box-shadow: 0 0 0 4px var(--lp-soft);
}

.ml-field small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--lp-muted);
}

.ml-form-status {
  min-height: 1.4em;
  margin: 4px 0 12px;
  font-weight: 700;
}

.ml-form-status.is-ok {
  color: var(--lp-success);
}

.ml-form-status.is-error {
  color: #dc2626;
}

.ml-form-status.is-info {
  color: var(--lp-muted);
}

.ml-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ml-dialog-actions .ml-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

@media (max-width: 480px) {
  .ml-form {
    padding: 20px 16px 16px;
  }

  .ml-dialog-actions {
    flex-direction: column-reverse;
  }

  .ml-dialog-actions .ml-btn {
    width: 100%;
  }
}

.ml-dialog[open] {
  position: fixed;
  inset: 0;
  margin: auto;
}

/* Una sola tarjeta de llamada a la acción y dos accesos rápidos */
.pl-cta-grid {
  grid-template-columns: 1fr;
}

.ml-quick {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .ml-quick {
    grid-template-columns: 1fr;
  }
}
