* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Tahoma, Arial, sans-serif;

  --bg: #090c17;
  --bg-soft: #0d1221;
  --surface: rgba(19, 25, 43, .78);
  --surface-solid: #121827;
  --surface-2: #171f32;
  --line: rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .15);
  --text: #f7f8fc;
  --muted: #98a1b8;
  --muted-2: #747e98;
  --brand: #8f83ff;
  --brand-2: #5dd6c0;
  --brand-soft: rgba(143, 131, 255, .14);
  --success: #59d7a5;
  --danger: #ff8a9a;
  --shadow: 0 26px 70px rgba(0, 0, 0, .28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 88% -10%, rgba(133, 111, 255, .22), transparent 34rem),
    radial-gradient(circle at 4% 34%, rgba(64, 212, 190, .09), transparent 30rem),
    linear-gradient(180deg, #090c17 0%, #0a0e1a 52%, #080b14 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
}

.loading-screen strong,
.loading-screen span {
  display: block;
}

.loading-screen strong {
  color: var(--text);
  font-size: 18px;
}

.loading-screen span {
  margin-top: 4px;
  font-size: 12px;
}

.loading-logo,
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(145deg, var(--brand), #6859e8);
  color: white;
  box-shadow: 0 12px 30px rgba(112, 92, 239, .30);
  font-weight: 900;
}

.loading-logo {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  font-size: 22px;
}

.app {
  min-height: 100vh;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0;
  background: rgba(9, 12, 23, .72);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.header-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  direction: ltr;
  cursor: pointer;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 16px;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  letter-spacing: -.02em;
  font-size: 16px;
}

.brand-copy span {
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 1px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  transition: .18s ease;
}

.nav-btn:hover,
.nav-btn.active {
  color: var(--text);
  background: rgba(255,255,255,.06);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(89,215,165,.08);
}

main.page {
  padding: 36px 0 42px;
}

.featured {
  position: relative;
  min-height: 440px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: center;
  gap: 48px;
  overflow: hidden;
  padding: 42px 48px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 82% 18%, rgba(143,131,255,.20), transparent 18rem),
    linear-gradient(135deg, rgba(23,30,51,.96), rgba(13,18,33,.90));
  box-shadow: var(--shadow);
}

.featured::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  left: -190px;
  bottom: -300px;
  background: rgba(93,214,192,.08);
  filter: blur(2px);
}

.featured-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(143,131,255,.26);
  border-radius: 999px;
  background: rgba(143,131,255,.09);
  color: #c7c0ff;
  font-size: 11px;
  font-weight: 800;
}

.featured h1 {
  margin: 17px 0 10px;
  font-size: clamp(43px, 6vw, 76px);
  line-height: .98;
  letter-spacing: -.055em;
}

.featured .lead {
  max-width: 620px;
  margin: 0;
  color: #b7bfd2;
  line-height: 1.9;
  font-size: 14px;
}

.featured-author {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.featured-actions,
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.featured-actions {
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 14px;
  padding: 0 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: wait;
  opacity: .55;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #f8f9ff, #dcdfff);
  color: #101427;
  box-shadow: 0 10px 24px rgba(173,176,255,.13);
}

.btn-secondary {
  background: rgba(255,255,255,.055);
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.featured-progress {
  margin-top: 23px;
  max-width: 480px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.progress-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}

.progress-value {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .25s ease;
}

.featured-cover-wrap {
  position: relative;
  z-index: 2;
  justify-self: center;
}

.featured-cover-glow {
  position: absolute;
  inset: 12% 0 -8%;
  border-radius: 36px;
  background: rgba(143,131,255,.23);
  filter: blur(45px);
  transform: scale(.90);
}

.cover-image {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, #272f48, #171d2e);
  border: 1px solid rgba(255,255,255,.11);
  box-shadow: 0 24px 60px rgba(0,0,0,.38);
}

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

.featured-cover {
  width: 250px;
  aspect-ratio: 2 / 3;
  border-radius: 22px;
  transform: rotate(-2deg);
}

.placeholder-cover {
  display: grid;
  place-items: center;
  color: #e8eaff;
  font-weight: 900;
  letter-spacing: -.03em;
  background:
    radial-gradient(circle at 80% 10%, rgba(143,131,255,.42), transparent 50%),
    linear-gradient(145deg, #222a43, #121827);
}

.featured-cover.placeholder-cover {
  font-size: 50px;
}

.section {
  margin-top: 34px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.section-head h2,
.section-head p {
  margin: 0;
}

.section-head h2 {
  font-size: 21px;
  letter-spacing: -.025em;
}

.section-head p {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 11px;
}

.section-link {
  border: 0;
  background: transparent;
  color: #bcb5ff;
  cursor: pointer;
  font-size: 11px;
}

.continue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.continue-card {
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 122px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.035);
  text-decoration: none;
  transition: .18s ease;
}

.continue-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: rgba(255,255,255,.052);
}

.continue-cover {
  width: 74px;
  aspect-ratio: 2 / 3;
  border-radius: 11px;
}

.continue-card h3 {
  margin: 0;
  font-size: 14px;
}

.continue-card .sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.continue-card .progress-track {
  margin-top: 12px;
  height: 5px;
}

.discovery-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(17,23,39,.58);
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 10px;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.search,
.select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: rgba(255,255,255,.042);
}

.search {
  padding: 0 43px 0 14px;
}

.select {
  padding: 0 13px;
}

.search:focus,
.select:focus {
  border-color: rgba(143,131,255,.42);
  box-shadow: 0 0 0 3px rgba(143,131,255,.07);
}

.select option {
  background: #101525;
  color: white;
}

.category-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 13px;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 10px;
  transition: .16s ease;
}

.chip:hover,
.chip.active {
  border-color: rgba(143,131,255,.32);
  background: var(--brand-soft);
  color: #d8d3ff;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.book-card {
  position: relative;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.025);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.book-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.043);
}

.book-card-locked {
  cursor: default;
}

.book-card-locked:hover {
  transform: none;
  border-color: var(--line);
  background: rgba(255,255,255,.025);
}

.locked-cover {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
}

.locked-cover .book-cover {
  display: block;
  filter: saturate(.68);
}

.locked-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 10, 21, .20), rgba(7, 10, 21, .54));
  pointer-events: none;
}

.locked-cover-button {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  color: #fff;
  background: rgba(9, 12, 23, .68);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .38);
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.locked-cover-button:hover {
  background: rgba(34, 29, 57, .86);
  border-color: rgba(255, 255, 255, .55);
}

.locked-cover-button:focus-visible {
  outline: 2px solid #b9a7ff;
  outline-offset: 4px;
}

.locked-cover-button.is-shaking {
  animation: lock-shake .65s ease-in-out;
}

.locked-cover-button.is-shaking .lock-shackle {
  animation: shackle-jiggle .65s ease-in-out;
}

@keyframes lock-shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); box-shadow: 0 10px 26px rgba(0, 0, 0, .38); }
  18%, 52% { transform: translate(calc(-50% - 5px), -50%) rotate(-8deg); }
  35%, 70% { transform: translate(calc(-50% + 5px), -50%) rotate(8deg); }
  85% { transform: translate(-50%, -50%) rotate(-3deg); box-shadow: 0 0 28px rgba(185, 167, 255, .55); }
}

@keyframes shackle-jiggle {
  0%, 100% { transform: translateY(0); }
  26%, 64% { transform: translateY(-2px); }
  45%, 80% { transform: translateY(1px); }
}

@media (prefers-reduced-motion: reduce) {
  .locked-cover-button.is-shaking,
  .locked-cover-button.is-shaking .lock-shackle {
    animation-duration: .01ms;
  }
}

.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 15px;
}

.book-card-body {
  padding: 13px 4px 5px;
}

.book-card h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.book-card-author {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.book-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 9px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.05);
}

.offline-badge {
  color: #a7e8cf;
  background: rgba(89,215,165,.08);
  border-color: rgba(89,215,165,.14);
}

.favorite {
  position: absolute;
  z-index: 4;
  top: 20px;
  left: 20px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  color: white;
  background: rgba(7,10,20,.68);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 16px;
}

.favorite.active {
  background: #f8f9ff;
  color: #242941;
}

.book-card-progress {
  margin-top: 12px;
}

.book-card-progress .progress-track {
  height: 5px;
}

.book-card-progress span {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 44px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--text);
  margin-bottom: 5px;
}

.page-footer {
  margin-top: 44px;
  padding: 22px 0 4px;
  text-align: center;
  color: #59627a;
  font-size: 10px;
}

/* Book page */
.book-page {
  width: min(1020px, calc(100% - 40px));
  margin: 0 auto;
}

.book-topbar {
  padding: 26px 0 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.book-hero {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 84% 10%, rgba(143,131,255,.14), transparent 20rem),
    rgba(17,23,39,.64);
}

.book-hero-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 19px;
}

.book-hero-content {
  min-width: 0;
}

.book-kicker {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.book-title {
  margin: 16px 0 6px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1;
  letter-spacing: -.055em;
}

.book-author {
  color: #a7aec1;
  font-size: 14px;
}

.book-description {
  max-width: 670px;
  margin: 15px 0 0;
  line-height: 1.95;
  color: var(--muted);
  font-size: 13px;
}

.demo-note {
  max-width: 670px;
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px solid rgba(255, 194, 102, .42);
  border-radius: 12px;
  background: rgba(255, 194, 102, .1);
  color: #ffe0aa;
  font-size: 13px;
  line-height: 1.9;
}

.book-progress-block {
  margin-top: 20px;
  max-width: 560px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 17px;
  margin-top: 17px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 17px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(17,23,39,.60);
  padding: 24px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.panel-title h2,
.panel-title p {
  margin: 0;
}

.panel-title h2 {
  font-size: 17px;
}

.panel-title p {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 10px;
}

.learning-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 9px;
}

.learning-stat {
  padding: 15px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 16px;
  background: rgba(255,255,255,.028);
}

.learning-stat strong,
.learning-stat span {
  display: block;
}

.learning-stat strong {
  font-size: 21px;
}

.learning-stat span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.player-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(143,131,255,.13), transparent 16rem),
    rgba(255,255,255,.028);
  border: 1px solid rgba(255,255,255,.06);
}

.player-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 13px;
}

.player-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  background: var(--brand-soft);
  color: #dcd8ff;
  font-size: 19px;
}

.player-head strong,
.player-head span {
  display: block;
}

.player-head strong {
  font-size: 13px;
}

.player-head span {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
}

.audio-player {
  width: 100%;
  min-height: 45px;
  margin-top: 5px;
  filter: saturate(.75);
}

.pending-book {
  display: grid;
  grid-template-columns: minmax(160px, 230px) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin: 16px 0 40px;
}

.pending-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
}

.pending-book h1 { margin: 16px 0; }
.pending-book p { color: var(--muted); line-height: 1.9; }

.pending-audio {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pending-audio strong { display: block; margin-bottom: 8px; }
.pending-audio small { display: block; margin-top: 8px; color: var(--muted); }

@media (max-width: 600px) {
  .pending-book { grid-template-columns: 1fr; }
  .pending-cover { max-width: 200px; }
}

.listen-live {
  margin-top: 13px;
}

.listen-live-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 7px;
}

.offline-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.12);
}

.offline-status {
  font-size: 10px;
  color: #c4cada;
}

.download-progress {
  display: none;
  margin-top: 10px;
}

.download-progress-text {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9px;
}

.summary-text p {
  margin: 0 0 15px;
  line-height: 2.05;
  color: #d2d8e5;
  font-size: 14px;
}

.summary-text p:last-child {
  margin-bottom: 0;
}

.summary-text h3,
.summary-text h4 {
  color: #fff;
  line-height: 1.7;
}

.summary-text h3 {
  margin: 28px 0 10px;
  font-size: 18px;
}

.summary-text h3:first-child {
  margin-top: 0;
}

.summary-text h4 {
  margin: 20px 0 7px;
  font-size: 15px;
}

.summary-list {
  margin: 0 0 16px;
  padding: 0 23px 0 0;
  color: #d2d8e5;
  font-size: 14px;
  line-height: 2;
}

.summary-list li + li {
  margin-top: 5px;
}

.idea-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.idea-item {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
  color: #c9cfdd;
  font-size: 11px;
  line-height: 1.75;
}

.idea-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: #d9d5ff;
  font-weight: 900;
}

.quiz-question {
  padding: 17px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.quiz-question:first-child {
  padding-top: 0;
}

.quiz-question:last-of-type {
  border-bottom: 0;
}

.quiz-question-title {
  margin: 0 0 10px;
  color: #dbe0eb;
  line-height: 1.8;
  font-size: 12px;
}

.quiz-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 7px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 12px;
  background: rgba(255,255,255,.022);
  color: #b9c0d0;
  cursor: pointer;
  font-size: 10px;
}

.quiz-option:hover {
  border-color: rgba(143,131,255,.22);
  background: rgba(143,131,255,.045);
}

.quiz-option input {
  accent-color: var(--brand);
}

.quiz-result {
  min-height: 20px;
  color: #d7dbea;
  font-size: 12px;
  line-height: 1.8;
}

.quiz-feedback {
  margin: 10px 0 0;
  padding-inline-start: 22px;
}

.meta-note {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.6;
}

/* Offline page */
.offline-hero {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 85% 0%, rgba(89,215,165,.10), transparent 20rem),
    rgba(17,23,39,.62);
}

.offline-hero h1 {
  margin: 10px 0 7px;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -.045em;
}

.offline-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 9px;
  margin-top: 18px;
}

.storage-stat {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.055);
  background: rgba(255,255,255,.025);
  border-radius: 15px;
}

.storage-stat strong,
.storage-stat span {
  display: block;
}

.storage-stat strong {
  font-size: 18px;
}

.storage-stat span {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
}

.offline-list {
  display: grid;
  gap: 11px;
}

.offline-row {
  display: grid;
  grid-template-columns: 64px minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.027);
}

.offline-row-cover {
  width: 64px;
  aspect-ratio: 2/3;
  border-radius: 10px;
}

.offline-row h3 {
  margin: 0;
  font-size: 13px;
}

.offline-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 980px) {
  .featured {
    grid-template-columns: minmax(0,1fr) 235px;
    gap: 30px;
    padding: 34px;
  }

  .featured-cover {
    width: 210px;
  }

  .continue-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell,
  .header-inner,
  .book-page {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    padding: 8px 0;
  }

  .brand-copy span,
  .header-status .status-pill:nth-child(2) {
    display: none;
  }

  .main-nav {
    gap: 0;
  }

  .nav-btn {
    padding: 8px 9px;
    font-size: 10px;
  }

  main.page {
    padding-top: 20px;
  }

  .featured {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 26px;
    border-radius: 26px;
  }

  .featured-copy {
    order: 2;
  }

  .featured-cover-wrap {
    order: 1;
  }

  .featured-cover {
    width: 170px;
  }

  .featured h1 {
    font-size: clamp(39px, 12vw, 58px);
  }

  .continue-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr;
  }

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

  .book-card {
    padding: 8px;
    border-radius: 18px;
  }

  .book-cover {
    border-radius: 12px;
  }

  .locked-cover {
    border-radius: 12px;
  }

  .locked-cover-button {
    width: 52px;
    height: 52px;
  }

  .favorite {
    top: 14px;
    left: 14px;
    width: 32px;
    height: 32px;
  }

  .book-hero {
    grid-template-columns: 110px minmax(0,1fr);
    gap: 18px;
    align-items: start;
    padding: 20px;
    border-radius: 23px;
  }

  .book-title {
    margin-top: 11px;
    font-size: clamp(28px, 8vw, 42px);
  }

  .book-description {
    grid-column: 1 / -1;
  }

  .book-hero .book-description {
    font-size: 11px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .learning-stats,
  .storage-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .offline-row {
    grid-template-columns: 54px minmax(0,1fr);
  }

  .offline-row-cover {
    width: 54px;
  }

  .offline-row .inline-actions {
    grid-column: 1 / -1;
  }
}

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

@media (max-width: 430px) {
  .header-inner {
    gap: 8px;
  }

  .brand-copy {
    display: none;
  }

  .header-status {
    margin-inline-start: 0;
  }

  .status-pill {
    padding: 7px 8px;
  }

  .featured-actions .btn {
    flex: 1;
  }

  .book-grid {
    gap: 9px;
  }

  .book-card h3 {
    font-size: 12px;
  }

  .book-card-author {
    font-size: 9px;
  }

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

  .learning-stats,
  .storage-grid {
    grid-template-columns: 1fr;
  }

  .book-topbar {
    padding-top: 16px;
  }
}


/* v0.12 Learning System */
.learning-path {
  margin-top: 17px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(93,214,192,.06), transparent 20rem),
    rgba(17,23,39,.55);
}

.learning-path-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.learning-path-head h2 {
  margin: 9px 0 0;
  font-size: 18px;
}

.learning-path-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.learning-step {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  color: var(--text);
  text-align: start;
  cursor: pointer;
  transition: .16s ease;
}

.learning-step:hover {
  transform: translateY(-2px);
  border-color: rgba(143,131,255,.26);
  background: rgba(143,131,255,.055);
}

.learning-step.completed {
  border-color: rgba(89,215,165,.14);
  background: rgba(89,215,165,.045);
}

.learning-step-index {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--brand-soft);
  color: #d9d5ff;
  font-size: 10px;
  font-weight: 900;
}

.learning-step.completed .learning-step-index {
  background: rgba(89,215,165,.12);
  color: #a8edd0;
}

.learning-step-copy {
  min-width: 0;
}

.learning-step-copy strong,
.learning-step-copy small {
  display: block;
}

.learning-step-copy strong {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.learning-step-copy small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 11px;
  align-items: start;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 15px;
  background: rgba(255,255,255,.024);
  cursor: pointer;
  transition: .16s ease;
}

.action-item:hover {
  border-color: rgba(143,131,255,.22);
}

.action-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.action-check {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 9px;
  background: rgba(255,255,255,.035);
}

.action-item.done .action-check {
  border-color: rgba(89,215,165,.25);
  background: rgba(89,215,165,.12);
}

.action-item.done .action-check::after {
  content: "✓";
  color: #a8edd0;
  font-size: 12px;
  font-weight: 900;
}

.action-copy strong,
.action-copy small {
  display: block;
}

.action-copy strong {
  font-size: 11px;
}

.action-copy small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 9px;
}

.action-item.done .action-copy strong {
  color: #a9b1c4;
  text-decoration: line-through;
}

.flashcard-shell {
  max-width: 590px;
  margin: 0 auto;
}

.flashcard-card {
  width: 100%;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 30px;
  border: 1px solid rgba(143,131,255,.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(143,131,255,.12), transparent 17rem),
    linear-gradient(145deg, rgba(30,37,60,.88), rgba(17,23,39,.90));
  color: var(--text);
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  transition: .2s ease;
}

.flashcard-card:hover {
  transform: translateY(-2px);
  border-color: rgba(143,131,255,.30);
}

.flashcard-card.showing-back {
  border-color: rgba(89,215,165,.18);
  background:
    radial-gradient(circle at 0% 100%, rgba(89,215,165,.08), transparent 17rem),
    linear-gradient(145deg, rgba(24,42,47,.72), rgba(17,23,39,.90));
}

.flashcard-label {
  color: #a79eff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.flashcard-card.showing-back .flashcard-label {
  color: #83dcb8;
}

.flashcard-card strong {
  max-width: 470px;
  font-size: clamp(18px, 3vw, 25px);
  line-height: 1.75;
}

.flashcard-hint {
  color: var(--muted-2);
  font-size: 9px;
}

.flashcard-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
}

@media (max-width: 980px) {
  .learning-path-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .learning-path {
    padding: 16px;
  }

  .learning-path-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .learning-path-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flashcard-card {
    min-height: 210px;
    padding: 22px;
  }
}


/* v0.13 scalable content */
.content-source-note {
  color: var(--muted-2);
  font-size: 9px;
}

/* Three dimensional jacket: the artwork is split into front, spine and back. */
.book3d {
  --book-width: 230px;
  --book-thickness: 40px;
  position: relative;
  display: block;
  width: var(--book-width);
  height: auto;
  aspect-ratio: 69 / 100;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  direction: ltr;
  perspective: 1100px;
  transform: none;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}

.book3d::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 90%;
  height: 11%;
  bottom: -3%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .68);
  filter: blur(18px);
  border-radius: 50%;
}

.book3d::after {
  content: "برای دیدن پشت جلد کلیک کن";
  position: absolute;
  inset-inline: -20px;
  bottom: -28px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  font-family: inherit;
  opacity: .85;
}

.book3d.is-flipped::after { content: "بازگشت به روی جلد"; }
.book3d:focus-visible { outline: 2px solid var(--brand); outline-offset: 9px; }

.book3d-volume {
  display: block;
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(5deg) rotateY(-27deg);
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}

.book3d:hover:not(.is-flipped) .book3d-volume,
.book3d:focus-visible:not(.is-flipped) .book3d-volume {
  transform: rotateX(3deg) rotateY(-38deg);
}

.book3d.is-flipped .book3d-volume {
  transform: rotateX(3deg) rotateY(160deg);
}

.book3d-face {
  position: absolute;
  display: block;
  overflow: hidden;
  height: 100%;
  backface-visibility: hidden;
  border: 1px solid rgba(255,255,255,.18);
  background: #f9f4e8;
}

.book3d-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.book3d-front,
.book3d-back { width: 100%; }

.book3d-front {
  transform: translateZ(calc(var(--book-thickness) / 2));
  box-shadow: -12px 18px 28px rgba(0,0,0,.25);
}

.book3d-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(255,255,255,.22), transparent 21%, transparent 72%, rgba(0,0,0,.12));
  pointer-events: none;
}

.book3d-back {
  transform: rotateY(180deg) translateZ(calc(var(--book-thickness) / 2));
}

.book3d-spine,
.book3d-pages {
  width: var(--book-thickness);
  left: 50%;
}

.book3d-spine {
  transform: translateX(-50%) rotateY(90deg) translateZ(calc(var(--book-width) / 2));
}

.book3d-pages {
  transform: translateX(-50%) rotateY(-90deg) translateZ(calc(var(--book-width) / 2));
  background: repeating-linear-gradient(90deg, #f8f4e9 0 2px, #d9d1be 2px 3px, #fdfaf2 3px 5px);
}

.book3d.featured-cover { --book-width: 250px; --book-thickness: 44px; }
.book3d.book-hero-cover { --book-width: 230px; --book-thickness: 40px; }
.book3d.pending-cover { --book-width: 210px; --book-thickness: 37px; }

@media (max-width: 980px) {
  .book3d.featured-cover { --book-width: 210px; --book-thickness: 37px; }
}

@media (max-width: 760px) {
  .book3d.featured-cover { --book-width: 170px; --book-thickness: 30px; }
  .book3d.book-hero-cover { --book-width: 110px; --book-thickness: 19px; }
}

@media (max-width: 600px) {
  .book3d.pending-cover { --book-width: 170px; --book-thickness: 30px; }
}

@media (max-width: 430px) {
  .book3d.book-hero-cover { --book-width: 86px; --book-thickness: 15px; }
  .book3d::after { font-size: 8px; bottom: -22px; }
}

@media (prefers-reduced-motion: reduce) {
  .book3d-volume { transition: none; }
}

.site-version {
  display: block;
  margin-top: 7px;
  font-size: 9px;
  letter-spacing: .04em;
  opacity: .78;
}
