:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #66716b;
  --paper: #fffaf1;
  --panel: #ffffff;
  --line: #e5dfd2;
  --green: #25745a;
  --deep-green: #173f34;
  --teal: #0f7f89;
  --gold: #c7861b;
  --rose: #b64d67;
  --sky: #dff3f2;
  --shadow: 0 18px 50px rgba(31, 37, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 127, 137, 0.12), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(199, 134, 27, 0.14), transparent 26rem),
    linear-gradient(120deg, rgba(223, 243, 242, 0.8), rgba(255, 250, 241, 0.95) 38%, rgba(255, 235, 204, 0.72)),
    var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(23, 32, 28, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 28, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

:focus-visible {
  outline: 3px solid rgba(15, 127, 137, 0.38);
  outline-offset: 3px;
}

.clean-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.clean-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(260px, 0.75fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid rgba(229, 223, 210, 0.9);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.92);
  backdrop-filter: blur(18px);
}

.compact-brand {
  margin-bottom: 0;
}

.compact-brand .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  font-size: 28px;
}

.compact-brand h1 {
  color: var(--ink);
}

.compact-brand p {
  color: var(--muted);
}

.app-tabs,
.library-tabs {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.app-tab,
.library-tab {
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4e5a53;
  font-weight: 800;
  cursor: pointer;
}

.app-tab.is-active,
.library-tab.is-active {
  background: var(--ink);
  color: #fff;
}

.compact-stats {
  margin-bottom: 0;
  background: #fff;
  color: var(--ink);
}

.compact-stats .label {
  color: var(--muted);
}

.app-view,
.library-view {
  display: none;
}

.app-view.is-visible,
.library-view.is-visible {
  display: block;
}

.focus-hero {
  display: block;
  margin-bottom: 16px;
}

.focus-hero .hero-copy {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  width: 100%;
  max-width: none;
  min-height: 220px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 253, 249, 0.9)),
    #fff;
  box-shadow: 0 10px 28px rgba(31, 37, 32, 0.07);
}

.focus-hero .hero-copy::after {
  position: absolute;
  right: clamp(18px, 6vw, 80px);
  top: 50%;
  content: "اقرأ";
  color: rgba(37, 116, 90, 0.07);
  font-family: "Traditional Arabic", "Amiri", "Scheherazade New", serif;
  font-size: clamp(6rem, 16vw, 12rem);
  font-weight: 900;
  line-height: 1;
  transform: translateY(-46%);
}

.focus-hero .hero-copy > * {
  position: relative;
  z-index: 1;
}

.clean-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(31, 37, 32, 0.07);
}

.quest-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.5fr);
  gap: 18px;
  align-items: stretch;
  padding: 24px;
  margin-bottom: 16px;
}

.quest-hero h2 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.05;
}

.quest-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quest-summary article {
  display: grid;
  align-content: center;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.quest-summary strong {
  margin-top: 6px;
  font-size: 1.45rem;
}

.quest-layout,
.concept-quest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 16px;
  margin-bottom: 16px;
}

.quest-map-panel,
.today-plan,
.concept-map-panel,
.checkpoint-panel {
  padding: 18px;
}

.compact-title {
  margin-bottom: 8px;
}

.quest-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 10px;
}

.quest-node {
  position: relative;
  min-height: 164px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.quest-node::after {
  position: absolute;
  top: 24px;
  right: -10px;
  width: 18px;
  height: 2px;
  content: "";
  background: rgba(37, 116, 90, 0.28);
}

.quest-node-number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--sky);
  color: var(--deep-green);
  font-weight: 900;
}

.quest-node strong,
.quest-node em,
.quest-node small,
.quest-node b {
  display: block;
}

.quest-node em {
  margin-top: 8px;
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
}

.quest-node small {
  margin-top: 8px;
  color: var(--muted);
}

.quest-node b {
  width: fit-content;
  margin-top: 10px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #fff2cf;
  color: #7a4c05;
  font-size: 0.75rem;
}

.quest-node.is-current {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 2px rgba(15, 127, 137, 0.14);
}

.quest-node.is-done {
  border-color: rgba(37, 116, 90, 0.32);
  background: #f3fbf7;
}

.quest-node.is-ahead {
  opacity: 0.72;
}

.today-plan ol {
  padding-left: 20px;
  color: #3f4a43;
  line-height: 1.6;
}

.note-box {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.note-box label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.note-box textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

.concept-node-map {
  display: grid;
  gap: 10px;
}

.concept-node,
.checkpoint-card,
.parse-card,
.challenge-card,
.challenge-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.concept-node h4,
.checkpoint-card h4,
.parse-card h4,
.challenge-card h4 {
  margin: 6px 0;
}

.inline-page-link {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(37, 116, 90, 0.18);
  border-radius: 999px;
  background: #f4fbf8;
  color: var(--deep-green);
  font-weight: 800;
  cursor: pointer;
}

.checkpoint-actions,
.workbook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.locked-key {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.parse-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.parse-token {
  min-height: 116px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  cursor: pointer;
}

.parse-token strong {
  display: block;
  font-family: "Traditional Arabic", "Amiri", "Scheherazade New", serif;
  font-size: 1.8rem;
}

.parse-token span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 900;
}

.parse-token.is-labeled {
  border-color: var(--green);
  background: #f3fbf7;
}

.parse-answer {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.parse-answer > div {
  display: grid;
  grid-template-columns: 110px 1fr 1.3fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.challenge-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.focus-hero h2 {
  max-width: 720px;
  margin: 8px 0 10px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.04;
}

.focus-hero p:not(.eyebrow) {
  max-width: 680px;
  color: #46514a;
  font-size: 1.05rem;
  line-height: 1.58;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.hero-meta span,
.lesson-status {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(37, 116, 90, 0.16);
  border-radius: 999px;
  background: rgba(248, 252, 250, 0.86);
  color: var(--deep-green);
  font-size: 0.84rem;
  font-weight: 900;
}

.hero-meta span:last-child,
.lesson-status.is-mastered {
  border-color: rgba(199, 134, 27, 0.28);
  background: #fff2cf;
  color: #6f4a0b;
}

.progress-panel,
.clean-panel {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 28px rgba(31, 37, 32, 0.06);
}

.clean-lesson-stage {
  margin-top: 18px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.library-tabs {
  width: fit-content;
  margin-bottom: 16px;
}

button,
a {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  background: #17201c;
  color: #f7f1e7;
}

.brand,
.lesson-card,
.section-title,
.stats,
.video-layout {
  display: flex;
  align-items: center;
}

.brand {
  gap: 14px;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  background: #f2c35d;
  color: #17201c;
  font-size: 34px;
  font-weight: 800;
}

.brand p,
.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand p {
  color: #d2c8b7;
}

.clean-topbar .brand p {
  color: var(--muted);
}

.brand h1,
.hero h2,
.lesson-copy h3,
.section-title h3,
.concept-box h4,
.quiz-box h4,
.builder h4 {
  margin: 0;
  line-height: 1.03;
}

.brand h1 {
  font-size: 1.35rem;
}

.stats {
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.stats div {
  min-width: 0;
}

.stats .label {
  color: #cfc7b8;
}

.stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
}

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

.lesson-button {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.lesson-button:hover,
.lesson-button.is-active {
  background: #f7f1e7;
  color: #17201c;
}

.lesson-button small {
  display: block;
  margin-top: 4px;
  color: currentColor;
  opacity: 0.72;
}

.lesson-button .done {
  float: right;
  color: var(--gold);
  font-weight: 900;
}

.resource-box {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.resource-box a,
.resource-card,
.video-link {
  color: inherit;
  text-decoration: none;
}

.resource-box a {
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 28px;
  align-items: stretch;
  min-height: 340px;
  margin-bottom: 24px;
}

.hero-copy {
  align-self: center;
  max-width: 760px;
}

.hero h2 {
  max-width: 680px;
  margin-top: 8px;
  font-size: clamp(2.3rem, 6vw, 5.4rem);
}

.hero p:not(.eyebrow) {
  max-width: 650px;
  color: #46514a;
  font-size: 1.1rem;
  line-height: 1.65;
}

.hero-picture {
  min-height: 320px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.hero-actions,
.actions,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button,
.tab,
.choice,
.word-chip {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  padding: 0 18px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #1e654e;
  transform: translateY(-1px);
}

.ghost-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.install-button {
  border-color: rgba(15, 127, 137, 0.32);
  color: #13565c;
}

[hidden] {
  display: none !important;
}

.ghost-button:hover,
.ghost-button:focus-visible,
.path-tile:hover,
.tab:hover,
.choice:hover,
.word-chip:hover,
.module-button:hover,
.document-card:hover,
.workbook-page-button:hover {
  border-color: rgba(15, 127, 137, 0.45);
  box-shadow: 0 10px 24px rgba(31, 37, 32, 0.08);
  transform: translateY(-1px);
}

button,
a {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.path-panel,
.trainer,
.resources,
.deep-course {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 40px rgba(31, 37, 32, 0.08);
}

.section-title {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-title h3 {
  margin-top: 4px;
  font-size: 1.45rem;
}

.meter {
  min-width: 230px;
  color: var(--muted);
  font-weight: 700;
}

.meter i {
  display: block;
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e1d6;
}

.meter b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.35s ease;
}

.lesson-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.path-tile {
  display: grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.path-tile.is-active {
  border-color: rgba(37, 116, 90, 0.48);
  background: var(--green);
  color: #fff;
  outline: 3px solid rgba(37, 116, 90, 0.16);
}

.path-tile.is-done {
  border-color: rgba(15, 127, 137, 0.32);
  background: #eaf6f4;
}

.path-tile strong {
  display: none;
}

.path-tile small,
.path-tile .label {
  display: none;
}

.step-number {
  font-weight: 900;
}

.lesson-stage {
  display: grid;
  grid-template-columns: minmax(240px, 0.58fr) minmax(0, 1.42fr);
  gap: 18px;
  margin-top: 22px;
}

.lesson-card {
  align-items: stretch;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(229, 223, 210, 0.92);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(31, 37, 32, 0.08);
}

.clean-lesson-stage > .lesson-card {
  position: sticky;
  top: 96px;
  align-self: start;
}

.lesson-image {
  height: 240px;
}

.lesson-copy {
  padding: 20px;
}

.lesson-copy h3 {
  margin-top: 7px;
  font-size: 2rem;
}

.lesson-status {
  margin-top: 10px;
}

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

.pill-row span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--sky);
  color: #13565c;
  font-size: 0.83rem;
  font-weight: 800;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.tab {
  min-height: 40px;
  background: transparent;
  color: #44504a;
  font-weight: 800;
}

.tab.is-active {
  background: var(--deep-green);
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 63, 52, 0.16);
}

.mode {
  display: none;
}

.mode.is-visible {
  display: block;
}

.concept-box,
.pattern-box,
.coach,
.quiz-box,
.builder {
  padding: 18px 20px;
  border: 1px solid rgba(229, 223, 210, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.concept-box {
  border-color: rgba(37, 116, 90, 0.16);
  background:
    linear-gradient(135deg, rgba(248, 252, 250, 0.96), rgba(255, 255, 255, 0.92)),
    #fff;
}

.pattern-box {
  margin: 10px 0 12px;
  border-color: rgba(199, 134, 27, 0.22);
  background: #fff8e6;
}

.pattern-box strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.concept-box p,
.coach li,
.feedback {
  color: var(--muted);
  line-height: 1.55;
}

.examples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 14px;
}

.example {
  padding: 15px;
  border: 1px solid rgba(15, 127, 137, 0.12);
  border-radius: 8px;
  background: #eaf6f4;
}

.example strong {
  display: block;
  font-family: "Traditional Arabic", "Amiri", "Scheherazade New", serif;
  font-size: 1.9rem;
  line-height: 1.2;
  direction: rtl;
}

.example span {
  display: block;
  margin-top: 6px;
  color: #44504a;
  font-weight: 700;
}

.arabic-lab {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid rgba(37, 116, 90, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(251, 255, 253, 0.98), rgba(244, 250, 247, 0.88)),
    #fbfffd;
}

.arabic-lab .section-title {
  margin-bottom: 12px;
}

.arabic-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 12px;
}

.arabic-lab-card {
  padding: 14px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.arabic-chip-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.arabic-chip,
.breakdown-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(37, 116, 90, 0.1);
  border-radius: 8px;
  background: #f3faf7;
}

.arabic-chip strong,
.breakdown-item strong {
  display: block;
  color: #1d3f35;
  font-family: "Traditional Arabic", "Amiri", "Scheherazade New", serif;
  font-size: 1.8rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.arabic-chip span,
.breakdown-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

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

.breakdown-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.arabic-check {
  margin-top: 12px;
  border: 1px solid rgba(199, 134, 27, 0.26);
  border-radius: 8px;
  background: #fffaf0;
}

.arabic-check summary {
  cursor: pointer;
  padding: 13px 14px;
  color: #5a4014;
  font-weight: 900;
}

.arabic-check p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  line-height: 1.55;
}

.lesson-walkthrough {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid rgba(15, 127, 137, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.walkthrough-lead {
  margin: 0 0 12px;
  color: #3e4943;
  font-size: 1rem;
  line-height: 1.62;
}

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

.walkthrough-card {
  padding: 14px;
  border: 0;
  border-radius: 8px;
  background: #f8fcfa;
}

.walkthrough-card p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.walkthrough-check {
  margin-top: 12px;
  border: 1px solid rgba(37, 116, 90, 0.22);
  border-radius: 8px;
  background: #f3faf7;
}

.walkthrough-check summary {
  cursor: pointer;
  padding: 13px 14px;
  color: #173f34;
  font-weight: 900;
}

.walkthrough-check p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  line-height: 1.55;
}

.coach {
  margin-bottom: 14px;
}

.coach ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.study-deep-dive {
  display: block;
  margin: 14px 0;
}

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

.study-expander,
.chart-expander {
  border: 1px solid rgba(229, 223, 210, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.study-expander summary,
.chart-expander summary {
  display: grid;
  gap: 5px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.study-expander summary::-webkit-details-marker,
.chart-expander summary::-webkit-details-marker {
  display: none;
}

.study-expander summary strong,
.chart-expander summary strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.study-expander summary small,
.chart-expander summary small {
  color: var(--muted);
  line-height: 1.45;
}

.study-expander[open] summary,
.chart-expander[open] summary {
  border-bottom: 1px solid var(--line);
}

.study-expander[open] .deep-card-grid,
.chart-expander-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.deep-card {
  padding: 16px;
  border: 1px solid rgba(229, 223, 210, 0.72);
  border-radius: 8px;
  background: #fff;
}

.full-width-card {
  grid-column: 1 / -1;
  background: #f8fcfa;
  border-color: rgba(37, 116, 90, 0.24);
}

.deep-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.compact-links {
  margin-top: 10px;
}

.compact-links a {
  padding: 8px 10px;
  font-size: 0.92rem;
}

.flashcard {
  display: grid;
  width: 100%;
  min-height: 310px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(37, 116, 90, 0.08), rgba(199, 134, 27, 0.14)),
    #fff;
  color: var(--ink);
  text-align: center;
}

.flashcard:hover {
  transform: translateY(-2px);
}

.flashcard strong {
  align-self: end;
  font-size: clamp(2rem, 6vw, 4rem);
  direction: rtl;
}

.flashcard p {
  margin: 10px auto 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 1.1rem;
}

.choices,
.word-bank,
.answer-tray,
.video-list,
.resource-grid {
  display: grid;
  gap: 10px;
}

.choices {
  grid-template-columns: repeat(2, 1fr);
}

.choice,
.word-chip {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.choice.correct {
  border-color: #96d5bd;
  background: #ddf4e8;
}

.choice.wrong {
  border-color: #efb5b5;
  background: #ffeaea;
}

.word-bank,
.answer-tray {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  min-height: 66px;
  margin-top: 12px;
}

.answer-tray {
  padding: 10px;
  border: 2px dashed #d6cbbc;
  border-radius: 8px;
  background: #fffaf1;
}

.video-layout {
  align-items: stretch;
  gap: 16px;
}

.video-layout.has-no-video {
  display: block;
}

.video-layout.has-no-video video {
  display: none;
}

video {
  width: min(54vw, 680px);
  min-height: 280px;
  border-radius: 8px;
  background: #101514;
}

.video-link,
.resource-card {
  display: block;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.video-link.is-active {
  border-color: var(--teal);
  box-shadow: inset 4px 0 0 var(--teal);
}

.video-placeholder {
  color: var(--muted);
}

.video-placeholder strong,
.video-placeholder span {
  display: block;
}

.video-placeholder span {
  margin-top: 6px;
  line-height: 1.45;
}

.video-note {
  padding: 13px;
  border: 1px solid rgba(37, 116, 90, 0.18);
  border-radius: 8px;
  background: #f8fcfa;
  color: var(--muted);
}

.video-note strong,
.video-note span {
  display: block;
}

.video-note span {
  margin-top: 5px;
  line-height: 1.45;
}

.resources {
  margin-top: 22px;
}

.deep-course {
  margin-top: 22px;
}

.search-box {
  width: min(420px, 100%);
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.course-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.roadmap-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.38fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

.module-button {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.module-button.is-active {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--green);
}

.module-button strong {
  display: block;
  margin-top: 3px;
  line-height: 1.2;
}

.module-detail {
  display: grid;
  gap: 14px;
}

.module-hero,
.module-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.module-hero h4 {
  margin: 6px 0 0;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  line-height: 1.04;
}

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

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

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

.resource-mini-list a {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.workbook-inline-link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.resource-mini-list a:hover,
.workbook-inline-link:hover {
  border-color: var(--teal);
}

.day-card,
.document-card,
.page-card,
.all-video-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.day-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.day-card h4 {
  margin: 4px 0 0;
  font-size: 1.2rem;
  line-height: 1.15;
}

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

.day-card details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.day-card summary {
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.day-card details .detail-list {
  margin-top: 10px;
}

.day-card details p {
  margin-top: 10px;
}

.detail-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: #3e4943;
  line-height: 1.45;
}

.source-chip {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff2cf;
  color: #6f4a0b;
  font-size: 0.82rem;
  font-weight: 800;
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-top: 18px;
}

.mini-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
}

.mini-title strong {
  font-size: 1.02rem;
}

.document-list,
.page-reader,
.all-video-list {
  display: grid;
  gap: 10px;
}

.document-card {
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.document-card.is-active {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--green);
}

.document-card h4,
.page-card h4,
.all-video-card h4 {
  margin: 0;
  line-height: 1.2;
}

.document-card p,
.page-card p,
.all-video-card span {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.term-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.term-row span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eaf6f4;
  color: #13565c;
  font-size: 0.76rem;
  font-weight: 800;
}

.page-reader {
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.page-card {
  padding: 14px;
}

.page-card p {
  font-size: 0.94rem;
}

.document-preview-card {
  border-color: rgba(37, 116, 90, 0.26);
  background: #f8fcfa;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.page-detail summary {
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.page-detail p {
  margin-top: 12px;
}

.core-chart-panel {
  margin: 14px 0;
}

.compact-section-title {
  margin-bottom: 12px;
}

.chart-preview {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.chart-preview p {
  color: var(--muted);
  line-height: 1.55;
}

.chart-preview img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.muslim-chart-intro {
  max-width: 980px;
  margin-bottom: 12px;
}

.muslim-chart-intro p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.55;
}

.muslim-chart-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.muslim-chart-collapse {
  margin-top: 12px;
}

.muslim-chart-collapse summary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.muslim-chart-collapse .muslim-chart-table-wrap {
  margin-top: 12px;
}

.muslim-chart-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: #fff;
}

.muslim-chart-table caption {
  padding: 14px;
  background: #17201c;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  text-align: left;
}

.muslim-chart-table th,
.muslim-chart-table td {
  padding: 14px 16px;
  border: 1px solid var(--line);
  vertical-align: middle;
}

.muslim-chart-table thead th {
  background: #f3eadb;
  color: #17201c;
  font-weight: 900;
}

.muslim-chart-table tbody th {
  background: #f8fcfa;
  color: #173f34;
  font-weight: 900;
}

.muslim-chart-table td[dir="rtl"] {
  color: #111a17;
  font-family: "Traditional Arabic", "Amiri", "Scheherazade New", serif;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.muslim-chart-table span {
  color: var(--muted);
  font-size: 0.86rem;
}

.original-chart-page {
  margin-top: 14px;
}

.original-chart-page summary {
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.original-chart-page img {
  display: block;
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workbook-browser {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.workbook-page-list {
  display: grid;
  gap: 14px;
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.key-pages,
.all-pages {
  display: grid;
  gap: 8px;
}

.workbook-page-button {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.workbook-page-button.is-active {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--green);
}

.workbook-page-button strong,
.workbook-page-button small {
  display: block;
}

.workbook-page-button small {
  margin-top: 4px;
  color: var(--muted);
}

.workbook-page-preview {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workbook-page-preview img {
  display: block;
  width: 100%;
  max-height: 820px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.all-videos {
  margin-top: 18px;
}

.all-video-list {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.all-video-card {
  padding: 13px;
  color: var(--ink);
  text-decoration: none;
}

.all-video-card:hover,
.resource-card:hover,
.video-link:hover {
  border-color: var(--teal);
}

.resource-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.resource-card strong {
  display: block;
}

.resource-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 340px;
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(14px);
  transition: 0.25s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  .clean-topbar,
  .focus-hero,
  .quest-hero,
  .quest-layout,
  .concept-quest-grid,
  .roadmap-layout,
  .chart-preview,
  .workbook-browser,
  .app-shell,
  .hero,
  .lesson-stage {
    grid-template-columns: 1fr;
  }

  .clean-topbar {
    position: static;
  }

  .clean-lesson-stage > .lesson-card {
    position: static;
  }

  .app-tabs,
  .library-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .lesson-nav {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  video {
    width: 100%;
  }

  .video-layout {
    display: grid;
  }
}

@media (max-width: 680px) {
  .clean-shell,
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .focus-hero .hero-copy {
    padding: 20px;
  }

  .focus-hero .hero-copy::after {
    right: 10px;
    font-size: 6.5rem;
  }

  .focus-hero h2 {
    font-size: 2.2rem;
  }

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

  .hero h2 {
    font-size: 2.45rem;
  }

  .tabs,
  .examples,
  .arabic-lab-grid,
  .arabic-chip-list,
  .breakdown-list,
  .walkthrough-grid,
  .choices,
  .deep-card-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    display: grid;
  }

  .meter {
    min-width: 0;
  }

  .library-layout {
    grid-template-columns: 1fr;
  }

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

  .quest-summary {
    grid-template-columns: 1fr;
  }

  .quest-node::after {
    display: none;
  }

  .parse-answer > div {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
