

.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 {
  text-align: center;
}

.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,
.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);
  color: #fff; 
  transform: translateY(-2px);
}

body.active .pl-btn-primary:hover,
body.active .ml-btn-primary:hover {
  color: #0b1220; 
}

.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;
}

.pl-hero {
  padding: 136px 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);
}

@media (max-width: 640px) {
  .pl-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .pl-stats dt { font-size: 1.4rem; }
  .pl-stats dd { font-size: 12px; }
}

.pl-section {
  padding: 80px 0;
  scroll-margin-top: 96px; 
}

.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);
}

.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-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 .new-ribbon,
.ml-book-cover .new-ribbon {
  top: 8px;
  right: 8px;
  left: auto;
  bottom: auto;
  padding: 3px 10px;
  font-size: 0.65rem;
}

.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-title-es,
.ml-book-title-es {
  margin: 3px 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--lp-muted);
}

.ml-book-title-es {
  font-size: 0.9rem;
}

.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);
}

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

.pl-group + .pl-group {
  margin-top: 48px;
}

.pl-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0 0 18px;
}

.pl-group-title {
  margin: 0;
  font-size: 1.4rem;
  color: var(--lp-navy);
}

.pl-group-note {
  margin: 0;
  color: var(--lp-muted);
}

.pl-shelf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.pl-book.pl-book-compact {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
}

.pl-book-compact .pl-book-cover {
  align-self: stretch;
}

.pl-book-compact .pl-book-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.pl-book-compact h3 {
  font-size: 1.15rem;
}

.pl-book-compact .pl-book-title-es {
  font-size: 0.95rem;
}

.pl-book-compact .pl-book-author {
  margin: 6px 0 8px;
  font-size: 0.92rem;
}

.pl-book-compact .pl-book-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.pl-book-compact .pl-badges {
  margin-top: auto;
}

.pl-features {
  display: grid;
  grid-template-columns: repeat(2, 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);
}

.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);
}

.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;
}

.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);
}

.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,
body.active .ml-continue .ml-btn-primary:hover {
  background: #eaf1ff;
  color: #0f2a5c;
}

.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(210px, 1fr));
  gap: 20px;
}

.ml-book {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  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.1rem;
}

.ml-book-meta {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--lp-muted);
}

.ml-book .ml-book-cover {
  align-self: stretch;
}

.ml-book .ml-book-author {
  margin: 2px 0 4px;
  font-size: 0.9rem;
}

.ml-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.ml-version {
  padding: 2px 8px;
  border: 1px solid var(--lp-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--lp-muted);
}

.ml-version.is-current {
  background: var(--lp-soft);
  border-color: transparent;
  color: var(--lp-primary);
}

a.ml-version {
  position: relative;
  z-index: 2;
  display: inline-block;
  padding: 5px 10px;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

a.ml-version:hover,
a.ml-version:focus-visible {
  border-color: var(--lp-primary);
  background: var(--lp-soft);
  color: var(--lp-primary);
}

.ml-book {
  position: relative;
}

.ml-book-link {
  text-decoration: none;
}

.ml-book-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
}

.ml-book-link:focus-visible {
  outline: none;
}

.ml-book-link:focus-visible::after {
  outline: 3px solid var(--lp-accent);
  outline-offset: 3px;
}

.ml-pill {
  position: absolute;
  z-index: 1;
  bottom: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 16px);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ml-pill-free { background: #15803d; }
.ml-pill-sample { background: #1d4ed8; }
.ml-pill-premium { background: #92400e; }
.ml-pill-soon { background: #4b5563; }

.ml-book.is-soon {
  cursor: default;
}

.ml-book.is-soon:hover {
  transform: none;
  border-color: var(--lp-line);
  box-shadow: none;
}

.ml-book.is-soon .ml-book-cover img {
  filter: grayscale(0.7) brightness(0.9);
}

.ml-book.is-soon .ml-book-action {
  display: none; 
}

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

.ml-book-body .ml-progress-row {
  margin: 8px 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;
}

.ml-phrases {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  box-shadow: var(--lp-shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.ml-phrases:focus-visible {
  outline: 3px solid var(--lp-accent);
  outline-offset: 3px;
}

.ml-phrases-icon {
  flex: 0 0 auto;
  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-phrases-info {
  flex: 1 1 auto;
  min-width: 0;
}

.ml-phrases-info h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--lp-navy);
}

.ml-phrases-info p {
  margin: 2px 0 0;
  font-size: 0.875rem;
  color: var(--lp-muted);
}

.ml-phrases > .ml-btn {
  flex: 0 0 auto;
  min-height: 44px;
}

.ml-quick {
  display: grid;
  grid-template-columns: repeat(2, 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);
}

@media (max-width: 1120px) {
  .pl-hero {
    padding-top: 116px; 
  }
}

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

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

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

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

  .pl-shelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

.pl-shelf.pl-shelf-preview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

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

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

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

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

  .pl-shelf,
  .pl-shelf.pl-shelf-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .pl-book.pl-book-compact {
    gap: 10px;
    padding: 10px;
  }

  .pl-book-compact h3 {
    font-size: 1rem;
  }

  .pl-book-compact .pl-book-title-es {
    font-size: 0.85rem;
  }

  .pl-group-title {
    font-size: 1.2rem;
  }

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

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

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

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

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

  .ml-book {
    gap: 10px;
    padding: 8px;
  }

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

  .ml-book-position {
    display: none;
  }

  .ml-stat {
    flex: 1 1 0;
    min-width: 0;
    gap: 10px;
    padding: 10px 12px;
  }

  .ml-stat > i {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 1rem;
  }

  .ml-stat-number {
    font-size: 1.3rem;
  }

  .ml-stat-label {
    font-size: 13px;
  }

  .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;
  }
}

.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%;
    flex-wrap: nowrap;
    gap: 8px;
  }
}

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;
}

.ml-soon {
  grid-column: 1 / -1; 
  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;
}

button.ml-soon-link {
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.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;
}

.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;
  }
}

.pl-features.pl-features-single {
  grid-template-columns: 1fr;
  max-width: 760px;
  margin: 0 auto;
}

.pl-feature-cta {
  margin-top: 18px;
}

.pl-feature-note {
  margin: 8px 0 0;
  color: var(--ds-muted, #5b6678);
  font-size: 14px;
}

.pl-cta-quote {
  text-align: center;
}

.pl-quote {
  margin: 0 0 28px;
}

.pl-quote p {
  margin: 0;
}

.pl-quote .pl-quote-en {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.3;
}

.pl-quote .pl-quote-es {
  margin-top: 10px;
  font-size: 1.15rem;
}

.pl-quote footer {
  margin-top: 12px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}

.pl-cta-quote .pl-cta-row {
  justify-content: center;
}

.ml-fav {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, color 0.15s ease;
}

.ml-fav:hover {
  transform: scale(1.08);
  color: #e11d48;
}

.ml-fav.is-on {
  color: #e11d48;
}

.ml-fav:focus-visible {
  outline: 3px solid var(--lp-accent);
  outline-offset: 2px;
}

.ml-version-done {
  color: var(--lp-success);
}

.ml-more {
  position: absolute;
  z-index: 3;
  top: 20px;
  right: 20px;
}

.ml-book.has-more .ml-book-cover .new-ribbon {
  right: 52px;
}

.ml-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #334155;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ml-more-btn:hover,
.ml-more-btn[aria-expanded="true"] {
  color: var(--lp-primary);
}

.ml-more-btn[aria-expanded="true"] {
  background: var(--lp-soft);
}

.ml-more-btn:focus-visible,
.ml-more-menu button:focus-visible {
  outline: 3px solid var(--lp-accent);
  outline-offset: 2px;
}

.ml-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  padding: 4px;
  border: 1px solid var(--lp-line);
  border-radius: 10px;
  background: var(--lp-surface);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
}

.ml-more-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 13px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--lp-line);
  border-left: 1px solid var(--lp-line);
  background: var(--lp-surface);
  transform: rotate(45deg);
}

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

.ml-more-menu button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--lp-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.ml-more-menu button:hover {
  background: var(--lp-soft);
}

.ml-hidden-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 18px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--lp-muted);
}

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

.ml-hidden-note i {
  margin-top: 2px;
}

.ml-hidden-note a {
  color: var(--lp-primary);
}

.ml-done-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 2px 0 10px;
  padding: 0;
  list-style: none;
}

.ml-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--lp-success);
}

.ml-catalogue {
  background: transparent;
}

.ml-count {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--lp-muted);
}

.pl-all-books {
  margin: 36px 0 0;
  text-align: center;
}

@media (max-width: 640px) {
  .ml-filters {
    flex-wrap: wrap;
  }
}

.ml-levels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: -6px 0 18px;
}

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

.ml-levels-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--lp-muted);
}

.ml-levels-note {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--lp-muted);
}

.ml-levels-note:empty {
  display: none;
}

.ml-chip-count {
  margin-left: 2px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.75;
}

.ml-shelf + .ml-shelf {
  margin-top: 32px;
}

.ml-shelf[hidden],
.ml-library-welcome[hidden],
.ml-library-head .ml-btn[hidden] {
  display: none;
}

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

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

.ml-shelf-count {
  min-width: 26px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
}

.ml-shelf-count:empty {
  display: none;
}

.ml-shelf-empty,
.ml-loading {
  margin: 0;
  padding: 14px 16px;
  border: 1.5px dashed var(--lp-line);
  border-radius: 14px;
  color: var(--lp-muted);
  font-weight: 600;
}

.ml-shelf-empty a {
  color: var(--lp-primary);
  font-weight: 800;
}

.ml-loading {
  grid-column: 1 / -1;
}

.ml-library-welcome {
  padding: 24px 20px;
  border: 1.5px dashed var(--lp-line);
  border-radius: 16px;
  text-align: center;
}

.ml-library-welcome h3 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: var(--lp-navy);
}

.ml-library-welcome p {
  margin: 0 auto 16px;
  max-width: 520px;
  color: var(--lp-muted);
}

.ml-library-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

#library-suggest {
  margin-top: 32px;
}

@media (max-width: 640px) {
  .ml-shelf + .ml-shelf {
    margin-top: 24px;
  }

  .ml-library-welcome-actions .ml-btn {
    flex: 1 1 100%;
  }

.ml-header {
    gap: 12px;
    margin-bottom: 16px;
  }

  .ml-title {
    font-size: 1.4rem;
  }

  .ml-subtitle {
    display: none;
  }

  .ml-continue {
    margin-bottom: 16px;
  }

.ml-shelf-title {
    margin-bottom: 8px;
    font-size: 1.1rem;
  }

  .ml-shelf-empty {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
  }
}

.pg-hero-catalogue {
  padding-bottom: 32px;
}

.ml-catalogue-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px;
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  background: var(--lp-surface);
}

.ml-catalogue-head .ml-search {
  flex: 1 1 260px;
}

.ml-catalogue-head .ml-search input {
  min-height: 44px;
  font-size: 16px;
  background: var(--lp-bg);
}

.ml-catalogue-head .ml-filters {
  gap: 6px;
}

.ml-catalogue-head .ml-chip {
  min-height: 38px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 800;
}

.ml-bar-sep {
  width: 1px;
  height: 28px;
  background: var(--lp-line);
}

.ml-filter-menu {
  display: contents;
}

.ml-catalogue-head .ml-levels {
  display: flex;
  margin: 0;
}

.ml-catalogue-head .ml-levels[hidden],
.ml-catalogue-head .ml-levels-note:empty {
  display: none;
}

.ml-catalogue-head .ml-levels-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ml-catalogue-head .ml-chip-count,
.ml-catalogue-head .ml-levels-note,
.ml-filter-btn,
.ml-active-filters {
  display: none;
}

.ml-catalogue-head:has(.ml-levels[hidden]) .ml-bar-sep {
  display: none;
}

.ml-catalogue-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--lp-soft);
  color: #1e3a8a;
  font-size: 15px;
  line-height: 1.45;
}

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

body.active .ml-catalogue-note {
  color: #dbeafe;
}

.ml-catalogue-note p {
  flex: 1 1 auto;
  margin: 0;
}

.ml-catalogue-note b {
  font-weight: 800;
}

.ml-note-short {
  display: none;
}

.ml-note-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #f59e0b;
  color: #1f2937;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.ml-note-btn:hover,
.ml-note-btn:focus-visible {
  background: #d97706;
  color: #1f2937;
}

body.active .ml-note-btn {
  color: #1f2937;
}

.ml-count-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 22px 0 12px;
}

.ml-count-row .ml-count {
  margin: 0;
}

.ml-type-group {
  display: flex;
  align-items: center;
}

.ml-start {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 22px;
  padding: 18px 22px;
  border-radius: 18px;
  
  background: linear-gradient(135deg, #0f2a5c 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: var(--lp-shadow);
}

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

.ml-start-cover {
  flex: 0 0 auto;
  width: 92px;
  aspect-ratio: 320 / 441;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  transform: rotate(-3deg);
}

.ml-start-body {
  flex: 1 1 auto;
  min-width: 0;
}

.ml-start-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fcd34d;
}

.ml-start-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.ml-start-es {
  margin: 2px 0 0;
  font-size: 15px;
  color: #c7d7fe;
}

.ml-start-meta {
  margin: 8px 0 0;
  font-size: 15px;
  color: #e0e7ff;
}

.ml-start-progress {
  height: 6px;
  max-width: 320px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.ml-start-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fcd34d;
}

.ml-start-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 14px;
}

.ml-start-btn,
.ml-start-btn:hover,
.ml-start-btn:focus-visible {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: #f59e0b;
  color: #1f2937;
  font-weight: 800;
  text-decoration: none;
}

.ml-start-btn:hover,
.ml-start-btn:focus-visible {
  background: #fbbf24;
}

body.active .ml-start-btn,
body.active .ml-start-btn:hover {
  color: #1f2937;
}

body.active .ml-start-link,
body.active .ml-start-link:hover {
  color: #fff;
}

.ml-start-link,
.ml-start-link:hover {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ml-start-percent {
  font-size: 14px;
  font-weight: 700;
  color: #e0e7ff;
}

.ml-genres {
  margin-top: 26px;
}

.ml-genres[hidden],
.ml-genre-tiles[hidden],
.ml-genre-current[hidden] {
  display: none;
}

.ml-genres.is-chosen .ml-genres-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ml-genres-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--lp-navy);
}

.ml-genre-tiles {
  display: grid;
  
  grid-template-columns: repeat(var(--genre-count, 8), minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1099px) {
  .ml-genre-tiles {
    grid-template-columns: repeat(var(--genre-half, 4), minmax(0, 1fr));
  }
}

.ml-genre-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px 12px;
  border: 1.5px solid var(--lp-line);
  border-radius: 14px;
  background: var(--lp-surface);
  color: var(--lp-ink);
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ml-genre-tile:hover {
  border-color: var(--lp-primary);
  transform: translateY(-2px);
}

.ml-genre-covers {
  display: flex;
  justify-content: center;
  height: 64px;
  margin-bottom: 6px;
}

.ml-genre-covers img {
  width: 44px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  margin: 0 -8px;
}

.ml-genre-covers img:nth-child(1) { transform: rotate(-7deg); }
.ml-genre-covers img:nth-child(2) { position: relative; z-index: 1; transform: translateY(-3px); }
.ml-genre-covers img:nth-child(3) { transform: rotate(7deg); }

.ml-genre-name {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--lp-navy);
}

.ml-genre-count {
  margin-top: auto; 
  font-size: 13px;
  color: var(--lp-muted);
}

.ml-genre-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.ml-genre-current-label {
  font-weight: 700;
  color: var(--lp-muted);
}

.ml-genre-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--lp-primary);
  background: var(--lp-soft);
  color: var(--lp-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.ml-genre-chip .bi-x-lg {
  font-size: 12px;
}

.ml-genre-all {
  padding: 0;
  border: 0;
  background: none;
  color: var(--lp-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ml-length-shelves {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

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

.ml-length-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}

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

.ml-length-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--lp-muted);
}

.ml-length-sub {
  margin: 2px 0 16px;
  font-size: 15px;
  color: var(--lp-muted);
}

.ml-catalogue .ml-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 30px 24px;
}

.ml-catalogue .ml-book {
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.ml-catalogue .ml-book:hover {
  transform: none;
  box-shadow: none;
}

.ml-catalogue .ml-book-cover {
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 8px 20px rgba(15, 23, 42, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ml-catalogue .ml-book:hover .ml-book-cover,
.ml-catalogue .ml-book:focus-within .ml-book-cover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--lp-shadow-lg);
}

.ml-catalogue .ml-book-cover img {
  aspect-ratio: 320 / 441;
}

.ml-catalogue .ml-pill-premium {
  background: #1f2937;
}

.ml-catalogue .ml-book h3 {
  font-size: 1.05rem;
  line-height: 1.25;
}

.ml-catalogue .ml-book-title-es {
  margin-top: 2px;
}

.ml-catalogue .ml-book-author,
.ml-catalogue .ml-book-meta {
  display: none;
}

.ml-catalogue .ml-book-time {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--lp-muted);
}

.ml-catalogue .ml-book-time .bi {
  font-size: 12px;
}

.ml-catalogue .ml-versions {
  gap: 4px;
  margin: auto 0 0;
  padding-top: 8px;
}

.ml-catalogue .ml-versions ~ .ml-book-foot {
  margin-top: 0;
}

.ml-catalogue .ml-version {
  padding: 3px 6px;
  font-size: 11.5px; 
  border-color: transparent;
  border-radius: 6px;
  background: #f1f5f9;
  color: #374151;
  font-weight: 800;
}

body.active .ml-catalogue .ml-version {
  background: rgba(148, 163, 184, 0.16);
  color: var(--lp-ink);
}

.ml-catalogue .ml-version.is-level-match {
  background: #dbeafe;
  color: #1e40af;
  box-shadow: inset 0 0 0 1px #93c5fd;
}

body.active .ml-catalogue .ml-version.is-level-match {
  background: rgba(59, 130, 246, 0.28);
  color: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.55);
}

.ml-book-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.ml-catalogue .ml-book-action.is-locked {
  color: var(--lp-muted);
}

.ml-catalogue .ml-book-action i {
  display: none;
}

.ml-catalogue .ml-fav {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  background: transparent;
  box-shadow: none;
  color: var(--lp-muted);
  font-size: 1.15rem;
}

.ml-catalogue .ml-fav.is-on,
.ml-catalogue .ml-fav:hover {
  color: #e11d48;
}

@media (max-width: 640px) {
  .pg-hero-catalogue {
    padding: 96px 0 8px;
  }

  .pg-hero-catalogue h1 {
    margin: 0 auto;
    font-size: 1.8rem;
  }

  .pg-hero-catalogue .pg-lead {
    display: none;
  }

  .ml-catalogue-head {
    position: relative;
    flex-wrap: wrap;
    gap: 10px 8px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .ml-catalogue-head .ml-search {
    flex: 1 1 0;
    min-width: 0;
  }

  .ml-catalogue-head .ml-search input {
    background: var(--lp-surface);
  }

  .ml-bar-sep {
    display: none;
  }

.ml-type-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ml-catalogue-head .ml-type-filters {
    flex-wrap: wrap;
  }

  .ml-start {
    gap: 14px;
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
  }

  .ml-start-cover {
    width: 70px;
  }

  .ml-start-kicker {
    font-size: 12px;
  }

  .ml-start-title {
    font-size: 1.1rem;
  }

  .ml-start-es,
  .ml-start-meta {
    font-size: 13.5px;
  }

  .ml-start-meta {
    margin-top: 4px;
  }

  .ml-start-actions {
    margin-top: 10px;
  }

  .ml-start-btn,
  .ml-start-btn:hover,
  .ml-start-btn:focus-visible {
    min-height: 40px;
    padding: 0 16px;
  }

.ml-genres {
    margin-top: 12px;
  }

  .ml-genres-title {
    margin-bottom: 8px;
    font-size: 1.05rem;
  }

  .ml-genre-tiles {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 4px 16px 6px;
  }

  .ml-genre-tiles::-webkit-scrollbar {
    display: none;
  }

  .ml-genre-tile {
    flex: 0 0 104px;
    gap: 2px;
    padding: 8px 6px 6px;
  }

  .ml-genre-tile:hover {
    transform: none;
  }

  .ml-genre-covers {
    height: 38px;
    margin-bottom: 4px;
  }

  .ml-genre-covers img {
    width: 26px;
    height: 38px;
    margin: 0 -5px;
  }

  .ml-genre-name {
    font-size: 13px;
  }

  .ml-genre-count {
    font-size: 13px;
  }

  .ml-length-shelves {
    gap: 30px;
  }

  .ml-length-head h2 {
    font-size: 1.25rem;
  }

  .ml-length-sub {
    margin-bottom: 12px;
    font-size: 14px;
  }

  .ml-filter-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1.5px solid var(--lp-line);
    background: var(--lp-surface);
    color: var(--lp-ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
  }

  .ml-filter-btn[aria-expanded="true"] {
    border-color: var(--lp-primary);
    color: var(--lp-primary);
  }

  .ml-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--lp-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
  }

  body.active .ml-filter-badge {
    color: #0b1220;
  }

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

  .ml-filter-menu {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 20;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1.5px solid var(--lp-line);
    border-radius: 14px;
    background: var(--lp-surface);
    box-shadow: var(--lp-shadow-lg);
  }

  .ml-filter-menu.is-open {
    display: flex;
  }

  .ml-catalogue-head .ml-levels {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ml-catalogue-head .ml-levels-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lp-muted);
  }

  .ml-catalogue-head .ml-chip-count {
    display: inline;
  }

  .ml-catalogue-head .ml-levels-note {
    display: block;
    margin: 0;
    font-size: 13px;
    color: var(--lp-muted);
  }

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

  .ml-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1.5px solid var(--lp-primary);
    background: var(--lp-soft);
    color: var(--lp-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
  }

  .ml-active-chip i {
    font-size: 11px;
  }

  .ml-catalogue-note {
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .ml-note-long {
    display: none;
  }

  .ml-note-short {
    display: inline;
  }

  .ml-note-btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .ml-count-row {
    margin: 14px 0 8px;
  }

  .ml-catalogue .ml-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
  }

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

  .ml-catalogue .ml-book-title-es {
    font-size: 0.85rem;
  }

  .ml-catalogue .ml-versions {
    display: none; 
  }

  .ml-catalogue .ml-versions ~ .ml-book-foot {
    margin-top: auto;
  }
}

.ml-greeting {
  display: block;
}

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

.ml-phrases {
  margin-bottom: 24px;
}

.ml-stats .ml-stat {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  padding: 10px 18px;
  box-shadow: none;
}

.ml-stats .ml-stat-number {
  font-size: 1.5rem;
}

.ml-stats .ml-stat-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ml-shelves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
  gap: 28px 20px;
}

.ml-shelves .ml-shelf + .ml-shelf {
  margin-top: 0;
}

.ml-shelf .ml-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

.ml-shelf .ml-book {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  padding: 12px;
  background: var(--lp-surface);
}

.ml-shelf .ml-book-cover {
  align-self: start;
}

.ml-shelf .ml-pill-premium {
  left: 6px;
  bottom: 6px;
  padding: 3px 7px;
  font-size: 0;
}

.ml-shelf .ml-pill-premium i {
  font-size: 12px;
}

.ml-shelf .ml-book h3 {
  margin-top: 2px;
}

.ml-shelf .ml-book-action {
  margin-top: auto;
}

.ml-shelf .ml-book-body > .ml-book-action {
  padding-top: 10px;
}

.ml-shelf .ml-fav {
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  background: transparent;
  box-shadow: none;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 6px rgba(0, 0, 0, 0.3));
}

.ml-shelf .ml-fav.is-on,
.ml-shelf .ml-fav:hover {
  color: #f43f5e;
}

.ml-shelf .ml-more-btn {
  width: 32px;
  height: 32px;
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: none;
  color: #fff;
}

.ml-shelf .ml-more-btn:hover {
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
}

.ml-shelf .ml-more-btn[aria-expanded="true"] {
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
}

.ml-shelf .ml-more-menu::before {
  right: 11px;
}

.ml-round {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--lp-primary);
}

@media (max-width: 640px) {
  .ml-header {
    align-items: flex-start;
  }

  .ml-stats {
    width: auto;
  }

  .ml-stats .ml-stat {
    flex: 0 0 auto;
    padding: 6px 12px;
  }

  .ml-stats .ml-stat-number {
    font-size: 1.2rem;
  }

  .ml-stats .ml-stat-label {
    font-size: 11px;
  }

.ml-shelves {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .ml-shelf .ml-grid {
    gap: 10px;
  }

  .ml-soon .ml-soon-icon {
    display: none;
  }

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

  .ml-shelf .ml-book-title-es,
  .ml-shelf .ml-book-meta {
    display: none;
  }

.ml-shelf .ml-more {
    top: 2px;
    right: 2px;
  }

  .ml-shelf .ml-more-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    box-shadow: none;
    color: var(--lp-muted);
  }

  .ml-shelf .ml-more-btn[aria-expanded="true"] {
    background: var(--lp-soft);
    color: var(--lp-primary);
  }

  .ml-shelf .ml-more-menu::before {
    right: 15px;
  }

  .ml-shelf .ml-book.has-more h3 {
    padding-right: 32px;
  }

  .ml-shelf .ml-fav {
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
  }

  .ml-shelf .ml-book-cover .new-ribbon {
    display: none;
  }
}

.ml-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 28px;
}

.ml-main,
.ml-side {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.ml-side {
  position: sticky;
  top: 96px;
}

.ml-layout .ml-header,
.ml-layout .ml-continue,
.ml-layout .ml-phrases,
.ml-side .ml-streak {
  margin: 0;
}

.ml-side-eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lp-primary);
}

.ml-layout .ml-continue {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  grid-template-areas: "thumb info" "thumb btn";
  align-items: center;
  align-content: center;
  gap: 6px 24px;
  padding: 22px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: 22px;
  box-shadow: var(--lp-shadow);
  color: var(--lp-ink);
}

.ml-layout .ml-continue-thumb {
  grid-area: thumb;
  width: 124px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.ml-layout .ml-continue-info {
  grid-area: info;
  align-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.ml-layout .ml-continue-eyebrow {
  color: var(--lp-primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 1;
}

body.active .ml-layout .ml-continue {
  background: var(--lp-surface);
}

body.active .ml-layout .ml-continue :is(h2, p, span) {
  color: var(--lp-muted);
}

.ml-layout .ml-continue-info h2,
body.active .ml-layout .ml-continue-info h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--lp-navy);
}

.ml-layout .ml-continue-info p {
  color: var(--lp-muted);
  opacity: 1;
}

body.active .ml-layout .ml-continue span.ml-continue-eyebrow {
  color: var(--lp-primary);
}

.ml-continue-bar {
  width: 100%;
  max-width: 360px;
  height: 8px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--lp-soft);
  overflow: hidden;
}

.ml-continue-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lp-primary);
}

.ml-layout .ml-continue-percent {
  font-size: 14px;
}

.ml-layout .ml-continue .ml-btn-primary {
  grid-area: btn;
  justify-self: start;
  align-self: start;
  margin-top: 8px;
  min-height: 54px;
  padding: 0 26px;
  border: 0;
  border-bottom: 4px solid var(--ds-blue-dark, #1e3a8a);
  border-radius: 14px;
  background: var(--lp-primary);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

body.active .ml-layout .ml-continue .ml-btn-primary {
  color: #0b1220;
  border-bottom-color: #2563eb;
}

.ml-library-head .ml-section-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--lp-navy);
}

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

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

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

.ml-shelf-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.ml-shelf-tabs .ml-chip {
  flex: none;
  min-height: 40px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--lp-ink);
}

.ml-shelf-tabs .ml-chip[aria-pressed="true"] {
  background: var(--lp-primary);
  border-color: var(--lp-primary);
  color: #fff;
}

body.active .ml-shelf-tabs .ml-chip[aria-pressed="true"] {
  color: #0b1220;
}

.ml-chip-count {
  margin-left: 4px;
  font-weight: 600;
  opacity: 0.75;
}

.ml-chip-count:empty {
  display: none;
}

.ml-layout .ml-shelves {
  display: block;
}

.ml-shelves[data-shelf-filter="all"] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}

.ml-shelves[data-shelf-filter="all"] .ml-shelf:not([hidden]),
.ml-shelves[data-shelf-filter="all"] .ml-grid {
  display: contents;
}

.ml-shelves[data-shelf-filter="all"] .ml-shelf-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ml-shelves[data-shelf-filter="all"] .ml-shelf-empty,
.ml-shelves[data-shelf-filter="progress"] .ml-shelf:not([data-shelf="progress"]),
.ml-shelves[data-shelf-filter="favourites"] .ml-shelf:not([data-shelf="favourites"]),
.ml-shelves[data-shelf-filter="completed"] .ml-shelf:not([data-shelf="completed"]) {
  display: none;
}

.ml-shelves[data-shelf-filter="all"] .ml-book[data-also-above] {
  display: none;
}

.ml-mark-done button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--lp-success);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ml-mark-done button:focus-visible {
  outline: 3px solid var(--lp-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.ml-shelves[data-shelf-filter="all"],
.ml-layout .ml-shelf .ml-grid {
  align-items: stretch;
}

.ml-shelf .ml-versions {
  flex-wrap: nowrap;
  gap: 4px;
  margin: 2px 0 8px;
  overflow: hidden;
}

.ml-shelf .ml-versions li {
  display: flex;
  min-width: 0;
}

.ml-shelf .ml-version,
.ml-shelf a.ml-version {
  flex: 0 1 auto;
  min-width: 0;
  padding: 3px 6px;
  border-color: transparent;
  border-radius: 6px;
  background: #f1f5f9;
  color: #374151;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-shelf .ml-version.is-current {
  background: var(--lp-soft);
  color: var(--lp-primary);
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.25);
}

body.active .ml-shelf .ml-version {
  background: rgba(148, 163, 184, 0.16);
  color: var(--lp-ink);
}

body.active .ml-shelf .ml-version.is-current {
  background: rgba(59, 130, 246, 0.28);
  color: #dbeafe;
}

.ml-layout .ml-shelf .ml-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}

.ml-layout .ml-shelf .ml-book {
  display: flex;
  gap: 10px;
}

.ml-layout .ml-shelf .ml-book-title-es,
.ml-layout .ml-shelf .ml-book-meta {
  display: none;
}

.ml-side .ml-phrases,
.ml-next {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 20px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: 20px;
  box-shadow: var(--lp-shadow);
}

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

.ml-side .ml-phrases h2 {
  margin: 2px 0 0;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--lp-navy);
}

.ml-side .ml-phrases p {
  margin: 0;
  color: var(--lp-muted);
}

.ml-side .ml-phrases > .ml-btn {
  margin-top: 12px;
  width: 100%;
}

.ml-side .ml-phrases > .ml-btn-primary {
  border: 0;
  border-bottom: 4px solid var(--ds-blue-dark, #1e3a8a);
}

.ml-next-book {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  color: inherit;
  text-decoration: none;
}

.ml-next-book img {
  flex: none;
  width: 64px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.ml-next-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ml-next-info strong {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--lp-navy);
}

.ml-next-info span {
  font-size: 14px;
  color: var(--lp-muted);
}

.ml-next-info .ml-next-go {
  margin-top: 4px;
  font-weight: 800;
  color: var(--lp-primary);
}

.ml-next-book:hover strong {
  text-decoration: underline;
}

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

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

.ml-side .ml-stats .ml-stat {
  flex: 1;
}

.ml-practice {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.ml-practice .ml-side-eyebrow {
  margin: 0 0 -2px;
}

.ml-practice-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 86px;
  padding: 10px 14px 10px 20px;
  background: var(--lp-surface);
  border: 2px solid var(--lp-line);
  border-bottom-width: 5px;
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.ml-practice-card:hover {
  color: inherit;
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.ml-practice-card:active {
  transform: translateY(2px);
  border-bottom-width: 3px;
}

.ml-practice-card:focus-visible {
  outline: 3px solid var(--lp-primary);
  outline-offset: 3px;
}

.ml-practice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ml-practice-text strong {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--lp-navy);
}

.ml-practice-sub {
  font-size: 14px;
  color: var(--lp-muted);
}

.ml-practice-art {
  flex: none;
  width: 104px;
  height: auto;
}

#phrases-card .ml-practice-art {
  width: 114px;
  margin: -4px -4px -4px 0;
}

#words-card .ml-practice-art {
  height: 96px;
  margin: -12px 0 -10px;
}

.ml-practice-badge {
  position: absolute;
  top: -12px;
  right: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ea580c;
  box-shadow: 0 2px 0 #9a3412;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ml-practice-badge.is-done {
  background: #16a34a;
  box-shadow: 0 2px 0 #14532d;
}

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

body.active .ml-practice-card:hover {
  border-color: rgba(96, 165, 250, 0.45);
}

.ml-books-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 18px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  box-shadow: var(--lp-shadow);
  color: var(--lp-muted);
  font-size: 15px;
}

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

.ml-books-line > i {
  font-size: 1.3rem;
  color: var(--lp-primary);
}

.ml-books-line b {
  font-weight: 900;
  color: var(--lp-navy);
}

.ml-books-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lp-primary);
}

.ml-side .ml-streak {
  display: flex;
  flex-direction: column-reverse;
  gap: 14px;
  padding: 16px;
}

.ml-side .ml-streak-scene .hs-panorama {
  min-height: 0;
  aspect-ratio: 780 / 280;
  max-height: 280px;
}

.ml-side .ml-streak-count {
  font-size: 26px;
}

.ml-side .ml-streak .streak-week {
  max-width: none;
}

@media (max-width: 991px) {
  .ml-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .ml-main,
  .ml-side {
    display: contents;
  }

  .ml-main > *,
  .ml-side > * {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
  }

  .ml-layout .ml-header { order: 1; }
  .ml-layout .ml-continue { order: 2; }
  .ml-side .ml-streak { order: 3; }
  .ml-side .ml-practice { order: 4; }
  .ml-next { order: 5; }
  .ml-side .ml-books-line { order: 6; }
  .ml-layout .ml-library { order: 7; }
}

@media (max-width: 640px) {
  .ml-layout .ml-continue {
    gap: 14px 16px;
    padding: 18px;
  }

  .ml-layout .ml-continue-thumb {
    width: 84px;
  }

  .ml-layout .ml-continue-info {
    align-self: center;
  }

  .ml-layout .ml-continue-info h2 {
    font-size: 1.3rem;
  }

.ml-layout .ml-continue {
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-areas: "thumb info" "btn btn";
  }

  .ml-layout .ml-continue .ml-btn-primary {
    width: 100%;
    margin-top: 0;
  }

  .ml-layout .ml-shelf .ml-grid,
  .ml-shelves[data-shelf-filter="all"] {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ml-layout .ml-shelf .ml-book {
    display: grid;
    gap: 12px;
  }
}
