:root {
  --primary: hsl(16, 100%, 60%);
  --primary-dim: hsl(16, 100%, 50%);
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --font: 'Tajawal', system-ui, sans-serif;
  --header-h: 72px;
  --bottom-nav-h: 68px;
  --bd-player-h: 7.25rem;
  --max: 1200px;
  --page-pad: 1rem;
}

html.dark {
  color-scheme: dark;
  --bg: hsl(0, 0%, 7%);
  --card: hsl(0, 0%, 10%);
  --card-hover: hsl(0, 0%, 13%);
  --muted: hsl(0, 0%, 18%);
  --border: hsl(0, 0%, 20%);
  --text: hsl(0, 0%, 95%);
  --text-muted: hsl(0, 0%, 60%);
  --surface-hover: rgba(255, 255, 255, .06);
  --header-scrolled: rgba(18, 18, 18, .92);
  --header-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  --search-bg: hsl(0, 0%, 14%);
  --search-focus-bg: hsl(0, 0%, 16%);
  --nav-link: rgba(255, 255, 255, .82);
  --nav-link-hover: #fff;
  --nav-active-bg: hsla(16, 45%, 16%, .9);
  --icon-muted: rgba(255, 255, 255, .75);
  --ghost-border: hsl(0, 0%, 28%);
  --ghost-hover-border: hsl(0, 0%, 36%);
  --ghost-color: #fff;
  --menu-line: #fff;
  --overlay: rgba(0, 0, 0, .45);
  --mobile-nav-bg: rgba(18, 18, 18, .98);
  --notif-border: hsl(0, 0%, 7%);
  --card-shadow: 0 20px 50px rgba(0, 0, 0, .4);
  --hero-pattern: #fff;
  --btn-outline-bg: rgba(255, 255, 255, .04);
  --book-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --bottom-nav-bg: rgba(12, 12, 14, .96);
  --bottom-nav-border: hsl(0, 0%, 16%);
  --bottom-nav-muted: hsl(0, 0%, 55%);
  --pill-bg: hsla(0, 0%, 100%, .03);
  --pill-bg-hover: hsla(0, 0%, 100%, .06);
  --on-dark-text: #fff;
  --on-dark-muted: rgba(255, 255, 255, .78);
}

html.light {
  color-scheme: light;
  --bg: hsl(0, 0%, 98%);
  --card: #ffffff;
  --card-hover: hsl(0, 0%, 96%);
  --muted: hsl(0, 0%, 93%);
  --border: hsl(0, 0%, 88%);
  --text: hsl(0, 0%, 12%);
  --text-muted: hsl(0, 0%, 45%);
  --surface-hover: rgba(0, 0, 0, .05);
  --header-scrolled: rgba(255, 255, 255, .94);
  --header-shadow: 0 8px 30px rgba(0, 0, 0, .06);
  --search-bg: hsl(0, 0%, 93%);
  --search-focus-bg: #fff;
  --nav-link: hsl(0, 0%, 38%);
  --nav-link-hover: hsl(0, 0%, 10%);
  --nav-active-bg: hsla(16, 100%, 60%, .14);
  --icon-muted: hsl(0, 0%, 42%);
  --ghost-border: hsl(0, 0%, 82%);
  --ghost-hover-border: hsl(0, 0%, 72%);
  --ghost-color: var(--text);
  --menu-line: hsl(0, 0%, 20%);
  --overlay: rgba(0, 0, 0, .28);
  --mobile-nav-bg: rgba(255, 255, 255, .98);
  --notif-border: #fff;
  --card-shadow: 0 16px 40px rgba(0, 0, 0, .08);
  --hero-pattern: hsl(0, 0%, 30%);
  --btn-outline-bg: #fff;
  --book-shadow: 0 12px 28px rgba(0, 0, 0, .1);
  --bottom-nav-bg: rgba(255, 255, 255, .96);
  --bottom-nav-border: hsl(0, 0%, 90%);
  --bottom-nav-muted: hsl(0, 0%, 50%);
  --pill-bg: hsla(0, 0%, 0%, .045);
  --pill-bg-hover: hsla(0, 0%, 0%, .075);
  --on-dark-text: #fff;
  --on-dark-muted: rgba(255, 255, 255, .78);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 2rem;
  transition: background-color .25s ease, color .25s ease;
  overflow-x: clip;
  max-width: 100%;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
  min-width: 0;
}

.main {
  overflow-x: clip;
  max-width: 100%;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}
.pulse--sm { width: 6px; height: 6px; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.85); }
}

html.light .quick-cat,
html.light .book-card,
html.light .explore-card,
html.light .spotlight,
html.light .footer {
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

/* Header */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .2s, box-shadow .2s;
  max-width: 100%;
  overflow-x: clip;
}

.header.scrolled {
  background: var(--header-scrolled);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
  box-shadow: var(--header-shadow);
}

.header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: .65rem;
  min-width: 0;
}

.header__start {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header__logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: .15rem;
}

.header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .85rem;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--nav-link);
  white-space: nowrap;
  transition: color .15s, background .15s;
}

.header__nav-link svg {
  flex-shrink: 0;
  opacity: .9;
}

.header__nav-link:hover {
  color: var(--nav-link-hover);
  background: var(--surface-hover);
}

.header__nav-link--active {
  color: var(--primary);
  background: var(--nav-active-bg);
}

.header__nav-link--active svg {
  color: var(--primary);
}

.header__nav-link--live::after {
  content: '';
  position: absolute;
  top: 5px;
  inset-inline-end: 6px;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid var(--notif-border);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
  animation: liveDotPulse 1.6s ease infinite;
  pointer-events: none;
}

@keyframes liveDotPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  50% {
    opacity: 0.9;
    transform: scale(0.92);
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
  }
}

.header__search {
  position: relative;
  flex: 1;
  max-width: 340px;
  min-width: 0;
}

.header__search input {
  width: 100%;
  height: 42px;
  padding-inline: 2.75rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--search-bg);
  color: var(--text);
  font: inherit;
  font-size: .86rem;
  transition: background .15s, box-shadow .15s;
}

.header__search input::placeholder {
  color: var(--text-muted);
}

.header__search input:focus {
  outline: none;
  background: var(--search-focus-bg);
  box-shadow: 0 0 0 2px hsla(16, 100%, 60%, .2);
}

.header__search-icon {
  position: absolute;
  inset-inline-start: .95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header__end {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
  margin-inline-start: auto;
}

.header__tools {
  display: flex;
  align-items: center;
  gap: .1rem;
}

.header__icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--icon-muted);
  transition: background .15s, color .15s;
}

.header__icon-btn:hover {
  background: var(--surface-hover);
  color: var(--nav-link-hover);
}

.header__icon-btn--link {
  text-decoration: none;
  color: var(--icon-muted);
}

.header__icon-btn--active {
  background: hsla(16, 100%, 60%, .12);
  color: var(--primary);
}

.header__icon-btn--badge {
  position: relative;
}

.header__icon-badge {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.header__lang-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 .55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--ghost-border);
  color: var(--nav-link);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
  transition: background .15s, color .15s, border-color .15s;
}

.header__lang-btn:hover {
  background: var(--surface-hover);
  color: var(--nav-link-hover);
  border-color: var(--ghost-hover-border);
}

.header__lang-btn .lang-label {
  line-height: 1;
}

.header__ctas {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}

.header__btn:active { transform: scale(.98); }

.header__btn--ghost {
  border: 1px solid var(--ghost-border);
  color: var(--ghost-color);
  background: transparent;
}

.header__btn--ghost:hover {
  background: var(--surface-hover);
  border-color: var(--ghost-hover-border);
}

.header__btn--primary {
  background: var(--primary);
  color: #fff;
  padding-inline: 1.15rem;
  box-shadow: 0 6px 20px hsla(16, 100%, 60%, .28);
}

.header__btn--primary:hover {
  background: var(--primary-dim);
}

.header__menu {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 10px;
}

.header__menu span {
  display: block;
  height: 2px;
  background: var(--menu-line);
  border-radius: 1px;
  transition: transform .2s, opacity .2s;
}

.theme-icon { display: block; }
html.dark .theme-icon--moon { display: none; }
html.light .theme-icon--sun { display: none; }

.header__menu.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__menu.open span:nth-child(2) { opacity: 0; }
.header__menu.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: .7rem 1.4rem;
  font-size: .9rem;
  line-height: 1.2;
  transition: background .15s, transform .1s, border-color .15s;
  white-space: nowrap;
}
.btn svg {
  display: block;
  flex-shrink: 0;
  align-self: center;
}
.btn:active { transform: scale(.98); }
.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px hsla(16, 100%, 60%, .28);
}
.btn--primary:hover { background: var(--primary-dim); }
.btn--outline {
  background: var(--btn-outline-bg);
  border: 1.5px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn--outline:hover { background: var(--muted); }
.btn--white {
  background: #fff;
  color: #111;
  font-weight: 800;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: .82rem;
}
.btn--full { width: 100%; }

.btn--hero {
  border-radius: var(--radius-pill);
  font-size: 1rem;
  padding: .9rem 1.5rem;
  gap: .55rem;
}

.btn__chevron {
  opacity: .9;
  margin-inline-start: .15rem;
}

/* Bottom nav + WhatsApp FAB */
.bottom-nav,
.whatsapp-fab {
  display: none;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 210;
  height: var(--bottom-nav-h);
  padding: .45rem .35rem calc(.45rem + env(safe-area-inset-bottom, 0px));
  background: var(--bottom-nav-bg);
  border-top: 1px solid var(--bottom-nav-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  justify-content: space-around;
  align-items: flex-end;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  min-width: 3.25rem;
  padding: .2rem .35rem;
  color: var(--bottom-nav-muted);
  font-size: .62rem;
  font-weight: 700;
  transition: color .15s;
}

.bottom-nav__item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav__item--active {
  color: var(--primary);
}

.bottom-nav__item--active svg {
  stroke: var(--primary);
}

.whatsapp-fab {
  position: fixed;
  z-index: 205;
  bottom: calc(var(--bottom-nav-h) + .85rem + env(safe-area-inset-bottom, 0px));
  inset-inline-end: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  height: 48px;
  padding: 0 1.1rem;
  border-radius: var(--radius-pill);
  background: #25d366;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(37, 211, 102, .4);
  transition: transform .15s, box-shadow .15s;
}

.whatsapp-fab span {
  display: none;
}

@media (min-width: 768px) {
  .whatsapp-fab span {
    display: inline;
  }
}

.whatsapp-fab:active {
  transform: scale(.95);
}

.whatsapp-fab:hover {
  box-shadow: 0 10px 28px rgba(37, 211, 102, .5);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 0 2rem;
}
.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__bg::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 50%;
  height: 55%;
  background: radial-gradient(ellipse, hsla(16,100%,60%,.08), transparent 70%);
}
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .03;
  background-image: radial-gradient(circle, var(--hero-pattern) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero__row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .9rem;
  background: hsla(16,100%,60%,.12);
  border: 1px solid hsla(16,100%,60%,.25);
  border-radius: 999px;
  color: var(--primary);
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.hero__title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: .85rem;
}
.hero__grad {
  background: linear-gradient(to left, var(--primary), #fb923c, #fcd34d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__brand {
  color: var(--primary);
  position: relative;
}
.hero__brand::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 0;
  left: 0;
  height: 3px;
  background: hsla(16,100%,60%,.4);
  border-radius: 2px;
}
.hero__desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 26rem;
  margin-bottom: 1.25rem;
}
.hero__desc strong { color: var(--text); font-weight: 600; }
.hero__btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.5rem; }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
}
.stat {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.stat__icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(16,100%,60%,.1);
  border-radius: 10px;
  color: var(--primary);
}
.stat strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}
.stat span:last-child {
  font-size: .68rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat--live .stat__icon { background: rgba(239,68,68,.12); color: #f87171; }
.stat--live strong { color: #f87171; }

/* Sub card */
.sub-card {
  position: relative;
  background: linear-gradient(135deg, var(--card), hsla(16,100%,60%,.06));
  border: 1px solid hsla(16,100%,60%,.2);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--card-shadow);
}
.sub-card__bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(to left, var(--primary), #fbbf24);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.sub-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), #fb923c);
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 8px 20px hsla(16,100%,60%,.35);
}
.sub-card h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: .2rem; }
.sub-card > p { font-size: .75rem; color: var(--text-muted); margin-bottom: .85rem; }
.sub-card ul { margin-bottom: 1rem; text-align: right; }
.sub-card li {
  font-size: .75rem;
  color: var(--text-muted);
  padding: .15rem 0;
  padding-right: 1rem;
  position: relative;
}
.sub-card li::before {
  content: '✓';
  position: absolute;
  right: 0;
  color: var(--primary);
  font-weight: 800;
}
.sub-card__tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: #22c55e;
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  padding: .2rem .5rem;
  border-radius: 999px;
}

/* Quick cats */
.hero__explore-label {
  text-align: center;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .85rem;
}
.quick-cats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .65rem;
  padding: .75rem;
  background: var(--bg);
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 1;
}
.quick-cat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem .5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  min-width: 0;
  overflow: hidden;
}
.quick-cat:hover {
  transform: translateY(-4px);
  box-shadow: var(--book-shadow);
  border-color: var(--border);
}
.quick-cat__live {
  position: absolute;
  top: .4rem;
  inset-inline-start: .4rem;
  background: #ef4444;
  color: #fff;
  font-size: .55rem;
  font-weight: 900;
  padding: .1rem .35rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: .2rem;
  max-width: calc(100% - .8rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-cat__icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  margin-bottom: .55rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.grad-orange { background: linear-gradient(135deg, #f97316, #fbbf24); }
.grad-pink { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.grad-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.grad-blue { background: linear-gradient(135deg, #3b82f6, #22d3ee); }
.grad-green { background: linear-gradient(135deg, #10b981, #4ade80); }
.grad-red { background: linear-gradient(135deg, #ef4444, #f43f5e); }
.grad-yellow { background: linear-gradient(135deg, #eab308, #facc15); }
.grad-teal { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }
.grad-rose { background: linear-gradient(135deg, #f43f5e, #ec4899); }
.grad-indigo { background: linear-gradient(135deg, #6366f1, #818cf8); }
.quick-cat strong {
  font-size: .78rem;
  font-weight: 800;
  margin-bottom: .1rem;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}
.quick-cat__desc {
  font-size: .65rem;
  color: var(--text-muted);
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

@media (min-width: 1025px) {
  .quick-cats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.page { padding-top: .5rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Featured carousel */
.featured {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.featured__slide {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 360px;
  color: var(--on-dark-text);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .08);
}
.feat-bg-1 { background: linear-gradient(135deg, #1e1b4b, #312e81); }
.feat-bg-2 { background: linear-gradient(135deg, #431407, #9a3412); }
.feat-bg-3 { background: linear-gradient(135deg, #0c4a6e, #1e3a5f); }
.feat-bg-4 { background: linear-gradient(135deg, #3b0764, #581c87); }
.featured__bg {
  position: absolute;
  inset: 0;
}
.featured__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .32;
  filter: blur(5px);
  transform: scale(1.08);
}
.featured__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .72) 42%, rgba(0, 0, 0, .45) 100%),
    linear-gradient(to left, rgba(0, 0, 0, .55), transparent 55%);
}
.featured__content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.75rem;
  padding: 1.85rem 2rem 2rem;
  align-items: center;
  min-height: 360px;
}
.featured__cover-wrap { position: relative; flex-shrink: 0; }
.featured__cover {
  width: 148px;
  height: 210px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .55);
  border: 2px solid rgba(255, 255, 255, .12);
}
.featured__tag {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  padding: .15rem .45rem;
  border-radius: 6px;
}
.featured__type {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: rgba(255,255,255,.12);
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  margin-bottom: .5rem;
  color: var(--on-dark-muted);
}
.featured__info {
  flex: 1;
  min-width: 0;
}
.featured__info h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.95rem);
  font-weight: 900;
  margin-bottom: .25rem;
  color: var(--on-dark-text);
  line-height: 1.25;
}
.featured__author {
  color: var(--on-dark-muted);
  font-size: .9rem;
  margin-bottom: .55rem;
  font-weight: 600;
}
.featured__desc {
  color: rgba(255, 255, 255, .84);
  font-size: .9rem;
  line-height: 1.75;
  margin-bottom: .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 40rem;
}
.featured__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: .85rem;
}
.featured__rating {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-bottom: 0;
  font-size: .88rem;
  color: var(--on-dark-text);
}
.featured__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .1rem;
}
.featured__slide .btn--outline {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .35);
  color: #fff;
}
.featured__slide .btn--outline:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .5);
}
.featured__slide .star:not(.star--on) {
  color: rgba(255, 255, 255, .35);
}

.featured__slide .star--on {
  color: #eab308;
}
.featured__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  padding: .15rem 0 .1rem;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: .35;
  padding: 0;
  flex-shrink: 0;
  transition: width .2s ease, opacity .2s ease, background .2s ease;
}
.dot:hover { opacity: .55; }
.dot.active {
  background: var(--primary);
  opacity: 1;
  width: 18px;
  border-radius: 3px;
}

/* Live banner */
.live-banner { padding: .75rem 0; }
.live-banner__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(to left, #e11d48, var(--primary));
  color: var(--on-dark-text);
  overflow: hidden;
}
.live-banner__waves {
  position: absolute;
  inset: 0;
  opacity: .1;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,100 C150,200 350,0 600,100 C850,200 1050,0 1200,100 L1200,200 L0,200 Z' fill='white' opacity='.3'/%3E%3C/svg%3E") center/cover;
}
.live-banner__left {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 200px;
}
.live-banner__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
.live-banner__icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
  animation: ping 2s ease infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
.live-banner__top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: #ef4444;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 999px;
}
.live-banner__listeners {
  font-size: .72rem;
  color: rgba(255,255,255,.8);
}
.live-banner__left h3 {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
}
.live-banner__left p {
  font-size: .78rem;
  color: rgba(255,255,255,.75);
  margin-top: .1rem;
}

/* Explore */
.explore {
  padding: 1.5rem 0;
  min-width: 0;
  overflow-x: clip;
}
.explore__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  min-width: 0;
}
.explore__head > div {
  min-width: 0;
  flex: 1 1 auto;
}
.explore__head h2 {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.25;
  word-break: break-word;
}
.explore__head p {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .15rem;
  line-height: 1.45;
}
.explore__badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .7rem;
  background: hsla(16,100%,60%,.1);
  color: var(--primary);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.explore__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  min-width: 0;
}
.explore-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: var(--radius-lg);
  color: #fff;
  min-height: 200px;
  min-width: 0;
  transition: transform .2s;
  overflow: hidden;
}
.explore-card:hover { transform: scale(1.02); }
.sec-orange { background: linear-gradient(135deg, var(--primary), #ea580c); }
.sec-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.sec-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.sec-yellow { background: linear-gradient(135deg, #eab308, #ca8a04); }
.sec-green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.sec-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.sec-rose { background: linear-gradient(135deg, #f43f5e, var(--primary)); }
.sec-teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.sec-pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.sec-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.explore-card__live,
.explore-card__free {
  position: absolute;
  top: .5rem;
  inset-inline-start: .5rem;
  font-size: .62rem;
  font-weight: 700;
  padding: .12rem .4rem;
  border-radius: 999px;
  z-index: 1;
  max-width: calc(100% - 1rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.explore-card:has(.explore-card__live),
.explore-card:has(.explore-card__free) {
  padding-top: 1.75rem;
}
.explore-card__live { background: #ef4444; display: flex; align-items: center; gap: .2rem; }
.explore-card__free { background: rgba(34,197,94,.85); }
.explore-card__top {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: .5rem;
  row-gap: .35rem;
  align-items: start;
  margin-bottom: .5rem;
}
.explore-card__icon {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  flex-shrink: 0;
}
.explore-card__icon--sm { width: 28px; height: 28px; }
.explore-card__top > div {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.explore-card h3 {
  font-size: .82rem;
  font-weight: 900;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}
.explore-card__top > div > p {
  font-size: .65rem;
  opacity: .8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.explore-card__count {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  justify-self: start;
  font-size: .65rem;
  background: rgba(255,255,255,.2);
  padding: .1rem .35rem;
  border-radius: 999px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.explore-card__meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 700;
  color: #fde047;
  margin-bottom: .55rem;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
}

.explore-card__meta--muted {
  color: rgba(255, 255, 255, .75);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explore-card__stars {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: .08rem;
  flex-shrink: 0;
}

.explore-card__stars .star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .35);
}

.explore-card__stars .star--on {
  color: #fde047;
}

.explore-card__stars .star svg {
  width: 12px;
  height: 12px;
  display: block;
}

.explore-card__rating-val {
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
  opacity: .95;
}
.explore-card__sample {
  display: flex;
  gap: .45rem;
  align-items: center;
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(8px);
  padding: .4rem;
  border-radius: 10px;
  margin-top: auto;
  margin-bottom: .4rem;
  min-width: 0;
}
.explore-card__sample > div {
  min-width: 0;
  flex: 1;
}
.explore-card__sample img {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.explore-card__sample strong {
  display: block;
  font-size: .68rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.explore-card__sample span { font-size: .6rem; opacity: .7; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.explore-card__dur { font-size: .58rem !important; opacity: .6 !important; }
.explore-card__sample--empty {
  opacity: .8;
  min-width: 0;
}
.explore-card__sample--empty span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.explore-card__more {
  font-size: .65rem;
  opacity: .8;
  text-align: start;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Row sections */
.row-section {
  padding: 1.25rem 0;
  overflow-x: clip;
  min-width: 0;
}
.row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .85rem;
  gap: 1rem;
}
.row-head__title { font-size: 1.15rem; font-weight: 900; }
.row-head__sub { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }
.row-head__actions { display: flex; align-items: center; gap: .25rem; }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  color: var(--primary);
  font-size: .82rem;
  font-weight: 700;
  padding: .35rem .6rem;
  border-radius: 8px;
}
.link-btn:hover { background: hsla(16,100%,60%,.1); }
.scroll-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
}
.scroll-btn:hover { background: var(--muted); color: var(--text); }
.row-scroll {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: .5rem;
  margin: 0 -1rem;
  padding-inline: 1rem;
  scrollbar-width: none;
}
.row-scroll::-webkit-scrollbar { display: none; }
.row-scroll__item {
  flex-shrink: 0;
  width: 150px;
  scroll-snap-align: start;
}

/* Book card */
.book-card,
a.book-card {
  display: block;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.book-card__cover {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: .5rem;
  background: var(--muted);
}
.book-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.book-card:hover .book-card__cover img { transform: scale(1.05); }
.badge {
  position: absolute;
  top: .35rem;
  right: .35rem;
  font-size: .58rem;
  font-weight: 800;
  padding: .12rem .35rem;
  border-radius: 6px;
  z-index: 1;
}
.badge--free { background: #22c55e; color: #fff; }
.badge--hot { background: var(--primary); color: #fff; top: auto; bottom: .35rem; right: .35rem; }
.book-card__play {
  position: absolute;
  bottom: .4rem;
  left: .4rem;
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s, transform .2s;
}
.book-card__play svg {
  display: block;
  flex-shrink: 0;
}
.book-card:hover .book-card__play { opacity: 1; transform: scale(1); }
.book-card__title {
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-card__author {
  font-size: .72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-card__rating {
  display: flex;
  align-items: center;
  gap: .15rem;
  margin-top: .2rem;
  font-size: .7rem;
  color: var(--text-muted);
}
.star { color: var(--border); display: flex; }
.star--on { color: #eab308; }
.star svg { width: 11px; height: 11px; }

/* Promo */
.promo { padding: .75rem 0; }
.promo__card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  background: linear-gradient(135deg, hsla(16,100%,60%,.12), var(--card));
  border: 1px solid hsla(16,100%,60%,.2);
  border-radius: var(--radius-lg);
  transition: border-color .2s;
}
.promo__card:hover { border-color: hsla(16,100%,60%,.4); }
.promo__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(16,100%,60%,.15);
  border-radius: 14px;
  color: var(--primary);
  flex-shrink: 0;
}
.promo__card strong { display: block; font-size: 1rem; font-weight: 900; margin-bottom: .15rem; }
.promo__card > div > p { font-size: .8rem; color: var(--text-muted); }
.promo__tags {
  display: flex;
  gap: .75rem;
  margin-top: .4rem;
  font-size: .7rem;
  color: var(--text-muted);
}
.promo__tags span { display: flex; align-items: center; gap: .2rem; }
.promo__cta {
  margin-right: auto;
  background: hsla(16,100%,60%,.12);
  color: var(--primary);
  font-weight: 800;
  font-size: .82rem;
  padding: .5rem 1rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Spotlight */
.spotlight { padding: 1.5rem 0; }
.spotlight__card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(to left, var(--card), hsla(16,100%,60%,.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
@media (min-width: 768px) {
  .spotlight__card { flex-direction: row; }
}
.spotlight__cover {
  position: relative;
  flex-shrink: 0;
}
.spotlight__cover img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
@media (min-width: 768px) {
  .spotlight__cover img { width: 240px; height: 100%; min-height: 280px; }
}
.spotlight__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  padding: .25rem .6rem;
  border-radius: 8px;
}
.spotlight__body { padding: 1.25rem 1.5rem; }
.spotlight__type {
  display: inline-block;
  background: hsla(16,100%,60%,.12);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 6px;
  margin-bottom: .5rem;
}
.spotlight__body h2 { font-size: 1.5rem; font-weight: 900; margin-bottom: .15rem; }
.spotlight__author { color: var(--text-muted); font-weight: 600; margin-bottom: .5rem; }
.spotlight__rating {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: .75rem;
  font-size: .85rem;
}
.spotlight__rating span { color: var(--text-muted); font-size: .78rem; }
.spotlight__desc {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.spotlight__btns { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Browse */
.browse {
  padding: 1.5rem 0 2rem;
  min-width: 0;
  overflow-x: clip;
}
.browse__title {
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: .85rem;
  word-break: break-word;
}
.pills {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding-bottom: .75rem;
  margin-bottom: 1rem;
  scrollbar-width: none;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  scroll-snap-align: start;
  transition: background .15s, border-color .15s, color .15s;
}
.pill:hover { background: hsla(16,100%,60%,.08); color: var(--primary); border-color: hsla(16,100%,60%,.3); }
.pill--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px hsla(16,100%,60%,.3);
}
.pill svg { width: 14px; height: 14px; flex-shrink: 0; }
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  min-width: 0;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 2.5rem 0 1.25rem;
  margin-top: 1rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer__brand img { margin-bottom: .75rem; border-radius: 8px; }
.footer__brand p { font-size: .82rem; color: var(--text-muted); line-height: 1.65; max-width: 260px; }
.footer__col h4 { font-size: .88rem; font-weight: 800; margin-bottom: .75rem; }
.footer__col a {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .4rem;
  transition: color .15s;
}
.footer__col a:hover { color: var(--primary); }
.live-link { display: flex !important; align-items: center; gap: .35rem; }
.footer__apps { display: flex; flex-direction: column; gap: .4rem; margin-top: .75rem; }
.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .4rem .75rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
}
.store-btn--disabled {
  opacity: .85;
  pointer-events: none;
  cursor: default;
}
.store-btn__soon {
  font-size: .62rem;
  font-weight: 800;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: hsla(16, 100%, 60%, .15);
  color: var(--primary);
  letter-spacing: .02em;
}
.store-btn:hover { background: var(--bg); color: var(--text); }
.store-btn--disabled:hover { background: var(--muted); color: inherit; }
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text-muted);
}
.footer__social { display: flex; gap: .5rem; }
.footer__social a {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--muted);
  border-radius: 8px;
  color: var(--text-muted);
}
.footer__social a:hover { background: var(--primary); color: #fff; }

/* Desktop — wider layout, less empty side space */
@media (min-width: 1280px) {
  :root {
    --max: 1360px;
    --page-pad: 1.25rem;
  }
}

@media (min-width: 1440px) {
  :root {
    --max: 1540px;
    --page-pad: 1.5rem;
  }
  .books-grid { grid-template-columns: repeat(4, 1fr); }
  .browse-grid:not(.browse-grid--list) { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1600px) {
  :root {
    --max: 1680px;
    --page-pad: 2rem;
  }
  .books-grid { grid-template-columns: repeat(5, 1fr); }
  .browse-grid:not(.browse-grid--list) { grid-template-columns: repeat(6, 1fr); }
  .hero__row { grid-template-columns: 1fr 360px; gap: 3rem; }
  .hero__desc { max-width: 34rem; }
}

@media (min-width: 1920px) {
  :root {
    --max: min(1860px, calc(100vw - 3rem));
  }
}

/* Responsive */
@media (max-width: 1200px) {
  .header__nav-link { padding: .45rem .65rem; font-size: .8rem; }
  .header__search { max-width: 220px; }
  .header__btn { font-size: .8rem; padding-inline: .85rem; }
}

@media (max-width: 1024px) {
  .header__nav,
  .header__search,
  .header__ctas { display: none; }

  .header__tools { display: flex; }
  .header__inner { justify-content: space-between; }
  .header__start { gap: 0; }
  .header__end {
    margin-inline-start: 0;
    gap: .15rem;
  }
  .header__menu { display: flex; }

  .header__nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: 0;
    padding: 1rem;
    background: var(--mobile-nav-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
    z-index: 231;
    gap: .25rem;
  }

  .header__nav.open .header__nav-link {
    justify-content: flex-start;
    border-radius: 12px;
    padding: .75rem 1rem;
  }

  body.nav-open { overflow: hidden; }

  /* Header must stack above body::after overlay so the menu stays clickable */
  body.nav-open .header {
    z-index: 230;
  }

  body.nav-open .bottom-nav {
    display: none;
  }

  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: var(--overlay);
    z-index: 220;
    pointer-events: auto;
  }

  .hero__row { grid-template-columns: 1fr; }
  .hero__card { max-width: 320px; margin-inline: auto; }
  .quick-cats { grid-template-columns: repeat(3, 1fr); }
  .explore__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .books-grid { grid-template-columns: repeat(4, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }

  body {
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + .5rem);
  }

  .bottom-nav,
  .whatsapp-fab {
    display: flex;
  }

  .header__logo img {
    width: 40px;
    height: 40px;
  }

  .header__inner {
    gap: .35rem;
    padding-block: .45rem;
  }

  .header__end {
    min-width: 0;
    flex-shrink: 1;
  }

  .header__tools {
    gap: 0;
  }

  .header__icon-btn {
    width: 36px;
    height: 36px;
  }

  .header__menu {
    width: 36px;
    height: 36px;
    padding: 7px;
  }

  .hero {
    padding: 1rem 0 1.25rem;
    overflow: hidden;
  }

  .hero__text {
    width: 100%;
    min-width: 0;
  }

  .hero__bg::before {
    top: -5%;
    right: 0;
    left: 0;
    transform: none;
    width: 100%;
    height: 45%;
    background: radial-gradient(ellipse at center, hsla(16, 100%, 60%, .1), transparent 68%);
  }

  .hero__bg::after {
    opacity: .06;
    background-size: 28px 28px;
  }

  .hero__row {
    margin-bottom: 0;
    gap: 0;
    min-height: 0;
    align-content: start;
    align-items: start;
  }

  .hero__card,
  .hero__stats {
    display: none;
  }

  .hero__badge {
    margin-bottom: 1.1rem;
    font-size: .74rem;
    padding: .4rem .85rem;
    background: hsla(16, 100%, 60%, .08);
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .hero__title {
    font-size: clamp(1.75rem, 8.5vw, 2.45rem);
    line-height: 1.35;
    margin-bottom: 1rem;
    overflow: visible;
    overflow-wrap: break-word;
  }

  .hero__grad {
    display: inline-block;
    padding-bottom: .08em;
    background: linear-gradient(to bottom, var(--primary), #fb923c, #fde68a);
    -webkit-background-clip: text;
    background-clip: text;
  }

  .hero__brand {
    display: inline-block;
    padding-bottom: .12em;
  }

  .hero__desc {
    font-size: .92rem;
    line-height: 1.7;
    max-width: none;
    margin-bottom: 1.35rem;
  }

  .hero__btns {
    flex-direction: column;
    gap: .65rem;
    margin-bottom: 1.25rem;
  }

  .hero__btn-secondary {
    display: none;
  }

  .btn--hero {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.25rem;
    font-size: 1.02rem;
    border-radius: 18px;
    box-shadow: 0 10px 28px hsla(16, 100%, 60%, .35);
  }

  .btn--hero .btn__chevron {
    display: none;
  }

  .hero__explore-label {
    margin-top: 0;
    margin-bottom: .75rem;
    font-size: .78rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
    font-weight: 800;
  }

  .quick-cats {
    margin-top: 0;
  }

  .footer {
    margin-bottom: .5rem;
  }

  .explore__head {
    flex-direction: column;
    align-items: stretch;
    gap: .65rem;
  }

  .explore__badge {
    align-self: flex-start;
    max-width: 100%;
    white-space: normal;
    text-align: start;
    line-height: 1.35;
  }

  .explore__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
  }

  .explore-card {
    min-height: 0;
    padding: .9rem;
  }

  .explore-card:has(.explore-card__live),
  .explore-card:has(.explore-card__free) {
    padding-top: 1.75rem;
  }

  .explore-card:hover {
    transform: none;
  }

  .explore-card__top {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .explore-card__icon {
    width: 32px;
    height: 32px;
  }

  .explore-card h3 {
    font-size: .88rem;
  }

  .explore-card__top > div > p {
    font-size: .68rem;
  }

  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
  }

  .quick-cats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    padding: .65rem;
  }

  .quick-cat {
    padding: .75rem .35rem;
  }

  .quick-cat__icon {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 768px) {
  .featured__slide {
    min-height: 0;
  }

  .featured__content {
    min-height: 0;
    padding: 1.35rem 1.25rem 1.45rem;
    gap: 1.15rem;
    align-items: flex-start;
  }

  .featured__cover {
    width: 118px;
    height: 168px;
  }

  .featured__desc {
    font-size: .84rem;
    line-height: 1.65;
    -webkit-line-clamp: 3;
  }
}

@media (max-width: 640px) {
  .header__menu { display: flex; }
  .live-banner__left { min-width: 0; }
  .quick-cats { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .quick-cat { padding: .75rem .35rem; }
  .quick-cat__icon { width: 38px; height: 38px; }
  .featured__content {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1.1rem 1.35rem;
    gap: 1rem;
  }
  .featured__cover-wrap { align-self: center; }
  .featured__cover { width: 112px; height: 160px; }
  .featured__info h2 { font-size: 1.2rem; }
  .featured__desc {
    font-size: .82rem;
    -webkit-line-clamp: 4;
    margin-bottom: .65rem;
  }
  .featured__actions {
    flex-direction: column;
  }
  .featured__actions .btn {
    width: 100%;
    justify-content: center;
  }
  .live-banner__inner { flex-direction: column; align-items: flex-start; }
  .explore__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .promo__card { flex-wrap: wrap; }
  .promo__cta { width: 100%; text-align: center; margin-right: 0; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* LTR (English) */
html[dir="ltr"] body {
  font-family: 'Inter', 'Tajawal', system-ui, sans-serif;
}

html[dir="ltr"] .btn__chevron {
  transform: scaleX(-1);
}

html[dir="ltr"] .sub-card ul {
  text-align: left;
}

html[dir="ltr"] .sub-card li {
  padding-right: 0;
  padding-left: 1rem;
}

html[dir="ltr"] .sub-card li::before {
  right: auto;
  left: 0;
}

html[dir="ltr"] .sub-card__tag {
  left: auto;
  right: 1rem;
}

html[dir="ltr"] .hero__brand::after {
  right: 0;
  left: 0;
}

html[dir="ltr"] .promo__cta {
  margin-right: 0;
  margin-left: auto;
}

/* Section landing page */
.section-page__main-pills,
.browse-page__main-pills {
  margin-bottom: .25rem;
  padding-bottom: .35rem;
}

.section-subs {
  margin-bottom: .85rem;
  padding-bottom: 0;
  border-bottom: none;
}

.section-subs__label {
  margin: 0 0 .65rem;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.section-subs__pills .browse-pill {
  font-size: .75rem;
  padding: .4rem .85rem;
}

.section-subs__pills .browse-pill__icon {
  width: 20px;
  height: 20px;
}

.section-page.browse-page {
  padding: 1.25rem 0 2.5rem;
  min-width: 0;
  overflow-x: clip;
}

.section-page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-page__back {
  width: 100%;
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.section-page__hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}
.section-page__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.section-page__title {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 900;
  margin-bottom: .25rem;
  line-height: 1.25;
  word-break: break-word;
}
.section-page__desc {
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.45;
  word-break: break-word;
}
.section-page__subtitle {
  font-size: 1rem;
  font-weight: 800;
  margin: 1.5rem 0 .85rem;
}
.section-page__subs {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  margin-bottom: .5rem;
}

/* Browse page */
.browse-page {
  padding: 1.25rem 0 2.5rem;
  min-width: 0;
  overflow-x: clip;
}

.browse-page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  min-width: 0;
}

.browse-page__head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.browse-page__title {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: .35rem;
  word-break: break-word;
}

.browse-page__sub {
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.45;
  word-break: break-word;
}

.browse-page__count {
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  background: hsla(16, 100%, 60%, .1);
  border: 1px solid hsla(16, 100%, 60%, .2);
  padding: .4rem .85rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 100%;
}

.browse-pills {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .5rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: .65rem;
  margin-bottom: .65rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 100%;
  min-width: 0;
}

.browse-pills::-webkit-scrollbar {
  display: none;
}

.section-subs__pills.browse-pills {
  margin-bottom: 0;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}

.browse-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
  white-space: nowrap;
  scroll-snap-align: start;
  padding: .5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--pill-bg);
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}

.browse-pill:hover {
  background: var(--pill-bg-hover);
}

.browse-pill__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}

.browse-pill__icon svg {
  width: 13px;
  height: 13px;
}

.browse-pill--orange { border-color: hsla(16, 100%, 60%, .55); }
.browse-pill--orange .browse-pill__icon { background: hsla(16, 100%, 60%, .18); color: hsl(16, 100%, 60%); }
.browse-pill--amber { border-color: hsla(38, 92%, 50%, .55); }
.browse-pill--amber .browse-pill__icon { background: hsla(38, 92%, 50%, .18); color: hsl(38, 92%, 50%); }
.browse-pill--blue { border-color: hsla(217, 91%, 60%, .55); }
.browse-pill--blue .browse-pill__icon { background: hsla(217, 91%, 60%, .18); color: hsl(217, 91%, 60%); }
.browse-pill--purple { border-color: hsla(270, 70%, 60%, .55); }
.browse-pill--purple .browse-pill__icon { background: hsla(270, 70%, 60%, .18); color: hsl(270, 70%, 60%); }
.browse-pill--rose { border-color: hsla(350, 80%, 60%, .55); }
.browse-pill--rose .browse-pill__icon { background: hsla(350, 80%, 60%, .18); color: hsl(350, 80%, 60%); }
.browse-pill--green { border-color: hsla(142, 70%, 45%, .55); }
.browse-pill--green .browse-pill__icon { background: hsla(142, 70%, 45%, .18); color: hsl(142, 70%, 45%); }
.browse-pill--pink { border-color: hsla(330, 80%, 60%, .55); }
.browse-pill--pink .browse-pill__icon { background: hsla(330, 80%, 60%, .18); color: hsl(330, 80%, 60%); }
.browse-pill--teal { border-color: hsla(174, 70%, 40%, .55); }
.browse-pill--teal .browse-pill__icon { background: hsla(174, 70%, 40%, .18); color: hsl(174, 70%, 40%); }
.browse-pill--yellow { border-color: hsla(48, 96%, 53%, .55); }
.browse-pill--yellow .browse-pill__icon { background: hsla(48, 96%, 53%, .18); color: hsl(48, 96%, 53%); }
.browse-pill--indigo { border-color: hsla(239, 70%, 65%, .55); }
.browse-pill--indigo .browse-pill__icon { background: hsla(239, 70%, 65%, .18); color: hsl(239, 70%, 65%); }
.browse-pill--red { border-color: hsla(0, 84%, 60%, .55); }
.browse-pill--red .browse-pill__icon { background: hsla(0, 84%, 60%, .18); color: hsl(0, 84%, 60%); }

.browse-pill--active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}

.browse-pill--active .browse-pill__icon {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.browse-pill--active.browse-pill--orange { background: linear-gradient(135deg, #f97316, #fb923c); }
.browse-pill--active.browse-pill--amber { background: linear-gradient(135deg, #d97706, #f59e0b); }
.browse-pill--active.browse-pill--blue { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.browse-pill--active.browse-pill--purple { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.browse-pill--active.browse-pill--rose { background: linear-gradient(135deg, #e11d48, #f43f5e); }
.browse-pill--active.browse-pill--green { background: linear-gradient(135deg, #059669, #10b981); }
.browse-pill--active.browse-pill--pink { background: linear-gradient(135deg, #db2777, #ec4899); }
.browse-pill--active.browse-pill--teal { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.browse-pill--active.browse-pill--yellow { background: linear-gradient(135deg, #ca8a04, #eab308); color: #111; }
.browse-pill--active.browse-pill--yellow .browse-pill__icon { color: #111; background: rgba(0, 0, 0, .12); }
.browse-pill--active.browse-pill--indigo { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.browse-pill--active.browse-pill--red { background: linear-gradient(135deg, #dc2626, #ef4444); }

.section-subs__pills .browse-pill--sub-all.browse-pill--active {
  background: #fff;
  color: #111;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

html.light .browse-pill--sub-all.browse-pill--active,
html.light .section-subs__pills .browse-pill--sub-all.browse-pill--active {
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px hsla(16, 100%, 60%, .28);
}

html.light .browse-pill--sub-all.browse-pill--active .browse-pill__icon,
html.light .section-subs__pills .browse-pill--sub-all.browse-pill--active .browse-pill__icon {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.section-subs__pills .browse-pill:not(.browse-pill--active) {
  border-color: var(--border);
  background: var(--pill-bg);
}

.browse-toolbar {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .85rem;
}

.browse-search {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.browse-search svg:first-child {
  position: absolute;
  inset-inline-start: .95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.browse-search input {
  width: 100%;
  height: 48px;
  padding-inline: 2.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: .88rem;
  transition: border-color .15s, box-shadow .15s;
}

.browse-search input:focus {
  outline: none;
  border-color: hsla(16, 100%, 60%, .4);
  box-shadow: 0 0 0 3px hsla(16, 100%, 60%, .12);
}

.browse-sort {
  position: relative;
  flex-shrink: 0;
  min-width: 9.5rem;
  z-index: 30;
}

.browse-sort__trigger {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  height: 48px;
  padding-inline: .85rem .75rem;
  border: 1px solid hsla(16, 100%, 60%, .55);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.browse-sort__trigger:hover {
  border-color: hsla(16, 100%, 60%, .75);
  background: hsla(16, 100%, 60%, .04);
}

.browse-sort__trigger:focus {
  outline: none;
}

.browse-sort__trigger:focus-visible,
.browse-sort--open .browse-sort__trigger {
  border-color: hsla(16, 100%, 60%, .75);
  box-shadow: 0 0 0 3px hsla(16, 100%, 60%, .12);
}

.browse-sort__icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--primary);
  pointer-events: none;
}

.browse-sort__label {
  flex: 1;
  min-width: 0;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: start;
  pointer-events: none;
}

.browse-sort__chev {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--text-muted);
  pointer-events: none;
  transition: transform .2s ease;
}

.browse-sort--open .browse-sort__chev {
  transform: rotate(180deg);
}

.browse-sort__menu {
  position: absolute;
  top: calc(100% + .45rem);
  inset-inline-start: 0;
  inset-inline-end: 0;
  min-width: 100%;
  margin: 0;
  padding: .35rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  z-index: 140;
}

.browse-sort__menu[hidden] {
  display: none;
}

.browse-sort__option {
  padding: .62rem .8rem;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
}

.browse-sort__option:hover {
  background: hsla(16, 100%, 60%, .1);
  color: var(--primary);
}

.browse-sort__option--active {
  background: hsla(16, 100%, 60%, .14);
  color: var(--primary);
}

.browse-sort__option--active::before {
  content: '✓';
  display: inline-block;
  margin-inline-end: .4rem;
  font-size: .72rem;
  font-weight: 900;
}

.browse-view {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 48px;
  padding: .25rem;
  gap: .15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
}

.browse-view__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.browse-view__btn:hover {
  color: var(--text);
}

.browse-view__btn--active {
  background: var(--primary);
  color: #fff;
}

.browse-filter-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid hsla(16, 100%, 60%, .45);
  background: hsla(16, 100%, 60%, .1);
  color: var(--primary);
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}

.browse-filter-toggle:hover {
  background: hsla(16, 100%, 60%, .18);
}

.browse-promo {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1.1rem;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, hsla(217, 91%, 60%, .18), hsla(217, 91%, 60%, .06));
  border: 1px solid hsla(217, 91%, 60%, .28);
  transition: border-color .15s;
  min-width: 0;
  flex-wrap: wrap;
}

.browse-promo:hover {
  border-color: hsla(217, 91%, 60%, .45);
}

.browse-promo__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: hsla(217, 91%, 60%, .2);
  color: #60a5fa;
  flex-shrink: 0;
}

.browse-promo p {
  flex: 1 1 140px;
  min-width: 0;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.browse-promo__cta {
  font-size: .78rem;
  font-weight: 800;
  color: #fff;
  background: #3b82f6;
  padding: .45rem .9rem;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  white-space: nowrap;
}

.browse-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 180;
}

.browse-backdrop.open { display: block; }

.browse-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  align-items: start;
  min-width: 0;
}

.browse-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
}

.browse-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.browse-sidebar__head h2 {
  font-size: 1rem;
  font-weight: 900;
}

.browse-sidebar__close {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
}

.browse-filter-block {
  margin-bottom: 1rem;
}

.browse-filter-block h3 {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: .55rem;
}

.browse-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.browse-seg__btn {
  padding: .55rem .5rem;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 700;
  color: var(--text);
  background: var(--muted);
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}

.browse-seg__btn--active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px hsla(16, 100%, 60%, .3);
}

.browse-check {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .85rem;
  margin-bottom: 1rem;
  background: var(--muted);
  border-radius: var(--radius-pill);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}

.browse-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.browse-stars {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: .4rem;
}

.browse-stars__btn {
  flex: 1;
  max-width: 40px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  color: var(--text);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}

.browse-stars__btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px hsla(16, 100%, 60%, .35);
}

.browse-range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}

.browse-range-head span {
  font-size: .78rem;
  font-weight: 800;
  color: var(--primary);
}

.browse-range {
  width: 100%;
  accent-color: var(--primary);
}

.browse-clear {
  width: 100%;
  padding: .65rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px dashed var(--border);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.browse-clear:hover {
  color: var(--primary);
  border-color: hsla(16, 100%, 60%, .4);
  background: hsla(16, 100%, 60%, .06);
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  min-width: 0;
}

.browse-grid--list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.browse-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: .95rem;
}

/* Browse card */
.browse-card,
a.browse-card {
  display: block;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.browse-card__cover {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: .55rem;
  background: var(--muted);
}

.browse-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.browse-card:hover .browse-card__cover img {
  transform: scale(1.05);
}

.browse-card__type {
  position: absolute;
  top: .4rem;
  inset-inline-start: .4rem;
  font-size: .55rem;
  font-weight: 800;
  padding: .2rem .55rem;
  border-radius: var(--radius-pill);
  color: #fff;
  z-index: 1;
}

.browse-card__type--audiobook { background: #8b5cf6; }
.browse-card__type--ebook { background: #3b82f6; }
.browse-card__type--podcast { background: #10b981; }
.browse-card__type--drama { background: #ec4899; }
.browse-card__type--summary { background: #14b8a6; }

.browse-card__badge {
  position: absolute;
  top: .4rem;
  inset-inline-end: .4rem;
  font-size: .55rem;
  font-weight: 800;
  padding: .2rem .55rem;
  border-radius: var(--radius-pill);
  z-index: 1;
}

.browse-card__badge--free { background: #22c55e; color: #fff; }
.browse-card__badge--paid { background: var(--primary); color: #fff; }

.browse-card__play {
  position: absolute;
  bottom: .45rem;
  inset-inline-start: .45rem;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .2s, transform .2s;
}
.browse-card__play svg {
  display: block;
  flex-shrink: 0;
}

.browse-card:hover .browse-card__play {
  opacity: 1;
  transform: scale(1);
}

.browse-card__title {
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-card__author {
  font-size: .72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .35rem;
  gap: .35rem;
  min-width: 0;
}

.browse-card__rating {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .72rem;
  font-weight: 700;
  color: #eab308;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-card__rating svg { width: 12px; height: 12px; }

.browse-card__price {
  font-size: .72rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-card__price--free {
  color: #22c55e;
}

/* Browse list row */
.browse-list-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}

.browse-list-card:hover {
  border-color: hsla(16, 100%, 60%, .4);
  background: hsla(16, 100%, 60%, .05);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .14);
}

.browse-list-card__cover {
  flex-shrink: 0;
  width: 68px;
  height: 92px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--muted);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

.browse-list-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.browse-list-card__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .28rem;
}

.browse-list-card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}

.browse-list-card__type {
  font-size: .62rem;
  font-weight: 800;
  padding: .18rem .55rem;
  border-radius: var(--radius-pill);
  color: #fff;
  line-height: 1.2;
}

.browse-list-card__type--audiobook { background: #8b5cf6; }
.browse-list-card__type--ebook { background: #3b82f6; }
.browse-list-card__type--podcast { background: #10b981; }
.browse-list-card__type--drama { background: #ec4899; }
.browse-list-card__type--summary { background: #14b8a6; }

.browse-list-card__access {
  font-size: .62rem;
  font-weight: 800;
  padding: .18rem .55rem;
  border-radius: var(--radius-pill);
  line-height: 1.2;
}

.browse-list-card__access--free {
  background: hsla(142, 71%, 45%, .15);
  color: #22c55e;
}

.browse-list-card__access--paid {
  background: hsla(16, 100%, 60%, .15);
  color: var(--primary);
}

.browse-list-card__access--sub {
  background: hsla(16, 100%, 60%, .12);
  color: var(--primary);
}

.browse-list-card__title {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.browse-list-card__author {
  margin: 0;
  font-size: .78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browse-list-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin-top: .15rem;
}

.browse-list-card__rating {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  font-size: .74rem;
  font-weight: 700;
  color: #eab308;
}

.browse-list-card__rating svg {
  width: 13px;
  height: 13px;
}

.browse-list-card__stat {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.browse-list-card__stat svg {
  width: 13px;
  height: 13px;
  opacity: .85;
}

.browse-list-card__arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--muted);
  color: var(--text-muted);
  transition: background .15s, color .15s;
}

html[dir="ltr"] .browse-list-card__arrow svg {
  transform: scaleX(-1);
}

.browse-list-card:hover .browse-list-card__arrow {
  background: hsla(16, 100%, 60%, .15);
  color: var(--primary);
}

@media (max-width: 640px) {
  .browse-list-card {
    gap: .75rem;
    padding: .65rem .75rem;
  }

  .browse-list-card__cover {
    width: 56px;
    height: 76px;
  }

  .browse-list-card__title {
    font-size: .86rem;
  }

  .browse-list-card__meta {
    gap: .45rem;
  }

  .browse-list-card__arrow {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 1100px) {
  .browse-grid:not(.browse-grid--list) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .browse-layout { grid-template-columns: 1fr; }
  .browse-filter-toggle { display: inline-flex; }

  .browse-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    inset-inline-end: auto;
    width: min(300px, 88vw);
    z-index: 190;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform .25s ease, visibility .25s;
    overflow-y: auto;
    padding-top: 1.25rem;
    visibility: hidden;
    pointer-events: none;
  }

  html[dir="rtl"] .browse-sidebar {
    transform: translateX(100%);
  }

  .browse-sidebar.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .browse-sidebar__close { display: flex; align-items: center; justify-content: center; }

  body.filters-open { overflow: hidden; }
}

@media (max-width: 768px) {
  .browse-page__head {
    flex-direction: column;
    align-items: stretch;
    gap: .65rem;
  }

  .browse-page__count {
    align-self: flex-start;
    white-space: normal;
    line-height: 1.35;
  }

  .browse-toolbar {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .browse-search {
    flex: 1 1 100%;
  }

  .browse-sort {
    flex: 1 1 0;
    min-width: 0;
  }

  .browse-view {
    flex-shrink: 0;
  }

  .browse-filter-toggle {
    flex: 1 1 100%;
    width: 100%;
  }

  .browse-sort__label { font-size: .78rem; }

  .browse-grid:not(.browse-grid--list) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
  }

  .browse-grid--list {
    display: flex;
    flex-direction: column;
  }

  .browse-list-card__arrow {
    display: none;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
  }

  .browse-grid:not(.browse-grid--list) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
  }

  .explore__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
  }

  .explore-card {
    padding: .75rem;
    min-height: 0;
  }

  .explore-card h3 {
    font-size: .76rem;
  }

  .browse-card__title { font-size: .76rem; }
  .browse-card__author { font-size: .74rem; }

  .browse-list-card {
    padding: .65rem .7rem;
    gap: .65rem;
  }

  .browse-list-card__cover {
    width: 52px;
    height: 72px;
  }

  .browse-list-card__title {
    font-size: .84rem;
  }

  .browse-list-card__meta {
    gap: .35rem;
  }

  .browse-list-card__stat {
    font-size: .68rem;
  }
}

/* Live stream page */
.live-page {
  padding: 1.25rem 0 2.5rem;
}

.live-hero {
  position: relative;
  margin-bottom: 1.75rem;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid hsla(0, 0%, 100%, .06);
  background:
    radial-gradient(ellipse at 18% 50%, hsla(280, 80%, 55%, .16), transparent 52%),
    radial-gradient(ellipse at 82% 24%, hsla(330, 80%, 55%, .1), transparent 48%),
    linear-gradient(135deg, hsl(0, 0%, 10%), hsl(280, 24%, 12%) 58%, hsl(0, 0%, 8%) 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  color: var(--on-dark-text);
}

.live-hero__content {
  position: relative;
  z-index: 1;
}

.live-hero__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, hsla(280, 80%, 55%, .18), transparent 55%),
    radial-gradient(ellipse at 80% 30%, hsla(330, 80%, 55%, .12), transparent 50%);
  pointer-events: none;
}

.live-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.25rem 2.5rem;
}

.live-hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-hero__art {
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
  background: linear-gradient(145deg, hsla(280, 70%, 45%, .28), hsla(330, 80%, 55%, .18));
  border: 1px solid hsla(280, 70%, 60%, .35);
  color: #e879f9;
  box-shadow:
    0 0 70px hsla(280, 80%, 55%, .28),
    0 24px 56px rgba(0, 0, 0, .38);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.live-hero__art--has-logo {
  padding: 0;
  background: var(--card);
  border-color: hsla(0, 0%, 100%, .08);
}

.live-hero__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.live-hero__art svg {
  filter: drop-shadow(0 4px 12px hsla(330, 80%, 60%, .4));
}

.live-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .8rem;
  margin-bottom: .75rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, .16);
  border: 1px solid rgba(239, 68, 68, .35);
  color: #f87171;
  font-size: .74rem;
  font-weight: 800;
}

.live-hero__platform {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .45rem;
}

.live-hero__platform svg {
  flex-shrink: 0;
  opacity: .95;
}

.live-hero__title {
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.12;
  margin-bottom: .75rem;
  color: var(--on-dark-text);
}

.live-hero__desc {
  color: var(--on-dark-muted);
  font-size: .95rem;
  line-height: 1.75;
  max-width: 36rem;
  margin-bottom: 1.1rem;
}

.live-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  margin-bottom: 1.35rem;
}

.live-hero__stat {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--on-dark-muted);
}

.live-hero__stat svg {
  color: var(--primary);
  flex-shrink: 0;
}

.live-hero__cta {
  width: 100%;
  max-width: 420px;
  margin-top: .15rem;
  padding: .95rem 1.75rem;
  font-size: 1rem;
  border-radius: 18px;
  box-shadow: 0 12px 32px hsla(16, 100%, 60%, .38);
}

.live-hero__cta:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.live-hero__cta--playing {
  background: var(--accent, #c2410c);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .25);
}

.live-hero__cta--waiting {
  box-shadow: 0 0 0 3px hsla(16, 100%, 60%, .22);
}

.live-hero__cta--error {
  background: #7f1d1d;
}

.live-catalog {
  margin-bottom: 2rem;
}

.live-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.35rem;
}

.live-tabs__btn {
  position: relative;
  padding: .85rem 0;
  font-size: .98rem;
  font-weight: 800;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease;
}

.live-tabs__btn:hover {
  color: var(--text);
}

.live-tabs__btn--active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.live-tab-panel[hidden] {
  display: none !important;
}

.live-channels,
.live-programs.live-programs--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.live-channel-tile,
.live-program-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 180px;
  max-height: none;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid transparent;
  color: #fff;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.live-channel-tile {
  cursor: pointer;
}

.live-channel-tile:hover,
.live-program-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .24);
}

.live-channel-tile--active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px hsla(16, 100%, 60%, .35);
}

.live-channel-tile--playing {
  box-shadow: 0 0 0 2px hsla(16, 100%, 60%, .45);
}

.live-channel-tile--offline {
  opacity: .78;
}

.live-channel-tile__bg,
.live-program-tile__bg,
.live-channel-tile__cover,
.live-program-tile__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.02);
  transition: transform .35s ease;
  pointer-events: none;
}

.live-channel-tile:hover .live-channel-tile__bg,
.live-program-tile:hover .live-program-tile__bg,
.live-channel-tile:hover .live-channel-tile__cover,
.live-program-tile:hover .live-program-tile__cover {
  transform: scale(1.06);
}

.live-channel-tile__overlay,
.live-program-tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .28) 52%, rgba(0, 0, 0, .18) 100%);
}

.live-channel-tile__badge,
.live-program-tile__meta {
  position: absolute;
  top: .8rem;
  right: .8rem;
  left: auto;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}

.live-channel-tile__badge {
  background: rgba(239, 68, 68, .92);
  color: #fff;
}

.live-program-tile__meta {
  background: rgba(0, 0, 0, .45);
  color: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
}

.live-channel-tile__foot,
.live-program-tile__foot {
  position: absolute;
  left: .9rem;
  right: .9rem;
  bottom: .85rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding-left: 3.5rem;
}

html[dir="ltr"] .live-channel-tile__foot,
html[dir="ltr"] .live-program-tile__foot {
  padding-left: 3.5rem;
  padding-right: 0;
}

.live-channel-tile__title,
.live-program-tile__title {
  margin: 0;
  font-size: .98rem;
  font-weight: 900;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.live-program-tile__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-channel-tile__listeners,
.live-program-tile__host {
  font-size: .72rem;
  color: rgba(255, 255, 255, .78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-channel-tile__play,
.live-program-tile__play {
  position: absolute;
  left: .85rem;
  right: auto;
  bottom: .85rem;
  z-index: 3;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px hsla(16, 100%, 60%, .42);
  transition: transform .15s ease, background .15s ease;
}

.live-channel-tile__play:hover:not(:disabled) {
  transform: scale(1.05);
  background: var(--primary-dim);
}

.live-channel-tile__play:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.live-program-tile__play {
  pointer-events: none;
}

.live-section {
  margin-bottom: 2rem;
}

.live-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.live-section__head h2,
.live-section__title {
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: .25rem;
}

.live-section__head p {
  font-size: .82rem;
  color: var(--text-muted);
}

.live-section__link {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background .15s, color .15s;
}

.live-section__link:hover {
  background: var(--muted);
  color: var(--primary);
}

.live-programs:not(.live-programs--grid) {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.live-program-link {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}

.live-program-link:hover {
  border-color: hsla(16, 100%, 60%, .35);
  background: hsla(16, 100%, 60%, .04);
  transform: translateY(-1px);
}

.live-program-link__cover {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.live-program-link__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-program-link__info {
  min-width: 0;
}

.live-program-link__title {
  font-size: .95rem;
  font-weight: 800;
  margin: 0 0 .2rem;
}

.live-program-link .live-program__host {
  display: block;
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .2rem;
}

.live-program-link__desc {
  margin: 0 0 .35rem;
  font-size: .78rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-program-link__meta {
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.live-program-link__meta svg {
  width: 14px;
  height: 14px;
}

.live-program-link__arrow {
  color: var(--text-muted);
  transform: rotate(-90deg);
}

html[dir="rtl"] .live-program-link__arrow {
  transform: rotate(90deg);
}

.live-program-page {
  padding-top: 1rem;
}

.live-program-catalog {
  margin-bottom: 1rem;
}

.live-program-catalog .live-tabs__btn {
  text-decoration: none;
}

.live-program-back {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 1.35rem;
  text-decoration: none;
}

.live-program-back:hover {
  color: var(--text);
}

html[dir="rtl"] .live-program-back svg {
  transform: scaleX(-1);
}

.live-program-hero {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.75rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .12);
}

.live-program-hero__cover {
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
}

.live-program-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.live-program-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .74rem;
  font-weight: 700;
  color: var(--primary);
  background: hsla(16, 100%, 60%, .12);
  padding: .28rem .65rem;
  border-radius: 999px;
  margin-bottom: .65rem;
}

.live-program-hero__badge svg {
  width: 14px;
  height: 14px;
}

.live-program-hero__title {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0 0 .65rem;
}

.live-program-hero__desc {
  margin: 0 0 1rem;
  font-size: .92rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 38rem;
}

.live-program-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem 1.35rem;
  margin-bottom: 1.25rem;
}

.live-program-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.live-program-hero__meta-item svg {
  flex-shrink: 0;
  color: var(--primary);
}

.live-program-hero__meta-item svg polygon {
  fill: #fbbf24;
  stroke: none;
}

.live-program-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-width: min(100%, 320px);
  padding: .9rem 1.5rem;
  font-size: .98rem;
  font-weight: 800;
  border-radius: 16px;
  box-shadow: 0 12px 32px hsla(16, 100%, 60%, .32);
}

.live-program-hero__cta svg {
  width: 18px;
  height: 18px;
}

.live-program-playlist {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .08);
}

.live-program-playlist__head {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
}

.live-program-playlist__head svg {
  color: var(--primary);
  flex-shrink: 0;
}

.live-program-playlist__head h2 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
}

.live-program-playlist__count {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--muted);
  padding: .22rem .65rem;
  border-radius: 999px;
  margin-inline-start: auto;
}

.live-program-playlist__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.live-program-ep-row {
  display: flex;
  align-items: stretch;
  gap: .35rem;
  border-bottom: 1px solid var(--border);
}

.live-program-playlist__list li:last-child .live-program-ep-row {
  border-bottom: none;
}

.live-program-ep {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  padding: 1rem 1.35rem;
  border: none;
  background: transparent;
  color: inherit;
  text-align: start;
  cursor: pointer;
  font: inherit;
  transition: background .15s ease;
}

.live-program-ep__share {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  margin-inline-end: .65rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.live-program-ep__share:hover {
  background: var(--muted);
  color: var(--primary);
}

.live-program-ep__share svg {
  display: block;
  width: 18px;
  height: 18px;
}

.live-program-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .25rem;
}

.live-program-hero__share svg {
  display: block;
}

.live-program-ep:hover {
  background: var(--muted);
}

.live-program-ep--active {
  background: hsla(16, 100%, 60%, .08);
}

.live-program-ep__play {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 20px hsla(16, 100%, 60%, .35);
}

.live-program-ep__play svg {
  display: block;
}

.live-program-ep__info {
  flex: 1;
  min-width: 0;
}

.live-program-ep__num {
  display: block;
  font-size: .74rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .2rem;
}

.live-program-ep__title {
  display: block;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.35;
}

.live-program-ep__dur {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.live-program-ep__dur svg {
  opacity: .85;
}

.live-episode--btn {
  display: grid;
  grid-template-columns: 28px 56px 1fr auto;
  gap: .75rem;
  align-items: center;
  width: 100%;
  padding: .85rem 1.1rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  text-align: start;
  cursor: pointer;
  font: inherit;
  transition: background .15s;
}

.live-program-playlist__list li:last-child .live-episode--btn {
  border-bottom: none;
}

.live-episode--btn:hover {
  background: var(--muted);
}

.live-episode--active {
  background: hsla(16, 100%, 60%, .1);
  color: var(--primary);
}

.live-episode__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.live-episode__icon svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.live-program {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.live-program__head {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 1rem;
  align-items: center;
  width: 100%;
  padding: 1rem 1.1rem;
  border: none;
  background: none;
  color: var(--text);
  text-align: start;
  cursor: pointer;
  transition: background .15s;
}

.live-program__head:hover {
  background: var(--muted);
}

.live-program__cover {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.live-program__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-program__info {
  min-width: 0;
}

.live-program__title {
  font-size: .95rem;
  font-weight: 800;
  margin: 0 0 .2rem;
  line-height: 1.3;
}

.live-program__host {
  display: block;
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

.live-program__desc {
  margin: 0 0 .45rem;
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-program__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.live-program__pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: hsla(16, 100%, 60%, .12);
  color: var(--primary);
}

.live-program__pill--muted {
  background: var(--muted);
  color: var(--text-muted);
}

.live-program__pill svg {
  width: 12px;
  height: 12px;
}

.live-program__chev {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .2s;
}

.live-program--open .live-program__chev {
  transform: rotate(180deg);
}

.live-program__body {
  border-top: 1px solid var(--border);
}

.live-program__episodes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.live-program__episodes .live-episode {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: .85rem;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.live-program__episodes li:last-child .live-episode {
  border-bottom: none;
}

.live-program__episodes .live-episode__thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.live-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: .9rem;
}

.live-episodes {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.live-episode {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.live-episode:last-child {
  border-bottom: none;
}

.live-episode:hover {
  background: var(--muted);
}

.live-episode__thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.live-episode__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-episode__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  opacity: 0;
  transition: opacity .2s;
}

.live-episode:hover .live-episode__play {
  opacity: 1;
}

.live-episode__body h3 {
  font-size: .9rem;
  font-weight: 800;
  margin-bottom: .2rem;
}

.live-episode__body p {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.live-episode__dur {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.live-more-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .85rem;
}

.live-more-card {
  display: block;
  transition: transform .2s;
}

.live-more-card:hover {
  transform: translateY(-4px);
}

.live-more-card__cover {
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: .5rem;
  background: var(--muted);
}

.live-more-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.live-more-card:hover .live-more-card__cover img {
  transform: scale(1.05);
}

.live-more-card h3 {
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: .15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-more-card span {
  font-size: .7rem;
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .live-hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.75rem 1.5rem;
  }

  .live-hero__visual { order: -1; }

  .live-hero__desc,
  .live-hero__platform {
    margin-inline: auto;
  }

  .live-hero__stats {
    justify-content: center;
  }

  .live-hero__cta {
    margin-inline: auto;
  }

  .live-channels,
  .live-programs.live-programs--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-more-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .live-hero__art {
    width: 180px;
    height: 180px;
  }

  .live-hero__art svg {
    width: 64px;
    height: 64px;
  }

  .live-hero__inner {
    padding: 1.35rem 1.1rem;
    gap: 1.25rem;
  }

  .live-tabs {
    gap: 1rem 1.35rem;
  }

  .live-tabs__btn {
    font-size: .88rem;
    padding: .75rem 0;
  }

  .live-channels,
  .live-programs.live-programs--grid {
    grid-template-columns: 1fr;
    gap: .85rem;
  }

  .live-channel-tile,
  .live-program-tile {
    min-height: 170px;
    border-radius: 18px;
  }

  .live-episode {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto;
  }

  .live-episode__dur {
    grid-column: 2;
    justify-self: start;
  }

  .live-episode__thumb {
    width: 60px;
    height: 60px;
  }

  .live-program-link {
    grid-template-columns: 60px 1fr auto;
    gap: .75rem;
    padding: .85rem;
  }

  .live-program-link__cover {
    width: 60px;
    height: 60px;
  }

  .live-program-hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
    text-align: center;
  }

  .live-program-hero__cover {
    max-width: 240px;
    margin-inline: auto;
  }

  .live-program-hero__meta {
    justify-content: center;
  }

  .live-program-hero__cta {
    width: 100%;
    max-width: none;
  }

  .live-program-ep {
    gap: .75rem;
    padding: .9rem 1rem;
  }

  .live-program-ep__play {
    width: 38px;
    height: 38px;
  }

  .live-program-ep__title {
    font-size: .88rem;
  }

  .live-program__head {
    grid-template-columns: 60px 1fr auto;
    gap: .75rem;
    padding: .85rem;
  }

  .live-program__cover {
    width: 60px;
    height: 60px;
  }

  .live-program__episodes .live-episode {
    grid-template-columns: 52px 1fr;
  }

  .live-more-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Challenges page (reference layout) ── */
.ch-page {
  padding: 1.25rem 0 2.5rem;
}

.ch-hero {
  position: relative;
  margin-bottom: 1.75rem;
  padding: 1.75rem 2rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, hsla(16, 100%, 60%, .18), hsla(16, 100%, 60%, .04));
  overflow: hidden;
}

.ch-hero__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 85% 20%, hsla(16, 90%, 55%, .15), transparent 55%),
    radial-gradient(ellipse at 15% 80%, hsla(30, 70%, 45%, .08), transparent 50%);
  pointer-events: none;
}

.ch-hero__intro {
  position: relative;
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.25rem;
}

.ch-hero__badge {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: hsla(45, 90%, 50%, .18);
  color: #eab308;
}

.ch-hero__title {
  font-size: clamp(1.75rem, 4vw, 2rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: .25rem;
}

.ch-hero__sub {
  color: var(--text-muted);
  font-size: .92rem;
}

.ch-hero__stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  max-width: 28rem;
}

.ch-stat {
  padding: .85rem .75rem;
  border-radius: 1rem;
  background: hsla(0, 0%, 100%, .04);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  text-align: center;
}

html.light .ch-stat {
  background: hsla(0, 0%, 100%, .55);
}

.ch-stat strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: .15rem;
}

.ch-stat--green strong { color: #22c55e; }
.ch-stat--gold strong { color: #eab308; }

.ch-stat span {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.ch-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.ch-tabs__btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: .85rem;
  background: var(--card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.ch-tabs__btn:hover {
  color: var(--text);
  border-color: hsla(16, 80%, 55%, .35);
}

.ch-tabs__btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.ch-tabs__btn--active:hover {
  background: var(--primary-dim);
  border-color: var(--primary-dim);
  color: #fff;
}

.ch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ch-card {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1.25rem;
  border-radius: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
}

.ch-card--orange { border-color: hsla(16, 90%, 55%, .28); }
.ch-card--red { border-color: hsla(0, 80%, 55%, .28); }
.ch-card--green { border-color: hsla(140, 60%, 45%, .28); }
.ch-card--purple { border-color: hsla(280, 60%, 55%, .28); }
.ch-card--blue { border-color: hsla(210, 80%, 55%, .28); }
.ch-card--yellow { border-color: hsla(45, 90%, 50%, .28); }
.ch-card--done {
  border-color: hsla(140, 55%, 42%, .35);
  background: hsla(140, 55%, 42%, .05);
}

.ch-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.ch-card__head-main {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  min-width: 0;
}

.ch-card__head-text h3 {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: .2rem;
}

.ch-card__head-text p {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.ch-card__toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: .65rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform .2s, background .2s;
}

.ch-card__toggle:hover {
  background: var(--card-hover);
}

.ch-card__toggle--open {
  transform: rotate(180deg);
}

.ch-card__icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .85rem;
}

.ch-card__icon--orange { background: hsla(16, 90%, 55%, .12); color: #ff7043; }
.ch-card__icon--red { background: hsla(0, 80%, 55%, .12); color: #ef5350; }
.ch-card__icon--green { background: hsla(140, 60%, 45%, .12); color: #66bb6a; }
.ch-card__icon--purple { background: hsla(280, 60%, 55%, .12); color: #ab47bc; }
.ch-card__icon--blue { background: hsla(210, 80%, 55%, .12); color: #42a5f5; }
.ch-card__icon--yellow { background: hsla(45, 90%, 50%, .12); color: #ffca28; }

.ch-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.ch-tag {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}

.ch-tag--easy { background: hsla(140, 60%, 45%, .12); color: #66bb6a; }
.ch-tag--medium { background: hsla(45, 90%, 50%, .12); color: #ffb300; }
.ch-tag--hard { background: hsla(0, 80%, 55%, .12); color: #ef5350; }
.ch-tag--muted { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.ch-tag--done { background: hsla(140, 55%, 42%, .15); color: #4caf50; font-size: .72em; vertical-align: middle; }

.ch-card__progress {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.ch-card__bar {
  height: .55rem;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.ch-card__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to left, var(--primary), #fb923c);
  transition: width .4s ease;
}

.ch-card__progress-text {
  font-size: .72rem;
  color: var(--text-muted);
}

.ch-card__tips {
  padding: .85rem;
  border-radius: .85rem;
  background: hsla(0, 0%, 100%, .04);
  border: 1px solid var(--border);
}

html.light .ch-card__tips {
  background: hsla(0, 0%, 0%, .03);
}

.ch-card__tips-title {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 800;
  margin-bottom: .5rem;
  color: var(--primary);
}

.ch-card__tips ul {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.ch-card__tips li {
  display: flex;
  align-items: flex-start;
  gap: .35rem;
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ch-card__tips li svg {
  flex-shrink: 0;
  margin-top: .1rem;
  color: #22c55e;
}

.ch-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: auto;
}

.ch-card__reward {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--text-muted);
}

.ch-card__reward svg {
  color: #eab308;
}

.ch-card__btn {
  flex-shrink: 0;
  padding: .45rem .95rem;
  border: none;
  border-radius: .75rem;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s;
}

.ch-card__btn:hover {
  background: var(--primary-dim);
}

.ch-card__joined {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid hsla(16, 80%, 55%, .35);
  background: hsla(16, 80%, 55%, .1);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
}

.ch-empty,
.ch-empty-state {
  text-align: center;
}

.ch-empty-state {
  padding: 3rem 1.5rem;
  border-radius: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
}

.ch-empty-state__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  opacity: .35;
}

.ch-empty-state h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: .35rem;
}

.ch-empty-state p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.ch-leaderboard {
  max-width: 36rem;
  margin-inline: auto;
}

.ch-leaderboard__panel {
  border-radius: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.ch-leaderboard__head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: hsla(0, 0%, 100%, .03);
}

.ch-leaderboard__head h2 {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: 1rem;
  font-weight: 900;
}

.ch-leaderboard__head svg {
  color: #eab308;
}

.ch-leader {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.ch-leader:last-child {
  border-bottom: none;
}

.ch-leader--rank-1 { background: hsla(45, 90%, 50%, .06); }
.ch-leader--rank-2 { background: hsla(0, 0%, 60%, .05); }
.ch-leader--rank-3 { background: hsla(16, 90%, 55%, .05); }

.ch-leader__badge {
  width: 2rem;
  text-align: center;
  font-size: 1.1rem;
}

.ch-leader__avatar {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: .85rem;
  background: hsla(16, 80%, 55%, .12);
  color: var(--primary);
  font-weight: 900;
}

.ch-leader__meta {
  min-width: 0;
}

.ch-leader__name {
  display: block;
  font-weight: 800;
  margin-bottom: .1rem;
}

.ch-leader__pts {
  font-size: .75rem;
  color: var(--text-muted);
}

.ch-leader__rank {
  padding: .35rem .65rem;
  border-radius: .65rem;
  background: var(--bg);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 800;
}

.ch-leader--rank-1 .ch-leader__rank {
  background: #eab308;
  color: #fff;
}

.ch-leaderboard__you {
  padding: .85rem 1rem;
  border-top: 1px solid hsla(16, 80%, 55%, .25);
  background: hsla(16, 80%, 55%, .06);
}

.ch-leader--you .ch-leader__rank--you {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

@media (max-width: 768px) {
  .ch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ch-hero {
    padding: 1.25rem 1.15rem;
  }

  .ch-hero__stats {
    max-width: none;
  }

  .ch-tabs__btn {
    flex: 1;
    justify-content: center;
    min-width: calc(50% - .25rem);
  }
}

/* ── Subscriptions page ── */
.pr-page {
  padding: 2rem 0 3rem;
}

.pr-head {
  text-align: center;
  margin-bottom: 2.5rem;
}

.pr-head__title {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: .65rem;
}

.pr-head__sub {
  color: var(--text-muted);
  font-size: .95rem;
  max-width: 36rem;
  margin: 0 auto;
  line-height: 1.7;
}

.pr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 3rem;
}

.pr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: var(--radius-xl);
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}

.pr-card:hover {
  box-shadow: var(--card-shadow);
}

.pr-card--featured {
  background: linear-gradient(160deg, var(--primary), var(--primary-dim));
  border-color: transparent;
  color: #fff;
  transform: scale(1.03);
  box-shadow: 0 24px 60px hsla(16, 100%, 50%, .35);
  z-index: 1;
}

.pr-card--featured .pr-card__period,
.pr-card--featured .pr-card__features li {
  color: rgba(255, 255, 255, .85);
}

.pr-card--featured .pr-card__features li svg {
  color: #fff;
}

.pr-card--featured .pr-card__saving {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.pr-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: .3rem .85rem;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.pr-card:not(.pr-card--featured) .pr-card__badge {
  top: 1rem;
  left: auto;
  right: 1rem;
  transform: none;
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  padding: .2rem .55rem;
}

.pr-card__icon {
  width: 56px;
  height: 56px;
  margin: .5rem auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: hsla(16, 100%, 60%, .12);
  color: var(--primary);
}

.pr-card--featured .pr-card__icon {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.pr-card__name {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: .5rem;
}

.pr-card__price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .35rem;
  margin-bottom: .15rem;
}

.pr-card__price strong {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
}

.pr-card__currency {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pr-card--featured .pr-card__currency {
  color: rgba(255, 255, 255, .8);
}

.pr-card__period {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.pr-card__saving {
  display: inline-block;
  padding: .2rem .65rem;
  margin-bottom: .75rem;
  border-radius: 999px;
  background: hsla(140, 60%, 45%, .15);
  color: #22c55e;
  font-size: .72rem;
  font-weight: 800;
}

.pr-card__features {
  flex: 1;
  text-align: start;
  margin-bottom: 1.25rem;
  padding: 0 .25rem;
}

.pr-card__features li {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  font-size: .78rem;
  color: var(--text-muted);
  padding: .3rem 0;
  line-height: 1.45;
}

.pr-card__features li svg {
  flex-shrink: 0;
  margin-top: .1rem;
  color: #22c55e;
}

.pr-card__btn {
  width: 100%;
  padding: .8rem 1rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s, transform .15s;
}

.pr-card__btn:hover {
  background: var(--primary-dim);
  transform: translateY(-1px);
}

.pr-card--featured .pr-card__btn {
  background: #fff;
  color: var(--primary);
}

.pr-card--featured .pr-card__btn:hover {
  background: hsl(0, 0%, 96%);
}

.pr-section__title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 1.25rem;
}

.pr-pay {
  margin-bottom: 3rem;
}

.pr-pay__box {
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-xl);
  background: var(--card);
  border: 1px solid var(--border);
}

.pr-pay__logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .65rem;
  margin-bottom: 1rem;
}

.pay-badge {
  padding: .5rem 1rem;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 800;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.pay-badge--visa { color: #1a1f71; border-color: #1a1f71; }
.pay-badge--vodafone { color: #e60000; border-color: #e60000; }
.pay-badge--orange { color: #ff7900; border-color: #ff7900; }
.pay-badge--etisalat { color: #719500; border-color: #719500; }
.pay-badge--instapay { color: #6c2bd9; border-color: #6c2bd9; }
.pay-badge--fawry { color: #f5a623; border-color: #f5a623; }
.pay-badge--aman { color: #00a651; border-color: #00a651; }

html.dark .pay-badge--visa { color: #7b8cff; border-color: #7b8cff; }

.pr-pay__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--text-muted);
  text-align: center;
}

.pr-pay__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.pr-faq {
  max-width: 720px;
  margin: 0 auto;
}

.pr-faq__item {
  margin-bottom: .65rem;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.pr-faq__q {
  padding: 1rem 1.25rem;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pr-faq__q::-webkit-details-marker { display: none; }

.pr-faq__q::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s;
}

.pr-faq__item[open] .pr-faq__q::after {
  content: '−';
}

.pr-faq__a {
  padding: 0 1.25rem 1rem;
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* checkout modal */
.pr-checkout {
  position: fixed;
  inset: 0;
  z-index: 380;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.pr-checkout[hidden] { display: none !important; }
.pr-checkout__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
.pr-checkout__panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.pr-checkout__close {
  position: absolute;
  top: .65rem;
  inset-inline-end: .65rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}
.pr-checkout__title {
  margin: 0 0 .35rem;
  font-size: 1.2rem;
  font-weight: 900;
}
.pr-checkout__plan {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: .9rem;
}
.pr-checkout__label {
  margin: 0 0 .5rem;
  font-weight: 700;
  font-size: .9rem;
}
.pr-checkout__methods {
  display: grid;
  gap: .5rem;
  margin-bottom: .85rem;
}
.pr-method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-align: start;
}
.pr-method--active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.pr-method__name { font-weight: 800; font-size: .92rem; }
.pr-method__acc { font-size: .78rem; opacity: .7; font-family: ui-monospace, monospace; }
.pr-checkout__details-card {
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px dashed var(--border);
  font-size: .88rem;
  line-height: 1.6;
}
.pr-checkout__acc { margin: .35rem 0 0; }
.pr-checkout__acc code {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.pr-checkout__instr { margin: .5rem 0 0; color: var(--text-muted); }
.pr-checkout__field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: .85rem;
  font-size: .88rem;
  font-weight: 600;
}
.pr-checkout__field input[type="text"],
.pr-checkout__field input[type="file"] {
  width: 100%;
  padding: .7rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.pr-checkout__error {
  color: #e74c3c;
  font-size: .85rem;
  margin: 0 0 .75rem;
}
.pr-checkout__empty {
  opacity: .7;
  font-size: .9rem;
}
.pr-checkout__field--row .pr-coupon-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.pr-coupon-row input {
  flex: 1;
  min-width: 0;
}
.pr-checkout__coupon-msg {
  font-size: .85rem;
  margin: .35rem 0 .75rem;
}
.pr-checkout__coupon-msg--ok { color: #10b981; }
.pr-checkout__coupon-msg--err { color: #e74c3c; }
.pr-checkout__price-breakdown {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem .85rem;
  margin-bottom: .85rem;
}
.pr-price-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .875rem;
  padding: .2rem 0;
}
.pr-price-line--save { color: #10b981; }
.pr-price-line--total {
  margin-top: .35rem;
  padding-top: .45rem;
  border-top: 1px dashed var(--border);
}
.pr-manage__discount {
  margin: .5rem 0 0;
  font-size: .875rem;
  color: #10b981;
}
body.pr-checkout-open { overflow: hidden; }

/* manage subscription */
.pr-manage {
  max-width: 720px;
  margin: 0 auto 2.5rem;
}
.pr-manage__card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: var(--card-shadow, none);
}
.pr-manage__top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.1rem;
  align-items: start;
}
.pr-manage__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(232,160,32,.25), rgba(120,53,15,.2));
  color: var(--primary);
}
.pr-manage__label {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .2rem;
}
.pr-manage__name {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  margin-bottom: .35rem;
}
.pr-manage__badge {
  display: inline-flex;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  background: rgba(34,197,94,.15);
  color: #22c55e;
}
.pr-manage__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.1rem;
  font-size: .86rem;
  color: var(--text-muted);
}
.pr-manage__meta code {
  font-size: .8rem;
}
.pr-manage__days {
  font-weight: 700;
  color: var(--text);
}
.pr-manage__pending {
  margin-top: 1rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: rgba(251,188,5,.12);
  border: 1px solid rgba(251,188,5,.3);
  font-size: .88rem;
}
.pr-manage__card--pending {
  border-color: rgba(251,188,5,.35);
}
.pr-manage__icon--pending {
  background: rgba(251,188,5,.15);
  color: #eab308;
}
.pr-manage__badge--pending {
  background: rgba(251,188,5,.18);
  color: #ca8a04;
  border: 1px solid rgba(251,188,5,.35);
}
.pr-manage__card--rejected {
  border-color: rgba(239,68,68,.35);
  margin-bottom: 1.25rem;
}
.pr-manage__icon--rejected {
  background: rgba(239,68,68,.15);
  color: #ef4444;
}
.pr-manage__badge--rejected {
  background: rgba(239,68,68,.12);
  color: #dc2626;
  border: 1px solid rgba(239,68,68,.3);
}
.pr-manage__rejected {
  margin-top: 1rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.28);
  font-size: .88rem;
}
.pr-manage__rejected-note,
.pr-manage__rejected-ref {
  margin: .65rem 0 0;
  font-size: .85rem;
  opacity: .9;
}
.pr-manage__pending-meta {
  margin: .75rem 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .45rem;
}
.pr-manage__pending-meta li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .82rem;
}
.pr-manage__pending-meta span {
  color: var(--text-muted);
}
.pr-manage__pending-meta code {
  font-size: .78rem;
}
.pr-manage__pending p {
  margin: .35rem 0 0;
  color: var(--text-muted);
}
.pr-manage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1.15rem;
}
.pr-manage__plans {
  margin-top: 1.75rem;
}
.pf-plan__link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

@media (min-width: 640px) {
  .pr-manage__top {
    grid-template-columns: auto 1fr auto;
  }
  .pr-manage__meta {
    grid-column: auto;
    flex-direction: column;
    align-items: flex-end;
    text-align: end;
    gap: .35rem;
  }
}

html[dir="ltr"] .pr-card__features {
  text-align: left;
}

@media (max-width: 900px) {
  .pr-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .pr-card--featured {
    transform: none;
    order: -1;
  }
}

/* ── Search page ── */
.sr-page {
  padding: 1.5rem 0 2.5rem;
}

.sr-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.sr-head__title {
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: .5rem;
}

.sr-head__sub {
  color: var(--text-muted);
  font-size: .92rem;
  max-width: 32rem;
  margin: 0 auto;
  line-height: 1.6;
}

.sr-form {
  display: flex;
  align-items: center;
  gap: .65rem;
  max-width: 720px;
  margin: 0 auto 1.25rem;
  padding: .55rem .55rem .55rem 1rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.sr-form:focus-within {
  border-color: hsla(16, 100%, 60%, .45);
  box-shadow: 0 0 0 3px hsla(16, 100%, 60%, .12);
}

.sr-form__icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.sr-form input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}

.sr-form input::placeholder {
  color: var(--text-muted);
}

.sr-form__clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}

.sr-form__btn {
  flex-shrink: 0;
  padding: .65rem 1.25rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s;
}

.sr-form__btn:hover {
  background: var(--primary-dim);
}

.sr-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem;
  margin-bottom: 1.5rem;
}

.sr-tab {
  padding: .45rem .95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.sr-tab--active {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}

.sr-section {
  margin-bottom: 1.5rem;
}

.sr-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.sr-section h2 {
  font-size: .95rem;
  font-weight: 800;
}

.sr-link-btn {
  border: none;
  background: none;
  color: var(--primary);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.sr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.sr-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.sr-chip:hover {
  border-color: hsla(16, 100%, 60%, .4);
  background: hsla(16, 100%, 60%, .08);
}

.sr-chip--muted {
  color: var(--text-muted);
}

.sr-count {
  font-size: .85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.sr-grid {
  margin-bottom: 1rem;
}

.sr-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: .92rem;
}

@media (max-width: 640px) {
  .sr-form {
    flex-wrap: wrap;
    padding: .75rem;
  }

  .sr-form input {
    width: 100%;
    order: 1;
    padding: .25rem 0;
  }

  .sr-form__icon {
    order: 0;
  }

  .sr-form__clear {
    order: 2;
    margin-inline-start: auto;
  }

  .sr-form__btn {
    order: 3;
    width: 100%;
    margin-top: .25rem;
  }
}

/* ── Notifications page ── */
.nt-page {
  padding: 1.5rem 0 2.5rem;
}

.nt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.nt-head__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: .35rem;
}

.nt-head__sub {
  color: var(--text-muted);
  font-size: .88rem;
}

.nt-mark-all {
  flex-shrink: 0;
  padding: .55rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--primary);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.nt-mark-all:hover {
  border-color: hsla(16, 100%, 60%, .4);
  background: hsla(16, 100%, 60%, .08);
}

.nt-mark-all[hidden] {
  display: none;
}

.nt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.25rem;
}

.nt-tab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.nt-tab--active {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}

.nt-tab__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: .7rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.nt-tab--active .nt-tab__badge {
  background: rgba(255, 255, 255, .25);
  color: #fff;
}

.nt-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: 2rem;
}

.nt-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .9rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}

.nt-item:hover {
  border-color: hsla(16, 100%, 60%, .35);
  transform: translateY(-1px);
}

.nt-item--unread {
  border-color: hsla(16, 100%, 60%, .25);
  background: hsla(16, 100%, 60%, .05);
}

.nt-item__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
}

.nt-item__icon--orange { background: hsla(25, 95%, 55%, .15); color: hsl(25, 95%, 55%); }
.nt-item__icon--blue { background: hsla(210, 90%, 55%, .15); color: hsl(210, 90%, 55%); }
.nt-item__icon--red { background: hsla(0, 80%, 55%, .15); color: hsl(0, 80%, 55%); }
.nt-item__icon--purple { background: hsla(270, 70%, 55%, .15); color: hsl(270, 70%, 55%); }
.nt-item__icon--yellow { background: hsla(45, 95%, 50%, .15); color: hsl(45, 95%, 45%); }
.nt-item__icon--green { background: hsla(145, 65%, 42%, .15); color: hsl(145, 65%, 42%); }

.nt-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.nt-item__title {
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.35;
}

.nt-item__text {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.nt-item__time {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

.nt-item__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: .45rem;
  border-radius: 50%;
  background: var(--primary);
}

.nt-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: .92rem;
}

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

.nt-settings {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
}

.nt-settings__title {
  font-size: .95rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.nt-settings__list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.nt-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.nt-toggle__text {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.nt-toggle__text strong {
  font-size: .88rem;
  font-weight: 700;
}

.nt-toggle__text small {
  font-size: .78rem;
  color: var(--text-muted);
}

.nt-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.nt-toggle__track {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--border);
  transition: background .2s;
}

.nt-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}

.nt-toggle input:checked + .nt-toggle__track {
  background: var(--primary);
}

.nt-toggle input:checked + .nt-toggle__track::after {
  transform: translateX(20px);
}

html[dir="rtl"] .nt-toggle input:checked + .nt-toggle__track::after {
  transform: translateX(-20px);
}

@media (max-width: 640px) {
  .nt-head {
    flex-direction: column;
    align-items: stretch;
  }

  .nt-mark-all {
    width: 100%;
    text-align: center;
  }
}

/* ── Profile page ── */
.pf-page {
  padding: 1.5rem 0 2.5rem;
}

.pf-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, hsla(16, 100%, 60%, .1), var(--card));
  box-shadow: var(--card-shadow);
}

.pf-hero__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.pf-hero__avatar-wrap--premium,
.haki-avatar-wrap--premium,
.header__account-avatar-wrap--premium {
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f97316, #eab308);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, .22), 0 8px 20px rgba(249, 115, 22, .18);
}

.pf-hero__avatar-wrap__crown,
.haki-avatar-wrap__crown,
.header__account-avatar-wrap__crown {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #fff;
  border: 2px solid var(--card, #121212);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.pf-hero__avatar-wrap__crown svg,
.haki-avatar-wrap__crown svg,
.header__account-avatar-wrap__crown svg {
  width: 13px;
  height: 13px;
}

.header__account-avatar-wrap__crown {
  width: 14px;
  height: 14px;
  right: -3px;
  bottom: -3px;
}

.header__account-avatar-wrap__crown svg {
  width: 8px;
  height: 8px;
}

.header__account-avatar-link {
  overflow: visible;
  padding: 0;
}

.header__account-avatar-wrap {
  position: relative;
  display: block;
  line-height: 0;
}

.header__account-avatar,
.header__account-avatar--initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
}

.header__account-avatar-wrap--premium .header__account-avatar,
.header__account-avatar-wrap--premium .header__account-avatar--initials {
  width: 28px;
  height: 28px;
}

.pf-hero__avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 900;
  overflow: hidden;
}

.pf-hero__avatar--img {
  object-fit: cover;
  display: block;
  padding: 0;
  background: var(--muted);
}

a.pf-lib-card {
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease;
}

a.pf-lib-card:hover {
  transform: translateY(-2px);
}

.pf-field__hint {
  display: block;
  margin-top: .25rem;
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pf-hero__info {
  flex: 1;
  min-width: 0;
}

.pf-hero__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}

.pf-hero__name {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.2;
}

.pf-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  background: hsla(45, 95%, 50%, .15);
  color: hsl(45, 95%, 45%);
  font-size: .72rem;
  font-weight: 800;
}

.pf-hero__badge svg {
  width: 14px;
  height: 14px;
}

.pf-hero__email {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
}

.pf-hero__bio {
  font-size: .88rem;
  line-height: 1.5;
  margin-bottom: .35rem;
}

.pf-hero__member {
  font-size: .78rem;
  color: var(--text-muted);
}

.pf-hero__edit {
  flex-shrink: 0;
  align-self: center;
  padding: .55rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.pf-hero__edit:hover {
  border-color: hsla(16, 100%, 60%, .4);
  background: hsla(16, 100%, 60%, .08);
}

.pf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .65rem;
  margin-bottom: 1.25rem;
}

.pf-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: 1rem .5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  text-align: center;
}

.pf-stat__icon {
  color: var(--primary);
  opacity: .85;
}

.pf-stat__icon svg {
  width: 20px;
  height: 20px;
}

.pf-stat__val {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.pf-stat__label {
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.pf-plan {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid hsla(16, 100%, 60%, .3);
  background: hsla(16, 100%, 60%, .06);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}

.pf-plan:hover {
  border-color: hsla(16, 100%, 60%, .5);
  transform: translateY(-1px);
}

.pf-plan__icon {
  flex-shrink: 0;
  color: var(--primary);
}

.pf-plan__icon svg {
  width: 28px;
  height: 28px;
}

.pf-plan__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.pf-plan__body strong {
  font-size: .88rem;
  font-weight: 800;
}

.pf-plan__body span {
  font-size: .8rem;
  color: var(--text-muted);
}

.pf-plan__hint {
  font-size: .75rem !important;
  line-height: 1.45;
}

.pf-plan--pending {
  border-color: rgba(251,188,5,.35);
  background: rgba(251,188,5,.06);
}

.pf-plan--pending:hover {
  border-color: rgba(251,188,5,.5);
}

.pf-plan--rejected {
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.06);
}

.pf-plan--rejected:hover {
  border-color: rgba(239,68,68,.5);
}

.pf-plan__icon--pending {
  color: #eab308;
}

.pf-plan__icon--rejected {
  color: #ef4444;
}

.pf-plan__action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary);
}

.pf-plan__action svg {
  width: 16px;
  height: 16px;
  transform: rotate(-90deg);
}

html[dir="rtl"] .pf-plan__action svg {
  transform: rotate(90deg);
}

.pf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.25rem;
}

.pf-tab {
  padding: .45rem .95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.pf-tab--active {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}

.pf-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 .3rem;
  margin-inline-start: .25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  font-size: .65rem;
  font-weight: 800;
}

.pf-tab:not(.pf-tab--active) .pf-tab__count {
  background: hsla(16, 100%, 60%, .15);
  color: var(--primary);
}

.pf-section {
  margin-bottom: 1.5rem;
}

.pf-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}

.pf-section__head h2 {
  margin-bottom: 0;
}

.pf-section__count {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pf-section__link {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}

.pf-section__link:hover {
  text-decoration: underline;
}

.pf-following-row {
  display: flex;
  gap: .85rem;
  overflow-x: auto;
  padding-bottom: .35rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pf-following-row::-webkit-scrollbar {
  display: none;
}

.pf-following-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
  width: 72px;
  text-decoration: none;
  color: inherit;
}

.pf-following-chip__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(16, 100%, 60%, .1);
  font-weight: 800;
  font-size: .9rem;
  color: var(--primary);
  transition: border-color .15s, transform .15s;
}

.pf-following-chip__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pf-following-chip:hover .pf-following-chip__avatar {
  border-color: var(--primary);
  transform: scale(1.04);
}

.pf-following-chip__name {
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-following-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.pf-following-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}

.pf-following-card:hover {
  border-color: hsla(16, 100%, 60%, .35);
  background: hsla(16, 100%, 60%, .04);
}

.pf-following-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: hsla(16, 100%, 60%, .1);
  font-weight: 800;
  font-size: .85rem;
  color: var(--primary);
}

.pf-following-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pf-following-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.pf-following-card__body strong {
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-following-card__body span {
  font-size: .75rem;
  color: var(--text-muted);
}

.pf-following-card > svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transform: rotate(-90deg);
}

html[dir="rtl"] .pf-following-card > svg {
  transform: rotate(90deg);
}

.pf-section h2 {
  font-size: .95rem;
  font-weight: 800;
  margin-bottom: .75rem;
}

.pf-activity {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.pf-activity__item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
}

.pf-activity__icon {
  flex-shrink: 0;
  color: var(--primary);
}

.pf-activity__icon svg {
  width: 18px;
  height: 18px;
}

.pf-activity__text {
  flex: 1;
  min-width: 0;
  font-size: .85rem;
  font-weight: 600;
}

.pf-activity__time {
  flex-shrink: 0;
  font-size: .75rem;
  color: var(--text-muted);
}

.pf-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .55rem;
}

.pf-quick__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1rem .5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
}
  transition: border-color .15s, background .15s;
}

.pf-quick__item:hover {
  border-color: hsla(16, 100%, 60%, .35);
  background: hsla(16, 100%, 60%, .06);
}

.pf-quick__icon {
  color: var(--primary);
}

.pf-quick__icon svg {
  width: 22px;
  height: 22px;
}

.pf-lib-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}

.pf-lib-card {
  display: flex;
  gap: .75rem;
  padding: .75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
}

.pf-lib-card__cover {
  width: 56px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.pf-lib-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.pf-lib-card__body h3 {
  font-size: .85rem;
  font-weight: 800;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pf-lib-card__body p {
  font-size: .75rem;
  color: var(--text-muted);
}

.pf-lib-card__bar {
  height: 4px;
  margin-top: auto;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.pf-lib-card__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.pf-lib-card__pct {
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary);
}

.pf-badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .65rem;
}

.pf-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1.15rem .75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  text-align: center;
}

.pf-badge--locked {
  opacity: .55;
}

.pf-badge__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.pf-badge__icon--orange { background: hsla(25, 95%, 55%, .15); color: hsl(25, 95%, 55%); }
.pf-badge__icon--green { background: hsla(145, 65%, 42%, .15); color: hsl(145, 65%, 42%); }
.pf-badge__icon--red { background: hsla(0, 80%, 55%, .15); color: hsl(0, 80%, 55%); }
.pf-badge__icon--yellow { background: hsla(45, 95%, 50%, .15); color: hsl(45, 95%, 45%); }

.pf-badge__icon svg {
  width: 22px;
  height: 22px;
}

.pf-badge strong {
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.3;
}

.pf-badge__status {
  font-size: .72rem;
  color: var(--text-muted);
}

.pf-settings {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
}

.pf-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.pf-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.pf-field span {
  font-size: .82rem;
  font-weight: 700;
}

.pf-field input,
.pf-field textarea {
  padding: .65rem .85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color .15s;
}

.pf-field input:focus,
.pf-field textarea:focus {
  border-color: hsla(16, 100%, 60%, .45);
}

.pf-field textarea {
  resize: vertical;
  min-height: 80px;
}

.pf-form__msg {
  font-size: .82rem;
  font-weight: 700;
  color: hsl(145, 65%, 42%);
}

.pf-form__msg[hidden] {
  display: none;
}

.pf-form__btn {
  padding: .75rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s;
}

.pf-form__btn:hover {
  background: var(--primary-dim);
}

.pf-logout {
  width: 100%;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: hsl(0, 70%, 55%);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
}

.pf-empty {
  color: var(--text-muted);
  font-size: .88rem;
  padding: 1rem 0;
}

@media (max-width: 768px) {
  .pf-stats {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .pf-lib-grid,
  .pf-badge-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pf-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .pf-hero__top {
    justify-content: center;
  }

  .pf-hero__edit {
    align-self: stretch;
    width: 100%;
  }

  .pf-plan {
    flex-wrap: wrap;
  }

  .pf-plan__action {
    width: 100%;
    justify-content: center;
    margin-top: .25rem;
  }
}

/* ── Publish page ── */
.pb-page {
  padding: 2rem 0 3rem;
}

.pb-page__inner {
  max-width: 720px;
}

.pb-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.pb-head__title {
  font-size: clamp(1.65rem, 4.5vw, 2.25rem);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: .6rem;
}

.pb-head__sub {
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.65;
  max-width: 36rem;
  margin: 0 auto;
}

.pb-notice {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid hsla(16, 100%, 60%, .35);
  background: hsla(16, 100%, 60%, .08);
}

.pb-notice__icon {
  flex-shrink: 0;
  color: var(--primary);
  margin-top: .1rem;
}

.pb-notice p {
  font-size: .85rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.pb-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.25rem;
}

.pb-stepper__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  min-width: 72px;
}

.pb-stepper__dot {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 800;
  transition: border-color .2s, background .2s, color .2s;
}

.pb-stepper__item--active .pb-stepper__dot {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.pb-stepper__item--done .pb-stepper__dot {
  border-color: var(--primary);
  background: hsla(16, 100%, 60%, .15);
  color: var(--primary);
}

.pb-stepper__label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pb-stepper__item--active .pb-stepper__label {
  color: var(--primary);
}

.pb-stepper__line {
  flex: 1;
  max-width: 80px;
  height: 2px;
  margin-bottom: 1.25rem;
  background: var(--border);
  transition: background .2s;
}

.pb-stepper__line--on {
  background: var(--primary);
}

.pb-card {
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.pb-card__title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1.15rem;
}

.pb-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
  margin-bottom: 1.25rem;
}

.pb-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  padding: 1.15rem .65rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}

.pb-type:hover {
  border-color: hsla(16, 100%, 60%, .35);
  transform: translateY(-2px);
}

.pb-type--selected {
  border-color: var(--primary);
  background: hsla(16, 100%, 60%, .08);
  box-shadow: 0 0 0 1px hsla(16, 100%, 60%, .25);
}

.pb-type__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.pb-type__icon--blue { background: hsla(210, 90%, 55%, .15); color: hsl(210, 90%, 55%); }
.pb-type__icon--orange { background: hsla(25, 95%, 55%, .15); color: hsl(25, 95%, 55%); }
.pb-type__icon--green { background: hsla(145, 65%, 42%, .15); color: hsl(145, 65%, 42%); }
.pb-type__icon--purple { background: hsla(270, 70%, 55%, .15); color: hsl(270, 70%, 55%); }
.pb-type__icon--yellow { background: hsla(45, 95%, 50%, .15); color: hsl(45, 95%, 45%); }
.pb-type__icon--teal { background: hsla(175, 65%, 42%, .15); color: hsl(175, 65%, 42%); }

.pb-type__icon svg {
  width: 24px;
  height: 24px;
}

.pb-type__label {
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.pb-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pb-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.pb-field span {
  font-size: .82rem;
  font-weight: 700;
}

.pb-field input,
.pb-field select,
.pb-field textarea {
  padding: .65rem .85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color .15s;
}

.pb-field input:focus,
.pb-field select:focus,
.pb-field textarea:focus {
  border-color: hsla(16, 100%, 60%, .45);
}

.pb-field textarea {
  resize: vertical;
  min-height: 100px;
}

.pb-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 1.75rem 1rem;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.pb-upload:hover,
.pb-upload--done {
  border-color: hsla(16, 100%, 60%, .4);
  background: hsla(16, 100%, 60%, .05);
}

.pb-upload__input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.pb-upload__icon {
  color: var(--primary);
}

.pb-upload strong {
  font-size: .88rem;
}

.pb-upload p {
  font-size: .78rem;
  color: var(--text-muted);
  max-width: 20rem;
}

.pb-error {
  font-size: .82rem;
  font-weight: 700;
  color: hsl(0, 70%, 55%);
  margin-bottom: .75rem;
}

.pb-error[hidden] {
  display: none;
}

.pb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: .8rem 1.25rem;
  border-radius: var(--radius-pill);
  border: none;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, opacity .2s;
}

.pb-btn--primary {
  background: var(--primary);
  color: #fff;
}

.pb-btn--primary:hover {
  background: var(--primary-dim);
}

.pb-btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.pb-btn--ghost:hover {
  background: var(--bg);
}

.pb-actions {
  display: flex;
  gap: .65rem;
}

.pb-actions .pb-btn {
  flex: 1;
}

.pb-review {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.pb-review__row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.pb-review__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pb-review dt {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pb-review dd {
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.5;
}

.pb-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .75rem;
  padding: 1rem 0;
}

.pb-success__icon {
  color: hsl(145, 65%, 42%);
}

.pb-success h2 {
  font-size: 1.2rem;
  font-weight: 900;
}

.pb-success p {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 28rem;
  margin-bottom: .5rem;
}

.header__btn--active {
  border-color: hsla(16, 100%, 60%, .45);
  background: hsla(16, 100%, 60%, .1);
  color: var(--primary);
}

@media (max-width: 640px) {
  .pb-types {
    grid-template-columns: repeat(2, 1fr);
  }

  .pb-stepper__label {
    display: none;
  }

  .pb-stepper__line {
    max-width: 40px;
  }

  .pb-review__row {
    grid-template-columns: 1fr;
    gap: .25rem;
  }

  .pb-actions {
    flex-direction: column-reverse;
  }
}

/* -- Book details page -- */

.bd-page {
  padding: 1.25rem 0 5rem;
  min-height: 60vh;
}

.bd-back {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  text-decoration: none;
  transition: color .2s;
}

.bd-back:hover { color: var(--text); }

html[dir="rtl"] .bd-back svg { transform: scaleX(-1); }

.bd-hero {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.bd-hero__cover-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bd-hero__cover {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

.bd-hero__listen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.25rem;
  font-size: 1rem;
  line-height: 1.2;
  border-radius: 999px;
}

.bd-hero__listen svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  align-self: center;
}

.btn--block { width: 100%; justify-content: center; }

.bd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .75rem;
}

.bd-badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.bd-badge--type { background: rgba(139,92,246,.2); color: #a78bfa; }
.bd-badge--cat { background: rgba(34,197,94,.15); color: #4ade80; }
.bd-badge--free { background: rgba(34,197,94,.25); color: #22c55e; }
.bd-badge--sub { background: rgba(245,158,11,.2); color: #fbbf24; }

.bd-title {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 .5rem;
}

.bd-meta-line {
  margin: 0 0 .35rem;
  font-size: .95rem;
  color: var(--text);
}

.bd-meta-line--muted { color: var(--text-muted); }

.bd-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 1.25rem;
  font-size: .9rem;
  color: var(--text-muted);
}

.bd-stat {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.bd-stat--rating {
  color: var(--text);
}

.bd-stat--rating strong { margin-inline-start: .15rem; }

.bd-author-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1rem;
}

.bd-author-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.bd-author-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.bd-author-card__info strong { font-size: .95rem; }
.bd-author-card__info span { font-size: .8rem; color: var(--text-muted); }

.btn--sm {
  padding: .4rem .85rem;
  font-size: .8rem;
  border-radius: 999px;
}

.bd-follow--on {
  background: rgba(255,107,53,.15);
  border-color: var(--primary);
  color: var(--primary);
}

.bd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
}

.bd-action-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.bd-action-btn:hover { border-color: var(--text-muted); }

.bd-action-btn--active {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239,68,68,.08);
}

.bd-list-wrap { position: relative; }

.bd-list-menu {
  position: absolute;
  top: calc(100% + .35rem);
  inset-inline-start: 0;
  min-width: 210px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .35rem;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.bd-list-menu__opt {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  text-align: start;
  padding: .55rem .75rem;
  border: none;
  background: none;
  color: var(--text);
  font-size: .85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.bd-list-menu__check {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.bd-list-menu__opt--on {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-weight: 600;
}

.bd-list-menu__opt:hover {
  background: var(--muted);
}

.bd-list-menu__opt--on:hover {
  background: color-mix(in srgb, var(--primary) 14%, var(--muted));
}

.bd-list-msg {
  position: absolute;
  top: calc(100% + .35rem);
  inset-inline-start: 0;
  margin: 0;
  padding: .35rem .55rem;
  font-size: .78rem;
  color: var(--primary);
  white-space: nowrap;
  pointer-events: none;
  z-index: 19;
}

.bd-list-wrap .bd-action-btn--active {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.bd-sub-banner {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.bd-sub-banner__icon {
  flex-shrink: 0;
  color: var(--primary);
  opacity: .9;
}

.bd-sub-banner__text {
  flex: 1;
  min-width: 0;
}

.bd-sub-banner__text strong {
  display: block;
  margin-bottom: .25rem;
  font-size: .95rem;
}

.bd-sub-banner__text p {
  margin: 0;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.bd-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.bd-layout--ebook {
  grid-template-columns: 1fr;
  max-width: 820px;
}

.bd-hero--ebook .bd-hero__listen svg {
  width: 18px;
  height: 18px;
}

.bd-playlist {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.bd-playlist__head {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: 1rem 1.15rem;
  border: none;
  background: none;
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: start;
}

.bd-playlist__chev {
  margin-inline-start: auto;
  transition: transform .2s;
}

.bd-playlist__head[aria-expanded="false"] .bd-playlist__chev {
  transform: rotate(-90deg);
}

html[dir="rtl"] .bd-playlist__head[aria-expanded="false"] .bd-playlist__chev {
  transform: rotate(90deg);
}

.bd-playlist__body { padding: 0 .65rem .85rem; }

.bd-episodes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.bd-episode-row {
  display: flex;
  align-items: stretch;
  gap: .25rem;
}

.bd-episode {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex: 1;
  min-width: 0;
  padding: .65rem .75rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: start;
  cursor: pointer;
  transition: background .2s;
}

.bd-episode__share {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.bd-episode__share:hover {
  background: var(--muted);
  color: var(--primary);
}

.bd-episode__share svg {
  display: block;
  width: 16px;
  height: 16px;
}

.bd-episode:hover:not(:disabled) { background: var(--muted); }

.bd-episode--active {
  background: rgba(255,107,53,.12);
  color: var(--primary);
}

.bd-episode--locked {
  opacity: .55;
  cursor: not-allowed;
}

.bd-episode__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}
.bd-episode__icon svg {
  display: block;
  flex-shrink: 0;
}

.bd-episode__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.bd-episode__title {
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bd-episode__dur {
  font-size: .75rem;
  color: var(--text-muted);
}

.bd-episode__tag {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.bd-episode__tag--free {
  background: rgba(34,197,94,.2);
  color: #22c55e;
}

.bd-playlist__hint {
  margin: .75rem .5rem 0;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
}

.bd-playlist__hint a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.bd-main {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem;
}

.bd-tabs {
  display: flex;
  gap: .35rem;
  margin-bottom: 1.15rem;
  padding: .25rem;
  background: var(--muted);
  border-radius: 12px;
}

.bd-tab {
  flex: 1;
  padding: .55rem 1rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.bd-tab--active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.bd-desc {
  margin: 0 0 1.25rem;
  line-height: 1.75;
  color: var(--text-muted);
  font-size: .95rem;
}

.bd-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}

.bd-meta-card {
  padding: .85rem 1rem;
  background: var(--muted);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.bd-meta-card span {
  font-size: .78rem;
  color: var(--text-muted);
}

.bd-meta-card strong {
  font-size: .92rem;
  font-weight: 700;
}

.bd-panel[hidden] {
  display: none !important;
}

.bd-reviews-empty {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: .9rem;
}

.bd-review {
  padding: 1rem 1.1rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.bd-review--mine {
  position: relative;
  padding: 1.1rem 1.15rem 1.15rem;
  background: color-mix(in srgb, var(--primary) 9%, var(--muted));
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 12%, transparent);
}

.bd-review--mine::before {
  content: '';
  position: absolute;
  inset-block: 12px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}

html[dir="rtl"] .bd-review--mine::before {
  border-radius: 4px 0 0 4px;
}

.bd-review__head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .75rem;
}

.bd-review__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.bd-review__name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .55rem;
}

.bd-review__name {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
}

.bd-review__badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.bd-review__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .95rem;
  flex-shrink: 0;
}

.bd-review__avatar--mine {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}

.bd-review__stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.bd-review__stars .star {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.bd-review__stars .star svg {
  width: 13px;
  height: 13px;
}

.bd-review__text {
  margin: 0;
  padding-inline-start: calc(42px + .75rem);
  font-size: .92rem;
  line-height: 1.7;
  color: var(--text);
}

.bd-review--mine .bd-review__text {
  color: var(--text);
}

.bd-review:not(.bd-review--mine) .bd-review__text {
  color: var(--text-muted);
}

.bd-review-form {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.bd-review-form__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.bd-review-form__hint {
  margin: -.25rem 0 0;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.bd-review-form--edit {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 8%, var(--muted));
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
}

.bd-review-form__stars {
  display: flex;
  gap: .35rem;
}

.bd-review-form__star {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--muted);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s, transform .15s;
}

.bd-review-form__star--on {
  background: color-mix(in srgb, var(--primary) 18%, var(--muted));
  color: var(--primary);
}

.bd-review-form__star:hover {
  transform: scale(1.05);
}

.bd-review-form__text {
  width: 100%;
  min-height: 96px;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--muted);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.bd-review-form__text:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent);
  outline-offset: 1px;
}

.bd-review-form__msg {
  margin: 0;
  font-size: .85rem;
  color: var(--primary);
}

.bd-reviews {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.bd-similar {
  margin-top: 2.5rem;
}

.bd-similar h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 1rem;
}

.bd-similar__grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.bd-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.bd-empty p { margin-bottom: 1rem; font-size: 1.1rem; }

@media (max-width: 900px) {
  .bd-hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .bd-hero__cover-col {
    max-width: 280px;
    margin-inline: auto;
    width: 100%;
  }

  .bd-layout {
    grid-template-columns: 1fr;
  }

  .bd-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .bd-actions {
    flex-direction: column;
  }

  .bd-action-btn {
    justify-content: center;
    width: 100%;
  }

  .bd-sub-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .bd-sub-banner .btn {
    align-self: flex-start;
  }

  .bd-review__text {
    padding-inline-start: 0;
  }
}

/* Book page — resume hint, visits, premium CTA */
.bd-resume-hint {
  margin: -.5rem 0 1rem;
  font-size: .85rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.bd-stat__muted {
  color: var(--text-muted);
  font-weight: 500;
  font-size: .85em;
}

.bd-playlist__head-title { flex: 1; text-align: start; }

.bd-playlist__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-inline-end: .35rem;
}

.bd-playlist__pill {
  font-size: .68rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--text-muted);
}

.bd-playlist__pill--free {
  background: rgba(34,197,94,.18);
  color: #4ade80;
}

.bd-playlist__head {
  flex-wrap: wrap;
  gap: .35rem;
}

.bd-meta-visits {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .85rem;
  padding: .85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: .9rem;
}

.bd-meta-visits span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
}

.bd-premium-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(120, 53, 15, .45), rgba(68, 36, 10, .35));
  border: 1px solid rgba(232, 160, 32, .25);
  color: var(--on-dark-text);
}

.bd-premium-cta__text strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: .25rem;
  color: var(--on-dark-text);
}

.bd-premium-cta__text p {
  margin: 0;
  font-size: .88rem;
  color: var(--on-dark-muted);
  line-height: 1.5;
}

/* Fixed audio player — above bottom nav on mobile */
body.bd-playing {
  padding-bottom: calc(var(--bd-player-h) + env(safe-area-inset-bottom, 0px) + .5rem);
}

.bd-player {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 200;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0,0,0,.35);
  padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom, 0px));
}

.bd-player .container { position: relative; }

.bd-player__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .85rem 1rem;
  align-items: center;
}

.bd-player__cover {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.bd-player__meta {
  min-width: 0;
  display: none;
}

.bd-player__title,
.bd-player__ep {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bd-player__title { font-size: .92rem; }
.bd-player__ep { font-size: .78rem; color: var(--text-muted); }

.bd-player__main { grid-column: 1 / -1; }

.bd-player__progress {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .55rem;
}

.bd-player__time {
  font-size: .72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
}

.bd-player__time:last-child { text-align: end; }

.bd-player__seek {
  flex: 1;
  height: 4px;
  accent-color: var(--primary);
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.bd-player__seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--muted);
}

.bd-player__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
  cursor: pointer;
}

.bd-player__seek::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--muted);
  border: none;
}

.bd-player__seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
  cursor: pointer;
}

.bd-player__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
}

.bd-player__play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 6px 18px hsla(16, 100%, 60%, .38);
  padding: 0;
}

.bd-player__play:hover { filter: brightness(1.06); }

.bd-player__play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 0;
  pointer-events: none;
}

.bd-player__play-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.bd-player__skip,
.bd-player__speed {
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--text);
  border-radius: 999px;
  min-width: 44px;
  height: 36px;
  padding: 0 .65rem;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.bd-player__speed { min-width: 52px; }

.bd-player__skip:hover,
.bd-player__speed:hover { border-color: var(--text-muted); }

.bd-player__close {
  position: absolute;
  top: .35rem;
  inset-inline-end: .5rem;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 768px) {
  .bd-player {
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    z-index: 215;
    padding-bottom: .75rem;
  }

  body.bd-playing {
    padding-bottom: calc(var(--bottom-nav-h) + var(--bd-player-h) + env(safe-area-inset-bottom, 0px) + .5rem);
  }

  body.bd-playing .whatsapp-fab {
    bottom: calc(var(--bottom-nav-h) + var(--bd-player-h) + .85rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 769px) {
  .bd-player__inner {
    grid-template-columns: auto minmax(120px, 180px) 1fr auto;
  }

  .bd-player__meta { display: block; }
  .bd-player__main { grid-column: auto; }
  .bd-player__close { position: static; }
}

/* -- protected ebook reader -- */
.bd-reader {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  background: #0c0d10;
  color: #f2f2f2;
}
.bd-reader[hidden] { display: none !important; }

.bd-reader__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 1rem;
  background: rgba(12, 13, 16, .96);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
}

.bd-reader__toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.bd-reader__head {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  margin-inline-start: auto;
}

.bd-reader__icon-btn,
.bd-reader__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}
.bd-reader__icon-btn:hover,
.bd-reader__close:hover {
  background: rgba(255,255,255,.12);
}

.bd-reader__pill {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  padding: .2rem;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

.bd-reader__pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,.72);
  cursor: pointer;
}
.bd-reader__pill-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.bd-reader__pill-btn.is-active {
  color: #fff;
  background: rgba(194, 65, 12, .85);
}

.bd-reader__pill--zoom {
  gap: .2rem;
  padding-inline: .2rem;
}

.bd-reader__zoom-label {
  min-width: 3rem;
  text-align: center;
  font-size: .78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.82);
}

.bd-reader__pill-btn--text {
  min-width: 36px;
}

.bd-reader__zoom-glyph {
  font-family: "Tajawal", "Segoe UI", sans-serif;
  font-weight: 800;
  line-height: 1;
  display: block;
}
.bd-reader__zoom-glyph::before { content: "أ"; }
html[lang="en"] .bd-reader__zoom-glyph::before { content: "A"; }
.bd-reader__zoom-glyph--sm { font-size: .85rem; }
.bd-reader__zoom-glyph--lg { font-size: 1.2rem; }

.bd-reader--view-light .bd-reader__zoom-label {
  color: rgba(0,0,0,.7);
}

.bd-reader__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  text-align: end;
}
.bd-reader__meta strong {
  font-size: .92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bd-reader__meta span {
  font-size: .72rem;
  opacity: .62;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[dir="rtl"] .bd-reader__close svg {
  transform: scaleX(-1);
}

.bd-reader--view-light {
  background: #eceae4;
  color: #1a1a1a;
}
.bd-reader--view-light .bd-reader__bar {
  background: rgba(255,255,255,.92);
  border-bottom-color: rgba(0,0,0,.08);
}
.bd-reader--view-light .bd-reader__icon-btn,
.bd-reader--view-light .bd-reader__close,
.bd-reader--view-light .bd-reader__pill {
  background: rgba(0,0,0,.05);
  border-color: rgba(0,0,0,.08);
}
.bd-reader--view-light .bd-reader__pill-btn {
  color: rgba(0,0,0,.55);
}
.bd-reader--view-light .bd-reader__pill-btn.is-active {
  color: #fff;
}
.bd-reader--view-light .bd-reader__stage {
  background: #f7f6f2;
}
.bd-reader--view-light .bd-reader__notice {
  color: rgba(0,0,0,.5);
  border-top-color: rgba(0,0,0,.08);
}

.bd-reader--view-sepia {
  background: #1e1914;
  color: #f2ece0;
}
.bd-reader--view-sepia .bd-reader__stage {
  background: #f4ecd8;
}
.bd-reader--view-sepia .bd-reader__canvas {
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
}

.bd-reader--view-dark .bd-reader__stage {
  background: #0c0d10;
}

.bd-reader__stage {
  position: relative;
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.bd-reader__pages {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.bd-reader__page-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.bd-reader__page-wrap--lazy .bd-reader__page-placeholder {
  background: rgba(255, 255, 255, .05);
  border-radius: 6px;
  margin: 0 auto;
}

.bd-reader--view-light .bd-reader__page-wrap--lazy .bd-reader__page-placeholder {
  background: rgba(0, 0, 0, .04);
}

.bd-reader__pages--epub {
  width: 100%;
  max-width: 720px;
  align-self: center;
  overflow: visible;
}

.bd-reader__epub-view {
  width: 100%;
  min-height: 70vh;
  overflow: visible;
}

.haki-epub-scroll {
  width: 100%;
  min-height: 70vh;
  background: #fff;
  color: #111;
}

.haki-epub-chapter {
  width: 100%;
}

.haki-epub-frame-wrap,
.haki-epub-frame {
  display: none;
}

.bd-reader__stage:has(.bd-reader__pages--epub) {
  overflow-y: auto;
  overflow-x: hidden;
}

.bd-reader__pages--epub .epub-container,
.bd-reader__pages--epub iframe,
.bd-reader__pages--epub .haki-epub-frame {
  width: 100% !important;
  min-height: 70vh;
  border: 0;
  background: #fff;
}

.bd-reader__canvas {
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  background: #fff;
  pointer-events: none;
}

.bd-reader__loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(12,13,16,.85);
  font-size: 1rem;
  padding: 2rem;
  text-align: center;
}
.bd-reader__loading[hidden] { display: none !important; }

.bd-reader__notice {
  margin: 0;
  padding: .55rem 1rem .75rem;
  text-align: center;
  font-size: .75rem;
  color: rgba(255,255,255,.55);
  border-top: 1px solid rgba(255,255,255,.06);
  background: #0c0d10;
}

body.bd-reading {
  overflow: hidden;
}
body.bd-reading .whatsapp-fab,
body.bd-reading .bottom-nav,
body.bd-reading .header {
  visibility: hidden;
}

@media print {
  body.bd-reading * { display: none !important; }
  body.haki-protect-scope #bdRoot,
  body.haki-protect-scope #bdPlayer,
  body.haki-protect-scope #bdReader { display: none !important; }
  body.bd-reading::after,
  body.haki-protect-scope::after {
    content: "الطباعة غير مسموحة — حكي";
    display: block !important;
    text-align: center;
    padding: 4rem;
    font-size: 1.25rem;
  }
}

/* -- content capture protection -- */
.haki-protect {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(6, 7, 10, 0.94);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
}
.haki-protect[hidden] { display: none !important; }

.haki-protect__panel {
  max-width: 22rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}

.haki-protect__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid #ef4444;
  position: relative;
  animation: liveDotPulse 1.6s ease infinite;
}
.haki-protect__icon::after {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: #ef4444;
}

.haki-protect__title {
  font-size: 1.15rem;
  font-weight: 800;
}

.haki-protect__text {
  margin: 0;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text-muted, rgba(255,255,255,.65));
}

.haki-protect__btn {
  margin-top: .35rem;
  min-width: 9rem;
}

body.haki-protect-scope .bd-hero__cover,
body.haki-protect-scope .bd-player__cover,
body.haki-protect-scope .bd-reader__canvas {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body.haki-protect-active .bd-hero__cover,
body.haki-protect-active .bd-player,
body.haki-protect-active .bd-player__cover,
body.haki-protect-active .bd-reader__pages,
body.haki-protect-active .bd-reader__canvas {
  filter: blur(48px) brightness(0.35) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.haki-protect-scope[data-haki-protect-level="reader"] .bd-reader__stage,
body.haki-protect-scope[data-haki-protect-level="player"] .bd-player {
  user-select: none;
  -webkit-user-select: none;
}

.bd-reader__pages iframe {
  border: 0;
  width: 100% !important;
  min-height: 70vh;
  background: #fff;
}

@media (max-width: 640px) {
  .bd-reader__bar {
    flex-wrap: wrap;
    gap: .55rem;
    padding: .55rem .7rem .65rem;
  }
  .bd-reader__head {
    order: -1;
    width: 100%;
    margin-inline-start: 0;
  }
  .bd-reader__toolbar {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: .4rem;
  }
  .bd-reader__icon-btn,
  .bd-reader__close,
  .bd-reader__pill-btn {
    width: 42px;
    height: 42px;
  }
  .bd-reader__pill--zoom {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 44px;
    padding-inline: .35rem;
  }
  .bd-reader__pill-btn--text {
    min-width: 44px;
    width: 44px;
  }
  .bd-reader__zoom-label {
    min-width: 3.4rem;
    font-size: .85rem;
  }
  .bd-reader__zoom-glyph--sm { font-size: .95rem; }
  .bd-reader__zoom-glyph--lg { font-size: 1.35rem; }
  .bd-reader__meta strong {
    font-size: .84rem;
  }
  .bd-reader__stage {
    padding: .75rem .55rem 1.25rem;
  }
  .haki-epub-chapter {
    padding: 1rem .85rem 1.5rem !important;
  }
}
