/* Tikbook — one stylesheet for the site and the player. Each book has a theme. */
:root {
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --kufi: "Reem Kufi", "Alexandria", system-ui, sans-serif;
  --brand: #db3a12;
  --wrap: 1160px;
  --gutter: clamp(18px, 4vw, 32px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme] { --accent-ink: var(--accent); --mark-alt: var(--accent); }
[data-theme="home"] {
  --bg: #faf6ee; --bg2: #f1eadc; --ink: #15110d; --muted: #6a6055; --accent: #db3a12; --accent-ink: #c23110;
  --card: #fffdf9; --line: rgba(21, 17, 13, .11); --on-accent: #fff; --glyph: "";
}
[data-theme="kalila"] {
  --bg: #0f3d2d; --bg2: #072419; --ink: #f4ebd2; --muted: rgba(244, 235, 210, .68); --accent: #e9b84b;
  --card: rgba(255, 255, 255, .07); --line: rgba(244, 235, 210, .16); --on-accent: #0b2a1f; --glyph: "ك";
}
[data-theme="bukhala"] {
  --bg: #f2e2c0; --bg2: #e3c996; --ink: #2d1b0f; --muted: rgba(45, 27, 15, .68); --accent: #b8400e; --accent-ink: #9c3408;
  --card: rgba(45, 27, 15, .07); --line: rgba(45, 27, 15, .16); --on-accent: #fff6e6; --glyph: "ب";
}
[data-theme="war"] {
  --bg: #1a1714; --bg2: #0c0b0a; --ink: #efe7d6; --muted: rgba(239, 231, 214, .64); --accent: #e0303a; --accent-ink: #f0555d;
  --card: rgba(255, 255, 255, .06); --line: rgba(239, 231, 214, .14); --on-accent: #fff; --glyph: "兵";
}
[data-theme="muqaddima"] {
  --bg: #1f2d4d; --bg2: #0e1630; --ink: #f2ead8; --muted: rgba(242, 234, 216, .68); --accent: #e7a956;
  --card: rgba(255, 255, 255, .07); --line: rgba(242, 234, 216, .15); --on-accent: #16203a; --glyph: "ع";
}
[data-theme="hayy"] {
  --bg: #11535a; --bg2: #062a2e; --ink: #f3efe2; --muted: rgba(243, 239, 226, .7); --accent: #f2c66d;
  --card: rgba(255, 255, 255, .08); --line: rgba(243, 239, 226, .16); --on-accent: #08343a; --glyph: "ح";
}
[data-theme="meditations"] {
  --bg: #eeece7; --bg2: #d4d0c8; --ink: #211f26; --muted: rgba(33, 31, 38, .66); --accent: #6d3fa3;
  --card: rgba(33, 31, 38, .06); --line: rgba(33, 31, 38, .14); --on-accent: #fff; --glyph: "Μ";
}
/* Shared palettes for the wider library. The glyph comes from the book (set inline by the build). */
[data-theme="p-forest"] {
  --bg: #17402f; --bg2: #0a2318; --ink: #f3ecd6; --muted: rgba(243, 236, 214, .68); --accent: #e6b655;
  --card: rgba(255, 255, 255, .07); --line: rgba(243, 236, 214, .16); --on-accent: #0c2a1e;
}
[data-theme="p-navy"] {
  --bg: #1d2b52; --bg2: #0c1430; --ink: #f1ebdc; --muted: rgba(241, 235, 220, .68); --accent: #f0a94e;
  --card: rgba(255, 255, 255, .07); --line: rgba(241, 235, 220, .15); --on-accent: #131c3a;
}
[data-theme="p-teal"] {
  --bg: #0f4d55; --bg2: #05272c; --ink: #f2efe3; --muted: rgba(242, 239, 227, .7); --accent: #f4c76a;
  --card: rgba(255, 255, 255, .08); --line: rgba(242, 239, 227, .16); --on-accent: #07343a;
}
[data-theme="p-plum"] {
  --bg: #3d2152; --bg2: #1d0d2b; --ink: #f4ebf3; --muted: rgba(244, 235, 243, .68); --accent: #f29bb4;
  --card: rgba(255, 255, 255, .08); --line: rgba(244, 235, 243, .16); --on-accent: #2a1239;
}
[data-theme="p-wine"] {
  --bg: #5a1a26; --bg2: #2c0a12; --ink: #f7ead9; --muted: rgba(247, 234, 217, .7); --accent: #f2c078;
  --card: rgba(255, 255, 255, .08); --line: rgba(247, 234, 217, .16); --on-accent: #3a0f18;
}
[data-theme="p-ink"] {
  --bg: #1b1917; --bg2: #0b0a09; --ink: #efe8d8; --muted: rgba(239, 232, 216, .64); --accent: #ff6a3d; --accent-ink: #ff8560;
  --card: rgba(255, 255, 255, .06); --line: rgba(239, 232, 216, .14); --on-accent: #1b0d06;
}
[data-theme="p-char"] {
  --bg: #26303a; --bg2: #11171d; --ink: #eef1f0; --muted: rgba(238, 241, 240, .66); --accent: #5fd6c0;
  --card: rgba(255, 255, 255, .07); --line: rgba(238, 241, 240, .15); --on-accent: #0d2a26;
}
[data-theme="p-olive"] {
  --bg: #3f4420; --bg2: #1f220d; --ink: #f4f0d8; --muted: rgba(244, 240, 216, .7); --accent: #dfe07a;
  --card: rgba(255, 255, 255, .07); --line: rgba(244, 240, 216, .16); --on-accent: #262a0f;
}
[data-theme="p-sand"] {
  --bg: #f0dfbd; --bg2: #dfc592; --ink: #2c1c10; --muted: rgba(44, 28, 16, .68); --accent: #b3400f; --accent-ink: #983507;
  --card: rgba(44, 28, 16, .07); --line: rgba(44, 28, 16, .16); --on-accent: #fff5e5;
}
[data-theme="p-paper"] {
  --bg: #edebe6; --bg2: #d3cfc6; --ink: #201e25; --muted: rgba(32, 30, 37, .66); --accent: #5b3f9e;
  --card: rgba(32, 30, 37, .06); --line: rgba(32, 30, 37, .14); --on-accent: #fff;
}
[data-theme="p-rose"] {
  --bg: #f6dcd6; --bg2: #e9bcb2; --ink: #33161a; --muted: rgba(51, 22, 26, .68); --accent: #a8213a;
  --card: rgba(51, 22, 26, .07); --line: rgba(51, 22, 26, .15); --on-accent: #fff;
}
[data-theme="p-sky"] {
  --bg: #dbe6ee; --bg2: #b7cbd9; --ink: #13243a; --muted: rgba(19, 36, 58, .68); --accent: #1c4f9c;
  --card: rgba(19, 36, 58, .07); --line: rgba(19, 36, 58, .15); --on-accent: #fff;
}
[data-theme="player"] { --bg: #0c0c0c; --ink: #f5f5f5; --muted: rgba(255,255,255,.6); --accent: var(--brand); --line: rgba(255,255,255,.14); --card: rgba(255,255,255,.07); --on-accent: #fff; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.75 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.ic { width: 1.1em; height: 1.1em; flex: none; fill: currentColor; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; direction: ltr; flex: none; }
.brand .mark { width: 32px; height: 32px; }
.brand-name { font: 800 23px/1 var(--display); letter-spacing: -.04em; padding-bottom: 2px; }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-end: auto; }
.nav a {
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  font-size: 15.5px; font-weight: 500; color: var(--muted); transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--ink); background: var(--card); }
.top-end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.nav-watch {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 999px;
  text-decoration: none; font-size: 15.5px; font-weight: 700; color: var(--accent-ink);
}
.nav-watch:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
@media (max-width: 760px) {
  .nav { display: none; }
  .top-in { min-height: 60px; }
  .brand .mark { width: 28px; height: 28px; }
  .brand-name { font-size: 21px; }
}
@media (max-width: 420px) { .nav-watch { display: none; } }

/* ---------- buttons, labels ---------- */
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 28px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: 700 17px var(--font); text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s;
}
.cta:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--accent) 90%, transparent); }
.cta:active { transform: scale(.97); }
.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 54px; padding: 0 24px;
  border-radius: 999px; border: 1.5px solid var(--line); background: transparent;
  font: 600 16.5px var(--font); text-decoration: none; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.ghost:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); background: var(--card); }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .01em; color: var(--accent-ink); }
.chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--muted);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: #2fa866; box-shadow: 0 0 0 4px rgba(47, 168, 102, .18); }
.lede { font-size: clamp(17.5px, 1.6vw, 20px); line-height: 1.8; color: var(--muted); max-width: 34em; }

/* ---------- home: hero ---------- */
.home { overflow-x: clip; }
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: center; gap: clamp(24px, 5vw, 72px); padding-block: clamp(28px, 6vw, 72px) clamp(36px, 6vw, 80px); }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.hero h1 { font: 800 clamp(40px, 6.4vw, 78px)/1.22 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-stats { list-style: none; display: flex; gap: clamp(20px, 3vw, 36px); margin: 14px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); align-self: stretch; }
.hero-stats li { display: flex; flex-direction: column; gap: 2px; }
.hero-stats strong { font: 800 clamp(24px, 2.6vw, 32px)/1.2 var(--display); }
.hero-stats span { font-size: 14.5px; color: var(--muted); }

.hero-art { position: relative; display: grid; place-items: center; min-height: 620px; }
.hero-art::before {
  content: ""; position: absolute; width: min(118%, 600px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 5%, transparent) 62%, transparent 72%);
}
.float-cover { position: absolute; width: clamp(150px, 14vw, 186px); filter: drop-shadow(0 24px 30px rgba(21, 17, 13, .22)); }
.fc-a { inset-inline-start: -4%; top: 8%; transform: rotate(8deg); }
.fc-b { inset-inline-end: -5%; bottom: 7%; transform: rotate(-9deg); }

.phone {
  position: relative; z-index: 1; width: clamp(238px, 23vw, 286px); aspect-ratio: 9 / 18.6;
  border-radius: 46px; background: #15110d; padding: 9px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 2px 0 1px rgba(255, 255, 255, .12) inset, 0 50px 80px -30px rgba(21, 17, 13, .55), 0 18px 30px -18px rgba(21, 17, 13, .5);
}
.phone::before { content: ""; position: absolute; z-index: 3; top: 19px; left: 50%; width: 74px; height: 21px; margin-left: -37px; border-radius: 12px; background: #15110d; }
.phone-in { position: relative; height: 100%; border-radius: 37px; overflow: hidden; container-type: inline-size; background: #0c0c0c; }
.phone-screen {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto auto 1fr auto; color: var(--ink);
  background: radial-gradient(130% 80% at 85% 0%, var(--bg) 0%, var(--bg2) 100%);
  opacity: 0; animation: screen 15s infinite; animation-delay: calc(var(--n) * 5s);
}
.phone-screen.single { opacity: 1; animation: none; }
.phone-screen::before { content: var(--glyph); position: absolute; bottom: -4%; left: -10%; font: 700 96cqw/1 var(--kufi); color: var(--accent); opacity: .08; }
.p-bars { display: flex; gap: 1.4cqw; padding: 17cqw 5cqw 0; }
.p-bars i { flex: 1; height: 1.1cqw; min-height: 2.5px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 22%, transparent); overflow: hidden; }
.p-bars b { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: right center; }
.p-bars i:first-child b { animation: pbar 5s linear infinite; }
.p-pill { justify-self: start; margin: 4.4cqw 5cqw 0; padding: 1.6cqw 5cqw; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 4.8cqw; font-weight: 700; line-height: 1.6; }
.p-stage { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4cqw; padding: 0 7cqw 0 19cqw; }
.p-kicker { font-size: 4.6cqw; font-weight: 500; color: var(--muted); line-height: 1.5; }
.p-hook { font: 700 9.2cqw/1.5 var(--font); }
.p-hook em { font-style: normal; color: var(--accent); }
.p-foot { position: relative; display: flex; flex-direction: column; padding: 3cqw 6cqw 8cqw 19cqw; line-height: 1.5; }
.p-foot strong { font-size: 5.4cqw; }
.p-foot span { font-size: 4.4cqw; color: var(--muted); }
.p-rail { position: absolute; left: 4cqw; bottom: 8cqw; display: flex; flex-direction: column; gap: 4cqw; }
.p-rail i { display: grid; place-items: center; width: 14cqw; height: 14cqw; border-radius: 50%; background: var(--card); }
.p-rail svg { width: 48%; height: 48%; fill: var(--ink); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 540px; margin-inline: calc(var(--gutter) * -1); overflow: hidden; }
  .hero-art::before { width: 520px; }
  .fc-a { inset-inline-start: max(-20px, calc(50% - 250px)); }
  .fc-b { inset-inline-end: max(-20px, calc(50% - 250px)); }
  .phone { width: 250px; }
}
@media (max-width: 520px) {
  .hero-actions { align-self: stretch; }
  .hero-actions > * { flex: 1 1 100%; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(36px, 6vw, 72px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: clamp(22px, 3vw, 36px); }
.section-head h2 { font: 800 clamp(27px, 3.6vw, 42px)/1.3 var(--display); letter-spacing: -.01em; margin-top: 6px; }
.more { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--accent-ink); text-decoration: none; padding: 6px 0; }
.more .ic { transition: transform .2s var(--ease); }
.more:hover .ic { transform: translateX(-4px); }

/* ---------- covers ---------- */
.cover {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; aspect-ratio: 3 / 4.1;
  container-type: inline-size; border-radius: 12px 5px 5px 12px;
  color: var(--ink); text-decoration: none;
  background:
    linear-gradient(to left, rgba(0, 0, 0, .3), rgba(0, 0, 0, .06) 3.2%, rgba(255, 255, 255, .13) 5%, rgba(0, 0, 0, 0) 8.5%),
    radial-gradient(120% 90% at 20% 0%, var(--bg) 0%, var(--bg2) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 22px 38px -24px rgba(21, 17, 13, .6), 0 4px 10px -6px rgba(21, 17, 13, .3);
}
.cover::before {
  content: var(--glyph); position: absolute; z-index: -1; top: -3cqw; left: -5cqw;
  font: 700 92cqw/1 var(--kufi); color: var(--accent); opacity: .17; pointer-events: none;
}
.cover::after { content: ""; position: absolute; inset: 4.5cqw 9cqw 4.5cqw 4.5cqw; border: 1px solid var(--line); border-radius: 2.2cqw; pointer-events: none; }
.cover-in { position: relative; display: flex; flex-direction: column; flex: 1; padding: 9cqw 14cqw 10cqw 9.5cqw; }
.cover-tag { align-self: flex-start; font-size: 5.4cqw; font-weight: 600; line-height: 1.5; color: var(--accent); }
.cover-title { margin-top: auto; font: 700 14cqw/1.25 var(--kufi); text-wrap: balance; }
.cover-rule { width: 12cqw; height: max(2px, .9cqw); margin: 5cqw 0 4cqw; border-radius: 2px; background: var(--accent); }
.cover-author { font-size: 6cqw; line-height: 1.5; color: var(--muted); }

/* ---------- home: shelf ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: clamp(22px, 3vw, 36px) clamp(16px, 2.4vw, 28px); }
@media (min-width: 1100px) { .book-grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 560px) { .book-grid { grid-template-columns: 1fr 1fr; gap: 26px 14px; } .book-meta strong { font-size: 16px; } }
/* Shelf filters: category chips and a search box above the grid. */
.shelf-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: clamp(20px, 3vw, 30px); }
.shelf-search { flex: 1 1 240px; max-width: 360px; height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 500 16px var(--font); }
.shelf-search::placeholder { color: var(--muted); }
.shelf-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cats { display: flex; gap: 8px; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter); }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 15px var(--font); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.cat small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.cat:hover { border-color: var(--ink); }
.cat[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cat[aria-pressed="true"] small { color: inherit; opacity: .7; }
.book-card[hidden] { display: none; }
.shelf-empty { padding: 36px 0; color: var(--muted); font-size: 17px; }
@media (min-width: 900px) { .cats { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; } }
.book-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
.book-card .cover { transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.book-card:hover .cover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 32px 44px -24px rgba(21, 17, 13, .65), 0 6px 12px -6px rgba(21, 17, 13, .3); }
.cover-play {
  position: absolute; z-index: 2; left: 8cqw; top: 8cqw; display: grid; place-items: center; width: 20cqw; height: 20cqw; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); opacity: 0; transform: scale(.7); transition: opacity .2s, transform .25s var(--ease);
}
.cover-play svg { width: 44%; height: 44%; fill: currentColor; margin-left: 6%; }
.book-card:hover .cover-play, .book-card:focus-visible .cover-play { opacity: 1; transform: none; }
.book-meta { display: flex; flex-direction: column; line-height: 1.5; }
.book-meta strong { font: 700 17px/1.45 var(--display); }
.book-meta > span { color: var(--muted); font-size: 14.5px; }
.book-info { margin-top: 5px; font-size: 13.5px !important; }
.card-meter { display: block; height: 4px; margin-top: 9px; border-radius: 4px; background: var(--line); overflow: hidden; }
.card-meter b { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.book-info.on { color: var(--accent-ink); font-weight: 600; }

/* ---------- home: how it works ---------- */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: how; }
.how-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 26px 26px 28px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line); overflow: hidden;
}
.how-ic { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 10px; border-radius: 15px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.how-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.how-card strong { font: 700 21px/1.4 var(--display); }
.how-card p { color: var(--muted); font-size: 16.5px; }
.how-n { position: absolute; top: 14px; inset-inline-end: 22px; font: 800 54px/1 var(--display); color: var(--ink); opacity: .07; }
@media (max-width: 820px) { .how { grid-template-columns: 1fr; } }

/* ---------- home: Daqiqa band ---------- */
.band {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap;
  padding: clamp(28px, 5vw, 56px); border-radius: clamp(22px, 3vw, 32px); background: #15110d; color: #faf6ee;
}
.band-mark { position: absolute; left: -30px; bottom: -70px; width: 300px; height: 300px; color: #fff; opacity: .06; pointer-events: none; --mark-alt: currentColor; transform: rotate(-10deg); }
.band > div { position: relative; display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.band .eyebrow { color: #ff8a66; }
.band h2 { font: 800 clamp(25px, 3.2vw, 38px)/1.35 var(--display); }
.band p:not(.eyebrow) { color: rgba(250, 246, 238, .7); }
.band .cta { position: relative; background: #faf6ee; color: #15110d; box-shadow: none; }

/* ---------- home: FAQ ---------- */
.faq { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 24px clamp(24px, 5vw, 72px); align-items: start; }
.faq-side { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; position: sticky; top: 96px; }
.faq-side h2 { font: 800 clamp(27px, 3.6vw, 42px)/1.3 var(--display); }
.faq-side p { color: var(--muted); }
.faq-side .cta { margin-top: 8px; }
.faq-list { display: grid; gap: 10px; }
.faq-list details { border: 1px solid var(--line); border-radius: 18px; background: var(--card); transition: border-color .2s; }
.faq-list details[open] { border-color: color-mix(in srgb, var(--ink) 26%, transparent); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; cursor: pointer; list-style: none; font: 700 17.5px/1.5 var(--display); border-radius: 18px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bg2); font: 500 21px/1 var(--font); transition: transform .25s var(--ease); }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding: 0 22px 20px; color: var(--muted); max-width: 42em; }
@media (max-width: 820px) { .faq { grid-template-columns: 1fr; } .faq-side { position: static; } }

/* ---------- footer ---------- */
.foot { margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); font-size: 15px; }
.foot-in { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 32px 28px; padding-block: 48px 36px; }
.foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.foot-brand p { color: var(--muted); max-width: 26em; }
.foot h3 { font: 700 14px/1.5 var(--font); color: var(--muted); margin-bottom: 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { text-decoration: none; }
.foot ul a:hover { color: var(--accent-ink); }
.foot .foot-all a { font-weight: 700; color: var(--accent-ink); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
@media (max-width: 760px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* ---------- book page ---------- */
.book-hero { background: radial-gradient(90% 120% at 85% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), linear-gradient(to bottom, var(--bg), var(--bg2)); border-bottom: 1px solid var(--line); }
.book-hero-in { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(28px, 5vw, 60px); }
.book-hero .cover { width: clamp(210px, 24vw, 290px); box-shadow: 0 0 0 1px var(--line), 0 1px 0 rgba(255, 255, 255, .12) inset, 0 34px 50px -26px rgba(0, 0, 0, .6), 0 6px 14px -6px rgba(0, 0, 0, .35); transform: rotate(-2deg); }
.book-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.book-hero h1 { font: 800 clamp(36px, 5.4vw, 64px)/1.25 var(--display); letter-spacing: -.01em; }
.book-hero .by { font-size: 19px; font-weight: 600; color: var(--accent-ink); }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; }
.facts li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14.5px; font-weight: 500; }
.facts .ic { color: var(--accent); }
.book-hero .hero-actions { margin-top: 14px; }
@media (max-width: 720px) {
  .book-hero-in { grid-template-columns: 1fr; }
  .book-hero .cover { width: 190px; }
}

.eps { padding-block: clamp(32px, 5vw, 56px) 0; }
.eps .section-head { margin-bottom: 20px; align-items: center; }
.eps .section-head h2 { margin: 0; font-size: clamp(25px, 3vw, 34px); }
.eps-progress { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 500; color: var(--muted); }
.eps-progress .meter { width: 120px; margin: 0; }
.episodes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 820px) { .episodes { grid-template-columns: 1fr; } }
.episodes a {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 16px; height: 100%;
  padding: 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); text-decoration: none;
  transition: border-color .18s, transform .2s var(--ease), background-color .18s;
}
.episodes a:hover { border-color: var(--accent); transform: translateY(-2px); }
.ep-n { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 17px/1 var(--display); }
.ep-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ep-t { font: 700 17px/1.5 var(--display); }
.ep-hook { color: var(--muted); font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-d { font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.episodes a.seen .ep-n { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); color: transparent; }
.episodes a.seen .ep-n::after { content: "✓"; position: absolute; color: var(--accent); font-size: 18px; }

.after { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-block: 28px 0; }
@media (max-width: 720px) { .after { grid-template-columns: 1fr; } }
.after:has(> .after-card:only-child) { grid-template-columns: 1fr; }
.after-card {
  display: flex; flex-direction: column; gap: 4px; padding: 22px 24px; border-radius: 20px; text-decoration: none;
  border: 1px solid var(--line); background: var(--card); transition: border-color .18s, transform .2s var(--ease);
}
.after-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.after-card small { font-size: 13.5px; font-weight: 600; color: var(--accent-ink); }
.after-card strong { font: 700 20px/1.45 var(--display); }
.after-card span { color: var(--muted); font-size: 15px; }
.after-card.next { background: radial-gradient(120% 140% at 85% 0%, var(--bg), var(--bg2)); color: var(--ink); border-color: transparent; }

.seo-text { margin-top: 36px; color: var(--muted); font-size: 15.5px; }
.seo-text > summary { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 10px 0; font-weight: 600; color: var(--ink); }
.seo-text > summary::-webkit-details-marker { display: none; }
.seo-text > summary::before { content: "+"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); font: 500 19px/1 var(--font); transition: transform .25s var(--ease); }
.seo-text[open] > summary::before { transform: rotate(45deg); }
.seo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; padding-top: 8px; }
@media (max-width: 820px) { .seo-grid { grid-template-columns: 1fr; } }
.seo-ep h2, .seo-ep h3 { font: 700 17px/1.5 var(--display); color: var(--ink); margin: 18px 0 6px; }
.seo-ep p { margin: 0 0 6px; }

/* ---------- 404 ---------- */
.lost { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding-block: clamp(60px, 12vw, 140px); }
.lost-n { font: 800 clamp(90px, 20vw, 180px)/1 var(--display); color: var(--accent); letter-spacing: -.04em; }
.lost h1 { font: 800 clamp(26px, 4vw, 38px)/1.35 var(--display); }
.lost p { color: var(--muted); }

/* ---------- player ---------- */
.player { min-height: 100dvh; }
.player:not(.live) { max-width: 640px; margin: 0 auto; padding: 32px 20px; }
.player.live {
  position: fixed; inset: 0; overflow-y: scroll; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none; background: #000;
}
.player.live::-webkit-scrollbar { display: none; }
.slide {
  position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(80% 60% at 50% 40%, var(--bg) 0%, var(--bg2) 100%);
}
.frame {
  position: relative; container-type: size;
  width: min(100vw, calc(100dvh * 9 / 16)); height: 100%;
  display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden;
  color: var(--ink); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(130% 80% at 85% 0%, var(--bg) 0%, var(--bg2) 100%);
}
@media (min-width: 560px) {
  .frame { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0,0,0,.5); }
  .slide { background: #0b0b0b; }
}
.frame::before {
  content: var(--glyph); position: absolute; bottom: -8cqh; left: -10cqw; pointer-events: none;
  font: 700 95cqw/1 var(--kufi); color: var(--accent); opacity: .07;
}

.bars { display: flex; gap: 4px; padding: max(12px, env(safe-area-inset-top)) 14px 0; position: relative; z-index: 2; }
.bars i { flex: 1; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 22%, transparent); overflow: hidden; }
.bars b { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: right center; }

/* The left side is kept clear for the fixed logo + account buttons; a long title shortens with "…". */
.slide-top { display: flex; align-items: center; padding: 12px 14px 0 160px; position: relative; z-index: 2; min-width: 0; }
.slide-top .pill { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 30px; }
.slide-top .lang-chip { flex-shrink: 0; }
.pill {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 700; text-decoration: none;
  backdrop-filter: blur(6px);
}
.player-tools {
  position: fixed; z-index: 5; top: max(26px, calc(env(safe-area-inset-top) + 14px)); left: max(14px, calc((100vw - min(100vw, 100dvh * 9 / 16)) / 2 + 14px));
  display: flex; align-items: center; gap: 8px; direction: ltr;
}
.player-brand {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 9px; border-radius: 999px;
  font: 800 15px/1 var(--display); letter-spacing: -.03em; text-decoration: none; color: #fff;
  background: rgba(0,0,0,.28); backdrop-filter: blur(6px); --mark-alt: currentColor;
}
.player-brand .mark { width: 18px; height: 18px; }
.player-brand span { padding-bottom: 1px; }
.player-me { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.28); backdrop-filter: blur(6px); color: #fff; overflow: hidden; }
.player-me-icon svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.frame.is-locked .stage, .frame.is-locked .bars { filter: blur(2px); opacity: .55; }

.stage { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px 7cqw 0 18cqw; min-height: 0; }
.slide-foot { position: relative; z-index: 2; display: flex; flex-direction: column; padding: 10px 16px max(22px, env(safe-area-inset-bottom)) 18cqw; line-height: 1.45; }
.slide-foot strong { font-size: 16px; }
.slide-foot span { font-size: 13px; color: var(--muted); }

.rail { position: absolute; z-index: 3; left: 10px; bottom: max(26px, calc(env(safe-area-inset-bottom) + 14px)); display: flex; flex-direction: column; gap: 14px; }
.rail-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--card); color: var(--ink); backdrop-filter: blur(6px); text-decoration: none;
}
.rail-btn svg { width: 22px; height: 22px; fill: currentColor; }
.rail-btn.on { color: var(--accent); }
.rail-btn.on svg { animation: pop .35s ease; }

.paused-badge {
  position: absolute; inset: 0; margin: auto; z-index: 4; width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; letter-spacing: -2px; color: #fff;
  background: rgba(0,0,0,.45); opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s; pointer-events: none;
}
.paused-badge svg { width: 30px; height: 30px; fill: #fff; }
.is-paused .paused-badge { opacity: 1; transform: none; }
.is-paused *, .is-paused *::before { animation-play-state: paused !important; }

/* beats */
.beat { animation: beatIn .35s ease both; }
.beat p { margin: 0; }
.w { display: inline-block; opacity: 0; animation: wordIn .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d, 0s); }
.still .w { animation: none; opacity: 1; }
.em { color: var(--accent); font-weight: 700; }

.kicker { font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 14px !important; animation: wordIn .5s both; }
.hook-text { font: 700 clamp(26px, 8.4cqw, 40px)/1.45 var(--font); }
.body { font-size: clamp(20px, 6.2cqw, 28px); line-height: 1.75; font-weight: 500; }
.who { font-size: 15px; font-weight: 700; color: var(--accent); margin-bottom: 10px !important; animation: wordIn .4s both; }
.quote { font: 700 clamp(22px, 7cqw, 32px)/1.6 var(--font); }
.list-head { font: 700 clamp(22px, 7cqw, 30px)/1.45 var(--font); margin-bottom: 18px !important; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.items li {
  position: relative; padding: 12px 16px 12px 14px; padding-right: 40px; border-radius: 14px; background: var(--card); border: 1px solid var(--line);
  font-size: clamp(17px, 5.2cqw, 22px); font-weight: 500; line-height: 1.55;
  opacity: 0; animation: itemIn .45s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d);
}
.items li::before { content: ""; position: absolute; right: 16px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--accent); }
.beat-versus { display: grid; gap: 10px; }
.side {
  padding: 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  opacity: 0; animation: itemIn .5s both; animation-delay: var(--d);
}
.side-head { font-size: 14px; font-weight: 700; color: var(--accent); margin-bottom: 4px !important; }
.side p.still { font-size: clamp(18px, 5.6cqw, 24px); font-weight: 500; line-height: 1.6; }
.vs { justify-self: center; font: 700 18px var(--display); color: var(--muted); opacity: 0; animation: wordIn .4s both; animation-delay: var(--d); }
.num { font: 700 clamp(80px, 30cqw, 150px)/1 var(--display); color: var(--accent); margin-bottom: 14px; animation: numIn .7s cubic-bezier(.2,.9,.2,1.1) both; }
.label {
  display: inline-block; align-self: flex-start; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  padding: 5px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); margin-bottom: 16px !important;
  animation: wordIn .4s both;
}
.beat-takeaway, .beat-quiz { display: flex; flex-direction: column; }
.take { font: 700 clamp(22px, 7cqw, 30px)/1.6 var(--font); }

.q { font-size: clamp(20px, 6.2cqw, 27px); font-weight: 700; line-height: 1.55; margin-bottom: 18px !important; }
.options { display: grid; gap: 10px; }
.opt {
  min-height: 54px; padding: 12px 18px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card);
  text-align: right; font-size: clamp(16px, 5cqw, 19px); font-weight: 500; line-height: 1.45; cursor: pointer;
  opacity: 0; animation: itemIn .4s both; animation-delay: var(--d);
  transition: border-color .2s, background-color .2s, opacity .2s;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:disabled { cursor: default; }
.options[data-done] .opt:not(.right):not(.wrong) { opacity: .45; }
.opt.right { border-color: #2fb36b; background: color-mix(in srgb, #2fb36b 22%, transparent); }
.opt.wrong { border-color: #e5484d; background: color-mix(in srgb, #e5484d 20%, transparent); animation: shake .35s; opacity: 1; }
.why { margin-top: 14px !important; font-size: 16px; line-height: 1.65; color: var(--muted); animation: wordIn .4s both; }
.next-ep {
  margin-top: 16px; align-self: flex-start; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--bg2); font-weight: 700; font-size: 16px; animation: wordIn .4s .2s both;
}

/* end + loading */
.frame.end, .frame.loading { display: grid; place-items: center; grid-template-rows: 1fr; }
.end-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 0 9cqw; text-align: center; }
.end-body .label { align-self: center; }
.end-body .end-swipe { margin-top: 10px; font-size: 14px; opacity: .7; animation: end-nudge 1.6s ease-in-out infinite; }
@keyframes end-nudge { 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .end-body .end-swipe { animation: none; } }
.end-body h2 { font: 800 clamp(28px, 9cqw, 42px)/1.35 var(--display); margin: 0 0 4px; }
.score { margin: 0 0 12px; color: var(--muted); font-size: 17px; }
.end-books { display: grid; gap: 10px; margin-top: 8px; }
.end-books a { display: flex; flex-direction: column; padding: 12px 18px; border-radius: 14px; line-height: 1.5; text-decoration: none; background: radial-gradient(120% 120% at 80% 0%, var(--bg), var(--bg2)); color: var(--ink); border: 1px solid var(--line); text-align: right; }
.end-books span { color: var(--muted); font-size: 14px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }

.deck-nav { position: fixed; z-index: 6; top: 50%; transform: translateY(-50%); right: 24px; display: none; flex-direction: column; gap: 10px; }
.deck-nav button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font-size: 20px; cursor: pointer; }
.deck-nav button:hover { background: rgba(255,255,255,.18); }
@media (min-width: 900px) and (hover: hover) { .deck-nav { display: flex; } }

.hint { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); animation: beatIn .3s both; }
.hint-card { width: min(88vw, 360px); padding: 28px 24px; border-radius: 22px; background: #111; color: #fff; text-align: center; display: grid; gap: 12px; }
.hint-card p { margin: 0; color: rgba(255,255,255,.75); }
.hint-card .hint-big { font: 700 22px var(--font); color: #fff; animation: nudge 1.4s ease-in-out infinite; }
.hint-card .cta { --accent: var(--brand); --on-accent: #fff; }

.toast {
  position: fixed; z-index: 30; left: 50%; bottom: 32px; transform: translate(-50%, 20px); opacity: 0;
  padding: 10px 18px; border-radius: 999px; background: #fff; color: #111; font-weight: 500; font-size: 15px;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.noscript { color: #fff; text-align: center; padding: 40px 20px; }

@keyframes beatIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes wordIn { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes itemIn { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes numIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes pop { 50% { transform: scale(1.3); } }
@keyframes shake { 25% { transform: translateX(6px); } 75% { transform: translateX(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes nudge { 50% { transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation-duration: .01ms !important; animation-delay: 0s !important; }
  .w, .items li, .side, .opt, .vs { opacity: 1; }
}

/* ---------- account: header chip ---------- */
.acct { min-height: 40px; display: flex; align-items: center; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); text-decoration: none; font: 500 15px var(--font); cursor: pointer;
  transition: border-color .15s, transform .15s var(--ease);
}
.acct-chip:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.acct-chip.login { padding: 0 18px; white-space: nowrap; background: var(--ink); color: var(--bg); border-color: transparent; font-weight: 700; }
.acct-chip.login:hover { transform: translateY(-1px); }
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; }
.avatar.letter { display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; line-height: 1; }

/* ---------- sign-in sheet ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 8, 6, .55); backdrop-filter: blur(4px); animation: beatIn .25s both;
}
.sheet {
  width: min(100%, 460px); max-height: 92dvh; overflow-y: auto;
  padding: 22px 22px max(22px, env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0;
  background: var(--bg); color: var(--ink); display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 -20px 60px rgba(0,0,0,.35); animation: sheetUp .35s cubic-bezier(.2,.8,.2,1) both;
}
.sheet::before { content: ""; align-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 4px; }
@media (min-width: 560px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 28px; padding: 30px; }
  .sheet::before { display: none; }
}
.sheet h2 { margin: 0; font: 800 25px/1.4 var(--display); }
.sheet-text { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.free-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: #e5f6ec; color: #13703f; font: 700 13px var(--font);
}
.free-badge::before { content: "✓"; }
.free-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14.5px; color: var(--muted); }
.free-list li::before { content: "•"; color: #13703f; font-weight: 700; margin-left: 8px; }
.providers { display: grid; gap: 10px; margin-top: 6px; min-height: 52px; }
.providers .spinner { justify-self: center; }
.provider {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 18px;
  border-radius: 16px; text-decoration: none; font: 700 16px var(--font); border: 1.5px solid transparent;
  transition: transform .12s ease, filter .12s ease;
}
.provider:active { transform: scale(.98); }
.provider:hover { filter: brightness(1.06); }
.provider-logo { display: inline-grid; place-items: center; width: 22px; height: 22px; }
.provider-logo svg { width: 22px; height: 22px; }
.provider-tiktok, .provider-apple { background: #000; color: #fff; }
.provider-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.provider-dev { background: transparent; color: var(--ink); border-color: var(--line); border-style: dashed; }
.skip {
  align-self: center; min-height: 44px; padding: 0 16px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: 500 15px var(--font); text-decoration: underline; text-underline-offset: 4px;
}
.legal { margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.legal a { color: inherit; }

/* ---------- account page ---------- */
.account, .prose { max-width: 760px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) 24px; }
.account > .spinner { display: block; margin: 60px auto; }
.acct-empty { display: flex; flex-direction: column; gap: 16px; padding: 24px 0; }
.acct-empty h1, .acct-head h1 { margin: 0; font: 800 clamp(28px, 5vw, 40px)/1.3 var(--display); }
.acct-empty .lede { margin: 0; }
.acct-empty .cta { align-self: flex-start; }
.acct-head { display: flex; align-items: center; gap: 20px; padding: 8px 0 28px; }
.acct-head .muted { margin: 4px 0 10px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats div { display: flex; flex-direction: column; gap: 2px; padding: 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.stats strong { font: 800 34px/1.15 var(--display); color: var(--accent); }
.stats span { font-size: 14.5px; color: var(--muted); }
.account h2 { font: 800 23px/1.4 var(--display); margin: 36px 0 14px; }
.acct-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.acct-book {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 20px; text-decoration: none;
  background: radial-gradient(120% 120% at 80% 0%, var(--bg), var(--bg2)); color: var(--ink);
  transition: transform .2s var(--ease);
}
.acct-book:hover { transform: translateY(-3px); }
.acct-book strong { font: 700 18px/1.45 var(--display); }
.acct-book span { font-size: 14px; color: var(--muted); }
.meter { display: block; height: 5px; margin-top: 8px; border-radius: 5px; background: var(--line); overflow: hidden; }
.meter b { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.danger {
  min-height: 54px; padding: 0 24px; border-radius: 999px; border: 1.5px solid #e5484d33; background: transparent;
  color: #c62f35; font: 600 16.5px var(--font); cursor: pointer;
}
.danger:hover { background: #e5484d12; }
.prose h1 { font: 800 clamp(31px, 5vw, 46px)/1.3 var(--display); margin: 0 0 14px; }
.prose .lede { margin-bottom: 8px; }
.prose h2 { font: 700 21px/1.45 var(--display); margin: 34px 0 8px; }
.prose p { margin: 0 0 10px; }
.prose a { color: var(--accent-ink); text-underline-offset: 4px; }

@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes screen { 0% { opacity: 0; } 2.5%, 33.3% { opacity: 1; } 36%, 100% { opacity: 0; } }
@keyframes pbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .w, .items li, .side, .opt, .vs { opacity: 1; }
  .phone-screen, .p-bars i:first-child b { animation: none !important; }
  .phone-screen:first-child { opacity: 1; }
  .p-bars i:first-child b { transform: scaleX(.6); }
  .spinner { animation-duration: .8s !important; animation-iteration-count: infinite !important; }
}

/* ---------- recommendations: "for you", interest picker, why-chip ---------- */
.for-you { margin: 8px 0 40px; }
.for-you-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.for-you-head h2 { margin: 0; font: 700 24px var(--display); }
.ghost.small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.for-you-grid .book-card { position: relative; }
.why-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  font: 600 12px var(--font); white-space: nowrap;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}
.for-you-grid .why-chip { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2; background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(4px); }
.slide-top { gap: 8px; }
.slide-foot .why-chip { align-self: flex-start; margin-bottom: 6px; background: rgba(0,0,0,.3); color: #fff; backdrop-filter: blur(6px); }

.interests { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 8px; }
.interest {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; min-height: 64px;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; text-align: start;
  transition: border-color .15s, background-color .15s, transform .1s;
}
.interest strong { font: 700 16px var(--font); }
.interest span { font-size: 13px; color: var(--muted); }
.interest[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.interest[aria-pressed="true"] strong::after { content: " ✓"; color: var(--accent); }
.interest:active { transform: scale(.98); }
.interests-wrap .cta:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- save (المحفوظات) ---------- */
.rail-btn.save.on { color: #f5b800; }
.rail-btn.save.on svg { animation: pop .35s ease; }
.acct { gap: 8px; }
.saved-link {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none;
}
.saved-link svg { width: 18px; height: 18px; fill: currentColor; }
.saved-link b {
  position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand); color: #fff; font: 700 11px/18px var(--font); text-align: center;
}
.saved { max-width: 760px; margin: 0 auto; padding: 24px 20px 64px; }
.saved > .spinner { display: block; margin: 60px auto; }
.saved-head h1 { margin: 8px 0 6px; font: 700 clamp(28px, 6vw, 38px)/1.25 var(--display); }
.saved-head .lede { margin: 0 0 22px; }
.saved .cta { align-self: flex-start; }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.saved-item {
  display: flex; align-items: stretch; border-radius: 16px; overflow: hidden;
  background: radial-gradient(120% 140% at 85% 0%, var(--bg), var(--bg2)); color: var(--ink);
}
.saved-main { flex: 1; display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; text-decoration: none; min-width: 0; }
.saved-ep { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.saved-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.saved-text strong { font-size: 17px; }
.saved-text span { font-size: 13px; color: var(--muted); }
.saved-text em { font-style: normal; font-size: 14px; line-height: 1.55; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.saved-remove { flex: none; width: 48px; border: 0; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
.saved-remove:hover { color: var(--ink); }

/* ---------- share sheet (إرسال إلى) ---------- */
.share-wrap .sheet { gap: 14px; }
.share-head { display: flex; align-items: center; justify-content: center; position: relative; }
.share-head h2 { font-size: 20px; }
.share-close {
  position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); font-size: 15px; cursor: pointer;
}
.share-what { margin: -6px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.share-targets {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 6px;
  border-top: 1px solid var(--line); padding-top: 18px;
}
.share-target {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 0; background: none; padding: 0; color: var(--ink); text-decoration: none; cursor: pointer; font: inherit;
}
.share-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; transition: transform .12s ease; }
.share-target:active .share-icon { transform: scale(.92); }
.share-icon svg { width: 28px; height: 28px; }
.share-whatsapp { background: #25d366; }
.share-telegram { background: #229ed9; }
.share-tiktok { background: #000; box-shadow: inset -2px -2px 0 #25f4ee55, inset 2px 2px 0 #fe2c5555; }
@media (min-width: 560px) { .share-targets { grid-template-columns: repeat(6, 1fr); } }
.share-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.share-facebook { background: #1877f2; }
.share-copy { background: #8a8f98; }
.share-more { background: #3b82f6; }
.share-more svg { width: 26px; height: 26px; }
.share-label { font-size: 13px; line-height: 1.3; text-align: center; }
/* Many categories (more than 8): three per row, smaller tiles, so the picker stays one screen. */
.interests.many { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.interests.many .interest { min-height: 0; padding: 10px 10px; border-radius: 12px; }
.interests.many .interest strong { font-size: 14px; line-height: 1.35; }
.interests.many .interest span { font-size: 12px; }

/* ---------- reading language ---------- */
.lang-chip {
  margin-inline-start: 8px; height: 32px; min-width: 40px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); font: 700 13px var(--font); backdrop-filter: blur(6px);
}
.lang-link {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 700 14px var(--font);
}
.lang-options { display: grid; gap: 8px; }
.lang-option {
  display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 18px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 600 17px var(--font); cursor: pointer;
}
.lang-option[aria-pressed="true"] { border-color: var(--accent); }
.lang-option b { color: var(--accent); }
/* Left-to-right book text (English, Chinese…): progress fills from the left, lists and answers align left. */
.frame[data-dir="ltr"] .bars { direction: ltr; }
.frame[data-dir="ltr"] .bars b { transform-origin: left center; }
.stage[dir="ltr"] .opt { text-align: left; }
.stage[dir="ltr"] .items li { padding: 12px 16px 12px 40px; }
.stage[dir="ltr"] .items li::before { right: auto; left: 16px; }
.stage[lang="zh"], .stage[lang="zh-Hant"], .stage[lang="ja"] { font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", sans-serif; }
