:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #62717c;
  --paper: #fbf7ef;
  --cream: #fffdf8;
  --line: #d9d0c1;
  --teal: #116a6b;
  --teal-soft: #dff2ef;
  --coral: #c5533d;
  --gold: #c4932f;
  --leaf: #486b3d;
  --blue: #2f5f98;
  --shadow: 0 18px 55px rgba(31, 41, 51, 0.14);
  --shadow-soft: 0 8px 24px rgba(31, 41, 51, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(223, 242, 239, 0.74), rgba(255, 253, 248, 0.9) 38%, rgba(255, 241, 221, 0.72)),
    var(--paper);
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(196, 147, 47, 0.72);
  outline-offset: 3px;
}

.mobile-bar,
.drawer-shade,
.menu-close {
  display: none;
}

.mobile-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #153f42;
  color: #fffaf0;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.18);
}

.mobile-title {
  min-width: 0;
  text-align: right;
}

.mobile-title strong,
.mobile-title span {
  display: block;
}

.mobile-title strong {
  overflow: hidden;
  color: #fffdf8;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-title span {
  color: rgba(255, 250, 240, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #153f42;
  background: #f5c25d;
  font-weight: 900;
}

.menu-icon {
  display: grid;
  gap: 4px;
}

.menu-icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 18px;
  background: #153f42;
  color: #fffaf0;
  scrollbar-color: rgba(255, 250, 240, 0.32) transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f5c25d;
  color: #153f42;
  font-size: 34px;
  font-weight: 800;
}

.brand h1,
.top-band h2,
.video-panel h3,
.review-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 5px;
  color: currentColor;
  opacity: 0.72;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.progress-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-top,
.stats-row,
.panel-heading,
.action-row,
.top-band,
.media-grid {
  display: flex;
  align-items: center;
}

.progress-top,
.stats-row,
.panel-heading {
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  height: 10px;
  margin: 13px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0%;
  background: #f5c25d;
  transition: width 0.3s ease;
}

.progress-track.light {
  background: #e8dfd2;
}

.stats-row {
  color: rgba(255, 250, 240, 0.86);
  font-size: 13px;
}

.lesson-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.lesson-button {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  color: rgba(255, 250, 240, 0.9);
  background: transparent;
  text-align: left;
  transition: background 0.18s ease, transform 0.18s ease;
}

.lesson-button:hover,
.lesson-button.active {
  background: rgba(255, 255, 255, 0.13);
}

.lesson-button:hover {
  transform: translateX(2px);
}

.lesson-button .number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
}

.lesson-button strong {
  display: block;
  font-size: 14px;
}

.lesson-button span {
  font-size: 12px;
  color: rgba(255, 250, 240, 0.65);
}

.check {
  color: #f5c25d;
  font-weight: 900;
}

.main {
  padding: 28px;
  overflow: hidden;
}

.top-band {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 253, 248, 0.88), rgba(255, 253, 248, 0.88)),
    url("assets/book-pages/page-014.jpg") center 34% / cover;
  box-shadow: var(--shadow-soft);
}

.top-band h2 {
  max-width: 780px;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 0.98;
}

.subtitle {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.daily-card {
  min-width: 180px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
}

.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
}

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

.continue-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.continue-card button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.continue-card button:hover,
.action-row button:hover,
.quiz-options button:hover,
.build-token:hover,
.match-card:hover,
.link-button:hover,
.word-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.daily-card strong,
.daily-label {
  display: block;
}

.daily-label {
  color: var(--coral);
  font-weight: 800;
}

#resetProgress {
  margin-top: 12px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.lesson-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.srs-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.srs-dashboard article,
.source-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
}

.srs-dashboard article {
  padding: 16px;
}

.srs-dashboard strong {
  display: block;
  margin: 4px 0;
  color: #153f42;
  font-size: 30px;
  line-height: 1;
}

.srs-dashboard small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.3;
}

.focus-panel,
.book-panel,
.activity-card,
.video-panel,
.review-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
}

.focus-panel,
.book-panel,
.activity-card,
.video-panel,
.review-panel {
  padding: 20px;
}

.focus-panel {
  position: relative;
}

.focus-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral));
}

.pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: #0e5556;
  background: var(--teal-soft);
  font-size: 13px;
  font-weight: 800;
}

.arabic-feature {
  min-height: 90px;
  display: grid;
  place-items: center;
  margin: 16px 0;
  padding: 22px;
  border-radius: 8px;
  color: #153f42;
  background: #eef7f4;
  font-size: clamp(38px, 8vw, 86px);
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
}

.lesson-summary {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.coach-note strong,
.coach-note span,
.activity-hint {
  display: block;
}

.key-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.key-point {
  min-height: 100px;
  padding: 13px;
  border-radius: 8px;
  background: #fff4e0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.key-point:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.key-point:nth-child(2) {
  background: #e8f0fb;
}

.key-point:nth-child(3) {
  background: #e8f2df;
}

.key-point strong {
  display: block;
  margin-bottom: 6px;
}

.key-point span {
  color: #4b5a63;
  font-size: 14px;
  line-height: 1.35;
}

.lesson-body {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.lesson-section {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.coach-note {
  padding: 15px;
  border: 1px solid #e9d6ad;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fff8e8;
}

.coach-note strong {
  margin-bottom: 5px;
  color: #6f4d10;
}

.coach-note span {
  color: #5b6470;
  line-height: 1.5;
}

.lesson-section h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.lesson-section p,
.lesson-section li {
  color: var(--muted);
  line-height: 1.55;
}

.lesson-section p {
  margin: 0;
}

.lesson-section ul,
.lesson-section ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

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

.example-card {
  min-height: 92px;
  padding: 13px;
  border-radius: 8px;
  background: #eef7f4;
}

.example-kicker {
  display: block;
  margin-bottom: 4px;
  color: #517277;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.example-card strong {
  display: block;
  color: #153f42;
  font-size: 24px;
  line-height: 1.35;
}

.example-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.action-row {
  gap: 10px;
  flex-wrap: wrap;
}

.action-row button,
.quiz-options button,
.match-card,
.build-token,
.recall-actions button,
.link-button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
}

.action-row button,
.quiz-options button.correct,
.recall-actions button {
  color: #fff;
  background: var(--teal);
}

.action-row button.secondary,
.quiz-options button,
.build-token {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.ghost {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.book-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.book-panel summary::-webkit-details-marker {
  display: none;
}

.book-panel summary strong {
  display: block;
}

.book-panel img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.practice-band {
  margin: 18px 0;
}

.source-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 18px;
}

.source-note h3 {
  margin: 0 0 5px;
}

.source-note p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-note button,
.word-tools button,
.review-study-card button,
.ayah-actions button,
.add-review {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tab {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.tab.active {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.activity-card {
  min-height: 240px;
}

.activity-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.activity-hint {
  margin: -3px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.activity-card p {
  color: var(--muted);
  line-height: 1.5;
}

.quiz-arabic {
  display: inline-block;
  margin-bottom: 6px;
  color: #153f42;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.35;
}

.quiz-options,
.match-grid,
.build-bank,
.build-answer {
  display: grid;
  gap: 10px;
}

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

.quiz-options button {
  text-align: left;
  min-height: 58px;
}

.quiz-options button.wrong {
  color: #fff;
  background: var(--coral);
}

.feedback {
  min-height: 28px;
  margin-top: 12px;
  font-weight: 800;
  color: var(--teal);
}

.word-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.word-tools select,
.word-search {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.word-tools select {
  padding: 0 12px;
}

.word-search {
  width: min(420px, 100%);
  padding: 0 14px;
}

.word-list {
  display: grid;
  gap: 12px;
}

.word-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.word-main {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 14px;
  align-items: center;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.word-main strong,
.review-arabic,
.ayah-line button {
  font-family: "Traditional Arabic", "Amiri", "Noto Naskh Arabic", serif;
}

.word-main strong {
  color: #153f42;
  font-size: 34px;
  line-height: 1.2;
}

.word-main span {
  color: var(--muted);
  line-height: 1.35;
}

.word-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef7f4;
  color: #153f42;
  font-size: 12px;
  font-weight: 800;
}

.word-detail {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.word-detail dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.word-detail dl div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
}

.word-detail dt {
  color: var(--muted);
  font-weight: 900;
}

.word-detail dd {
  margin: 0;
  line-height: 1.4;
}

.word-detail dd[dir="rtl"] {
  font-size: 28px;
  line-height: 1.2;
}

.add-review:disabled {
  opacity: 0.66;
}

.review-study-card {
  display: grid;
  gap: 14px;
}

.review-arabic {
  min-height: 130px;
  color: #153f42;
  background: #eef7f4;
  font-size: clamp(48px, 10vw, 108px);
  font-weight: 900;
  line-height: 1.1;
}

.srs-rating-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.srs-rating-row button:nth-child(1) {
  background: var(--coral);
}

.srs-rating-row button:nth-child(2) {
  background: var(--gold);
}

.srs-rating-row button:nth-child(3) {
  background: var(--teal);
}

.srs-rating-row button:nth-child(4) {
  background: var(--leaf);
}

.ayah-test {
  display: grid;
  gap: 14px;
}

.ayah-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef7f4;
}

.ayah-line button {
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid rgba(17, 106, 107, 0.2);
  border-radius: 8px;
  color: #153f42;
  background: #fff;
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 900;
  line-height: 1.1;
}

.ayah-line button.known {
  border-color: var(--leaf);
  background: #e8f2df;
}

.ayah-line button.unknown {
  border-color: var(--coral);
  background: #fff0e8;
}

.ayah-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ayah-actions .secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.ayah-meanings {
  display: grid;
  gap: 8px;
}

.ayah-meanings div {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ayah-meanings strong {
  color: #153f42;
  font-size: 30px;
}

.match-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.match-card {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  min-height: 76px;
  overflow-wrap: anywhere;
}

.match-card.selected {
  outline: 3px solid var(--gold);
}

.match-card.matched {
  color: #fff;
  background: var(--leaf);
}

.build-bank,
.build-answer {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-top: 12px;
}

.build-answer {
  min-height: 68px;
  padding: 10px;
  border: 1px dashed var(--teal);
  border-radius: 8px;
  background: #eef7f4;
}

.build-token.used {
  opacity: 0.45;
}

.recall-card {
  display: grid;
  gap: 12px;
}

.recall-prompt {
  padding: 22px;
  border-radius: 8px;
  background: #f1ecd9;
  color: #2a3035;
  font-size: 22px;
  font-weight: 800;
}

.recall-answer {
  min-height: 54px;
  padding: 14px;
  border-radius: 8px;
  background: #eef7f4;
  color: #153f42;
  font-weight: 800;
}

.media-grid {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
}

.video-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.channel-link {
  background: var(--coral);
}

.player-shell {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #1f2933;
}

.player-stage,
.player-stage iframe,
.player-stage button {
  width: 100%;
  height: 100%;
}

.player-stage iframe {
  display: block;
  border: 0;
  background: #1f2933;
}

.player-poster {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  color: #fff;
  background-position: center;
  background-size: cover;
  isolation: isolate;
}

.player-poster::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(12, 22, 31, 0.42), rgba(12, 22, 31, 0.74));
}

.player-play {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
  font-size: 24px;
  font-weight: 900;
}

.player-cover-title {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.68);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.player-fallback {
  position: absolute;
  right: 18px;
  top: 18px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.video-help {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.video-list,
.review-queue {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.video-item,
.review-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.video-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.video-item.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(17, 106, 107, 0.14);
}

.video-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.video-thumb {
  width: 132px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #d9d0c1;
}

.video-copy strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.video-copy span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.youtube-url {
  display: inline-block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.video-actions {
  display: grid;
  gap: 8px;
}

.video-item button {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.video-item button[data-action="copy"] {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.video-item button[data-action="play"] {
  background: var(--coral);
}

.video-item a {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.video-item a.youtube-url {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  white-space: normal;
}

.soft-text {
  color: var(--muted);
  line-height: 1.5;
}

.review-item strong {
  display: block;
  margin-bottom: 4px;
}

.review-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 320px;
  padding: 13px 16px;
  border-radius: 8px;
  color: #fff;
  background: #153f42;
  box-shadow: var(--shadow);
  transform: translateY(120px);
  transition: transform 0.25s ease;
  z-index: 10;
}

.toast.show {
  transform: translateY(0);
}

.bottom-actions {
  display: none;
}

.player-mode-banner {
  position: fixed;
  left: 50%;
  top: 16px;
  z-index: 20;
  width: min(680px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.player-mode-banner strong {
  display: block;
  margin-bottom: 5px;
}

.player-mode-banner a {
  color: var(--blue);
  font-weight: 900;
}

@media (max-width: 1050px) {
  body.nav-open {
    overflow: hidden;
  }

  .mobile-bar {
    display: flex;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(86vw, 340px);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    box-shadow: 16px 0 42px rgba(0, 0, 0, 0.22);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .drawer-shade {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, 0.48);
  }

  body.nav-open .drawer-shade {
    display: block;
  }

  .menu-close {
    display: inline-flex;
    margin-left: auto;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    color: #fffaf0;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 800;
  }

  .lesson-nav {
    grid-template-columns: 1fr;
  }

  .lesson-grid,
  .media-grid,
  .srs-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 76px;
  }

  .main {
    padding: 14px;
  }

  .top-band {
    display: grid;
    padding: 16px;
  }

  .top-band h2 {
    font-size: 34px;
  }

  .subtitle,
  .lesson-summary {
    font-size: 15px;
  }

  .key-points,
  .quiz-options,
  .match-grid,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .video-item {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .video-thumb {
    width: 96px;
  }

  .video-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .video-actions a {
    grid-column: 1 / -1;
  }

  .daily-card {
    min-width: 0;
  }

  .continue-card {
    display: grid;
  }

  .source-note,
  .word-tools {
    display: grid;
  }

  .continue-card button {
    width: 100%;
  }

  .focus-panel,
  .book-panel,
  .activity-card,
  .video-panel,
  .review-panel {
    padding: 16px;
  }

  .word-main,
  .word-detail dl div,
  .ayah-meanings div {
    grid-template-columns: 1fr;
  }

  .srs-rating-row {
    grid-template-columns: 1fr 1fr;
  }

  .player-play {
    width: 76px;
    height: 76px;
    font-size: 18px;
  }

  .player-cover-title {
    left: 12px;
    right: 12px;
    bottom: 12px;
    font-size: 15px;
  }

  .bottom-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 253, 248, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px rgba(31, 41, 51, 0.12);
  }

  .bottom-actions button {
    min-height: 48px;
    border-radius: 8px;
    color: #fff;
    background: var(--teal);
    font-weight: 900;
  }

  .bottom-actions button:first-child {
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
  }

  .bottom-actions button:last-child {
    background: var(--blue);
  }
}
