:root {
  --kid-sky: #d9edf7;
  --kid-mint: #dff3e8;
  --kid-lemon: #fff2bd;
  --kid-rose: #f8dfe4;
  --kid-ink: #1e2a28;
}

[hidden] {
  display: none !important;
}

body.interactive-shell {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(13, 78, 77, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(13, 78, 77, 0.04) 1px, transparent 1px),
    #f2f6f1;
  background-size: 28px 28px;
  color: var(--kid-ink);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid #c7d3ce;
  background: rgba(251, 248, 239, 0.97);
  backdrop-filter: blur(10px);
}

.app-header span,
.nav-title span,
.lesson-kicker,
.study-head span,
.section-title span,
.lesson-tile span,
.worksheet-cover span,
.worksheet-head span {
  display: block;
  color: var(--maroon);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-header strong {
  display: block;
  margin-top: 2px;
  color: var(--teal);
  font-size: 25px;
  line-height: 1.08;
}

.app-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.app-header a,
.app-header button,
.lesson-list button,
.lesson-tile,
.score-box button,
.audio-button,
.practice-audio,
.choice,
.drill-actions button,
.lesson-view-top > button,
.hero-actions a,
.hero-actions button,
.worksheet-link {
  min-height: 44px;
  border: 1px solid #b8c6c1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--kid-ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.app-header a,
.app-header button,
.lesson-view-top > button,
.score-box button,
.drill-actions button,
.hero-actions a,
.hero-actions button,
.worksheet-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
}

.app-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: calc(100vh - 78px);
}

.drill-nav {
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  overflow: auto;
  padding: 18px;
  border-right: 1px solid #c7d3ce;
  background: #fbf8ef;
}

.nav-title {
  padding: 6px 4px 16px;
  border-bottom: 1px solid #d7cbb0;
}

.nav-title strong,
.section-title strong {
  display: block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 23px;
  line-height: 1.1;
}

.lesson-list {
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.lesson-list button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
}

.lesson-list button span,
.lesson-list button small {
  color: var(--muted);
  font-size: 12px;
}

.lesson-list button strong {
  color: var(--kid-ink);
  font-size: 14px;
  line-height: 1.2;
}

.lesson-list button.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.lesson-list button.is-complete {
  border-color: #7ab48d;
  background: #eef8f0;
}

.lesson-list button.is-next:not(.active) {
  border-color: var(--gold);
  background: #fff8df;
}

.app-main {
  min-width: 0;
  padding: 28px;
}

.lesson-dashboard,
.lesson-view {
  max-width: 1180px;
  margin: 0 auto;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #cbd5d0;
  border-radius: 8px;
  background: #fbf8ef;
}

.dashboard-hero h1,
.lesson-view-top h1 {
  margin: 4px 0 10px;
  color: var(--teal);
  font-size: 42px;
  line-height: 1.02;
}

.dashboard-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-actions button {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.hero-actions a {
  border-color: #b48635;
  background: #fff7df;
  color: #704f13;
  font-weight: 800;
}

.hero-progress {
  display: grid;
  gap: 12px;
  align-content: end;
}

.hero-art {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  border: 1px solid #cbd5d0;
  border-radius: 8px;
  background: #fff6e1;
}

.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  opacity: 0.82;
}

.hero-letter-row {
  position: absolute;
  inset: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  direction: rtl;
}

.hero-letter-row b {
  display: grid;
  min-height: 62px;
  place-items: center;
  border: 2px solid rgba(8, 84, 83, 0.18);
  border-radius: 8px;
  background: rgba(255, 252, 242, 0.92);
  color: var(--teal);
  box-shadow: 0 8px 18px rgba(29, 61, 58, 0.12);
  font-family: "Noto Naskh Arabic", "Amiri Quran", serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
}

.hero-progress span {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
  font-weight: 800;
}

.dashboard-progress,
.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe5e0;
}

.dashboard-progress div,
.progress-track div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), #5aa77f);
  transition: width 180ms ease;
}

.section-title {
  margin: 22px 0 12px;
}

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

.lesson-tile {
  position: relative;
  display: grid;
  min-height: 166px;
  align-content: start;
  gap: 8px;
  padding: 16px;
  overflow: hidden;
  text-align: left;
}

.lesson-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--kid-sky);
}

.lesson-tile:nth-child(4n + 2)::before {
  background: var(--kid-mint);
}

.lesson-tile:nth-child(4n + 3)::before {
  background: var(--kid-lemon);
}

.lesson-tile:nth-child(4n + 4)::before {
  background: var(--kid-rose);
}

.lesson-tile:hover,
.lesson-tile:focus {
  border-color: var(--teal);
  background: #f8fcfa;
}

.lesson-tile strong {
  color: var(--kid-ink);
  font-size: 21px;
  line-height: 1.14;
}

.lesson-tile em {
  color: var(--teal);
  font-style: normal;
  font-weight: 800;
}

.lesson-tile small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.lesson-tile.is-next {
  border-color: var(--gold);
  background: #fff9e5;
}

.lesson-tile.is-complete {
  border-color: #75ad89;
  background: #eff8f1;
}

.lesson-view-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.score-box {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}

.score-box span {
  min-width: 70px;
  color: var(--teal);
  font-weight: 800;
  text-align: right;
}

.lesson-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}

.lesson-tabs button {
  min-height: 52px;
  border: 1px solid #b8c6c1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--kid-ink);
  font-weight: 800;
  cursor: pointer;
}

.lesson-tabs button.active {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.lesson-workspace {
  display: block;
}

.lesson-panel,
.drill-card {
  border: 1px solid #c9d2ce;
  border-radius: 8px;
  background: #fbf8ef;
}

.study-panel,
.drill-card {
  padding: 24px;
}

.study-head h2,
.drill-card-head h2 {
  margin: 4px 0 0;
  color: var(--teal);
  font-size: 28px;
}

.study-panel p {
  max-width: 780px;
  margin: 16px 0;
  color: var(--kid-ink);
  font-size: 18px;
  line-height: 1.55;
}

.study-panel ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.study-panel li {
  min-height: 70px;
  padding: 12px;
  border: 1px solid #d7cbb0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  line-height: 1.35;
}

.study-panel h3 {
  margin: 20px 0 10px;
  color: var(--maroon);
  font-size: 17px;
}

.lesson-examples,
.practice-list,
.worksheet-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.lesson-example {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  min-height: 92px;
  padding: 12px;
  border: 1px solid #d7cbb0;
  border-radius: 8px;
  background: #ffffff;
}

.example-number,
.practice-audio span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.lesson-example strong {
  color: var(--teal);
  font-size: 28px;
  line-height: 1.35;
  text-align: right;
}

.lesson-example .example-note {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.practice-audio {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 10px 12px;
  text-align: right;
}

.practice-audio strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--teal);
  font-size: 28px;
  line-height: 1.35;
}

.worksheet-preview {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 12px;
  border: 1px solid #d7cbb0;
  border-radius: 8px;
  background: #ffffff;
}

.worksheet-preview strong {
  color: var(--kid-ink);
  font-size: 17px;
}

.worksheet-preview > span {
  color: var(--muted);
}

.worksheet-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.worksheet-samples b {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #d7cbb0;
  border-radius: 8px;
  color: var(--teal);
  background: #fbf8ef;
  font-size: 20px;
}

.worksheet-link {
  width: fit-content;
  margin-top: 14px;
  border-color: var(--teal);
  color: white;
  background: var(--teal);
  font-weight: 800;
}

.drill-card {
  min-height: 620px;
}

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

.question-line {
  min-height: 30px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 20px;
}

.prompt-wrap {
  min-height: 170px;
  display: grid;
  place-items: center;
  margin: 18px 0;
  padding: 20px;
  border: 1px solid #ddcfb4;
  border-radius: 8px;
  background: #ffffff;
}

.drill-prompt {
  color: var(--teal);
  font-size: 82px;
  line-height: 1.32;
  text-align: center;
  word-break: keep-all;
}

.drill-prompt.latin-prompt {
  color: var(--kid-ink);
  font-size: 40px;
}

.drill-prompt.long-prompt {
  font-size: 34px;
  line-height: 1.8;
}

.listen-panel {
  color: var(--teal);
  font-size: 32px;
  font-weight: 800;
}

.audio-row {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 44px;
  margin-bottom: 16px;
}

.audio-button {
  padding: 0 18px;
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.audio-row span {
  color: var(--muted);
  font-size: 14px;
}

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

.choice {
  min-height: 72px;
  padding: 12px 16px;
  font-weight: 800;
  text-align: center;
}

.choice.arabic {
  font-size: 32px;
  line-height: 1.4;
}

.choice.long-choice {
  font-size: 22px;
  line-height: 1.65;
}

.choice.is-correct {
  border-color: #2f7d4f;
  background: #e2f1e6;
}

.choice.is-wrong {
  border-color: #a63b45;
  background: #f7e4e6;
}

.feedback {
  min-height: 36px;
  margin-top: 18px;
  font-weight: 800;
}

.feedback.good {
  color: #276643;
}

.feedback.bad {
  color: #8f3341;
}

.drill-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.drill-actions button {
  padding: 0 16px;
  font-weight: 800;
}

.drill-actions button:last-child {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.worksheet-shell {
  background: #eef1ed;
}

.worksheet-cover,
.worksheet-page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 18px;
  padding: 18mm;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--paper);
}

.worksheet-cover {
  display: grid;
  align-content: center;
  gap: 10px;
}

.worksheet-cover h1 {
  margin: 0;
  color: var(--teal);
  font-size: 42px;
}

.worksheet-cover p {
  max-width: 130mm;
  color: var(--muted);
  font-size: 16px;
}

.worksheet-cover a {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: var(--teal);
  text-decoration: none;
}

.worksheet-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 10mm;
  border-bottom: 1px solid var(--line);
}

.worksheet-head h1 {
  margin: 2mm 0 0;
  color: var(--teal);
  font-size: 28px;
}

.worksheet-head > strong {
  color: var(--gold);
  font-size: 38px;
}

.worksheet-goal {
  color: var(--muted);
  font-size: 14px;
}

.worksheet-block {
  margin-top: 8mm;
}

.worksheet-block h2 {
  margin: 0 0 3mm;
  color: var(--maroon);
  font-size: 17px;
}

.worksheet-read-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3mm;
}

.worksheet-arabic,
.worksheet-prompt {
  display: block;
  min-height: 17mm;
  padding: 2mm 3mm;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--teal);
  font-size: 24px;
  line-height: 1.45;
  text-align: center;
}

.worksheet-identify {
  display: grid;
  gap: 2.5mm;
}

.worksheet-question {
  display: grid;
  grid-template-columns: 8mm minmax(38mm, 1fr) minmax(42mm, 1.1fr) minmax(32mm, auto);
  gap: 3mm;
  align-items: center;
  min-height: 14mm;
  padding: 2mm;
  border: 1px solid var(--line);
  background: #ffffff;
}

.worksheet-question b {
  color: var(--teal);
}

.worksheet-question small {
  color: var(--muted);
}

.copy-practice {
  display: grid;
  gap: 4mm;
}

.copy-row {
  display: grid;
  grid-template-columns: 42mm minmax(0, 1fr);
  gap: 5mm;
  align-items: center;
}

.copy-source {
  color: var(--teal);
  font-size: 26px;
  text-align: right;
}

.copy-lines {
  display: grid;
  gap: 6mm;
}

.copy-lines span {
  display: block;
  border-bottom: 1.5px solid #9aa7a2;
}

.worksheet-checks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3mm;
}

.worksheet-checks label {
  display: flex;
  gap: 3mm;
  min-height: 18mm;
  padding: 3mm;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 12px;
  line-height: 1.35;
}

.worksheet-checks label span {
  flex: 0 0 5mm;
  width: 5mm;
  height: 5mm;
  border: 1.5px solid var(--teal);
}

@media (max-width: 1080px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .study-panel ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-header {
    position: relative;
    display: grid;
    padding: 18px;
  }

  .app-header nav {
    justify-content: start;
  }

  .app-layout {
    display: block;
  }

  .drill-nav {
    position: relative;
    top: auto;
    height: auto;
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid #cad4cf;
  }

  body.is-dashboard .drill-nav {
    display: none;
  }

  .app-main {
    padding: 18px;
  }

  .dashboard-hero,
  .lesson-view-top {
    grid-template-columns: 1fr;
  }

  .dashboard-hero h1,
  .lesson-view-top h1 {
    font-size: 36px;
  }

  .hero-art {
    height: 150px;
  }

  .hero-letter-row {
    inset: 12px;
    gap: 8px;
  }

  .hero-letter-row b {
    min-height: 52px;
    font-size: 34px;
  }

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

  .lesson-examples,
  .practice-list,
  .worksheet-list,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .drill-prompt {
    font-size: 56px;
  }

  .worksheet-cover,
  .worksheet-page {
    width: 100%;
    min-height: auto;
    padding: 18px;
  }

  .worksheet-read-row,
  .worksheet-checks {
    grid-template-columns: 1fr;
  }

  .worksheet-question,
  .copy-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  .app-header,
  .drill-nav,
  .audio-row,
  .drill-actions {
    display: none;
  }

  .app-layout,
  .lesson-workspace {
    display: block;
  }

  .worksheet-cover,
  .worksheet-page {
    margin: 0;
    border: 0;
    page-break-after: always;
  }

  .worksheet-cover a {
    display: none;
  }
}

/* ---------- session flow, objectives, and report ---------- */

.nav-unit {
  margin: 14px 4px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5c6f68;
}

.unit-section {
  margin-top: 26px;
}

.unit-head strong {
  font-size: 17px;
}

.session-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 4px;
}

.step-chip {
  border: 2px solid #cbd5d0;
  border-radius: 999px;
  background: #ffffff;
  padding: 8px 16px;
  font-weight: 800;
  font-size: 13px;
  color: var(--kid-ink);
  cursor: pointer;
}

.step-chip.done {
  border-color: #2f7d4f;
  background: #eef8f0;
  color: #276643;
}

.step-chip.active {
  border-color: #0d4e4d;
  background: #0d4e4d;
  color: #ffffff;
}

.step-chip.locked,
.step-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.step-chip.active:disabled {
  opacity: 1;
}

.objective-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--kid-lemon);
}

.objective-strip strong {
  font-size: 13px;
  margin-right: 4px;
}

.objective-pill {
  border-radius: 999px;
  background: #ffffff;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.panel-actions button {
  border: 2px solid #0d4e4d;
  border-radius: 999px;
  background: #ffffff;
  color: #0d4e4d;
  padding: 12px 22px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

.panel-actions button.primary {
  background: #0d4e4d;
  color: #ffffff;
}

.drill-kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5c6f68;
}

.results-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 14px 0 20px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 2px solid #cbd5d0;
  background: #ffffff;
}

.results-summary.pass {
  border-color: #2f7d4f;
  background: #eef8f0;
}

.results-summary.fail {
  border-color: #b0813a;
  background: #fff6e1;
}

.result-score-big {
  font-size: 44px;
  font-weight: 900;
  color: #0d4e4d;
}

.results-summary p {
  margin: 6px 0 0;
  color: #44554f;
}

.results-objectives {
  display: grid;
  gap: 12px;
}

.objective-row {
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #dbe4df;
}

.objective-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 8px;
}

.objective-row-head .is-mastered { color: #276643; font-weight: 800; }
.objective-row-head .is-developing { color: #8a6420; font-weight: 800; }
.objective-row-head .is-weak { color: #8f3341; font-weight: 800; }

.objective-bar {
  height: 10px;
  border-radius: 999px;
  background: #eef1ed;
  overflow: hidden;
}

.objective-bar div {
  height: 100%;
  border-radius: 999px;
  background: #2f7d4f;
}

.objective-bar div.is-developing { background: #d3a94e; }
.objective-bar div.is-weak { background: #c25260; }

.report-panel {
  margin-top: 26px;
  padding: 20px 22px;
  border-radius: 20px;
  background: #ffffff;
  border: 2px solid #d7cbb0;
}

.report-focus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--kid-rose);
}

.report-focus strong {
  margin-right: 6px;
  font-size: 13px;
}

.report-unit {
  margin-top: 16px;
}

.report-unit h3 {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5c6f68;
}

.report-lesson-row {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px dashed #dbe4df;
}

.report-lesson-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.report-status { font-size: 13px; color: #5c6f68; }
.report-status.is-mastered { color: #276643; font-weight: 700; }
.report-status.is-developing { color: #8a6420; font-weight: 700; }

.report-objectives {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.obj-chip {
  border-radius: 999px;
  border: 1px solid #dbe4df;
  background: #f8fcfa;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #44554f;
}

.obj-chip.is-mastered { border-color: #2f7d4f; background: #eef8f0; color: #276643; }
.obj-chip.is-developing { border-color: #d3a94e; background: #fff8df; color: #8a6420; }
.obj-chip.is-weak { border-color: #c25260; background: #f7e4e6; color: #8f3341; }

.report-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.report-actions button {
  border: 2px solid #0d4e4d;
  border-radius: 999px;
  background: #ffffff;
  color: #0d4e4d;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
}

.report-actions button.danger {
  border-color: #a63b45;
  color: #a63b45;
}

@media print {
  body.print-report .app-header,
  body.print-report .drill-nav,
  body.print-report .dashboard-hero,
  body.print-report #unitSections,
  body.print-report .report-actions {
    display: none !important;
  }

  body.print-report .report-panel {
    border: none;
    padding: 0;
  }
}

/* ---------- tutorial slideshow ---------- */

.tutorial-box {
  margin: 14px 0 18px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 2px solid #d7cbb0;
  background: #fbf8ef;
}

.tutorial-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.tutorial-head span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7a55;
}

.tutorial-head strong {
  font-size: 20px;
}

.tutorial-arabic-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tutorial-arabic {
  font-size: 44px;
  line-height: 2;
  text-align: center;
  padding: 4px 8px;
}

#slideArabicPlay {
  border: 2px solid #0d4e4d;
  border-radius: 999px;
  background: #ffffff;
  color: #0d4e4d;
  padding: 6px 16px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.tutorial-text {
  margin: 14px 0 4px;
  font-size: 16px;
  line-height: 1.65;
  color: #3c4a45;
}

.tutorial-controls {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.tutorial-controls button {
  border: 2px solid #0d4e4d;
  border-radius: 999px;
  background: #ffffff;
  color: #0d4e4d;
  padding: 10px 20px;
  font-weight: 800;
  cursor: pointer;
}

.tutorial-controls button.primary {
  background: #0d4e4d;
  color: #ffffff;
}

.tutorial-controls button:disabled {
  opacity: 0.4;
  cursor: default;
}

.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
}

.tutorial-dots .dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #0d4e4d;
  background: #ffffff;
  cursor: pointer;
}

.tutorial-dots .dot.active {
  background: #0d4e4d;
}

/* ---------- surah memorization library ---------- */

.surah-library {
  margin-top: 30px;
}

.surah-group-title {
  margin: 18px 4px 6px;
  font-size: 12px;
}

.surah-tile em.arabic {
  font-style: normal;
  font-size: 22px;
}

.surah-view .lesson-view-top {
  align-items: center;
}

.surah-arabic-name {
  font-size: 34px;
  font-weight: 700;
}

.surah-note {
  margin: 14px 2px 6px;
  font-size: 15px;
  color: #44554f;
  max-width: 720px;
}

.surah-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
}

.surah-toolbar button {
  border: 2px solid #0d4e4d;
  border-radius: 999px;
  background: #ffffff;
  color: #0d4e4d;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
}

.surah-toolbar button.primary {
  background: #0d4e4d;
  color: #ffffff;
}

.surah-toolbar button.active {
  background: #fff2bd;
}

.surah-progress-text {
  font-weight: 800;
  font-size: 13px;
  color: #5c6f68;
}

.surah-bismillah {
  margin: 18px 0 4px;
  text-align: center;
  font-size: 34px;
  color: #0d4e4d;
}

.ayah-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.ayah-row {
  padding: 16px 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 2px solid #dbe4df;
}

.ayah-row.is-playing {
  border-color: #0d4e4d;
  background: #eef8f0;
}

.ayah-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ayah-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #0d4e4d;
  font-weight: 800;
  font-size: 13px;
  color: #0d4e4d;
  background: #ffffff;
}

.ayah-play,
.ayah-mem {
  border: 2px solid #0d4e4d;
  border-radius: 999px;
  background: #ffffff;
  color: #0d4e4d;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.ayah-mem {
  margin-left: auto;
  border-color: #b8c6c1;
  color: #5c6f68;
}

.ayah-mem.is-done {
  border-color: #2f7d4f;
  background: #eef8f0;
  color: #276643;
}

.ayah-text {
  font-size: 34px;
  line-height: 2.2;
  text-align: right;
  cursor: default;
}

.memorize-mode .ayah-text {
  filter: blur(10px);
  cursor: pointer;
  transition: filter 0.2s ease;
}

.memorize-mode .ayah-text.revealed {
  filter: none;
}

.ayah-translation {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: #44554f;
  border-top: 1px dashed #dbe4df;
  padding-top: 10px;
}

.hide-translation .ayah-translation {
  display: none;
}

.surah-attribution {
  margin-top: 20px;
  font-size: 12px;
  color: #7b8a84;
}

/* ---------- essentials: labels, transliteration, slide translation ---------- */

.slide-translation {
  margin: 2px 0 4px;
  font-size: 15px;
  font-style: italic;
  color: #5c6f68;
  text-align: center;
  max-width: 640px;
}

.ayah-label {
  margin: 2px 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0d4e4d;
  text-transform: uppercase;
}

.ayah-transliteration {
  margin: 8px 0 0;
  font-size: 15px;
  font-style: italic;
  color: #6a7a74;
}

.memorize-mode .ayah-transliteration {
  display: none;
}

/* ---------- journey dashboard: chapters, path, drawer ---------- */

.app-layout {
  display: block;
}

.drill-nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: min(330px, 86vw);
  height: 100vh;
  max-height: none;
  border-right: 1px solid #c7d3ce;
  box-shadow: 12px 0 34px rgba(13, 42, 40, 0.18);
  transform: translateX(-108%);
  transition: transform 0.24s ease;
}

body.nav-open .drill-nav {
  transform: none;
}

body.is-dashboard .drill-nav {
  display: block;
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(20, 34, 31, 0.38);
}

body.nav-open .nav-backdrop {
  display: block;
}

.hero-art img {
  object-fit: cover;
}

#unitSections {
  position: relative;
  margin-top: 26px;
  padding-left: 34px;
}

#unitSections::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 12px;
  border-left: 3px dashed #c9bd97;
}

.chapter {
  position: relative;
  margin-top: 18px;
}

.chapter::before {
  content: "";
  position: absolute;
  top: 40px;
  left: -28px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 3px solid #c9bd97;
  background: #fbf8ef;
}

.chapter.is-complete::before {
  border-color: #2f7d4f;
  background: #2f7d4f;
}

.chapter.is-current::before {
  border-color: #b0813a;
  background: #ffd97a;
}

.chapter-head {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #dbe4df;
  border-radius: 22px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.chapter.is-current > .chapter-head {
  border-color: var(--gold, #b0813a);
  background: #fffbef;
}

.chapter.is-complete > .chapter-head {
  border-color: #7ab48d;
  background: #f4faf5;
}

.chapter-emblem {
  width: 74px;
  height: 74px;
  flex: none;
  border-radius: 18px;
  object-fit: cover;
  background: #fbf8ef;
  border: 1px solid #e7dfc9;
}

.chapter-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chapter-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #8a7a55;
}

.chapter-info strong {
  font-size: 19px;
  color: var(--kid-ink);
}

.chapter-blurb {
  font-size: 13px;
  color: #5c6f68;
}

.chapter-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  margin-left: auto;
  flex: none;
}

.chapter-meta b {
  font-size: 14px;
  color: #0d4e4d;
}

.chapter-mini-bar {
  width: 74px;
  height: 8px;
  border-radius: 999px;
  background: #eef1ed;
  overflow: hidden;
}

.chapter-mini-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #2f7d4f;
}

.chapter .chevron {
  font-size: 15px;
  color: #8a9a93;
  transition: transform 0.2s ease;
}

.chapter.is-open .chevron {
  transform: rotate(180deg);
}

.chapter-body {
  padding: 16px 2px 6px;
}

@media (max-width: 900px) {
  #unitSections {
    padding-left: 24px;
  }

  #unitSections::before {
    left: 6px;
  }

  .chapter::before {
    left: -24px;
  }

  .chapter-emblem {
    width: 56px;
    height: 56px;
  }

  .chapter-blurb {
    display: none;
  }

  .hero-art {
    height: 190px;
  }
}

/* ---------- printable drill packet + practice chip ---------- */

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

.drillq {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 2px 8px;
  padding: 7px 10px;
  border: 1px solid #dbe4df;
  border-radius: 10px;
  break-inside: avoid;
}

.drillq-num {
  font-weight: 800;
  color: #0d4e4d;
}

.drillq-question {
  font-size: 12px;
  color: #5c6f68;
}

.drillq .drillq-arabic {
  grid-column: 2;
  font-size: 26px;
  line-height: 1.5;
}

.drillq em {
  grid-column: 2;
  font-size: 14px;
}

.drillq-choices {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: baseline;
}

.drillq-choice {
  font-size: 13px;
  white-space: nowrap;
}

.drillq-choice b {
  color: #8a7a55;
  margin-right: 3px;
}

.drillq-choice-ar {
  font-size: 20px;
}

.answer-key {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.key-row {
  font-size: 12px;
  line-height: 1.8;
  border-bottom: 1px dashed #dbe4df;
  padding-bottom: 6px;
}

.key-row strong {
  display: block;
  color: #0d4e4d;
}

.slide-transliteration {
  margin: 0 0 2px;
  font-size: 15px;
  font-style: italic;
  font-weight: 600;
  color: #0d4e4d;
  text-align: center;
  max-width: 640px;
}

/* ---------- child vs instructor modes ---------- */

body:not(.is-instructor) .instructor-only {
  display: none !important;
}

.grownups-button {
  border-color: #b48635 !important;
  background: #fff7df !important;
  color: #704f13 !important;
  font-weight: 800;
}

body.is-instructor .grownups-button::after {
  content: "•";
  margin-left: 6px;
  color: #2f7d4f;
  font-size: 20px;
  line-height: 0;
}

/* locked lesson tiles */

.lesson-tile.is-locked {
  opacity: 0.62;
  cursor: default;
  filter: saturate(0.4);
}

.lesson-tile.is-locked:hover,
.lesson-tile.is-locked:focus {
  transform: none;
  box-shadow: none;
}

.tile-lock {
  vertical-align: -1px;
  margin-right: 2px;
  color: #7b8a84;
}

/* stars */

.stars .star {
  font-style: normal;
  font-size: 17px;
  color: #cbd5d0;
  letter-spacing: 2px;
}

.stars .star.on {
  color: #e8a213;
}

.tile-stars {
  display: block;
  margin-top: 6px;
}

/* session progress dots (child mode) */

.session-steps.child-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5d0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.step-dot.done {
  background: #2f7d4f;
  border-color: #2f7d4f;
}

.step-dot.active {
  background: #0d4e4d;
  border-color: #0d4e4d;
  transform: scale(1.35);
}

/* results stars + celebration */

.result-stars {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 10px 0 16px;
  font-size: 58px;
  line-height: 1;
}

.big-star {
  color: #d8ded9;
  transform: scale(0);
  animation: star-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.big-star.on {
  color: #e8a213;
  text-shadow: 0 3px 0 rgba(180, 134, 53, 0.35);
}

@keyframes star-pop {
  0% { transform: scale(0) rotate(-18deg); }
  70% { transform: scale(1.25) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

.results-summary.celebrate {
  animation: summary-pop 0.45s ease 0.5s backwards;
}

@keyframes summary-pop {
  0% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* library view */

.library-intro {
  margin: 10px 0 4px;
  max-width: 560px;
  color: #44554f;
}

/* grown-ups area */

.parent-gate {
  margin-top: 22px;
  padding: 26px 24px;
  border-radius: 18px;
  border: 2px solid #cbd5d0;
  background: #ffffff;
  max-width: 480px;
  display: grid;
  gap: 14px;
  justify-items: start;
}

.parent-gate p {
  margin: 0;
  color: #44554f;
}

.gate-hint {
  font-size: 13px;
}

#gateHold {
  position: relative;
  overflow: hidden;
  border: 2px solid #0d4e4d;
  border-radius: 999px;
  background: #ffffff;
  color: #0d4e4d;
  padding: 14px 30px;
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.gate-progress {
  position: absolute;
  inset: 0;
  width: 0;
  background: rgba(13, 78, 77, 0.18);
  transition: none;
  pointer-events: none;
}

#gateHold.holding .gate-progress {
  width: 100%;
  transition: width 1.6s linear;
}

#parentPanel {
  margin-top: 22px;
  display: grid;
  gap: 18px;
}

.parent-card {
  padding: 20px 22px;
  border-radius: 18px;
  border: 2px solid #cbd5d0;
  background: #ffffff;
}

.parent-card p {
  margin: 10px 0 0;
  color: #44554f;
  max-width: 640px;
}

.parent-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.parent-card-head strong {
  font-size: 18px;
  color: #0d4e4d;
}

#instructorToggle,
#freeNavToggle {
  min-width: 72px;
  border: 2px solid #cbd5d0;
  border-radius: 999px;
  background: #ffffff;
  padding: 8px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: #5c6f68;
}

#instructorToggle.is-on,
#freeNavToggle.is-on {
  border-color: #2f7d4f;
  background: #2f7d4f;
  color: #ffffff;
}

.parent-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.parent-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #b8c6c1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--kid-ink);
  text-decoration: none;
  font-weight: 700;
}

.parents-view .report-panel {
  margin-top: 0;
}

/* ---------- tutorial slide artwork ---------- */

.tutorial-art {
  width: 100%;
  border: 1px solid #e3d9bf;
  border-radius: 14px;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  background: #fff6e1;
}

.tutorial-box.has-art {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  column-gap: 24px;
  align-items: start;
}

.tutorial-box.has-art .tutorial-art {
  grid-column: 1;
  grid-row: 1 / span 3;
}

.tutorial-box.has-art > :not(.tutorial-art) {
  grid-column: 2;
}

.tutorial-box.has-art .tutorial-controls,
.tutorial-box.has-art .tutorial-dots {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .tutorial-box.has-art {
    display: block;
  }

  .tutorial-box.has-art .tutorial-art {
    margin-bottom: 14px;
    aspect-ratio: 16 / 9;
  }
}

/* listen-step auto-play highlight */

.practice-audio.is-playing {
  border-color: #0d4e4d;
  background: #eaf6ef;
  box-shadow: 0 0 0 3px rgba(13, 78, 77, 0.15);
}

/* ---------- salah guide view ---------- */

.salah-intro {
  max-width: 720px;
  color: #44554f;
  font-size: 17px;
  line-height: 1.55;
  margin: 10px 0 4px;
}

.salah-heading {
  margin: 30px 0 12px;
  color: #0d4e4d;
  font-size: 24px;
}

.salah-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.salah-step {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 2px solid #cbd5d0;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.salah-art {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid #e3d9bf;
  background: #fff6e1;
}

.salah-step-body {
  padding: 14px 16px 16px;
}

.salah-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.salah-step-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0d4e4d;
  color: #ffffff;
  font-weight: 800;
  flex: none;
}

.salah-step-head strong {
  font-size: 18px;
  color: #0d4e4d;
}

.salah-step-arabic {
  margin: 10px 0 2px;
  font-size: 30px;
  line-height: 1.9;
  color: var(--kid-ink);
}

.salah-step-body p {
  margin: 8px 0 0;
  color: #44554f;
  line-height: 1.5;
}

.salah-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.salah-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 2px solid #0d4e4d;
  border-radius: 999px;
  background: #ffffff;
  color: #0d4e4d;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
}

.salah-links a:hover {
  background: #eaf6ef;
}

.salah-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.salah-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: #ffffff;
  border: 2px solid #cbd5d0;
  border-radius: 14px;
  overflow: hidden;
}

.salah-table th,
.salah-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e4ebe7;
}

.salah-table thead th {
  background: #0d4e4d;
  color: #ffffff;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.salah-table tbody th {
  color: #0d4e4d;
  font-size: 16px;
}

.salah-table tbody tr:nth-child(even) {
  background: #f6faf7;
}

.salah-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.salah-type {
  border: 2px solid #cbd5d0;
  border-radius: 16px;
  background: #ffffff;
  padding: 14px 16px;
}

.salah-type strong {
  color: #0d4e4d;
  font-size: 17px;
}

.salah-type p {
  margin: 8px 0 0;
  color: #44554f;
  line-height: 1.5;
}

.salah-specials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.salah-special {
  border: 2px solid #cbd5d0;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.salah-special > div {
  padding: 14px 16px 16px;
}

.salah-special strong {
  color: #0d4e4d;
  font-size: 18px;
}

.salah-special p {
  margin: 8px 0 0;
  color: #44554f;
  line-height: 1.5;
}

.salah-listen {
  margin-top: 4px;
}

.salah-review-note {
  margin: 30px 0 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--kid-lemon);
  color: #5a4a12;
  max-width: 760px;
  line-height: 1.5;
}

.pbuh {
  font-family: "Amiri Quran Local", "Noto Naskh Arabic Local", serif;
  font-size: 1.15em;
}

/* salah: words + audio, figure toggle, women variants, schools */

.salah-art-wrap {
  position: relative;
}

.salah-art-women {
  display: none;
}

.salah-view.show-women .salah-art-men {
  display: none;
}

.salah-view.show-women .salah-art-women {
  display: block;
}

.salah-figure-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px;
}

.salah-figure-toggle > span {
  font-weight: 700;
  color: #44554f;
}

.salah-figure-btn {
  min-height: 38px;
  padding: 0 18px;
  border: 2px solid #cbd5d0;
  border-radius: 999px;
  background: #ffffff;
  color: #5c6f68;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.salah-figure-btn.is-active {
  border-color: #0d4e4d;
  background: #0d4e4d;
  color: #ffffff;
}

.salah-figure-note {
  margin: 0 0 14px;
  color: #6a7873;
  font-size: 14px;
}

.salah-words {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f4f9f5;
  border: 1px solid #d8e6dd;
}

.salah-words-arabic {
  font-size: 26px;
  line-height: 1.9;
  color: var(--kid-ink);
}

.salah-words-translit {
  margin-top: 4px;
  font-style: italic;
  font-weight: 600;
  color: #0d4e4d;
}

.salah-words-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.salah-play {
  min-height: 38px;
  padding: 0 18px;
  border: 2px solid #0d4e4d;
  border-radius: 999px;
  background: #0d4e4d;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.salah-play:hover {
  background: #0a3d3c;
}

.salah-repeat {
  font-size: 13px;
  font-weight: 700;
  color: #8a5a12;
  background: var(--kid-lemon);
  padding: 4px 10px;
  border-radius: 999px;
}

.salah-women-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8eef2;
  border: 1px solid #ecd4de;
  color: #6d4152;
  font-size: 14px;
  line-height: 1.45;
}

.salah-women-note strong {
  color: #a03c63;
}

.salah-schools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.salah-school {
  border: 2px solid #cbd5d0;
  border-radius: 16px;
  background: #ffffff;
  padding: 16px 18px;
}

.salah-school > strong {
  display: block;
  color: #0d4e4d;
  font-size: 18px;
  margin-bottom: 8px;
}

.salah-school ul {
  margin: 0;
  padding-left: 20px;
}

.salah-school li {
  margin: 6px 0;
  color: #44554f;
  line-height: 1.45;
}

/* ---------- Urdu translation ---------- */

.ayah-translation.urdu {
  font-family: "Noto Naskh Arabic Local", "Noto Naskh Arabic", "Amiri Quran", serif;
  font-size: 1.15rem;
  line-height: 2;
  text-align: right;
  color: #3c4a47;
}

/* ---------- hifz memory test ---------- */

.hifz-panel {
  background: #fff;
  border: 2px solid rgba(13, 78, 77, 0.14);
  border-radius: 20px;
  padding: 18px 20px 20px;
  margin: 4px 0 18px;
  box-shadow: 0 10px 26px rgba(20, 55, 52, 0.08);
}

.hifz-panel .drill-prompt.arabic {
  font-size: 1.7rem;
  line-height: 2.1;
}

.hifz-result {
  margin-top: 12px;
}

/* ---------- record and compare ---------- */

.record-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
}

.record-row .record-hint {
  font-size: 0.85rem;
  color: #5b6b68;
}

#surahRecord.is-recording,
#listenRecord.is-recording {
  background: #b23a3a;
  border-color: #b23a3a;
  color: #fff;
  animation: recPulse 1.2s ease-in-out infinite;
}

@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(178, 58, 58, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(178, 58, 58, 0); }
}

/* ---------- illustrated stories ---------- */

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

.book-tile {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 2px solid rgba(13, 78, 77, 0.14);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.book-tile:hover,
.book-tile:focus {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(20, 55, 52, 0.14);
}

.book-cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.book-cover-plain {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(140deg, var(--kid-mint), var(--kid-sky));
  color: #0d4e4d;
  text-align: center;
}

.book-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 14px;
}

.book-info strong {
  font-size: 1.02rem;
}

.book-info small {
  color: #5b6b68;
}

.story-stage {
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  border: 2px solid rgba(13, 78, 77, 0.14);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(20, 55, 52, 0.1);
}

.story-art {
  width: 100%;
  border-radius: 16px;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.story-page-body {
  padding: 14px 8px 4px;
}

.story-art.is-archive {
  object-fit: contain;
  background: #f0ede5;
}

.story-art-caption {
  margin: 10px 8px 0;
  color: #54635f;
  font-size: 0.82rem;
  line-height: 1.55;
}

.story-art-caption a {
  color: #0d4e4d;
  text-underline-offset: 3px;
}

.story-page-title {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: #0d4e4d;
}

.story-text {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.75;
}

.story-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 8px;
}

.story-controls button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(13, 78, 77, 0.3);
  border-radius: 10px;
  background: #fff;
  color: #0d4e4d;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.story-controls .primary {
  background: #0d4e4d;
  color: #fff;
}

.story-controls button:disabled {
  opacity: 0.45;
  cursor: default;
}

.story-counter {
  font-size: 0.9rem;
  color: #5b6b68;
  white-space: nowrap;
}

/* ---------- dhikr & poetry ---------- */

.poem-card {
  background: #fff;
  border: 2px solid rgba(13, 78, 77, 0.14);
  border-radius: 24px;
  margin: 18px 0;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(20, 55, 52, 0.08);
}

.poem-art {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
}

.poem-body {
  padding: 18px 22px 20px;
}

.poem-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.poem-head h3 {
  margin: 0;
  font-size: 1.35rem;
  color: #0d4e4d;
}

.poem-poet {
  font-size: 0.9rem;
  color: #5b6b68;
}

.poem-intro {
  color: #3c4a47;
}

.poem-lines {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0;
}

.poem-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-left: 4px solid var(--kid-mint);
  padding: 4px 0 4px 12px;
}

.poem-line-text {
  flex: 1;
}

.poem-original {
  font-family: "Noto Naskh Arabic Local", "Noto Naskh Arabic", "Amiri Quran", serif;
  font-size: 1.45rem;
  line-height: 2;
}

.poem-translit {
  font-size: 0.92rem;
  color: #6a7a76;
  font-style: italic;
}

/* Urdu and Hindavi reading collection. Keep the full line and its glosses
   within the card even on small screens and at enlarged text sizes. */
.urdu-collection-intro { margin: 26px 0 18px; max-width: 760px; }
.poem-page, #poetryView { scroll-margin-top: 140px; }
.urdu-collection-intro h2 { margin: 8px 0; color: #164e42; font-size: clamp(1.7rem, 4vw, 2.3rem); }
.urdu-collection-intro p { line-height: 1.7; }
.urdu-poem-page .poem-line-text { min-width: 0; }
.urdu-poem-page .poem-original[lang="ur"] { font-family: "Noto Nastaliq Urdu Local", "Noto Naskh Arabic Local", serif; line-height: 2.7; padding: 10px 2px 16px; font-size: 1.5rem; }
.urdu-poem-page .poem-original[lang="hi"], .urdu-poem-page .word-chip [lang="hi"] { font-family: "Noto Sans Devanagari Local", "Nirmala UI", sans-serif; line-height: 1.9; }
.urdu-poem-page .poem-translit, .urdu-poem-page .word-chip u { overflow-wrap: anywhere; }
.urdu-poem-page .word-chip { max-width: 100%; }
.poem-edition { display: inline-block; margin: 0 0 12px; color: #386153; font-size: .84rem; font-weight: 650; }
.poem-sources { margin: 0 0 18px; padding: 12px 16px; border: 1px solid #dbe6df; border-radius: 12px; }
.poem-sources summary { cursor: pointer; color: #28624f; font-size: .88rem; font-weight: 650; }
.poem-sources p { margin: 12px 0 0; font-size: .88rem; overflow-wrap: anywhere; }
.poem-related { margin: 0 0 20px; }
.poem-related a { color: #216e55; font-weight: 650; }
.urdu-listening { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 15px; margin: 18px 0 12px; border: 1px solid #d9e5dc; border-radius: 15px; background: #f0f6ed; }
.urdu-listening button, .urdu-all-words { min-height: 44px; padding: 10px 16px; border: 1px solid #9ab5a4; border-radius: 10px; background: #fff; color: #245a43; font: inherit; font-size: .9rem; cursor: pointer; }
.urdu-listening .urdu-listen { background: #205b43; color: #fff; border-color: #205b43; font-weight: 650; }
.urdu-listening button:disabled { opacity: .45; cursor: default; }
.urdu-listening label { display: flex; align-items: center; gap: 8px; font-size: .84rem; }
.urdu-speed { min-height: 44px; padding: 8px; border: 1px solid #b7cabb; background: #fff; border-radius: 8px; color: #245a43; font: inherit; }
.urdu-audio-status { flex: 1 1 170px; font-size: .8rem; color: #496b57; }
.urdu-all-words { margin-bottom: 22px; }
.poem-stanza-heading { font-family: inherit; font-size: 1rem; line-height: 1.5; color: #2b6950; margin: 30px 0 10px; padding-top: 16px; border-top: 1px solid #dce7df; }
.poem-stanza-heading:first-child { margin-top: 0; }
.poem-language-label { display: block; color: #557763; font-size: .73rem; letter-spacing: .04em; margin: 2px 0 8px; }
.urdu-poem-page .poem-line.is-speaking { border-left-color: #aa7936; background: #fffae9; border-radius: 0 12px 12px 0; }
.urdu-poem-page .poem-play { flex-shrink: 0; min-width: 44px; min-height: 44px; }
.urdu-poem-page button:focus-visible, .urdu-poem-page select:focus-visible, .poem-sources summary:focus-visible { outline: 3px solid #b78c44; outline-offset: 3px; }
@media (max-width: 480px) {
  .urdu-poem-page .poem-body { padding: 18px 14px; }
  .urdu-poem-page .poem-line { gap: 8px; padding-left: 8px; }
  .urdu-poem-page .poem-original[lang="ur"] { font-size: 1.35rem; }
  .urdu-listening { padding: 12px; gap: 8px; }
  .urdu-audio-status { flex-basis: 100%; }
  .urdu-poem-page .poem-nav { flex-wrap: wrap; }
  .urdu-poem-page .poem-nav a { overflow-wrap: anywhere; }
}

.poem-translation {
  font-size: 1rem;
  color: #2b3a37;
  margin-top: 2px;
}

.poem-reflection {
  background: var(--kid-lemon);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.98rem;
}

.dhikr-card .poem-body h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: #0d4e4d;
}

.story-groups {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.story-group-title {
  margin: 14px 0 4px;
  font-size: 1.02rem;
}

/* grown-ups story shelf approvals */

.book-approvals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px 16px;
  margin-top: 10px;
}

.book-approval {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(13, 78, 77, 0.14);
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
}

.book-approval input {
  margin-top: 3px;
  accent-color: #0d4e4d;
}

.book-approval strong {
  display: block;
  font-size: 0.95rem;
}

.book-approval small {
  color: #5b6b68;
}

/* friends of Allah card */

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.friend-card {
  border: 1px solid rgba(13, 78, 77, 0.14);
  border-left: 4px solid var(--kid-lemon);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fffdf6;
}

.friend-card strong {
  display: block;
  color: #0d4e4d;
}

.friend-card p {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: #3c4a47;
}

/* ---------- poetry landing tiles + poem pages ---------- */

.poem-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 14px 0 20px;
}

.poem-tile {
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(13, 78, 77, 0.14);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.poem-tile:hover,
.poem-tile:focus {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(20, 55, 52, 0.14);
}

.poem-tile-art {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.poem-tile-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px 12px;
}

.poem-tile-info small {
  color: #5b6b68;
}

.poem-page-card {
  max-width: 900px;
  margin: 0 auto;
}

.poem-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(13, 78, 77, 0.14);
}

.poem-nav a {
  color: #0d4e4d;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--kid-mint);
}

.poem-nav a:hover {
  background: var(--kid-sky);
}

.poem-nav .poem-nav-all {
  background: var(--kid-lemon);
}

/* ---------- word-by-word popouts ---------- */

.word-toggle {
  margin-top: 8px;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(13, 78, 77, 0.25);
  background: #fff;
  color: #0d4e4d;
  cursor: pointer;
}

.word-toggle.is-open,
.word-toggle:hover {
  background: var(--kid-mint);
}

.word-toggle.is-open::after {
  content: " ▲";
}

.word-toggle:not(.is-open)::after {
  content: " ▼";
}

.word-popout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f4f9f4;
  border: 1px dashed rgba(13, 78, 77, 0.25);
}

.word-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(13, 78, 77, 0.14);
  max-width: 200px;
  text-align: center;
}

.word-chip b.arabic {
  font-family: "Amiri Quran Local", "Amiri Quran", "Noto Naskh Arabic Local", "Noto Naskh Arabic", serif;
  font-size: 1.35rem;
  line-height: 1.7;
  font-weight: normal;
}

.word-chip i {
  font-style: normal;
  font-size: 0.85rem;
  color: #2b3a37;
  direction: ltr;
}

.word-chip small {
  font-size: 0.72rem;
  color: #6a7a76;
  direction: ltr;
  line-height: 1.35;
}

/* ---------- full Quran reader ---------- */

.quran-loading {
  color: #5b6b68;
  padding: 20px 0;
}

.quran-grid {
  margin-top: 14px;
}

.quran-tile small {
  min-height: 0;
}

.quran-nav {
  max-width: 900px;
  margin: 20px auto 0;
}

/* ---------- jumu'ah khutba viewer ---------- */

.khutba-channel {
  margin: 12px 0 22px;
}

.khutba-channel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.khutba-channel-head strong {
  color: #0d4e4d;
}

.khutba-channel-head small {
  color: #5b6b68;
}

.khutba-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.khutba-card {
  border: 2px solid rgba(13, 78, 77, 0.14);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.khutba-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.khutba-play-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(13, 78, 77, 0.85);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
}

.khutba-thumb:hover .khutba-play-badge {
  background: #0d4e4d;
  transform: scale(1.08);
}

.khutba-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
}

.khutba-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 12px;
  font-size: 0.9rem;
}

.khutba-caption small {
  color: #5b6b68;
}

/* ---------- music & art cards ---------- */

.music-lyric {
  border-left: 4px solid var(--kid-lemon);
  padding: 6px 0 6px 14px;
  margin: 12px 0;
}

.music-links a {
  display: inline-block;
}

.ayah-phrase {
  border-left: 3px solid var(--kid-mint);
  padding-left: 12px;
  margin: 12px 0;
}

.ayah-phrase .ayah-text {
  font-size: 1.6rem;
}

/* khutba AI notes */

.khutba-notes-toggle {
  margin: 0 12px 12px;
  align-self: flex-start;
}

.khutba-notes {
  margin: 0 12px 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f4f9f4;
  border: 1px dashed rgba(13, 78, 77, 0.25);
  font-size: 0.9rem;
}

.khutba-note-summary {
  margin: 0 0 8px;
}

.khutba-note-points {
  margin: 0 0 8px;
  padding-left: 18px;
}

.khutba-note-points li {
  margin-bottom: 4px;
}

.khutba-note-cited {
  color: #4a5a57;
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.khutba-notes .urdu {
  font-family: "Noto Naskh Arabic Local", "Noto Naskh Arabic", serif;
  font-size: 1.05rem;
  line-height: 1.9;
  text-align: right;
}

.khutba-note-disclaimer {
  display: block;
  color: #7a8a86;
  font-size: 0.75rem;
  border-top: 1px solid rgba(13, 78, 77, 0.12);
  padding-top: 8px;
}

/* virtual jumu'ah companion */

.vj-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--kid-mint), var(--kid-sky));
  border: 2px solid rgba(13, 78, 77, 0.14);
  border-radius: 18px;
  padding: 14px 18px;
  margin: 14px 0 18px;
}

.vj-invite p {
  margin: 4px 0 0;
  color: #2b3a37;
  font-size: 0.92rem;
}

.vj-card {
  max-width: 860px;
  margin: 0 auto;
}

.vj-step h2 {
  color: #0d4e4d;
  margin-top: 0;
}

.vj-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  margin: 6px 0;
  border: 1px solid rgba(13, 78, 77, 0.14);
  border-radius: 12px;
  background: #fffdf6;
  cursor: pointer;
}

.vj-check input {
  margin-top: 3px;
  accent-color: #0d4e4d;
}

.vj-check:has(input:checked) {
  background: var(--kid-mint);
  text-decoration: none;
}

.vj-hadith {
  border-left: 4px solid var(--kid-lemon);
  padding: 6px 0 6px 14px;
  color: #4a5a57;
  font-size: 0.92rem;
}

.vj-khutba-picker select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(13, 78, 77, 0.25);
  font-size: 0.95rem;
  margin-bottom: 12px;
  background: #fff;
  color: var(--kid-ink);
}

.vj-khutba-picker .khutba-embed {
  border-radius: 14px;
}

.vj-khutba-picker .khutba-caption {
  padding: 8px 2px;
  color: #5b6b68;
  font-size: 0.88rem;
}

.vj-audio-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

/* khutba notes modal */

.khutba-link { display: block; text-align: center; text-decoration: none; }
.kmodal-actions { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 24px; }
.kmodal-actions a { color: var(--teal); text-underline-offset: 0.2em; }

body.kmodal-open {
  overflow: hidden;
}

.kmodal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 38, 0.55);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.kmodal {
  background: #fff;
  border-radius: 20px;
  max-width: 760px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(10, 30, 28, 0.35);
}

.kmodal-head {
  position: sticky;
  top: 0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(13, 78, 77, 0.14);
}

.kmodal-title {
  display: block;
  color: #0d4e4d;
  line-height: 1.35;
}

.kmodal-meta {
  color: #5b6b68;
}

.kmodal-close {
  border: 1px solid rgba(13, 78, 77, 0.25);
  background: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  color: #0d4e4d;
  flex-shrink: 0;
}

.kmodal-close:hover {
  background: var(--kid-mint);
}

.kmodal-body {
  padding: 6px 20px 20px;
}

.kmodal-body h3 {
  color: #0d4e4d;
  font-size: 0.95rem;
  margin: 16px 0 6px;
}

.kmodal-body p, .kmodal-body li {
  font-size: 0.93rem;
}

.kmodal-urdu {
  font-size: 1.1rem;
  line-height: 1.95;
  text-align: right;
}

.kmodal-translit {
  color: #4a5a57;
  font-style: italic;
}

.kmodal-cited {
  color: #4a5a57;
}

.kmodal-transcript {
  margin-top: 16px;
  border: 1px dashed rgba(13, 78, 77, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  background: #f8fbf8;
}

.kmodal-transcript summary {
  cursor: pointer;
  font-weight: 600;
  color: #0d4e4d;
  font-size: 0.9rem;
}

.kmodal-transcript p {
  white-space: pre-wrap;
  font-size: 0.88rem;
  max-height: 40vh;
  overflow-y: auto;
  margin: 10px 0 0;
}

.kmodal-transcript p.urdu {
  font-size: 1.05rem;
  line-height: 1.9;
}

/* surah study introduction (tafsir) */

.surah-study {
  background: #fffdf6;
  border: 2px solid rgba(13, 78, 77, 0.14);
  border-left: 6px solid var(--kid-lemon);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.surah-study summary {
  cursor: pointer;
  font-weight: 700;
  color: #0d4e4d;
}

.surah-study p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #2b3a37;
}

.surah-study-note {
  display: block;
  color: #7a8a86;
  font-size: 0.78rem;
  border-top: 1px solid rgba(13, 78, 77, 0.12);
  padding-top: 8px;
  margin-top: 8px;
}

/* ---------- art studio ---------- */

.studio-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
}

.studio-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(13, 78, 77, 0.25);
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  color: #0d4e4d;
}

.studio-tab.is-active {
  background: #0d4e4d;
  color: #fff;
}

.studio-hint {
  font-size: 0.9rem;
  color: #4a5a57;
}

.studio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: 10px 0;
  font-size: 0.88rem;
}

.studio-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4a5a57;
}

.studio-controls select,
.studio-controls button {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(13, 78, 77, 0.25);
  background: #fff;
  font-size: 0.88rem;
  color: var(--kid-ink);
  cursor: pointer;
}

.studio-controls input[type="range"] {
  width: 110px;
  accent-color: #0d4e4d;
}

#calligCanvas, #geoCanvas {
  width: 100%;
  height: auto;
  border: 2px solid rgba(13, 78, 77, 0.2);
  border-radius: 16px;
  touch-action: none;
  cursor: crosshair;
  background: #fdfbf4;
}

.studio-steps {
  background: #f4f9f4;
  border: 1px dashed rgba(13, 78, 77, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.86rem;
  margin-bottom: 10px;
  display: grid;
  gap: 4px;
}

/* seerah pages */

.seerah-card {
  max-width: 920px;
  margin: 0 auto;
}

.seerah-body p {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #26332f;
}

.seerah-grid .poem-tile-info strong {
  font-size: 0.98rem;
}

/* ramadan deeds calendar */

.deeds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.deed-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(13, 78, 77, 0.14);
  border-radius: 12px;
  background: #fffdf6;
  cursor: pointer;
  position: relative;
}

.deed-cell input {
  position: absolute;
  top: 10px;
  right: 10px;
  accent-color: #0d4e4d;
}

.deed-cell .deed-day {
  font-weight: 700;
  color: #0d4e4d;
  font-size: 0.8rem;
}

.deed-cell .deed-text {
  font-size: 0.86rem;
  color: #2b3a37;
  padding-right: 22px;
}

.deed-cell.is-done {
  background: var(--kid-mint);
  border-color: rgba(13, 78, 77, 0.3);
}

.deed-cell.is-done .deed-text {
  text-decoration: line-through;
  color: #4a5a57;
}

.hajj-step .salah-words {
  margin-top: 8px;
}

.ramadan-week .poem-art {
  max-height: 300px;
}

/* ——— Islamic History timeline ——— */

.history-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin-top: 10px;
  padding-left: 14px;
}

.history-timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #0d4e4d 0%, #c2803d 100%);
  opacity: 0.35;
}

.history-era {
  position: relative;
  padding-left: 30px;
}

.history-era-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.history-era-dot {
  position: absolute;
  left: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #c2803d;
  border: 3px solid #f2f6f1;
  box-shadow: 0 0 0 2px rgba(13, 78, 77, 0.45);
}

.history-era-years {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0d4e4d;
  background: var(--kid-mint);
  border-radius: 999px;
  padding: 3px 14px;
}

.history-era-card .poem-art {
  max-height: 320px;
  object-fit: cover;
}

.history-script-note {
  background: var(--kid-sky);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.98rem;
}

/* ——— Story of the Script (Art view) ——— */

.script-story-title {
  margin-top: 30px;
}

.script-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
  align-items: start;
}

.script-style-card {
  background: #fbfdf9;
  border: 1px solid rgba(13, 78, 77, 0.14);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.script-style-head {
  display: flex;
  flex-direction: column;
}

.script-style-head strong {
  color: #0d4e4d;
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
}

.script-style-head small {
  color: #6a7a76;
  font-size: 0.8rem;
}

.script-style-look {
  margin: 0;
  font-size: 0.92rem;
  font-style: italic;
  color: #2b3a37;
}

.script-style-story {
  margin: 0;
  font-size: 0.92rem;
}

.script-specimens { display: grid; gap: 20px; }
.script-specimen { margin: 0; min-width: 0; }
.script-specimen-label { font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: #506655; margin-bottom: 8px; }
.script-specimen-image { display: block; position: relative; border: 1px solid #d9d6c9; border-radius: 8px; background: #eee9de; overflow: hidden; color: #254b3b; text-decoration: none; }
.script-specimen-image img { display: block; width: 100%; height: 290px; padding: 10px; object-fit: contain; }
.script-specimen-image > span { display: block; background: #fcf8ed; padding: 9px 12px; text-align: right; font-size: .8rem; border-top: 1px solid #d9d6c9; }
.script-specimen-image:hover { border-color: #58745c; }
.script-specimen-image:focus-visible, .script-specimen-source:focus-visible { outline: 3px solid #27604b; outline-offset: 3px; }
.script-specimen figcaption { margin-top: 12px; font-size: .86rem; line-height: 1.55; }
.script-specimen figcaption > strong { display: block; font-weight: 600; color: #284a3b; }
.script-specimen-cue { margin: 8px 0; color: #3c4a47; }
.script-specimen-source { font-size: .76rem; color: #315b47; text-underline-offset: 3px; }
.script-specimen figcaption > small { display: block; color: #6a7468; font-size: .7rem; margin-top: 3px; }
.script-typeset { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 12px; background: #f4ecd8; border: 1px solid #d9d6c9; border-radius: 8px; }
.script-typeset p { font: 400 clamp(48px, 6vw, 80px)/1.9 "Aref Ruqaa Local", serif; margin: 0; color: #183f32; }
.script-typeset span { font: .85rem Georgia, serif; color: #566451; }
@media (max-width: 700px) {
  .script-style-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .script-style-card { padding: 15px; }
  #art-script-styles .poem-body { padding: 14px; }
  .script-specimen-image img { height: 300px; }
}

.tool-list {
  margin: 8px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-item {
  font-size: 0.97rem;
  line-height: 1.55;
}

.tool-item strong {
  color: #0d4e4d;
}

/* ——— history figures ——— */

.history-figures {
  margin: 14px 0;
}

.history-figures-title {
  font-weight: 700;
  color: #0d4e4d;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.history-figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.history-figure {
  background: #fbfdf9;
  border: 1px solid rgba(13, 78, 77, 0.14);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-figure-art {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: top;
}

.history-figure-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-figure-info strong {
  color: #0d4e4d;
  font-size: 1rem;
}

.history-figure-info small {
  color: #6a7a76;
  font-size: 0.8rem;
}

.history-figure-info p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.history-guard-dot {
  background: #a63d40;
}

.history-guard-card {
  border: 2px solid rgba(166, 61, 64, 0.35);
}

/* ——— life stages & scenarios ——— */

.life-stages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.life-stage {
  display: flex;
  gap: 12px;
  background: #fbfdf9;
  border: 1px solid rgba(13, 78, 77, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
}

.life-stage-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
}

.life-stage-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--kid-mint);
  color: #0d4e4d;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.life-stage-age {
  font-size: 0.75rem;
  color: #6a7a76;
  text-align: center;
}

.life-stage-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.life-stage-head strong {
  color: #0d4e4d;
}

.life-stage-head small {
  color: #c2803d;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.life-stage-body p {
  margin: 4px 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.life-scenario {
  border: 1px solid rgba(13, 78, 77, 0.14);
  border-radius: 14px;
  background: #fbfdf9;
  margin-top: 10px;
  padding: 0;
}

.life-scenario summary {
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  list-style: none;
}

.life-scenario summary::before {
  content: "▸ ";
  color: #c2803d;
  font-weight: 700;
}

.life-scenario[open] summary::before {
  content: "▾ ";
}

.life-scenario summary strong {
  color: #0d4e4d;
}

.life-scenario summary span {
  font-size: 0.92rem;
  color: #2b3a37;
}

.life-scenario .scenario-think {
  margin: 0 16px 10px;
  background: var(--kid-sky);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.94rem;
}

.life-scenario .scenario-guidance {
  margin: 0 16px 14px;
  background: var(--kid-lemon);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.94rem;
}

/* ——— art studio: guided geometry & callig tips ——— */

.callig-tip {
  background: var(--kid-mint);
  border-radius: 12px;
  padding: 10px 14px;
}

.geo-step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.geo-step-nav strong {
  color: #0d4e4d;
  font-size: 0.95rem;
  text-align: center;
}

.geo-step-nav button {
  border: 1px solid rgba(13, 78, 77, 0.3);
  background: #fff;
  border-radius: 10px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 600;
}

.geo-step-nav button:disabled {
  opacity: 0.4;
  cursor: default;
}

.geo-step-text {
  font-size: 0.97rem;
  line-height: 1.5;
}

.history-guard-tile {
  outline: 2px solid rgba(166, 61, 64, 0.45);
  outline-offset: -2px;
}

/* ——— Words tab: zabaan-style drill ——— */

.word-deck-tile {
  align-items: center;
}

.word-deck-emoji {
  font-size: 2.6rem;
  padding: 18px 0 6px 16px;
}

.word-deck-progress {
  color: #c2803d;
  font-weight: 700;
}

.word-card-frame {
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.word-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  width: 100%;
  min-height: 340px;
  justify-content: center;
  cursor: pointer;
}

.word-giant {
  font-family: "Amiri Quran Local", "Noto Naskh Arabic Local", serif;
  font-size: 5.2rem;
  line-height: 1.6;
  color: #1e2a28;
}

.word-giant-phrase {
  font-size: 2.6rem;
  line-height: 2;
}

.word-main-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.word-main {
  font-family: "Amiri Quran Local", "Noto Naskh Arabic Local", serif;
  font-size: 2.2rem;
  color: #0d4e4d;
}

.word-translit {
  font-size: 1.3rem;
  color: #6a7a76;
}

.word-reveal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.word-veiled .wr-reveal,
.word-reveal.word-veiled {
  filter: blur(9px);
  opacity: 0.55;
  user-select: none;
  pointer-events: none;
}

.word-meaning {
  font-size: 1.25rem;
  font-style: italic;
  color: #2b3a37;
}

.word-family {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 1rem;
}

.word-form-ar {
  font-family: "Amiri Quran Local", "Noto Naskh Arabic Local", serif;
  font-size: 1.25rem;
  color: #0d4e4d;
}

.word-ref {
  font-size: 0.85rem;
  color: #6a7a76;
}

.word-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.word-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 26px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
}

.word-btn-green { background: #22a06b; }
.word-btn-blue { background: #2f6fed; }
.word-btn-amber { background: #c2803d; }

.word-btn-outline {
  background: #fff;
  color: #0d4e4d;
  border: 2px solid rgba(13, 78, 77, 0.35);
}

.word-btn-outline.is-known {
  background: var(--kid-mint);
  border-color: #22a06b;
}

.word-tools {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.92rem;
  color: #6a7a76;
}

.word-tools button {
  border: 1px solid rgba(13, 78, 77, 0.25);
  background: #fff;
  border-radius: 10px;
  padding: 6px 14px;
  cursor: pointer;
}

/* ——— surah word-review popout ——— */

.wr-modal {
  max-width: 700px;
}

.wr-toggle {
  margin-left: auto;
  margin-right: 12px;
  white-space: nowrap;
}

.wr-body {
  overflow-y: auto;
}

.wr-row {
  border-bottom: 1px solid rgba(13, 78, 77, 0.12);
  padding: 10px 4px;
  cursor: pointer;
}

.wr-row-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.wr-ar {
  font-family: "Amiri Quran Local", "Noto Naskh Arabic Local", serif;
  font-size: 1.5rem;
  color: #1e2a28;
  min-width: 110px;
}

.wr-root {
  background: var(--kid-mint);
  color: #0d4e4d;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.95rem;
}

.wr-root-none { opacity: 0.4; }

.wr-tr {
  color: #6a7a76;
  font-style: italic;
}

.wr-reveal {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
  margin-top: 3px;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.wr-en {
  font-weight: 600;
  color: #2b3a37;
}

.wr-more {
  font-size: 0.88rem;
  color: #6a7a76;
}

.wr-more span[dir="rtl"] {
  font-family: "Amiri Quran Local", "Noto Naskh Arabic Local", serif;
  font-size: 1.05rem;
}

.wr-ref {
  font-size: 0.8rem;
  color: #9aa8a4;
  margin-left: auto;
}

/* ——— encyclopedia ——— */

.pedia-search {
  width: 100%;
  max-width: 560px;
  border: 2px solid rgba(13, 78, 77, 0.25);
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 1.05rem;
  margin: 6px 0 10px;
  background: #fff;
}

.pedia-search:focus {
  outline: none;
  border-color: #0d4e4d;
}

.pedia-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pedia-chip {
  background: var(--kid-sky);
  color: #21504e;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pedia-chip-cat { background: var(--kid-mint); }
.pedia-chip-time { background: #eef0ec; color: #6a7a76; }

.pedia-chip-link {
  background: #fff;
  border: 1.5px solid rgba(13, 78, 77, 0.3);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
}

.pedia-chip-link:hover { background: var(--kid-mint); }

.pedia-summary {
  font-size: 1.12rem;
  line-height: 1.65;
  font-weight: 500;
  color: #1e2a28;
}

.pedia-facts {
  background: #fbfdf9;
  border: 1px solid rgba(13, 78, 77, 0.16);
  border-radius: 14px;
  padding: 14px 18px;
  margin: 12px 0;
}

.pedia-facts-title {
  font-weight: 800;
  color: #0d4e4d;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.pedia-facts dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px 18px;
}

.pedia-facts dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6a7a76;
}

.pedia-facts dd {
  margin: 0;
  font-weight: 600;
  color: #1e2a28;
}

.pedia-heading {
  color: #0d4e4d;
  font-size: 1.25rem;
  margin: 18px 0 6px;
}

.pedia-related {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pedia-related-title {
  font-weight: 700;
  color: #6a7a76;
  font-size: 0.9rem;
}

.pedia-card .poem-art {
  max-height: 330px;
  object-fit: cover;
}

/* ---------- alphabet board (Letters tab, modelled on zabaan.org) ---------- */

.alpha-switch {
  display: flex;
  gap: 0.4rem;
  margin: 1.2rem 0 1rem;
  flex-wrap: wrap;
}

.alpha-tab {
  border: 2px solid var(--line, #cbd5f5);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.alpha-tab.is-on {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.alpha-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.75rem;
  direction: rtl;
}

.alpha-card {
  direction: rtl;
  border: 2px solid #93c5fd;
  border-radius: 0.9rem;
  background: #fff;
  padding: 0.7rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.alpha-card:hover {
  background: #eff6ff;
  transform: translateY(-2px);
}

.alpha-card.is-open {
  border-color: #2563eb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
  grid-column: span 2;
}

.alpha-glyph {
  font-family: "Amiri Local", "Scheherazade New Local", serif;
  font-size: 2.6rem;
  line-height: 1.25;
  color: #0f172a;
}

.alpha-name {
  direction: ltr;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e3a8a;
}

.alpha-detail {
  display: none;
  direction: ltr;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.alpha-card.is-open .alpha-detail {
  display: flex;
}

.alpha-sound {
  font-size: 0.8rem;
  color: #475569;
}

.alpha-forms {
  direction: rtl;
  display: flex;
  gap: 0.5rem;
  font-family: "Amiri Local", "Scheherazade New Local", serif;
  font-size: 1.5rem;
  color: #334155;
}


/* ---------- peoples of islam ---------- */

.peoples-region {
  margin: 1.6rem 0 2rem;
}

.peoples-region-blurb {
  margin: 0.2rem 0 0.9rem;
  color: #475569;
  max-width: 62ch;
}

.peoples-facts {
  margin-bottom: 1.2rem;
}

.peoples-figures-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.8rem;
}

.peoples-figure {
  border-left: 3px solid #2563eb;
  background: #f8fafc;
  border-radius: 0 0.6rem 0.6rem 0;
  padding: 0.6rem 0.9rem;
}

.peoples-figure strong {
  display: block;
  color: #1e3a8a;
}

.peoples-figure p {
  margin: 0.25rem 0 0;
  font-size: 0.92rem;
  color: #334155;
}

/* ---------- life: hard questions ---------- */

.q-asked {
  font-size: 1.12rem;
  font-weight: 600;
  color: #1e3a8a;
  margin: 0 0 1rem;
}

.q-steelman,
.q-honest {
  border-radius: 0.7rem;
  padding: 0.85rem 1.05rem;
  margin: 1.1rem 0;
}

.q-steelman {
  background: #fef3c7;
  border-left: 4px solid #d97706;
}

.q-honest {
  background: #f1f5f9;
  border-left: 4px solid #64748b;
}

.q-steelman-title,
.q-honest-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.q-steelman-title { color: #92400e; }
.q-honest-title { color: #475569; }

.q-steelman p,
.q-honest p {
  margin: 0;
  color: #334155;
}

/* ---------- persian masters ---------- */

.persian-vocab-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 0.9rem;
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0;
}

.persian-vocab-cta strong { display: block; color: #312e81; }
.persian-vocab-cta small { color: #4338ca; }

.persian-poem-list {
  display: grid;
  gap: 0.5rem;
  margin: 0.6rem 0 1.2rem;
}

.persian-poem-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--line, #dbe3f5);
  border-radius: 0.7rem;
  padding: 0.6rem 0.9rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.persian-poem-row:hover { background: #f5f7ff; border-color: #a5b4fc; }
.persian-poem-row strong { display: block; color: #1e293b; }
.persian-poem-row small { color: #64748b; }

.persian-poem-num {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}

.persian-also {
  font-size: 0.92rem;
  color: #475569;
  border-top: 1px dashed var(--line, #dbe3f5);
  padding-top: 0.7rem;
}

/* ---------- devotional pieces: naat, hamd, qawwali ---------- */

.devotional-group { margin: 1.6rem 0 2rem; }

.devotional-original {
  font-family: "Amiri Local", "Scheherazade New Local", serif;
  font-size: 1.9rem;
  color: #0f172a;
  margin-bottom: 0.6rem;
}

.memorise-card {
  position: relative;
  background: linear-gradient(180deg, #fffbeb, #fef3c7);
  border: 2px solid #fbbf24;
  border-radius: 1rem;
  padding: 1.1rem 1.2rem 1rem;
  margin: 1.3rem 0;
  text-align: center;
}

.memorise-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #92400e;
  margin-bottom: 0.6rem;
}

.memorise-play {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
}

.memorise-original {
  font-family: "Amiri Local", "Scheherazade New Local", serif;
  font-size: 2.05rem;
  line-height: 1.85;
  color: #0f172a;
}

.memorise-translit {
  font-style: italic;
  color: #b45309;
  margin-top: 0.2rem;
}

.memorise-translation {
  font-size: 1.05rem;
  color: #1e293b;
  margin-top: 0.35rem;
}

.memorise-why {
  font-size: 0.9rem;
  color: #78350f;
  margin: 0.6rem 0 0;
}

.devotional-section { margin: 1.2rem 0; }

.devotional-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #475569;
  border-bottom: 1px solid var(--line, #dbe3f5);
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}

.devotional-rights {
  font-size: 0.82rem;
  color: #64748b;
  border-top: 1px dashed var(--line, #dbe3f5);
  padding-top: 0.6rem;
  margin-top: 1rem;
}

/* ---------- persian masters: a quieter, more contemplative section ---------- */

.persian-view,
.persian-page {
  --pm-ink: #1c1917;
  --pm-deep: #1e3a5f;
  --pm-lapis: #26456e;
  --pm-gold: #b08542;
  --pm-rose: #a8577a;
  --pm-cream: #fdfaf4;
  --pm-line: #e6dcc9;
}

/* hero */

.persian-hero {
  position: relative;
  border-radius: 1.2rem;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 12% 0%, #2c5282 0%, transparent 60%),
    radial-gradient(110% 100% at 92% 12%, #6b3f6e 0%, transparent 62%),
    linear-gradient(160deg, #16243d 0%, #1e3a5f 55%, #24304d 100%);
  color: #f8f4ea;
  padding: 2.4rem 1.6rem 2.1rem;
  margin-bottom: 1.6rem;
}

.persian-hero-inner {
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}

.persian-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d9b877;
  margin-bottom: 0.6rem;
}

.persian-hero-title {
  font-family: "Amiri Local", Georgia, serif;
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  line-height: 1.25;
  margin: 0;
  color: #fdfaf4;
}

.persian-hero-text {
  color: #ded5c4;
  line-height: 1.85;
  margin: 0.9rem 0 0;
}

/* geometric rule — no glyphs, so nothing can render as broken script */

.persian-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.3rem auto;
  max-width: 22rem;
}

.persian-ornament span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pm-gold), transparent);
  opacity: 0.7;
}

.persian-ornament i {
  width: 0.62rem;
  height: 0.62rem;
  border: 1.5px solid var(--pm-gold);
  transform: rotate(45deg);
  opacity: 0.85;
}

.persian-hero .persian-ornament i { border-color: #d9b877; }
.persian-hero .persian-ornament span { background: linear-gradient(90deg, transparent, #d9b877, transparent); }

/* poet tiles */

.persian-poet-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.persian-poet-tile {
  position: relative;
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  text-decoration: none;
  color: #fdfaf4;
  background: var(--pm-deep);
  min-height: 15rem;
  box-shadow: 0 6px 18px rgba(20, 30, 50, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.persian-poet-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(20, 30, 50, 0.28);
}

.persian-poet-tile-art {
  width: 100%;
  height: 100%;
  min-height: 15rem;
  object-fit: cover;
  display: block;
}

.persian-poet-tile-body {
  position: absolute;
  inset: auto 0 0 0;
  display: block;
  padding: 1.5rem 1rem 0.95rem;
  background: linear-gradient(180deg, transparent, rgba(12, 20, 36, 0.86) 46%);
}

.persian-poet-tile-body strong {
  display: block;
  font-family: "Amiri Local", Georgia, serif;
  font-size: 1.2rem;
}

.persian-poet-tile-body small { display: block; color: #cbd5e1; font-size: 0.8rem; }
.persian-poet-tile-body em { display: block; color: #e8c98a; font-size: 0.86rem; margin-top: 0.2rem; }

.persian-poet-tile-count {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

/* poet + poem heroes */

.persian-poet-hero,
.persian-poem-hero {
  position: relative;
  border-radius: 1.1rem;
  overflow: hidden;
  margin-bottom: -1.4rem;
}

.persian-poet-hero-art,
.persian-poem-hero-art {
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
  display: block;
}

.persian-poem-hero-scrim {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3rem 1.4rem 1.9rem;
  background: linear-gradient(180deg, transparent, rgba(12, 20, 36, 0.82) 55%);
  color: #fdfaf4;
  text-align: center;
}

.persian-poem-hero-poet {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #e8c98a;
}

.persian-poem-hero-title {
  font-family: "Amiri Local", Georgia, serif;
  font-size: clamp(1.3rem, 3.4vw, 2rem);
  line-height: 1.3;
}

/* reading column */

.persian-reading {
  max-width: 44rem;
  margin: 0 auto;
}

.persian-poem-intro {
  font-size: 1.02rem;
  line-height: 1.9;
  color: #44403c;
  text-align: center;
}

.persian-lines .poem-line {
  border: 0;
  padding: 0.75rem 0;
}

.persian-lines .poem-line + .poem-line {
  border-top: 1px solid var(--pm-line);
}

.persian-lines .poem-original {
  font-size: 1.85rem;
  line-height: 2.15;
  color: var(--pm-ink);
}

.persian-lines .poem-translit { color: var(--pm-lapis); font-style: italic; }
.persian-lines .poem-translation { color: #3f3f46; font-size: 1.02rem; }

/* reflection panel */

.persian-reflection {
  background: linear-gradient(180deg, #fffdf7, #faf3e4);
  border: 1px solid var(--pm-line);
  border-left: 4px solid var(--pm-gold);
  border-radius: 0 0.8rem 0.8rem 0;
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
}

.persian-reflection p { margin: 0; color: #57534e; line-height: 1.85; }

.persian-reflection-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pm-gold);
  margin-bottom: 0.35rem;
}

.persian-reflection-poem { text-align: center; border-left: 0; border-radius: 0.8rem; }
.persian-reflection-poem p { font-size: 1.05rem; }

/* poem gallery on the poet page */

.persian-gallery-title {
  text-align: center;
  font-family: "Amiri Local", Georgia, serif;
  color: var(--pm-deep);
}

.persian-poem-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem;
  margin: 0.8rem 0 1.3rem;
}

.persian-poem-card {
  display: block;
  border-radius: 0.85rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--pm-cream);
  border: 1px solid var(--pm-line);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.persian-poem-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(30, 58, 95, 0.16);
}

.persian-poem-card-art {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.persian-poem-card-body { display: block; padding: 0.6rem 0.7rem 0.7rem; }
.persian-poem-card-body strong { display: block; font-size: 0.94rem; color: var(--pm-ink); }
.persian-poem-card-body small { display: block; color: #78716c; font-size: 0.76rem; margin-top: 0.15rem; }

/* per-word transliteration inside the word-by-word chips */
.word-chip u {
  display: block;
  direction: ltr;
  text-decoration: none;
  font-style: italic;
  font-size: 0.78rem;
  color: #2563eb;
}

.word-grammar { color: #64748b; font-size: 0.86rem; }
.wr-forms u { display: block; direction: ltr; text-decoration: none; font-style: italic; font-size: 0.82rem; color: #2563eb; }

/* ---------- the library: classical works of scholarship ---------- */

.lib-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 0.6rem;
  margin: 1.2rem 0 1.6rem;
}

.lib-stats div {
  background: #f8fafc;
  border: 1px solid var(--line, #dbe3f5);
  border-radius: 0.7rem;
  padding: 0.7rem 0.5rem;
  text-align: center;
}

.lib-stats strong { display: block; font-size: 1.5rem; color: #1e3a8a; }
.lib-stats small { color: #64748b; font-size: 0.78rem; }

.lib-shelf { margin: 1.6rem 0 2rem; }
.lib-shelf-emoji { margin-right: 0.3rem; }

.lib-tile-meta {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.lib-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.lib-badge-sunni { background: #dbeafe; color: #1d4ed8; }
.lib-badge-shia { background: #dcfce7; color: #15803d; }
.lib-badge-shared { background: #fef3c7; color: #b45309; }

.lib-titlebar {
  text-align: center;
  border-bottom: 1px solid var(--line, #dbe3f5);
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
}

.lib-title-arabic {
  font-family: "Amiri Local", "Scheherazade New Local", serif;
  font-size: 2.1rem;
  line-height: 1.8;
  color: #0f172a;
}

.lib-subtitle { color: #475569; font-style: italic; }

.lib-chips {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.lib-chip {
  font-size: 0.72rem;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

.lib-entry-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b45309;
  background: #fffbeb;
  border-radius: 0.4rem;
  padding: 0.3rem 0.6rem;
  margin: 1.1rem 0 0.5rem;
}

.lib-entry {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line, #e6ecf8);
}

.lib-entry-num {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.lib-entry-body { flex: 1; min-width: 0; position: relative; }
.lib-entry-play { position: absolute; top: 0; right: 0; }

.lib-entry .poem-original {
  font-size: 1.55rem;
  line-height: 2.05;
  padding-right: 2.4rem;
}

.lib-entry-note {
  font-size: 0.92rem;
  color: #475569;
  background: #f8fafc;
  border-left: 3px solid #cbd5f5;
  border-radius: 0 0.4rem 0.4rem 0;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0 0;
}

.lib-entry-ref {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

/* ---------- canon directory ---------- */

.canon-directory { margin-top: 2rem; border-top: 2px solid var(--line, #dbe3f5); padding-top: 1.4rem; }

.canon-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0.7rem 0;
}

.canon-chip {
  border: 1px solid var(--line, #cbd5f5);
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.canon-chip:hover { background: #f1f5f9; }
.canon-chip.is-on { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
.canon-filter-sep { width: 1px; height: 1.2rem; background: var(--line, #cbd5f5); margin: 0 0.3rem; }

.canon-count { font-size: 0.82rem; color: #64748b; margin: 0.2rem 0 0.8rem; }

.canon-group { margin-bottom: 1.3rem; }

.canon-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1e3a8a;
  border-bottom: 1px solid var(--line, #dbe3f5);
  padding-bottom: 0.25rem;
  margin-bottom: 0.4rem;
}

.canon-group-title span { color: #94a3b8; font-weight: 400; }

.canon-row { border-bottom: 1px solid #eef2f9; }

.canon-row summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.2rem;
  cursor: pointer;
  list-style: none;
}

.canon-row summary::-webkit-details-marker { display: none; }
.canon-row summary:hover { background: #f8fafc; }
.canon-row[open] summary { background: #f1f5f9; }

.canon-row-main strong { color: #0f172a; }
.canon-row-main small { display: block; color: #64748b; font-size: 0.8rem; }

.canon-row-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
}

.canon-dates { color: #94a3b8; }

.canon-body { padding: 0.3rem 0.2rem 0.9rem; }

.canon-arabic {
  font-family: "Amiri Local", "Scheherazade New Local", serif;
  font-size: 1.5rem;
  color: #1e293b;
}

.canon-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.4rem 0 0.6rem;
}

.canon-facts span {
  font-size: 0.73rem;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

.canon-body p { margin: 0.4rem 0; font-size: 0.94rem; color: #334155; }
.canon-translation { color: #475569; background: #f8fafc; border-left: 3px solid #94a3b8; padding: 0.45rem 0.7rem; border-radius: 0 0.4rem 0.4rem 0; }

.canon-read {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1d4ed8;
}

/* ---------- museum gallery: real plates with real credits ---------- */

.gallery-intro { margin-top: 2rem; border-top: 2px solid var(--line, #dbe3f5); padding-top: 1.4rem; }
.gallery-group { margin: 1.4rem 0 1.8rem; }

.gallery-tile .poem-tile-art { aspect-ratio: 4 / 3; object-fit: cover; }

.plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.1rem;
  margin: 1rem 0 1.4rem;
}

.plate {
  margin: 0;
  background: #fbfaf7;
  border: 1px solid var(--line, #e2e0d8);
  border-radius: 0.6rem;
  overflow: hidden;
}

.plate a { display: block; }

.plate-img {
  width: 100%;
  display: block;
  background: #efece4;
}

.plate figcaption {
  padding: 0.55rem 0.7rem 0.7rem;
  font-size: 0.83rem;
  line-height: 1.45;
}

.plate figcaption strong { display: block; color: #1c1917; }
.plate figcaption span { display: block; color: #57534e; font-size: 0.8rem; }
.plate figcaption small { display: block; margin-top: 0.3rem; color: #8a857c; font-size: 0.72rem; }

.book-source {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.5rem 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
}
.book-source span { font-weight: 400; font-size: 0.78rem; color: #94a3b8; }
.book-source:hover { text-decoration: underline; }

/* ---------- the reading room: dark, gold, hushed ---------- */

.reader-view,
.reader-page {
  --rd-ink: #0a0a0a;
  --rd-gold: #c9a96e;
  --rd-cream: #e8d5a8;
  --rd-paper: #f5f0e8;
  --rd-dim: rgba(245, 240, 232, 0.45);
}

.reader-view,
.reader-page {
  background: radial-gradient(120% 90% at 50% 0%, #17130d 0%, #0a0a0a 60%);
  color: var(--rd-paper);
  border-radius: 1.1rem;
  padding: 2rem 1.3rem 2.4rem;
}

.reader-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rd-gold);
  text-align: center;
}

.reader-title {
  font-family: "Amiri Local", Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--rd-paper);
  margin: 0.4rem 0 0;
}

.reader-sub { text-align: center; color: var(--rd-dim); font-size: 0.9rem; }

.reader-rule {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  margin: 1.3rem auto; max-width: 20rem;
}
.reader-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--rd-gold), transparent); opacity: 0.6; }
.reader-rule i { width: 0.5rem; height: 0.5rem; border: 1px solid var(--rd-gold); transform: rotate(45deg); }

.reader-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}

.reader-tile {
  position: relative;
  display: block;
  border-radius: 0.8rem;
  overflow: hidden;
  text-decoration: none;
  color: var(--rd-paper);
  border: 1px solid rgba(201, 169, 110, 0.28);
  background: #100d09;
  min-height: 13rem;
}

.reader-tile:hover { border-color: var(--rd-gold); }
.reader-tile img { width: 100%; height: 13rem; object-fit: cover; display: block; opacity: 0.72; }
.reader-tile:hover img { opacity: 0.9; }

.reader-tile-body {
  position: absolute; inset: auto 0 0 0;
  padding: 2rem 0.8rem 0.8rem;
  background: linear-gradient(180deg, transparent, rgba(10, 10, 10, 0.92) 55%);
}
.reader-tile-body strong { display: block; font-family: "Amiri Local", Georgia, serif; font-size: 1.05rem; }
.reader-tile-body small { display: block; color: var(--rd-dim); font-size: 0.76rem; }
.reader-tile-body em { display: block; color: var(--rd-gold); font-size: 0.78rem; font-style: normal; margin-top: 0.15rem; }

/* a single passage, centred and unhurried */

.reader-stage { max-width: 40rem; margin: 0 auto; }

.reader-passage-title {
  text-align: center;
  font-family: "Amiri Local", Georgia, serif;
  font-size: 1.35rem;
  color: var(--rd-cream);
}

.reader-lines { margin: 1.4rem 0; }

.reader-line { margin-bottom: 1.15rem; text-align: center; }

.reader-original {
  font-family: "Amiri Local", "Scheherazade New Local", serif;
  font-size: 1.75rem;
  line-height: 2.2;
  color: var(--rd-paper);
  direction: rtl;
}

.reader-translit { font-style: italic; color: var(--rd-gold); font-size: 0.9rem; }
.reader-translation { color: rgba(245, 240, 232, 0.86); font-size: 1.02rem; margin-top: 0.2rem; }

.reader-note {
  border-top: 1px solid rgba(201, 169, 110, 0.25);
  padding-top: 0.8rem;
  color: var(--rd-dim);
  font-size: 0.92rem;
  text-align: center;
}

.reader-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem; margin-top: 1.6rem;
}

.reader-btn {
  border: 1px solid rgba(201, 169, 110, 0.4);
  background: transparent;
  color: var(--rd-cream);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.reader-btn:hover:not(:disabled) { border-color: var(--rd-gold); background: rgba(201, 169, 110, 0.12); }
.reader-btn:disabled { opacity: 0.3; cursor: default; }

.reader-progress { color: var(--rd-dim); font-size: 0.78rem; letter-spacing: 0.16em; }

.reader-back {
  background: transparent;
  border: 1px solid rgba(201, 169, 110, 0.4);
  color: var(--rd-cream);
}

/* ---------- architecture ---------- */

.arch-group { margin: 1.6rem 0 2rem; }
.arch-tile .poem-tile-art { aspect-ratio: 4 / 3; object-fit: cover; }

.arch-kicker {
  text-align: center;
  color: #78716c;
  font-style: italic;
  margin-bottom: 1rem;
}

.arch-origins,
.arch-caution,
.arch-signature {
  border-radius: 0.7rem;
  padding: 0.9rem 1.1rem;
  margin: 1.1rem 0;
}

.arch-origins { background: #f5f3ff; border-left: 4px solid #7c3aed; }
.arch-caution { background: #fffbeb; border-left: 4px solid #d97706; }
.arch-signature { background: #f0fdf4; border-left: 4px solid #16a34a; }

.arch-origins-label,
.arch-caution-label,
.arch-signature-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.arch-origins-label { color: #6d28d9; }
.arch-caution-label { color: #b45309; }
.arch-signature-label { color: #15803d; }

.arch-origins p, .arch-caution p { margin: 0; color: #3f3f46; }
.arch-signature ul { margin: 0; padding-left: 1.1rem; color: #3f3f46; }
.arch-signature li { margin-bottom: 0.3rem; }

.arch-landmark {
  border: 1px solid var(--line, #e2e0d8);
  border-radius: 0.7rem;
  padding: 0.85rem 1rem;
  background: #fbfaf7;
  margin: 1.1rem 0;
}
.arch-landmark strong { display: block; color: #1c1917; font-size: 1.05rem; }
.arch-landmark small { display: block; color: #78716c; margin-bottom: 0.35rem; }
.arch-landmark p { margin: 0; color: #44403c; }

.arch-spot {
  background: #f8fafc;
  border-left: 3px solid #64748b;
  border-radius: 0 0.4rem 0.4rem 0;
  padding: 0.55rem 0.8rem;
  margin: 1rem 0;
  color: #334155;
}

.arch-plates { margin-top: 1.3rem; }

/* ---------- devotional: the world's poetic traditions ---------- */
/* The section now carries Bengali, Tamil, Gujarati, Cyrillic, Chinese and
   romanised African, Balkan and Malay verse alongside the Arabic-script
   traditions. Those need their own fonts and left-to-right flow: the Arabic
   serif stack cannot draw them, and inheriting dir="rtl" reverses the
   punctuation. Sizes are tuned per script so a Bengali line and an Arabic line
   sit at the same optical weight. */
.lyric-bengali,
.lyric-tamil,
.lyric-gujarati,
.lyric-cyrillic,
.lyric-chinese,
.lyric-latin {
  color: #0f172a;
  line-height: 1.75;
  direction: ltr;
  text-align: left;
}

.lyric-bengali { font-family: "Noto Serif Bengali", "Nirmala UI", "Vrinda", serif; font-size: 1.5rem; }
.lyric-tamil { font-family: "Noto Serif Tamil", "Latha", "Nirmala UI", serif; font-size: 1.45rem; }
.lyric-gujarati { font-family: "Noto Serif Gujarati", "Shruti", "Nirmala UI", serif; font-size: 1.5rem; }
.lyric-cyrillic { font-family: "Charter", "Georgia", "DejaVu Serif", serif; font-size: 1.35rem; }
.lyric-chinese { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; font-size: 1.5rem; }
.lyric-latin { font-family: "Charter", "Georgia", "Iowan Old Style", serif; font-size: 1.3rem; font-style: italic; }

.devotional-original.lyric-bengali,
.devotional-original.lyric-tamil,
.devotional-original.lyric-gujarati,
.devotional-original.lyric-cyrillic,
.devotional-original.lyric-chinese,
.devotional-original.lyric-latin { font-size: 1.75rem; margin-bottom: 0.6rem; }

.memorise-original.lyric-bengali,
.memorise-original.lyric-tamil,
.memorise-original.lyric-gujarati,
.memorise-original.lyric-cyrillic,
.memorise-original.lyric-chinese,
.memorise-original.lyric-latin { text-align: center; direction: ltr; }

/* Pieces in languages we have no honest voice for carry no play button, so the
   text should reclaim the space the button would have held. */
.poem-line-silent { padding-left: 12px; }

/* Two ways into the same set: what a piece is, and where it is from. */
.devotional-axis {
  display: flex;
  gap: 8px;
  margin: 1.4rem 0 0.4rem;
}

.devotional-axis-btn {
  font: inherit;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid var(--teal, #0d4e4d);
  background: transparent;
  color: var(--teal, #0d4e4d);
  cursor: pointer;
}

.devotional-axis-btn.is-active {
  background: var(--teal, #0d4e4d);
  color: #fff;
}

.devotional-axis-btn:focus-visible {
  outline: 3px solid var(--gold, #b48635);
  outline-offset: 2px;
}

.tradition-region {
  font-weight: 400;
  font-size: 0.8em;
  opacity: 0.72;
  margin-left: 0.4rem;
}

/* Longer history chapters: searchable groups and quiet, readable article sections. */
.history-group { margin-block: 2.6rem; }
.history-group > h2 { margin: 0 0 .4rem; color: var(--ink); font-size: 1.3rem; }
.history-group > p { margin: 0 0 1rem; color: var(--muted); line-height: 1.6; }
.history-tile-kicker { display: block; margin-top: .45rem; font-size: .82rem; line-height: 1.5; }
.history-search { margin-block: 1.6rem 2rem; }
.history-search label { display: block; margin-bottom: .6rem; font-weight: 700; }
.history-search-controls { display: flex; gap: .6rem; flex-wrap: wrap; }
.history-search input { flex: 1 1 220px; min-width: 0; width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; font: inherit; color: var(--ink); background: var(--paper); }
.history-search button { min-height: 48px; padding: .7rem 1rem; border-radius: 12px; font: inherit; cursor: pointer; }
#historySearchStatus { color: var(--muted); font-size: .85rem; }
.history-read-time { font-size: .8rem; color: var(--muted); letter-spacing: .03em; }
.history-page .history-lead, .history-article-section { max-width: 72ch; margin-inline: auto; }
.history-page .history-lead .poem-intro { font-size: 1.1rem; }
.history-article-section { margin-block: 2.4rem; }
.history-article-section h2 { font-size: 1.3rem; line-height: 1.4; margin-bottom: 1rem; scroll-margin-top: 120px; color: var(--ink); }
.history-page .poem-intro { line-height: 1.85; }
.history-milestones { list-style: none; padding: 0; margin-block: 1.5rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.history-milestones li { border-top: 2px solid #bb9554; padding-top: .8rem; }
.history-milestones strong { display: block; color: var(--ink); margin-bottom: .4rem; }
.history-milestones span { display: block; font-size: .85rem; line-height: 1.65; color: var(--muted); }
.history-contents, .history-sources { border: 1px solid var(--line); border-radius: 14px; margin-block: 1.5rem; padding: .4rem 1rem; }
.history-contents summary, .history-sources summary { cursor: pointer; padding-block: .8rem; min-height: 44px; box-sizing: border-box; font-weight: 700; color: var(--ink); }
.history-contents ol, .history-sources ul { padding-left: 1.4rem; margin: .3rem 0 .8rem; }
.history-contents button { text-align: left; color: #286351; background: transparent; border: 0; padding: .6rem .3rem; min-height: 44px; font: inherit; cursor: pointer; line-height: 1.45; }
.history-sources a { display: inline-block; color: #286351; padding-block: .65rem; line-height: 1.5; overflow-wrap: anywhere; }
.history-contents button:hover, .history-sources a:hover { text-decoration: underline; }
.history-page .poem-nav { gap: .8rem; flex-wrap: wrap; }
.history-page .poem-nav a { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .history-milestones { grid-template-columns: 1fr; gap: .8rem; }
  .history-milestones li { display: grid; grid-template-columns: minmax(70px, 1fr) 3fr; gap: .75rem; }
  .history-page .poem-nav { display: grid; grid-template-columns: 1fr; text-align: center; }
  .history-page .poem-nav a { justify-content: center; }
}
/* Hash navigation must leave chapter controls below Kalam's sticky header. */
.history-page, #historyView { scroll-margin-top: 130px; }
.history-era-card .poem-art { max-height: 540px; object-fit: contain; background: #f7efe1; }
.history-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

/* Daily Quranic prayers */
.home-daily-dua {display:flex;flex-direction:column;gap:8px;padding:24px 28px;margin:22px 0;border:1px solid #c8d8cb;border-radius:18px;background:#edf3e9;color:#174e48;text-decoration:none}
.home-daily-dua strong {font:700 26px Georgia,serif}
.daily-dua-banner {display:grid;grid-template-columns:1fr 1.5fr;align-items:center;gap:26px;border-radius:18px;overflow:hidden;background:#edf3e9;margin:24px 0}
.daily-dua-banner img {width:100%;height:100%;max-height:300px;object-fit:cover}
.daily-dua-banner>div {padding:22px}
.daily-dua-banner h2 {font:32px Georgia,serif;margin:10px 0}
.dua-date,.dua-source-note {font-size:14px;color:#536760}
.daily-dua-reading {padding:30px;background:#fffcf5;border:1px solid #dedbcb;border-radius:18px;scroll-margin-top:140px}
.daily-dua-reading h2 {font:32px Georgia,serif;margin:10px 0 20px;color:#164b45}
.dua-reflection {font:19px/1.8 Georgia,serif;max-width:750px}
.dua-actions,.dua-filters {display:flex;flex-wrap:wrap;gap:12px;margin:20px 0}
.dua-actions a,.dua-actions button,.dua-filters button,.dua-play {min-height:44px;border:1px solid #aebfb2;border-radius:12px;padding:10px 16px;background:#f3f6eb;color:#164b45;font:inherit;text-decoration:none;cursor:pointer}
.dua-filters button[aria-pressed=true],.dua-save[aria-pressed=true] {background:#164b45;color:white}
.dua-verse {border-top:1px solid #dedbcb;padding:20px 0}
.dua-arabic {font-size:clamp(28px,4vw,40px);line-height:2.3;overflow-wrap:anywhere}
.dua-translation {font:20px/1.8 Georgia,serif}
.dua-play {width:auto;height:auto;display:inline-block;margin:12px 12px 12px 0}
.dua-library {margin:38px 0}
.dua-library label {display:block;margin-bottom:8px}
#duaSearch {width:100%;max-width:550px;border:1px solid #aebfb2;border-radius:10px;padding:14px;font:inherit}
.dua-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.dua-tile {display:flex;flex-direction:column;gap:12px;padding:22px;border:1px solid #dedbcb;border-radius:14px;background:#fffcf5;color:#164b45;text-decoration:none}
.dua-tile span {font-size:12px;text-transform:uppercase;letter-spacing:.1em}
.dua-tile strong {font:22px/1.4 Georgia,serif}
.dua-letter-invite {background:#edf3e9;border-radius:16px;padding:24px}
.dua-letter-invite a {color:#164b45;font-weight:700}
.daily-dua-reading .word-popout {flex-wrap:wrap}.daily-dua-reading .word-chip {max-width:100%;overflow-wrap:anywhere}
.dua-tile[hidden],.daily-dua-reading[hidden] {display:none}
@media(max-width:600px){.daily-dua-banner{grid-template-columns:1fr;gap:0}.daily-dua-banner img{max-height:180px}.daily-dua-reading{padding:18px}.dua-grid{grid-template-columns:1fr}.daily-dua-reading h2{font-size:28px}}

/* Museum object readings and the expanded comfort library. */
.artwork-highlights { margin: 2.5rem 0; }
.artwork-tile .poem-tile-art { object-fit: contain; background: #f3efe6; }
.artwork-figure { margin: 0; padding: clamp(16px, 4vw, 36px); background: #f3efe6; }
.artwork-figure img { display: block; max-width: 100%; width: auto; max-height: 620px; height: auto; margin: auto; }
.artwork-figure figcaption { max-width: 720px; margin: 22px auto 0; font-size: .92rem; line-height: 1.7; }
.artwork-figure figcaption span, .artwork-figure figcaption small { display: block; }
.artwork-looking { padding: 20px 24px; margin: 24px 0; background: #edf2e8; border-radius: 14px; }
.artwork-looking h2 { font-size: 1.3rem; margin: 0 0 10px; }
.artwork-looking p { margin: 0; }
.artwork-detail-link { display: inline-block; margin-top: 8px; font-weight: 600; }
.dua-context { color: var(--muted, #5c7165); font-size: 1rem; line-height: 1.75; max-width: 75ch; }
.khutba-feed-status { padding: 14px 18px; background: #edf2e8; border-radius: 12px; line-height: 1.6; }
.khutba-channel-head a { margin-left: auto; font-size: .85rem; }
.khutba-watch { margin-left: 8px; }
@media (max-width: 500px) { .artwork-page .poem-nav { gap: 12px; flex-wrap: wrap; } .khutba-channel-head { flex-wrap: wrap; } }

.art-page { scroll-margin-top: 140px; }
