@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;
  }
}
.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;
  }
}
.content-source-note {
  color: var(--muted-2);
  font-size: 9px;
}
.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;
}
.book3d.is-static {
  cursor: default;
  pointer-events: none;
}
.book3d.is-static::after {
  display: none;
}
.book3d.is-static::before {
  bottom: -2%;
  height: 10%;
  filter: blur(12px);
  opacity: .72;
}
.book3d.is-static .book3d-volume {
  transform: rotateX(4deg) rotateY(-28deg);
}
.book3d.is-static.is-flipped .book3d-volume {
  transform: rotateX(4deg) rotateY(-28deg);
}
