@font-face {
  font-family: "Anton";
  src: url("fonts/Anton-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #0a0507;
  --bg-2: #120a0d;
  --surface: #1a1115;
  --surface-2: #24181d;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f6eef0;
  --muted: #a8979d;
  --red: #e0244f;
  --red-deep: #b3123a;
  --gold: #f2c46d;
  --radius: 14px;
  --gutter: 16px;
  --tabs-h: 64px;
  --mini-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --reader-size: 20px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.has-tabs { padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }
body.has-tabs.has-mini { padding-bottom: calc(var(--tabs-h) + var(--mini-h) + var(--safe-b) + 8px); }
body.has-mini:not(.has-tabs) { padding-bottom: calc(var(--mini-h) + var(--safe-b) + 8px); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.3; cursor: default; }
img { display: block; max-width: 100%; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }

.icon { width: 24px; height: 24px; flex: none; }
.icon.tiny { width: 15px; height: 15px; vertical-align: -2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold);
}
.display {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.01em; line-height: 0.98; margin: 6px 0 8px;
  font-size: clamp(34px, 10vw, 56px);
  text-wrap: balance;
}
.meta { color: var(--muted); font-size: 14px; margin: 0; }
.lead { color: #d9cbd0; font-size: 16px; line-height: 1.55; max-width: 32rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.01em;
  transition: transform 0.12s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn .icon { width: 20px; height: 20px; }
.btn.primary { background: var(--red); color: #fff; box-shadow: 0 8px 30px -10px rgba(224, 36, 79, 0.8); }
.btn.primary:hover { background: #ec2d59; }
.btn.ghost { background: rgba(255, 255, 255, 0.1); color: var(--text); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.16); }
.btn.small { min-height: 40px; padding: 0 16px; }
.btn.block { display: flex; width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--text); flex: none;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.08); }
.icon-btn.glass { background: rgba(10, 5, 7, 0.45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.icon-btn.big .icon { width: 34px; height: 34px; }
.icon-btn.lock { color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.actions.wide .btn { flex: 1 1 0; min-width: 0; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-t) + 12px) var(--gutter) 12px;
  background: linear-gradient(180deg, rgba(10, 5, 7, 0.95), rgba(10, 5, 7, 0.75) 70%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.wordmark { font-family: var(--display); font-size: 26px; letter-spacing: 0.06em; line-height: 1; }
.wordmark span { color: var(--red); }

/* ---------- covers ---------- */
.cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; background: var(--surface); }
.cover-blank {
  display: grid; place-items: center; padding: 12px; text-align: center;
  background: radial-gradient(120% 80% at 50% 20%, #3a0a18, #14080c 70%);
  font-family: var(--display); text-transform: uppercase; font-size: 20px; line-height: 1;
}
.card-cover { position: relative; }
.card-cover .cover { box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9); }
.badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 6px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ---------- install help ---------- */
.install-banner {
  position: relative; z-index: 21; display: flex; align-items: center; gap: 10px;
  margin: 0 var(--gutter) 6px; padding: 10px 6px 10px 12px; border-radius: var(--radius);
  background: rgba(36, 24, 29, 0.92); border: 1px solid rgba(224, 36, 79, 0.35);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.install-banner img { border-radius: 10px; flex: none; }
.install-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.install-copy strong { font-size: 14px; }
.install-copy span { font-size: 12.5px; color: var(--muted); }
.install-banner .btn.small { min-height: 36px; padding: 0 16px; }
.install-banner .icon-btn { width: 36px; height: 36px; color: var(--muted); }
.install-banner .icon-btn .icon { width: 18px; height: 18px; }
.link-btn { color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px; padding: 8px; }
.install-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 8px; }
.install-head img { border-radius: 14px; flex: none; }
.install-head .sheet-title { margin: 0 0 2px; }
.install-head p { margin: 0; }
.steps { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; margin-top: 1px; }
.key { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.key .icon { width: 17px; height: 17px; }

/* ---------- home ---------- */
.hero { position: relative; margin-top: -68px; padding: calc(var(--safe-t) + 84px) var(--gutter) 28px; overflow: hidden; isolation: isolate; }
.hero-bg, .detail-bg, .player-bg {
  position: absolute; inset: -40px; z-index: -1;
  background: radial-gradient(120% 80% at 30% 10%, #3a0a18, var(--bg) 70%) center / cover no-repeat;
  filter: blur(34px) saturate(1.3) brightness(0.55);
  transform: scale(1.1);
}
.hero::after, .detail::after, .locked::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10, 5, 7, 0.1) 0%, rgba(10, 5, 7, 0.55) 55%, var(--bg) 100%);
}
.hero-inner { display: grid; grid-template-columns: 42% 1fr; gap: 18px; align-items: end; max-width: 1100px; margin: 0 auto; }
.hero-cover .cover { border-radius: 12px; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.06); }
.hero .display { font-size: clamp(30px, 9vw, 64px); }
.tagline { margin: 0 0 6px; color: #e6d7dc; font-size: 15px; line-height: 1.4; }
.hero .actions { margin-top: 14px; }
.hero .actions { flex-direction: column; align-items: stretch; max-width: 220px; }
.hero .btn { min-height: 44px; padding: 0 18px; }

.row { padding: 8px var(--gutter) 18px; max-width: 1132px; margin: 0 auto; }
.row-title { font-size: 19px; font-weight: 800; margin: 8px 0 14px; letter-spacing: -0.01em; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
.card, .continue { display: block; min-width: 0; }
.card:active .cover, .continue:active .cover { transform: scale(0.98); }
.card-title { margin-top: 10px; font-weight: 700; font-size: 15px; line-height: 1.25; }
.card-meta { margin-top: 3px; color: var(--muted); font-size: 13px; }
.scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: 34%; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px;
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.continue { scroll-snap-align: start; }
.bar { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px var(--gutter) 24px; }

/* ---------- book page ---------- */
.detail { position: relative; overflow: hidden; isolation: isolate; padding: calc(var(--safe-t) + 8px) var(--gutter) 8px; text-align: center; }
.detail-top { display: flex; justify-content: space-between; position: relative; z-index: 2; }
.detail-cover { width: 56%; max-width: 260px; margin: 4px auto 20px; }
.detail-cover .cover { border-radius: 12px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 1), 0 0 0 1px rgba(255, 255, 255, 0.07); }
.detail-copy { max-width: 560px; margin: 0 auto; }
.author { margin: 0 0 4px; color: #e6d7dc; font-weight: 600; }
.blurb { text-align: left; color: #dccdd2; font-size: 15.5px; line-height: 1.6; margin-top: 22px; }
.blurb p { margin: 0 0 12px; }

.chapters { padding: 6px var(--gutter) 24px; max-width: 592px; margin: 0 auto; }
.chapters-head { display: flex; align-items: baseline; justify-content: space-between; }
.chapters-head .muted { font-size: 13px; }
.chapter-list { list-style: none; margin: 0; padding: 0; }
.chapter { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.chapter:last-child { border-bottom: 1px solid var(--line); }
.chapter-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 14px 0; text-align: left; width: 100%; }
.chapter-num { font-family: var(--display); font-size: 22px; color: var(--muted); width: 30px; flex: none; }
.chapter.is-current .chapter-num { color: var(--red); }
.chapter-text { display: flex; flex-direction: column; min-width: 0; }
.chapter-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-text > span { color: var(--muted); font-size: 13px; }
.chapter.is-locked .chapter-text strong { color: #bfb1b6; }
.free { font-style: normal; color: var(--gold); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; margin-left: 6px; }

/* ---------- reader ---------- */
body[data-route="read"] { background: var(--bg); }
body[data-reader-theme="light"] { background: #f7f2ec; color: #241a1d; color-scheme: light; }
.reader-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 31; }
.reader-progress i { display: block; height: 100%; width: 0; background: var(--red); }
.reader-bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 2px;
  padding: calc(var(--safe-t) + 6px) 6px 6px;
  background: rgba(10, 5, 7, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: transform 0.25s ease;
}
.reader-bar.hidden { transform: translateY(-110%); }
.reader-title { flex: 1; min-width: 0; text-align: center; line-height: 1.2; }
.reader-title span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-title strong { font-size: 14px; }
body[data-reader-theme="light"] .reader-bar { background: rgba(247, 242, 236, 0.94); border-color: rgba(0, 0, 0, 0.08); }
body[data-reader-theme="light"] .reader .icon-btn { color: #241a1d; }
body[data-reader-theme="light"] .reader .muted, body[data-reader-theme="light"] .reader-title span { color: #7a6a70; }

.reader-body { max-width: 38rem; margin: 0 auto; padding: 30px 22px 60px; }
.reader-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--red); }
.reader-h { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: calc(var(--reader-size) * 1.9); line-height: 1; margin: 8px 0 28px; }
.reader-text p {
  font-family: var(--serif); font-size: var(--reader-size); line-height: 1.72;
  margin: 0 0 1em; color: #ece2e5; overflow-wrap: break-word; text-wrap: pretty;
}
body[data-reader-theme="light"] .reader-text p { color: #2a1f22; }
.reader-end { margin-top: 40px; }
.end-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.end-card strong { font-size: 19px; }
.end-card .btn { margin-top: 10px; }
.locked-teaser { background: linear-gradient(135deg, #2a0b16, var(--surface)); border-color: rgba(224, 36, 79, 0.35); }
body[data-reader-theme="light"] .end-card { background: #fff; border-color: rgba(0, 0, 0, 0.08); color: #241a1d; }
body[data-reader-theme="light"] .locked-teaser { background: linear-gradient(135deg, #fbe7ec, #fff); }
body[data-reader-theme="light"] .reader .btn.ghost { background: rgba(0, 0, 0, 0.06); color: #241a1d; }

/* ---------- full player ---------- */
.player {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-t) + 8px) 22px calc(var(--safe-b) + 22px);
}
.player-bg { filter: blur(50px) saturate(1.4) brightness(0.45); }
.player::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 5, 7, 0.2), rgba(10, 5, 7, 0.8) 70%, var(--bg)); }
.player-top { width: 100%; max-width: 480px; display: flex; align-items: center; justify-content: space-between; }
.player-art { width: min(64vw, 42vh, 320px); margin: 2vh auto 3vh; }
.player-art .cover { border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 1), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.player-info { width: 100%; max-width: 480px; }
.player-title { font-size: 22px; font-weight: 800; margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
.player-sub { margin: 4px 0 0; color: var(--muted); }
.scrub { width: 100%; max-width: 480px; margin-top: 22px; }
.scrub input {
  --pct: 0%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; margin: 0;
}
.scrub input::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--text) var(--pct), rgba(255, 255, 255, 0.2) var(--pct)); }
.scrub input::-moz-range-track { height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--text) var(--pct), rgba(255, 255, 255, 0.2) var(--pct)); }
.scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; margin-top: -5.5px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.scrub input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.controls { width: 100%; max-width: 420px; display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.play-btn {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red); color: #fff; box-shadow: 0 14px 40px -10px rgba(224, 36, 79, 0.9);
  transition: transform 0.12s ease;
}
.play-btn:active { transform: scale(0.94); }
.play-btn .icon { width: 32px; height: 32px; }
.play-btn[data-playing="false"] .icon { margin-left: 4px; }
.play-btn.loading { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(224, 36, 79, 0.15); } }
.player-extra { display: flex; gap: 10px; margin-top: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}
.pill[hidden] { display: none; }
.player-note { color: var(--gold); font-size: 14px; text-align: center; }

/* ---------- locked ---------- */
.locked { position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100dvh; padding: calc(var(--safe-t) + 8px) var(--gutter) 32px; text-align: center; }
.locked > *:not(.detail-bg):not(.detail-top) { max-width: 440px; margin-left: auto; margin-right: auto; }
.lock-badge {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 6vh auto 18px !important;
  background: rgba(224, 36, 79, 0.16); color: var(--red); box-shadow: 0 0 60px -6px rgba(224, 36, 79, 0.7);
}
.lock-badge .icon { width: 38px; height: 38px; }
.perks { list-style: none; padding: 0; margin: 18px auto 26px !important; text-align: left; display: grid; gap: 10px; width: fit-content; }
.perks .icon { color: var(--gold); margin-right: 6px; }
.locked .btn.block { margin-top: 10px; }

/* ---------- watch ---------- */
.soon { position: relative; text-align: center; padding: 12vh 28px 40px; overflow: hidden; }
.soon-glow { position: absolute; width: 360px; height: 360px; left: 50%; top: 4vh; transform: translateX(-50%); background: var(--red-deep); filter: blur(90px); opacity: 0.35; border-radius: 50%; z-index: -1; }
.soon-icon { width: 86px; height: 86px; margin: 0 auto 18px; border-radius: 24px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); }
.soon-icon .icon { width: 42px; height: 42px; color: var(--red); }
.soon .lead { margin: 10px auto 26px; }

.empty { text-align: center; padding: 18vh 28px; }
.empty h2 { margin: 0 0 8px; }
.empty .btn { margin-top: 18px; }

/* ---------- tab bar + mini player ---------- */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(10, 5, 7, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
#tabs[hidden], #mini[hidden] { display: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tab.active { color: var(--text); }
.tab.active .icon { color: var(--red); }

#mini {
  position: fixed; left: 8px; right: 8px; z-index: 39;
  bottom: calc(var(--safe-b) + 8px);
  height: var(--mini-h); display: flex; align-items: center; gap: 8px; padding: 0 8px 0 8px;
  background: rgba(36, 24, 29, 0.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.9); overflow: hidden;
  max-width: 640px; margin: 0 auto;
}
body.has-tabs #mini { bottom: calc(var(--tabs-h) + var(--safe-b) + 6px); }
.mini-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, 0.12); }
.mini-progress i { display: block; height: 100%; width: 0; background: var(--red); }
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.mini-cover { width: 40px; height: 48px; border-radius: 6px; aspect-ratio: auto; font-size: 8px; padding: 2px; }
.mini-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mini-text strong, .mini-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text strong { font-size: 14px; }
.mini-text span { font-size: 12.5px; color: var(--muted); }
.mini-play .icon { width: 26px; height: 26px; }

/* ---------- sheets + toast ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#sheet-root:empty { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow-y: auto;
  padding: 10px 20px calc(var(--safe-b) + 20px); background: var(--surface); color: var(--text);
  border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform 0.25s ease;
  max-width: 560px; margin: 0 auto;
}
#sheet-root.open { pointer-events: auto; }
#sheet-root.open .sheet-backdrop { opacity: 1; }
#sheet-root.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.2); margin: 0 auto 10px; }
.sheet-title { margin: 6px 0 14px; font-size: 18px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting > span { font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper output { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.segmented { display: flex; background: var(--bg); border-radius: 999px; padding: 4px; }
.segmented button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; }
.segmented button .icon { width: 17px; height: 17px; }
.segmented button.on { background: var(--surface-2); color: var(--text); }
.sheet .btn.block { margin-top: 16px; }
.chapter-list.in-sheet .chapter-main { padding: 12px 0; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 90px); z-index: 70;
  transform: translate(-50%, 10px); opacity: 0; transition: opacity 0.25s, transform 0.25s;
  background: #fff; color: #140a0d; font-weight: 600; font-size: 14px; padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- bigger screens ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scroller { grid-auto-columns: 22%; }
  .hero-inner { grid-template-columns: 240px 1fr; gap: 32px; }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .scroller { grid-auto-columns: 15%; }
  .top { padding-left: max(var(--gutter), calc(50vw - 550px)); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- accounts + subscriptions ---------- */
.top { display: flex; align-items: center; justify-content: space-between; }
.account-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); font-size: 13px; font-weight: 700;
}
.account-chip.premium { background: rgba(242, 196, 109, 0.18); color: var(--gold); }
.paywall { margin: 6px 0 4px; }
.plans { display: grid; gap: 10px; margin-bottom: 10px; }
.plan {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 16px 18px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line); text-align: left; transition: border-color 0.2s, background 0.2s;
}
.plan:hover, .plan:focus-visible { border-color: var(--red); background: rgba(224, 36, 79, 0.12); }
.plan-label { font-weight: 700; }
.plan-label em { font-style: normal; color: var(--gold); font-size: 12px; margin-left: 6px; letter-spacing: .04em; }
.plan-price strong { font-size: 18px; }
.login { display: grid; gap: 10px; text-align: left; margin-top: 4px; }
.login p { margin: 0; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input {
  font: inherit; font-size: 17px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px; width: 100%;
}
.field input:focus { outline: none; border-color: var(--red); }
.link { text-decoration: underline; text-underline-offset: 3px; }
.account { padding: 8px var(--gutter) 30px; max-width: 520px; margin: 0 auto; }
.account .display { font-size: 44px; }
.account-card { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.account-card p { margin: 0; }
.account-card.premium { border-color: rgba(242, 196, 109, 0.5); }
.account-email, .account-plan { font-size: 18px; font-weight: 700; margin-top: 2px !important; }
.account .btn.block { margin-top: 10px; }
.account-card .paywall { margin-top: 14px; }
