/* =====================================================================
   Audioers — listener design system
   Mobile-first. Deep-navy canvas, single violet accent, cinematic art.
   ===================================================================== */
:root {
  --bg: #08091a;
  --bg-2: #0d0e22;
  --surface: #14152d;
  --surface-2: #1b1c3a;
  --surface-3: #24264a;
  --border: #25274a;
  --border-soft: rgba(255,255,255,.06);
  --text: #f4f4fb;
  --muted: #a1a2c0;
  --dim: #6f7090;
  --accent: #7b5cff;
  --accent-hi: #9479ff;
  --accent-lo: #6644f2;
  --accent-soft: rgba(123,92,255,.16);
  --grad: linear-gradient(90deg, #6d5bff 0%, #c04bf2 55%, #ff8a3d 100%);
  --gold: #f5b942;
  --green: #22c55e;
  --red: #f05252;
  --orange: #f59e0b;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --tabbar-h: 64px;
  --mini-h: 64px;
  --sidebar-w: 240px;
  --dock-h: 88px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}
body.has-player { padding-bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-b) + 8px); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
.icon { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 14px; height: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }
.main { padding: 0 16px 24px; max-width: 1480px; margin: 0 auto; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.section-head h2 { font-size: 18px; font-weight: 700; }
.section-head a { color: var(--accent-hi); font-size: 13px; font-weight: 600; }
.page-title { font-size: 26px; font-weight: 800; padding-top: 18px; }
.page-sub { color: var(--muted); margin-top: 4px; }

/* ---------- Top bar (mobile) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: linear-gradient(var(--bg) 70%, rgba(8,9,26,0));
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; }
.topbar .spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--text); transition: background .15s; }
.icon-btn:hover { background: var(--surface-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Sidebar (desktop) ---------- */
.sidebar { display: none; }

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: rgba(13,14,34,.96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft); display: grid; grid-template-columns: repeat(5, 1fr);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--dim); font-weight: 500; }
.tabbar a.active { color: var(--accent-hi); }
.tabbar a.active .icon { filter: drop-shadow(0 0 8px rgba(123,92,255,.6)); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px;
  border-radius: 12px; font-weight: 700; font-size: 15px; transition: transform .08s, background .15s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(123,92,255,.35); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-light { background: #fff; color: #111; }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-outline { border: 1px solid var(--border); }
.btn-gold { background: linear-gradient(135deg, #f7c95c, #e79a1e); color: #241600; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-soft); display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.active, .chip:hover { background: var(--accent); color: #fff; border-color: transparent; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.badge-free { background: rgba(34,197,94,.14); color: #4ade80; }
.badge-premium { background: rgba(245,185,66,.14); color: var(--gold); }
.badge-soft { background: var(--surface-3); color: var(--muted); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; color: var(--muted); font-size: 13px; }
.meta > * + *::before { content: ""; display: inline-block; width: 1px; height: 11px; background: var(--dim); margin-right: 8px; vertical-align: -1px; }

/* ---------- Hero carousel ---------- */
.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-top: 4px; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 16 / 11; background: var(--surface); }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,9,26,.05) 20%, rgba(8,9,26,.55) 55%, rgba(8,9,26,.95) 100%); }
.hero-body { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 34px; }
.hero-body h2 { font-size: 26px; font-weight: 800; max-width: 16ch; }
.hero-body .meta { color: #d8d8ea; margin: 6px 0 14px; }
.hero-body .tagline { display: none; color: #d8d8ea; max-width: 52ch; margin-top: 6px; }
.hero-dots { position: absolute; z-index: 2; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.hero-dots button { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.35); transition: width .2s, background .2s; }
.hero-dots button.active { width: 18px; background: #fff; }
.hero-nav { display: none; }

/* ---------- Rails & cards ---------- */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 38%; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; scroll-padding-inline: 16px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.card { display: block; min-width: 0; }
.card-art { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-art img { transform: scale(1.04); }
.card-art .badge { position: absolute; top: 8px; left: 8px; backdrop-filter: blur(6px); }
.card-play { position: absolute; right: 8px; bottom: 8px; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; opacity: 0; transform: translateY(6px); transition: .2s; box-shadow: var(--shadow); }
.card:hover .card-play { opacity: 1; transform: none; }
.card-title { font-weight: 700; font-size: 14px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }

.cat-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 84px; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.cat-rail::-webkit-scrollbar { display: none; }
.cat-tile { aspect-ratio: 1; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 600; transition: background .15s, border-color .15s; }
.cat-tile:hover { background: var(--surface-2); border-color: var(--border); }
.cat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }

/* Continue-listening cards */
.cl-rail { grid-auto-columns: 82%; }
.cl-card { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 10px; }
.cl-card img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.cl-info { flex: 1; min-width: 0; }
.cl-info .t { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-info .s { color: var(--muted); font-size: 12px; }
.progress { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.round-play { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; flex: none; }
.round-play .icon { width: 18px; height: 18px; margin-left: 2px; }

/* ---------- Title (series / story) page ---------- */
.title-hero { position: relative; margin: 0 -16px; }
.title-backdrop { position: absolute; inset: 0; overflow: hidden; }
.title-backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(40px) saturate(1.3); opacity: .45; transform: scale(1.2); }
.title-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,9,26,.2), var(--bg) 92%); }
.title-inner { position: relative; padding: 8px 16px 0; }
.title-art { width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.title-art img { width: 100%; height: 100%; object-fit: cover; }
.title-info { margin-top: 18px; }
.title-info h1 { font-size: 26px; font-weight: 800; }
.title-info .meta { margin-top: 6px; }
.title-credits { color: var(--muted); font-size: 13px; margin-top: 6px; }
.title-credits b { color: var(--text); font-weight: 600; }
.title-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; margin-top: 16px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 6px 0; border-radius: 12px; }
.act .ring { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--text); transition: background .15s; }
.act:hover .ring { background: var(--surface-3); }
.act.on .ring { color: #ff5c8a; }
.desc { color: #cfd0e4; margin-top: 16px; font-size: 14px; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more-link { color: var(--accent-hi); font-size: 13px; font-weight: 600; margin-top: 4px; }

.free-note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 12px 14px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.free-note .icon { color: var(--accent-hi); }

.ep-list { display: flex; flex-direction: column; }
.ep { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.ep:last-child { border-bottom: 0; }
.ep-art { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex: none; background: var(--surface); }
.ep-art img { width: 100%; height: 100%; object-fit: cover; }
.ep-art .num { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,9,26,.45); font-weight: 800; font-size: 15px; }
.ep-body { flex: 1; min-width: 0; }
.ep-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-sub { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ep .progress { margin-top: 6px; }
.ep-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text); }
.ep-btn.locked { color: var(--gold); }
.ep.playing .ep-title { color: var(--accent-hi); }
.ep.playing .ep-btn { background: var(--accent); }
.done-tick { color: var(--green); }

/* ---------- Library ---------- */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 999px; padding: 4px; gap: 4px; margin-top: 14px; overflow-x: auto; max-width: 100%; }
.seg a { padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg a.active { background: var(--accent); color: #fff; }
.list-card { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.list-card img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius-lg); margin-top: 20px; }
.empty .icon { width: 44px; height: 44px; color: var(--accent-hi); margin-bottom: 12px; }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ---------- Forms & auth ---------- */
.auth-wrap { min-height: calc(100vh - var(--tabbar-h)); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; font-size: 26px; margin-bottom: 26px; }
.auth-card .brand img { width: 40px; height: 40px; }
.auth-card h1 { font-size: 24px; font-weight: 800; }
.auth-card .sub { color: var(--muted); margin: 4px 0 20px; }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tabs2 a { text-align: center; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--muted); font-size: 14px; }
.tabs2 a.active { background: var(--accent); color: #fff; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #d4d5e8; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon { position: absolute; left: 14px; color: var(--dim); pointer-events: none; }
.input, .select {
  width: 100%; height: 50px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  padding: 0 14px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input-wrap .input { padding-left: 44px; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .err { color: #ff8a8a; font-size: 12px; margin-top: 5px; }
.field.has-err .input, .field.has-err .select { border-color: var(--red); }
.field-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 16px; }
.field-row a, .link { color: var(--accent-hi); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.fine { color: var(--dim); font-size: 12px; text-align: center; margin-top: 18px; }
.fine a { color: var(--accent-hi); }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-error { background: rgba(240,82,82,.12); color: #ffb0b0; border: 1px solid rgba(240,82,82,.3); }
.alert-success { background: rgba(34,197,94,.12); color: #9ff0bd; border: 1px solid rgba(34,197,94,.3); }
.alert-info { background: var(--accent-soft); color: #d6ccff; border: 1px solid rgba(123,92,255,.35); }
.flash-stack { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 90; width: min(92vw, 460px); }

/* Settings / profile list */
.profile-head { display: flex; align-items: center; gap: 14px; padding-top: 18px; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 22px; }
.plan-card { margin-top: 18px; border-radius: var(--radius); padding: 16px; background: linear-gradient(135deg, rgba(245,185,66,.18), rgba(123,92,255,.14)); border: 1px solid rgba(245,185,66,.25); display: flex; gap: 12px; align-items: center; }
.plan-card .icon { color: var(--gold); width: 28px; height: 28px; }
.menu-list { margin-top: 18px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-soft); overflow: hidden; }
.menu-list a, .menu-list .row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.menu-list a:last-child, .menu-list .row:last-child { border-bottom: 0; }
.menu-list .grow { flex: 1; }
.menu-list small { display: block; color: var(--muted); font-size: 12px; }
.danger-text { color: #ff7b7b; }
.card-box { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; margin-top: 18px; }
.toggle { position: relative; width: 44px; height: 26px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 13px; transition: .2s; cursor: pointer; }
.toggle span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(18px); }

/* Search */
.search-box { position: relative; margin-top: 14px; }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.search-box .input { padding-left: 44px; border-radius: 999px; height: 46px; }
.suggest { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.suggest a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.suggest a:hover, .suggest a.hl { background: var(--surface-3); }
.suggest img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }

/* Pricing page */
.plans { display: grid; gap: 14px; margin-top: 18px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.plan h3 { font-size: 18px; }
.plan .price { font-size: 30px; font-weight: 800; margin: 8px 0 2px; }

/* =====================================================================
   PLAYER
   ===================================================================== */
.player-root { position: fixed; z-index: 45; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); pointer-events: none; }
.player-root[hidden] { display: none; }
.mini {
  pointer-events: auto; margin: 0 8px 8px; height: var(--mini-h); border-radius: 14px; background: rgba(30,28,62,.97);
  backdrop-filter: blur(14px); border: 1px solid var(--border-soft); box-shadow: var(--shadow); display: flex; align-items: center;
  gap: 10px; padding: 0 8px 0 8px; position: relative; overflow: hidden;
}
.mini-art { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-3); }
.mini-text { flex: 1; min-width: 0; cursor: pointer; }
.mini-text .t { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text .s { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bar { position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: rgba(255,255,255,.12); }
.mini-bar span { display: block; height: 100%; background: var(--accent-hi); width: 0; }
.pbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); flex: none; transition: background .15s, opacity .15s; }
.pbtn:hover { background: rgba(255,255,255,.08); }
.pbtn[disabled] { opacity: .35; pointer-events: none; }
.pbtn.main { width: 64px; height: 64px; background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(123,92,255,.45); }
.pbtn.main:hover { background: var(--accent-hi); }
.pbtn.main .icon { width: 28px; height: 28px; }
.pbtn.small-main { background: #fff; color: #111; width: 40px; height: 40px; }
.pbtn.small-main .icon { width: 18px; height: 18px; }
.mini .hide-sm { display: none; }
.spin { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dock-meta, .dock-side { display: none; }

/* Full-screen player (mobile sheet; desktop modal panel) */
.full {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; pointer-events: auto;
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); overflow-y: auto; visibility: hidden;
}
.full.open { transform: none; visibility: visible; }
.full-bg { position: absolute; inset: 0; overflow: hidden; z-index: -1; }
.full-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(60px) saturate(1.4); opacity: .35; transform: scale(1.3); }
.full-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,9,26,.3), var(--bg) 85%); }
.full-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 0; }
.full-head .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; text-align: center; flex: 1; }
.full-body { flex: 1; display: flex; flex-direction: column; padding: 8px 24px calc(20px + var(--safe-b)); max-width: 520px; width: 100%; margin: 0 auto; }
.full-art { width: 100%; aspect-ratio: 1; border-radius: 20px; overflow: hidden; margin: 12px auto 22px; box-shadow: 0 30px 70px rgba(0,0,0,.55); max-width: 400px; background: var(--surface); }
.full-art img { width: 100%; height: 100%; object-fit: cover; }
.full-title { text-align: center; }
.full-title h2 { font-size: 22px; font-weight: 800; }
.full-title .ep { display: block; border: 0; padding: 4px 0 0; color: var(--muted); font-size: 14px; }
.full-title .lang { color: var(--accent-hi); font-size: 13px; font-weight: 600; margin-top: 2px; }
.scrub { margin-top: 22px; }
.range { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.range-track { position: absolute; left: 0; right: 0; top: 50%; height: 5px; margin-top: -2.5px; background: rgba(255,255,255,.14); border-radius: 3px; overflow: hidden; }
.range-buf { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.14); }
.range-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #8b5cf6, #d946ef); }
.range-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.55); }
.range-thumb { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; background: #fff; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.controls .pbtn .icon { width: 26px; height: 26px; }
.toolbar { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 26px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); padding: 6px 0; border-radius: 10px; }
.tool:hover { color: var(--text); }
.tool.on { color: var(--accent-hi); }
.tool .val { font-weight: 700; font-size: 13px; color: var(--text); height: 22px; display: grid; place-items: center; }
.paywall { margin-top: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.paywall .icon { color: var(--gold); width: 30px; height: 30px; }
.paywall h3 { margin: 8px 0 4px; font-size: 17px; }
.paywall p { color: var(--muted); font-size: 14px; }
.paywall .btns { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* Bottom sheets */
.sheet-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); opacity: 0; visibility: hidden; transition: .2s; pointer-events: auto; }
.sheet-scrim.open { opacity: 1; visibility: visible; }
.sheet {
  position: fixed; z-index: 71; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto; background: var(--bg-2);
  border-radius: 22px 22px 0 0; border-top: 1px solid var(--border); padding: 10px 20px calc(24px + var(--safe-b));
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); pointer-events: auto;
}
.sheet.open { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 8px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 14px; }
.sheet-head h3 { font-size: 17px; }
.sheet h4 { font-size: 15px; margin: 18px 0 10px; }
.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opt { height: 44px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-soft); font-weight: 600; font-size: 14px; }
.opt.on { background: var(--accent); border-color: transparent; color: #fff; }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.sheet-list { display: flex; flex-direction: column; gap: 4px; }
.sl-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; text-align: left; width: 100%; }
.sl-item:hover { background: var(--surface-2); }
.sl-item.on { background: var(--accent-soft); outline: 1px solid rgba(123,92,255,.4); }
.sl-item .n { width: 28px; color: var(--dim); font-weight: 700; font-size: 13px; text-align: center; flex: none; }
.sl-item .b { flex: 1; min-width: 0; }
.sl-item .b .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-item .b .s { color: var(--muted); font-size: 12px; }
.sl-item .lock { color: var(--gold); }

/* Up-next countdown */
.upnext { position: fixed; z-index: 75; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-b) + 20px); background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); pointer-events: auto; display: flex; gap: 12px; align-items: center; }
.upnext[hidden] { display: none; }
.upnext .ring-count { position: relative; width: 52px; height: 52px; flex: none; }
.upnext .ring-count svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.upnext .ring-count circle { fill: none; stroke-width: 4; }
.upnext .ring-count .bg { stroke: var(--surface-3); }
.upnext .ring-count .fg { stroke: var(--accent-hi); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.upnext .ring-count b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; }
.upnext .info { flex: 1; min-width: 0; }
.upnext .info small { color: var(--accent-hi); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.upnext .info div { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext .btns { display: flex; gap: 6px; flex: none; }
.full.open ~ .upnext { bottom: 24px; }

.toast { position: fixed; z-index: 95; left: 50%; bottom: calc(var(--tabbar-h) + var(--mini-h) + 28px); transform: translateX(-50%); background: #fff; color: #111; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* Embed */
body.embed { padding: 0; background: transparent; }
.embed-card { display: flex; gap: 14px; align-items: center; padding: 14px; background: linear-gradient(135deg, #15132f, #0c0d22); border: 1px solid var(--border); border-radius: 16px; min-height: 150px; }
.embed-card .art { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; flex: none; }
.embed-card .body { flex: 1; min-width: 0; }
.embed-card .t { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.embed-card .s { color: var(--muted); font-size: 12px; }
.embed-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.embed-row .range { flex: 1; }
.embed-brand { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 700; }
.embed-brand img { width: 16px; height: 16px; }

/* Footer */
.site-footer { color: var(--dim); font-size: 12px; padding: 30px 16px 10px; text-align: center; }
.site-footer a { color: var(--muted); margin: 0 8px; }

/* =====================================================================
   Tablet
   ===================================================================== */
@media (min-width: 640px) {
  .rail { grid-auto-columns: 26%; }
  .cl-rail { grid-auto-columns: 46%; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .hero-slide { aspect-ratio: 16 / 8; }
  .hero-body .tagline { display: block; }
  .hero-body h2 { font-size: 34px; }
  .title-inner { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: end; padding-top: 24px; }
  .title-art { margin: 0; }
  .title-info { margin: 0; }
  .title-info h1 { font-size: 34px; }
  .title-actions { grid-template-columns: repeat(auto-fill, 88px); }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .upnext { left: auto; right: 20px; width: 420px; }
  .embed-card .art { width: 140px; height: 140px; }
}

/* =====================================================================
   Desktop: sidebar + docked player bar
   ===================================================================== */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  body.has-player { padding-bottom: var(--dock-h); }
  .tabbar, .topbar .m-only { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); z-index: 35;
    background: var(--bg-2); border-right: 1px solid var(--border-soft); padding: 20px 14px;
  }
  body.has-player .sidebar { bottom: var(--dock-h); }
  .sidebar .brand { padding: 0 8px 22px; }
  .sidebar .brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-top: -2px; }
  .side-group { margin-top: 14px; }
  .side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 700; padding: 0 12px 6px; }
  .side-link { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
  .side-link:hover { background: var(--surface); color: var(--text); }
  .side-link.active { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(123,92,255,.3); }
  .side-foot { margin-top: auto; }
  .side-promo { background: linear-gradient(135deg, rgba(123,92,255,.25), rgba(192,75,242,.15)); border: 1px solid rgba(123,92,255,.3); border-radius: var(--radius); padding: 14px; font-size: 13px; color: var(--muted); }
  .side-promo b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
  .app { margin-left: var(--sidebar-w); }
  .main { padding: 0 32px 40px; }
  .topbar { padding: 16px 32px; background: rgba(8,9,26,.85); backdrop-filter: blur(12px); }
  .topbar .brand { display: none; }
  .topbar .search-box { margin: 0; width: 420px; }
  .rail { grid-auto-columns: calc((100% - 5 * 16px) / 6); gap: 16px; margin: 0; padding: 0; }
  .cl-rail { grid-auto-columns: calc((100% - 2 * 16px) / 3); }
  .cat-rail { grid-auto-columns: 110px; margin: 0; padding: 0; gap: 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 22px 16px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .hero-slide { aspect-ratio: 21 / 8; }
  .hero-body { left: 84px; right: 84px; bottom: 44px; }
  .hero-body h2 { font-size: 44px; }
  .hero-nav { display: grid; position: absolute; z-index: 2; top: 50%; right: 16px; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.35); place-items: center; backdrop-filter: blur(6px); }
  .hero-nav.prev { right: auto; left: 16px; }
  .title-hero { margin: 0 -32px; }
  .title-inner { grid-template-columns: 300px 1fr; padding: 28px 32px 0; gap: 36px; }
  .title-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; }
  .auth-wrap { min-height: 100vh; }

  /* Docked player */
  .player-root { bottom: 0; }
  .mini { margin: 0; height: var(--dock-h); border-radius: 0; border: 0; border-top: 1px solid var(--border); background: rgba(13,14,34,.98); padding: 0 24px; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(360px, 2fr) minmax(240px, 1fr); gap: 24px; }
  .mini-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .mini-art { width: 56px; height: 56px; }
  .mini .hide-sm { display: flex; }
  .mini .m-ctrl { display: none; }
  .mini-bar { display: none; }
  .dock-meta { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .dock-btns { display: flex; align-items: center; gap: 10px; }
  .dock-scrub { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .dock-scrub .range { flex: 1; }
  .dock-side { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
  .vol { width: 100px; }
  .full { left: auto; right: 0; top: 0; bottom: var(--dock-h); width: 460px; border-left: 1px solid var(--border); transform: translateX(105%); box-shadow: -20px 0 60px rgba(0,0,0,.4); }
  .full.open { transform: none; }
  .full .full-close-down { display: none; }
  .sheet { left: auto; right: 24px; bottom: calc(var(--dock-h) + 16px); width: 420px; border-radius: 20px; border: 1px solid var(--border); transform: translateY(20px); opacity: 0; visibility: hidden; transition: .2s; }
  .sheet.open { transform: none; opacity: 1; visibility: visible; }
  .upnext { bottom: calc(var(--dock-h) + 16px); }
  .full.open ~ .upnext { bottom: calc(var(--dock-h) + 16px); right: 480px; }
  .toast { bottom: calc(var(--dock-h) + 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* visibility helpers */
.d-only { display: none !important; }
@media (min-width: 1024px) {
  .d-only { display: block !important; }
  .m-only { display: none !important; }
}

/* mini-player left block (mobile) */
.mini-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.ad-playing .range, .ad-playing [data-act="back"], .ad-playing [data-act="fwd"], .ad-playing [data-act="next"], .ad-playing [data-act="prev"] { pointer-events: none; opacity: .4; }
/* in-app navigation progress */
html.is-loading body::before { content: ""; position: fixed; z-index: 100; top: 0; left: 0; height: 2px; width: 40%; background: var(--grad); animation: navbar 1s ease-in-out infinite; }
@keyframes navbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.title-layout aside { margin-top: 8px; }
@media (min-width: 1024px) { .title-layout aside { margin-top: 26px; } }

[hidden] { display: none !important; }
.sl-item .b .t, .sl-item .b .s { display: block; }
body.embed .player-root { position: static; pointer-events: auto; padding: 8px; }

/* =====================================================================
   Commerce (Phase 2)
   ===================================================================== */
button.link { background: none; border: 0; padding: 0; color: var(--accent-hi); font-weight: 600; cursor: pointer; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.lbl { display: block; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.crumb-line { color: var(--dim); font-size: 12px; padding-top: 18px; }
.crumb-line a:hover { color: var(--text); }
.grow { flex: 1; min-width: 0; }

.plan-hl { border-color: rgba(123,92,255,.6); background: linear-gradient(180deg, rgba(123,92,255,.14), var(--surface) 60%); }
.ticks { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 8px; font-size: 14px; color: #d4d5e8; }
.ticks li { display: flex; gap: 8px; align-items: center; }
.ticks .icon { color: var(--green); }

.pass-offer { display: flex; gap: 16px; align-items: center; margin-top: 18px; padding: 16px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(245,185,66,.16), rgba(123,92,255,.12)); border: 1px solid rgba(245,185,66,.3); flex-wrap: wrap; }
.pass-offer img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; }
.pass-offer h2 { font-size: 20px; margin: 6px 0 2px; }
.pass-offer .price { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.pass-offer .pass-buy { text-align: right; }
.pass-offer.compact { margin-top: 16px; padding: 14px; border-radius: var(--radius); }

.checkout { max-width: 980px; }
.checkout-grid { display: grid; gap: 0 18px; align-items: start; }
.summary-item { display: flex; gap: 14px; align-items: center; }
.summary-item img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; }
.summary-item h2 { font-size: 18px; margin: 6px 0 2px; }
.conflict { border-color: rgba(245,165,36,.4); background: rgba(245,165,36,.08); }
.pay-methods { display: grid; gap: 8px; }
.pay-method { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-weight: 600; font-size: 14px; }
.pay-method:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pay-method input { accent-color: var(--accent); width: 18px; height: 18px; }
.total-box { position: sticky; top: 84px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--border-soft); }
.sum-row:last-of-type { border-bottom: 0; }
.sum-row.total { font-size: 18px; font-weight: 800; padding-top: 12px; }
.sum-row > span:first-child { color: var(--muted); }
.sum-row.total > span:first-child { color: var(--text); }

.result-wrap { max-width: 520px; margin: 0 auto; text-align: center; padding: 40px 0 10px; }
.result-wrap h1 { font-size: 26px; margin: 14px 0 6px; }
.result-wrap > .btn, .result-wrap > div > .btn { margin-top: 18px; }
.result-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; }
.result-ic .icon { width: 34px; height: 34px; }
.result-ic.ok { background: rgba(34,197,94,.16); color: #4ade80; }
.result-ic.wait { background: rgba(245,165,36,.16); color: var(--orange); }
.result-ic.bad { background: rgba(240,82,82,.16); color: #ff8a8a; }
.receipt { text-align: left; }

.ledger { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.ledger:empty { display: none; }
.ledger-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row b { display: block; font-size: 14px; font-weight: 600; }
.ledger-row small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.ledger-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ledger-ic.in { background: rgba(34,197,94,.14); color: #4ade80; }
.ledger-ic.out { background: rgba(240,82,82,.12); color: #ff9b9b; }
.ledger-ic.neutral { background: var(--surface-3); color: var(--muted); }
.ledger-amt { text-align: right; font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger-amt.pos { color: #4ade80; }
.ledger-amt small { margin-top: 4px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill-ok { background: rgba(34,197,94,.14); color: #4ade80; }
.pill-warn { background: rgba(245,165,36,.16); color: #fbbf24; }
.pill-bad { background: rgba(240,82,82,.14); color: #ff9b9b; }
.pill-muted { background: var(--surface-3); color: var(--muted); }

.wallet-hero { margin-top: 16px; display: grid; gap: 12px; }
.bal-main { padding: 20px; border-radius: var(--radius-lg); background: radial-gradient(120% 140% at 0% 0%, rgba(123,92,255,.35), transparent 60%), var(--surface); border: 1px solid rgba(123,92,255,.3); }
.bal-big { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 14px; font-variant-numeric: tabular-nums; }
.bal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bal-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.bal-grid > div { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px; min-width: 0; }
.bal-grid b { display: block; font-size: 20px; margin: 2px 0; font-variant-numeric: tabular-nums; }
.bal-grid small { color: var(--dim); font-size: 11.5px; display: block; }
.ref-box { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.ref-code { font-size: 22px; font-weight: 800; letter-spacing: .1em; margin-top: 4px; padding: 6px 14px; border-radius: 10px; border: 1px dashed rgba(123,92,255,.6); background: var(--accent-soft); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.stat-row > div { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.stat-row b { display: block; font-size: 18px; }
.stat-row span { color: var(--muted); font-size: 12px; }
.steps { display: flex; gap: 8px; padding: 0; margin: 16px 0 0; list-style: none; counter-reset: s; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 6px; }
.steps li::before { content: counter(s); width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); color: var(--text); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.steps li + li::after { content: none; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(245,165,36,.1); border: 1px solid rgba(245,165,36,.3); color: #fde3a7; font-size: 13.5px; margin: 12px 0 16px; }
.notice .icon { color: var(--orange); margin-top: 1px; }
.seg label { padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg label.active { background: var(--accent); color: #fff; }
.wallet-mini { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.wallet-mini > div { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.wallet-mini b { display: block; font-size: 17px; margin-top: 2px; }

@media (max-width: 639px) {
  .bal-grid, .stat-row { grid-template-columns: 1fr; }
  .bal-grid > div { display: flex; flex-direction: column; }
  .pass-offer .pass-buy { text-align: left; width: 100%; }
  .wallet-mini { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .checkout-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .wallet-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); align-items: stretch; }
  .bal-grid > div { display: flex; flex-direction: column; justify-content: center; }
}
/* keep closed sheets out of the accessibility tree and off-screen captures */
.sheet { visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s; }
.sheet.open { visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
@media (min-width: 1024px) { .sheet, .sheet.open { transition: .2s; } }

/* =====================================================================
   Episode brief + photographic explanation (Phase 3)
   ===================================================================== */
.brief-card { display: grid; gap: 16px; margin-top: 20px; padding: 16px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); }
.brief-card figure { margin: 0; }
.brief-card button[data-lightbox] { display: block; width: 100%; border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.brief-lead img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .3s; }
.brief-lead button:hover img, .brief-gallery button:hover img { transform: scale(1.03); }
.brief-card figcaption { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.4; }
.brief-text { color: #dcdcef; font-size: 15px; line-height: 1.65; margin-top: 10px; }
.brief-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.brief-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.ep-brief { margin-top: 6px; }
.ep-brief summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--accent-hi); font-size: 12px; font-weight: 600; list-style: none; }
.ep-brief summary::-webkit-details-marker { display: none; }
.brief-compact { padding: 8px 0 2px; }
.brief-compact p { color: #cfd0e4; font-size: 13px; line-height: 1.55; white-space: normal; }
.brief-strip { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.brief-thumb { flex: none; width: 96px; height: 60px; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.brief-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep .ep-body { overflow: hidden; }

.about-ep { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.about-ep h3 { font-size: 15px; margin-bottom: 8px; }
.about-ep p { color: #cfd0e4; font-size: 14px; line-height: 1.6; }
.about-photos { display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: 10px; overflow-x: auto; margin-top: 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.about-photos figure { margin: 0; scroll-snap-align: start; }
.about-photos button { display: block; width: 100%; border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.about-photos img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.about-photos figcaption { color: var(--muted); font-size: 12px; margin-top: 4px; }

.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(4,4,14,.94); display: none; align-items: center; justify-content: center; padding: 56px 12px 24px; }
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: min(1100px, 100%); text-align: center; }
.lightbox img { max-width: 100%; max-height: 74vh; border-radius: 12px; margin: 0 auto; object-fit: contain; }
.lightbox figcaption { color: #e6e6f5; font-size: 15px; margin-top: 12px; line-height: 1.5; }
.lb-count { color: var(--dim); font-size: 12px; margin-top: 6px; }
.lb-close { position: absolute; top: 12px; right: 14px; width: 44px; height: 44px; border-radius: 50%; font-size: 28px; color: #fff; background: rgba(255,255,255,.08); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; font-size: 30px; color: #fff; background: rgba(255,255,255,.08); }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
@media (min-width: 640px) {
  .brief-card { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; padding: 18px; }
  .brief-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .about-photos { grid-auto-columns: 46%; }
}
.brief-card.no-photo { grid-template-columns: 1fr !important; }

/* Ad break UI */
.ad-bar { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px; border-radius: 14px; background: linear-gradient(135deg, rgba(245,185,66,.14), rgba(123,92,255,.12)); border: 1px solid rgba(245,185,66,.3); }
.ad-bar .ad-companion { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.ad-bar .ad-info { flex: 1; min-width: 0; }
.ad-bar .ad-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #241600; background: var(--gold); border-radius: 4px; padding: 1px 6px; }
.ad-bar b { display: block; font-size: 13px; margin-top: 4px; font-weight: 600; color: #f1e6c8; }
.ad-playing .mini-text .s { color: var(--gold); }
.ep:has(.ep-brief[open]) { align-items: flex-start; }

/* =====================================================================
   PWA & downloads (Phase 4)
   ===================================================================== */
.ep-dl { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--muted); }
.ep-dl:hover { color: var(--text); background: var(--surface-2); }
[data-download][data-state="done"] { color: var(--green); }
.act[data-state="done"] .ring { color: var(--green); }
[data-download][data-state="busy"] { color: var(--accent-hi); }
[data-download][data-state="busy"] .icon { animation: dl-pulse 1.1s ease-in-out infinite; }
@keyframes dl-pulse { 50% { transform: translateY(2px); opacity: .55; } }
.dl-row.expired { opacity: .6; }
.dl-row .icon-btn { color: var(--muted); }
.round-play[disabled] { opacity: .4; pointer-events: none; }
.update-bar, .net-bar { position: fixed; z-index: 96; left: 50%; transform: translateX(-50%); top: 12px; display: flex; gap: 12px; align-items: center;
  padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 14px; max-width: calc(100vw - 24px); }
.net-bar { top: auto; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); background: #2a2140; border-color: rgba(245,185,66,.35); padding: 8px 14px; font-size: 13px; }
body.has-player .net-bar { bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-b) + 18px); }
.net-bar a { color: var(--gold); font-weight: 600; }
.install-link { width: 100%; background: none; border: 1px dashed var(--border); margin-bottom: 10px; }
.offline-hero { display: flex; gap: 16px; align-items: center; padding: 20px; margin-top: 12px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border-soft); }
.offline-hero > .icon { width: 44px; height: 44px; color: var(--gold); }
.offline-hero h1 { font-size: 22px; }
body.offline-shell { padding-bottom: calc(var(--mini-h) + var(--safe-b) + 24px); }
body.offline-shell .player-root { bottom: calc(var(--safe-b) + 0px); }
@media (min-width: 1024px) {
  .net-bar { bottom: 24px; }
  body.has-player .net-bar { bottom: calc(var(--dock-h) + 16px); }
  body.offline-shell .app { margin-left: 0; }
  body.offline-shell .player-root { bottom: 0; }
}
@media (display-mode: standalone) { .topbar { padding-top: max(12px, env(safe-area-inset-top)); } }

/* Onboarding / languages */
.onb-card { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(123,92,255,.22), rgba(192,75,242,.12)); border: 1px solid rgba(123,92,255,.35); }
.onb-card > .icon { color: var(--accent-hi); width: 28px; height: 28px; }
.onb-card b { display: block; }
.onb-card .muted { font-size: 13px; }
.welcome { max-width: 720px; margin: 0 auto; text-align: center; padding: 28px 0 10px; }
.welcome-mark img { width: 72px; height: 72px; margin: 0 auto 14px; }
.welcome h1 { font-size: 28px; font-weight: 800; }
.welcome > p { margin: 8px auto 22px; max-width: 46ch; }
.lang-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.lang-chip { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: border-color .15s, background .15s; }
.lang-chip input { position: absolute; opacity: 0; pointer-events: none; }
.lang-chip b { display: block; font-size: 16px; }
.lang-chip small { color: var(--muted); font-size: 12px; }
.lang-chip .tick { margin-left: auto; color: #fff; background: var(--accent); border-radius: 50%; padding: 3px; opacity: 0; transition: opacity .15s; }
.lang-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.lang-chip:has(input:checked) .tick { opacity: 1; }
.lang-chip:has(input:focus-visible) { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.welcome-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
@media (min-width: 640px) { .lang-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.upnext.after { flex-wrap: wrap; }
.upnext.after img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.upnext.after .info small { display: block; text-transform: none; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext.after .btns { width: 100%; justify-content: flex-end; }
@media (min-width: 640px) { .upnext.after { flex-wrap: nowrap; } .upnext.after .btns { width: auto; } }

/* =====================================================================
   Embeds (Phase 4): light theme, playlist, embed-code dialog
   ===================================================================== */
body.embed.theme-light { --bg: #ffffff; --surface: #f4f4fa; --surface-2: #ebebf5; --surface-3: #dedef0; --border: #e1e1ee; --border-soft: rgba(0,0,0,.06);
  --text: #14152d; --muted: #5d5f80; --dim: #8a8ca8; color: var(--text); }
body.embed.theme-light .embed-card { background: linear-gradient(135deg, #ffffff, #f3f1ff); }
body.embed.theme-light .pbtn { color: var(--text); }
body.embed.no-brand .embed-brand { display: none; }
body.embed-playlist { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
body.embed-playlist .player-root { flex: none; }
.embed-list { list-style: none; margin: 0 8px 8px; padding: 6px; overflow-y: auto; flex: 1; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.embed-list button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--text); }
.embed-list button:hover, .embed-list button:focus-visible { background: var(--surface-2); }
.embed-list button:focus-visible { outline: 2px solid var(--accent); }
.embed-list .n { color: var(--dim); font-weight: 700; text-align: center; }
.embed-list .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.embed-list .d { color: var(--muted); font-size: 12px; }
.embed-list button[data-locked] .t { color: var(--muted); }
.embed-list button.on { background: var(--accent-soft); }
.embed-list button.on .n { color: var(--accent-hi); }
.embed-list button.playing .n::before { content: "▶"; font-size: 10px; }
.embed-list button.playing .n { font-size: 0; }
.embed-list button.playing .n::before { font-size: 11px; }

.embed-dialog .opts { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.embed-dialog textarea { width: 100%; min-height: 96px; font: 12px/1.5 ui-monospace, Menlo, monospace; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px; resize: vertical; }
.embed-dialog iframe { display: block; width: 100%; border: 0; border-radius: 16px; background: transparent; margin-top: 10px; }
dialog.app-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
dialog.app-dialog::backdrop { background: rgba(4,5,15,.7); }
.app-dialog .dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.app-dialog .dlg-head h3 { margin: 0; font-size: 18px; }
.app-dialog .dlg-x { background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.app-dialog .chip { cursor: pointer; }
.app-dialog .chip.on { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }
